Package: gnrt
gnrt - lightweight, fast and extensible static site generatorAboutA lightweight static site generator written in Python.Features:Markdown-based contentFrontmatter supportJinja2 templatingOptional YAML-based configurationRequirementsPython 3.6+Installationpip install --upgrade gnrtYou may need to add$HOME/.local/binto your$PATH.Usagegnrtgnrtwill look for an optionalconfig.ymlfile in the current working directory, optional Jinja2 templates in thetemplatesfolder, markdown files in thecontentfolder, then write the generated output files in thepublicfolder, while respecting thecontentfolder and sub-folders structure.To get a list of options, use:gnrt -hConfigurationConfiguration is stored inconfig.yml. Any key-value pair is allowed. These keys and their values can be used in the content and template files.---
sitename: My awesome blog
baseurl: https://example.com
language: en
foo: barIf theconfig.ymlfile exists,gnrtwill look for thedefaultsandlistsentries.DefaultsThis is where you define default configuration values, which can be overridden in content files.Example:defaults:
  template: default.j2
  markdown-extras:
    - break-on-newline
    - fenced-code-blocks
  nav: includes/nav.html
  bar: fooReserved keysThese keys have a specific meaning, and their values can be overridden in content files, like any otherdefault.markdown-extras: allows to enable Markdown extensions, seeExtrasfor a list of valuestemplate: sets the defaultJinja templateto be used while rendering content filesListsThis is where lists of content are defined, allowing the generation of lists of links for instance.Example:lists:
  nav1:
  filter:
    key: category
    value: page
    template: nav-page.j2
  nav2:
    filter:
      key: category
      value: article
    sort: published
    reverse: true
    template: nav-article.j2
  rss:
    filter:
      key: category
      value: article
    sort: published
    reverse: true
    template: rss.j2
    target: public/rss.xmlLists can select content through afilter, which gets a metadatakeyand avalueto match.They can be sorted by metadata value (e.g. a published date, an integer, ...), in forward (default) orreverseorder.During rendering, the generated content is saved in theincludesfolder (for caching), while the file path can be customized through thetargetkey. This allows to generate a RSS feed for instance.Content filesContent files have the.mdextension and are stored in thecontentfolder.FrontmatterContent files may have afrontmatter- i.e. structured metadata - written in YAML.This is where default values can be overridden.Example:---
id: home
title: Home
link: /
nav-order: 3
---Reserved keysid: the current item identifier, which can be used in any content file to access this item's metadatalink: URL of the generated pagetarget: path of the generated filetitle: title of the current itemBodyContentbodyis written inMarkdown.It may also contain Jinja2 syntax and placeholders, allowing injection ofdatasetvalues, such as links to other pages:Check the [about]({{ data.about.link }}) page or read the [articles]({{ data.articles.link }})!ExampleSee the example website indocs/example, which you can generate by installinggnrt, cloning this repository, moving tognrt/docs/exampleand executinggnrt.You can then browse it athttp://localhost:8080/by moving to the generatedpublicfolder and executingpython3 -m http.server 8080.You may also want to check alive gnrt-generated blogand read thisarticle about gnrt.