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: docs/guides/pages.md
+7-7Lines changed: 7 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,9 +7,9 @@ Easily create static and dynamic pages with a layout.
7
7
8
8
## Dynamic pages
9
9
10
-
Pages use the [jinjapy](https://github.com/hyperflask/jinjapy) file format. It combines python code and a [jinja template](#the-page-template). The python code will be executed first on every request, then the template will be rendered.
10
+
Pages use the [jinjapy](https://github.com/hyperflask/jinjapy) file format. It combines python code and a [jinja template](#the-page-template). The python code will be executed first on every request, then the template will be rendered. The python code is enclosed inside 2 lines containing 3 dashes "---".
11
11
12
-
The python code is enclosed inside 2 lines containing 3 dashes "---"
12
+
Create new pages in the `app/pages` folder using the `.jpy` extension.
13
13
14
14
A special [page object](#the-page-object) is available in the python code. Assign values to this object so that they become available in the template.
15
15
@@ -53,13 +53,13 @@ All formats can have a YAML frontmatter defining variables that will be injected
53
53
54
54
The URL rule is constructed using the following rules:
55
55
56
-
-`index.ext` file are roots
56
+
-`index.jpy` file are roots
57
57
- folder hierarchy are transformed to url paths:
58
-
-`posts/release-annoucement.ext` converts to `/posts/release-annoucement`
59
-
-`posts/index.ext` converts to `/posts`
60
-
-`folder/subfolder/page.ext` converts to `/folder/subfolder/page`
58
+
-`posts/release-annoucement.jpy` converts to `/posts/release-annoucement`
59
+
-`posts/index.jpy` converts to `/posts`
60
+
-`folder/subfolder/page.jpy` converts to `/folder/subfolder/page`
61
61
- placeholders are allowed in filenames:
62
-
-`posts/<slug>.ext` converts to `/posts/<slug>`
62
+
-`posts/<slug>.jpy` converts to `/posts/<slug>`
63
63
64
64
The placeholder value is available through the [`page` object](#the-page-object) (eg: `page.slug`).
0 commit comments