diff --git a/config/routes.php b/config/routes.php index 9ed7073..27f069d 100644 --- a/config/routes.php +++ b/config/routes.php @@ -44,4 +44,7 @@ $framework_routes = [ '/novaconium/sitemap.xml' => [ 'get' => 'NOVACONIUM/sitemap' ], + '/novaconium/sample/{slug}' => [ + 'get' => 'NOVACONIUM/samples' + ], ]; \ No newline at end of file diff --git a/controllers/404.php b/controllers/404.php new file mode 100644 index 0000000..124205c --- /dev/null +++ b/controllers/404.php @@ -0,0 +1,4 @@ +parameters['slug']; + +//build path +$tmpl = $pt . '/' . $slug; + +//Check if file exits +$baseDir = (strpos($pt, 'novacore') !== false) ? FRAMEWORKPATH : BASEPATH; +if (strpos($pt, '@novacore') !== false) { + $baseDir = str_replace('@novacore', FRAMEWORKPATH . '/views', $pt); +} else { + $baseDir = str_replace('@novacore', BASEPATH . '/views', $pt); +} + +$possibleFile = $baseDir . '/' . $slug . '.html.twig'; // add .twig extension if needed + +if (is_file($possibleFile) && is_readable($possibleFile)) { + view($tmpl, $data); +} else { + http_response_code('404'); + header("Content-Type: text/html"); + view('@novacore/404'); +} diff --git a/docs/404.md b/docs/404.md new file mode 100644 index 0000000..1673911 --- /dev/null +++ b/docs/404.md @@ -0,0 +1,6 @@ +# 404 Page + +404 page is created like any other page. +Create a 404.php in your controllers and a 404.html.twig in your views. +anytime a resource is not found by the router, it will default to this controller. +if you do not have this controller in your app, it will default to the novaconium 404 page. diff --git a/skeleton/novaconium/App/controllers/404.php b/skeleton/novaconium/App/controllers/404.php deleted file mode 100644 index 6d08c22..0000000 --- a/skeleton/novaconium/App/controllers/404.php +++ /dev/null @@ -1,15 +0,0 @@ - - -

Error 404 Resource Not found

-

-

Novaconium Default 404 page.

- diff --git a/src/Router.php b/src/Router.php index 783e8cd..48cae2a 100644 --- a/src/Router.php +++ b/src/Router.php @@ -121,7 +121,7 @@ class Router { if (file_exists(BASEPATH . '/App/controllers/404.php')) { return BASEPATH . '/App/controllers/404.php'; } else { - return FRAMEWORKPATH . '/defaults/App/controllers/404.php'; + return FRAMEWORKPATH . '/controllers/404.php'; } } } diff --git a/views/404.html.twig b/views/404.html.twig new file mode 100644 index 0000000..679e1ef --- /dev/null +++ b/views/404.html.twig @@ -0,0 +1,7 @@ +{% extends '@novaconium/master.html.twig' %} + +{% block content %} +

404 File Not Found

+

Novaconium Default 404 page.

+

Return Home

+{% endblock %} \ No newline at end of file diff --git a/views/samples/basic.html.twig b/views/samples/basic.html.twig new file mode 100644 index 0000000..7f601e3 --- /dev/null +++ b/views/samples/basic.html.twig @@ -0,0 +1,269 @@ +{% extends '@novaconium/master.html.twig' %} + +{% set title = "Basic HTML Elements" %} +{% set description = "This is the basic html page from hugo" %} +{% set keywords = "my,keywords,go,here" %} +{% set author = "Mike Hunt" %} + +{% block content %} + +
+
+

{{ title }}

+ +
+
+

The main purpose of this article is to make sure that all basic HTML Elements are decorated with CSS so as to not miss any possible elements when creating new themes for Hugo.

+ +

Headings

+ +

Let’s start with all possible headings. The HTML <h1><h6> elements represent six levels of section headings. <h1> is the highest section level and <h6> is the lowest.

+ +

Heading 1

+ +

Heading 2

+ +

Heading 3

+ +

Heading 4

+ +
Heading 5
+ +
Heading 6
+ +
+ +

Paragraph

+ +

According to the HTML5 specification by W3C, HTML documents consist of a tree of elements and text. Each element is denoted in the source by a start tag, such as <body>, and an end tag, such as </body>. (Certain start tags and end tags can in certain cases be omitted and are implied by other tags.)

+ +

Elements can have attributes, which control how the elements work. For example, hyperlink are formed using the a element and its href attribute.

+ +

List Types

+ +

Ordered List

+ +
    +
  1. First item
  2. +
  3. Second item
  4. +
  5. Third item
  6. +
+ +

Unordered List

+ + + +

Nested list

+ + + +

Definition List

+ +

HTML also supports definition lists.

+ +
+
Blanco tequila
+
The purest form of the blue agave spirit...
+
Reposado tequila
+
Typically aged in wooden barrels for between two and eleven months...
+
+ +

Blockquotes

+ +

The blockquote element represents content that is quoted from another source, optionally with a citation which must be within a footer or cite element, and optionally with in-line changes such as annotations and abbreviations.

+ +
+

Quoted text. +This line is part of the same quote. +Also you can put Markdown into a blockquote.

+
+ +

Blockquote with a citation.

+ +
+

My goal wasn't to make a ton of money. It was to build good computers. I only started the company when I realized I could be an engineer forever.

+
Steve Wozniak
+
+ +

According to Mozilla’s website, Firefox 1.0 was released in 2004 and became a big success.

+ +

Tables

+ +

Tables aren’t part of the core Markdown spec, but Hugo supports them.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
IDMakeModelYear
1HondaAccord2009
2ToyotaCamry2012
3HyundaiElantra2010
+ +

Colons can be used to align columns.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TablesAreCool
align: leftalign: centeralign: right
align: leftalign: centeralign: right
align: leftalign: centeralign: right
+ +

You can also use inline Markdown.

+ + + + + + + + + + + + + + + + + + + +
InlineMarkdownInTable
italicsboldstrikethroughcode
+ +

Code

+ +
<!DOCTYPE html>
+<html lang="en">
+<head>
+  <meta charset="UTF-8">
+  <title>Example HTML5 Document</title>
+</head>
+<body>
+  <p>Test</p>
+</body>
+</html>
+
+ +
<!DOCTYPE html>
+<html lang="en">
+<head>
+  <meta charset="UTF-8">
+  <title>Example HTML5 Document</title>
+</head>
+<body>
+  <p>Test</p>
+</body>
+</html>
+ +

Other stuff — abbr, sub, sup, kbd, etc.

+ +

GIF is a bitmap image format.

+ +

H2O

+ +

C6H12O6

+ +

Xn + Yn = Zn

+ +

Press X to win. Or press CTRL+ALT+F to show FPS counter.

+ +

As a unit of information in information theory, the bit has alternatively been called a shannon, named after Claude Shannon, the founder of field of information theory.

+
+ +
+ +{% endblock %}