You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+20-8Lines changed: 20 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -60,25 +60,37 @@ This is the global assets directory, in which you can organize your CSS, JavaScr
60
60
Routes are defined separately from pages to easily manage the content and access of each route.
61
61
62
62
## Route Properties
63
-
Each route is defined as a key on the `routes` property in `config.json` whose value is an object with properties that define the route's page title and content. Additional properties can be set for metadata/SEO purposes, but the title and file/body properties are the only necessary properties:
63
+
Each route is defined as a key on the `routes` property in `config.json` whose value is an object with properties that define the route's page title and content.
64
+
65
+
|Name|Data Type|Required?|Note|
66
+
|---|---|---|---|
67
+
|`title`|`string`|Yes|Page title|
68
+
|`file`|`string`|Conditional|Required if `body` not set. Overwrites `body` value with rendered content|
69
+
|`body`|`string`|Conditional|Required if `file` not set. Throws error if neither `file` and `body` set|
70
+
|`layout`|`string`|No|If set to valid path, will override default `layout`. If set to false, no layout is used and page body is echoed as is|
71
+
72
+
Additional arbitrary properties can be set for metadata/SEO purposes, but the title and file/body properties are the only necessary properties:
64
73
```json
65
74
{
66
75
"routes": {
67
76
"/": {
68
77
"title": "Page Title",
69
78
"file": "pages/page.php",
70
79
"description": "This is a description of the page for SEO",
|`file`|`string`|Conditional|Required if `body` not set. Overwrites `body` value with rendered content|
80
-
|`body`|`string`|Conditional|Required if `file` not set. Throws error if neither `file` and `body` set|
81
-
|`layout`|`string`|No|If set to valid path, will override default `layout`. If set to false, no layout is used and page body is echoed as is|
85
+
You can then implement your additional properties in your layout, such as for social media SEO tags. Use the `@` warning suppressing syntax for when some routes don't have the property specified:
You can also specify non-static matching routes for the key string. Use the `:param` syntax to dynamically match a route and have its parameters set to the parsed values from the incoming URI:
0 commit comments