Open Sitez Documentation
Documentation main page
using the folder plugin
To create a folder route in the definition.osz file, follow these steps:
- Add a route to the
routessection. - Set the
typeof the route tofolder. - Set the
basedirof the route to the directory where the folder content is located. - Optionally, set the
content-typeof the route to specify how the contents of the folder should be rendered. - Optionally, add content to the
beforeandaftersections to be displayed before and after the folder content.
Here is an example of a folder route:
routes:
documentation:
type: folder
basedir: private/documentation
This route will serve the contents of the private/documentation directory. The contents of the folder will be rendered as text unless the content-type option is set to something else.
Here is an example of a folder route with a few more options:
routes:
documentation:
type: folder
basedir: private/documentation
content-type: markdown
before:
prediv:
type: text
content: <div id='wrapper' style='position:relative;'>
prelude:
type: text
content:
- <h2> <a href="/documentation/about.md">Open Sitez Documentation</a></h2>
- <a href="/documentation/about.md">Documentation main page</a><p> </p>
after:
postdiv:
type: text
content: </div>
This route will serve the contents of the private/documentation directory. The contents of the folder will be rendered as Markdown. Additionally, the content of the prediv and postdiv sections will be displayed before and after the folder content, respectively.
You can create as many folder routes as you need in the definition.osz file. This allows you to serve static content from different directories on your site.