Open Sitez Documentation

Documentation main page

 

using the folder plugin

To create a folder route in the definition.osz file, follow these steps:

  1. Add a route to the routes section.
  2. Set the type of the route to folder.
  3. Set the basedir of the route to the directory where the folder content is located.
  4. Optionally, set the content-type of the route to specify how the contents of the folder should be rendered.
  5. Optionally, add content to the before and after sections 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>&nbsp;</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.