Skip to content

Tera design is a rust development web server built with tera templates which should feel familiar if you have used Django before

License

Notifications You must be signed in to change notification settings

mocsy/tera_design

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

A webapp to use tera templates for frontend development

Tera design was envisioned with frontend developers in mind. It is a dev web server focusing on rapid frontend protoyping using the tera templates engine. Writen in rust using actix-web, it is so fast you never gonna notice any delays.

How it works

Tera design looks for .html files in the templates directory. When you open a page in the browser you can ommit the .html extension.

If a template requires variables as input, then those can be put into a .json file of the same name in JSON format. In case a required value is not present in the corresponding .json file, it shows an error in the browser.

Templates can be organized into directories, and these directories make it into the url of the page. The resulting prototype uses these urls and handled and feels like the final app would do.

When parts of the variables apply to every page in a given directory, these can be put into a single mod.json file instead of copy pasting the same values to every context.

The above features enable tera_design to enhance static html design efforts. It easy to integrate the result to jinja2 based projects, like rust tera/askama, python django, etc.

loading static files form directory

Ne in 0.1.5, static directories can be configured in config.ron:

(
    static_dirs: [
        "css",
        "js",
        "vendor",
        "img",
        "fonts",
        "static",
    ]
)

Note: this is dev server, not stable enough to be used in production

Example

It includes a copy of SB Admin 2 modified to showcase some tera template fetures without the need for completeness.

License

Code released under the MIT license.

Build

cargo install cross cross build --release --target x86_64-pc-windows-gnu

About

Tera design is a rust development web server built with tera templates which should feel familiar if you have used Django before

Resources

License

Stars

Watchers

Forks

Packages

No packages published