TeensyCMS
A very small, very minimal CMS for allowing admins deploying your web applications to add custom pages and have them accessible from a nav bar.
A typical application using TeensyCMS dos so like this:
- Check for a
pages_dirvariable in its config - Load the TeensyCMS from that path on the file system
- Have nav bars in the site's template use the values returned from TeensyCMS
- Mount a single route like
/pages/{tail:.*}that renders TeensyCMS content
That's it.
A typical use case for this would be if you wanted a admin to be able to provide their own pages that may or maybe not include:
- An
Aboutpage - A
Contactpage - A
Terms of Servicepage - A
Code of Conductpage - Whatever else they want idk a list of their favorite cats
A full working example of a website implementing TeensyCMS can be found in the examples/ directory and run with cargo run, but for reference a simple app might look like this:
use ;
use ;
// this page struct is defined by the application developer
// the fields here are the "contract" for what a developer can use in their templates
let my_config = from_env;
let cms = from_path.unwrap;
// finish initializing the web server
// imagine some fancy routing macro that wraps this
A page looks like the following:
---
title: My Page
url: /my-page
cats:
---
<h1>{{ page.title }}</h1>
<ul>
<li>{{ cat }}</li>
</ul>
Anti-Copyright
Intellectual property isn't real. There is no license. If you insist on having one, this is Creative Commons Zero (public domain).