{"id":24796327,"url":"https://github.com/shellshape/temple","last_synced_at":"2026-03-01T17:36:51.912Z","repository":{"id":274539907,"uuid":"915611703","full_name":"shellshape/temple","owner":"shellshape","description":"A *very* simple static web page generator to build simple static web pages without the burden of code duplication.","archived":false,"fork":false,"pushed_at":"2025-10-15T13:43:10.000Z","size":36,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-16T10:14:00.194Z","etag":null,"topics":["cli","rust","ssg","static-site-generator","templating"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/shellshape.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-01-12T10:39:13.000Z","updated_at":"2025-04-14T09:47:09.000Z","dependencies_parsed_at":"2025-06-19T08:47:21.907Z","dependency_job_id":null,"html_url":"https://github.com/shellshape/temple","commit_stats":null,"previous_names":["shellshape/temple"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/shellshape/temple","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shellshape%2Ftemple","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shellshape%2Ftemple/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shellshape%2Ftemple/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shellshape%2Ftemple/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/shellshape","download_url":"https://codeload.github.com/shellshape/temple/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shellshape%2Ftemple/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29976288,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-01T16:35:47.903Z","status":"ssl_error","status_checked_at":"2026-03-01T16:35:44.899Z","response_time":124,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cli","rust","ssg","static-site-generator","templating"],"created_at":"2025-01-30T00:32:41.837Z","updated_at":"2026-03-01T17:36:46.894Z","avatar_url":"https://github.com/shellshape.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# temple\n\nA **very** simple static web page generator to build simple static web pages without the burden of code duplication.\n\n**Disclaimer**\n\nThis tool is primarily built for generating simple static websites like [my personal website](https://github.com/zekroTJA/new.zekro.de). It deliberately does not implement more complex templating features like logic operators (if, else, ...) or loops (for, foreach, ...). Also there is no pre-processing for stuff like SCSS, TypeScript or whatever. But you can build wrapper scripts that do that for you, of course. \n\nIf you are looking for something more sophisticated, please check out real static site generators like [Zola](https://www.getzola.org/), [Hugo](https://gohugo.io/), [Nuxt](https://nuxt.com/), [Astro](https://jamstack.org/) or [any other of the hundreds of choices](https://jamstack.org/generators/).\n\n## Usage\n\nTemple basically used 3 components for building your website.\n- `templates`: HTML files which can be used as foundation or components for your webpage.\n- `pages`: HTML files which can *use* or *extend* from `templates`.\n- `public`: Public source or media files like stylesheets, scripts, images, ...\n\nThe required project layout in the *source* directory looks as following.\n```\nsrc/\n    pages/\n        0_index.html\n        1_projects.html\n        2_contact.html\n        imprint.html\n        ...\n    public/\n        stylesheet.css\n        somescript.js\n        favicon.ico\n        site.webmanifest\n        ...\n    templates/\n        base.html\n        ...\n```\n\nA page or template is a simple HTML file which can also have functions and a config.\n\nLets assume you have a template file `src/templates/base.html` which has the following content.\n```html\n\u003c!DOCTYPE html\u003e\n\u003chtml lang=\"en\"\u003e\n  \u003chead\u003e\n    \u003ctitle\u003ezekro.de | {{pagename}}\u003c/title\u003e\n  \u003c/head\u003e\n  \u003cbody\u003e\n    \u003cnav class=\"header\"\u003e\n      {{navitems}}\n    \u003c/nav\u003e\n    \u003cmain\u003e{{pagecontent}}\u003c/main\u003e\n    \u003cfooter\u003esome footer\u003c/footer\u003e\n  \u003c/body\u003e\n\u003c/html\u003e\n```\n\nAnd you have a page `src/pages/0_index.html` with the following content.\n```html\n+++\ntitle = \"hey\"\npath = \"/\"\noutput = \"index.html\"\n+++\n\n{{ extends base }}\n\n\u003ch1\u003eHey!\u003c/h1\u003e\n```\n\nAnd maybe another page page `src/pages/1_projects.html` with the following content.\n```html\n{{ extends base }}\n\n\u003ch1\u003eProjects!\u003c/h1\u003e\n```\n\nWhen building the page, the following output will be generated.\n```\ndist/\n    index.html\n    projects/\n        index.html\n    public/\n        stylesheet.css\n        somescript.js\n        favicon.ico\n        site.webmanifest\n        ...\n```\n\nAnd the contents of the file `dist/index.html` will looks as following.\n```html\n\u003c!DOCTYPE html\u003e\n\u003chtml lang=\"en\"\u003e\n  \u003chead\u003e\n    \u003ctitle\u003ezekro.de | hey\u003c/title\u003e\n  \u003c/head\u003e\n  \u003cbody\u003e\n    \u003cnav class=\"header\"\u003e\n      \u003ca href=\"/\" class=\"active\"\u003ehey\u003c/a\u003e\n      \u003ca href=\"/projects\"\u003eprojects\u003c/a\u003e\n    \u003c/nav\u003e\n    \u003cmain\u003e\u003ch1\u003eHey!\u003c/h1\u003e\u003c/main\u003e\n    \u003cfooter\u003esome footer\u003c/footer\u003e\n  \u003c/body\u003e\n\u003c/html\u003e\n```\n\nAnd the contents of the file `dist/projects/index.html` will looks as following.\n```html\n\u003c!DOCTYPE html\u003e\n\u003chtml lang=\"en\"\u003e\n  \u003chead\u003e\n    \u003ctitle\u003ezekro.de | projects\u003c/title\u003e\n  \u003c/head\u003e\n  \u003cbody\u003e\n    \u003cnav class=\"header\"\u003e\n      \u003ca href=\"/\"\u003ehey\u003c/a\u003e\n      \u003ca href=\"/projects\" class=\"active\"\u003eprojects\u003c/a\u003e\n    \u003c/nav\u003e\n    \u003cmain\u003e\u003ch1\u003eProjects!\u003c/h1\u003e\u003c/main\u003e\n    \u003cfooter\u003esome footer\u003c/footer\u003e\n  \u003c/body\u003e\n\u003c/html\u003e\n```\n\n### Functions\n\n#### `{{ extends \u003ctemplate_name\u003e }}`\n\nReplaces `{{ pagename }}` in the template given via the `template_name` with the contents of the page. This is useful to build a scaffolding for your web page to extend your pages content into.\n\n#### `{{ use \u003ctemplate_name\u003e }}`\n\nIs replaced by the content in the template with the passed `template_name`. This is useful for components which are used in multiple pages of your site.\n\n#### `{{ pagename }}`\n\nWill be replaced with the name of the current page.\n\n#### `{{ navitems }}`\n\nWill be replaced with an anchor list with links and the names of all pages. When `navignore` is set to `true` in the page config, the page will not appear in the list.\n\n\u003e [!TIP]  \n\u003e When a page name has an underscore in the name, everything before the first underscore and itself will be removed from the name. This way you can sort the pages so that the `{{navitems}}` function always ensures the same order. \n\n#### `{{ currentdate \u003cformat?\u003e }}`\n\nWill be replaced with the current date, formatted with the given `format` string. When no format string is given, the default format of `%Y-%m-%d %H:%M:%S` will be used. [Here](https://docs.rs/chrono/latest/chrono/format/strftime/index.html) you can find the full specification for the date format.\n\n#### `{{ exec \u003ccommand\u003e \u003cargs...\u003e }}`\n\nExecutes a `command` with the given `args` and will be replaced with it's outputs.\n\n\u003e [!WARNING]  \n\u003e Please be cautious with this feature, especially in CI/CD pipelines, as it wil lexecute everything passed without any filtering!\n\n### Page Config\n\nAs you see above, you can configure some stuff of your pages by putting it in a block at the top level of the page beginning with `+++` and ending with `+++`. The contents of the block are in [TOML](https://toml.io/en/) format.\n\n```toml\n# The page title.\n# When not set, the name of the file will be used.\ntitle = \"hey\"\n\n# The navigation path of the page. \n# When not set, the path will be \"/\u003ctitle\u003e\".\npath = \"/somethingelse\"\n\n# Alternative output directory in the destination directory.\n# When not set, the output path will be \"\u003cpagename\u003e/index.html\".\noutput = \"index.html\"\n\n# When set to true, the page will not be listed in the 'navitems' function.\nnavignore = true\n```\n\n### Real World Example\n\nIf you need a real world example, my personal web page is built with this tool!\n\n- [Page](https://zekro.de)\n- [Repository](https://github.com/zekrotja/new.zekro.de)\n\n## Install\n\nYou can either download the latest release builds form the [Releases page](https://github.com/shellshape/temple/releases) or you can install it using cargo install.\n```\ncargo install --git https://github.com/shellshape/temple\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshellshape%2Ftemple","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshellshape%2Ftemple","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshellshape%2Ftemple/lists"}