Skip to content
/ drfly Public

static website generator powered by Python, YAML, Markdown and mustache

License

Notifications You must be signed in to change notification settings

klml/drfly

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

99 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

drfly

static website generator powered by Python, YAML, Python-Markdown and mustache.

There are many other and better staticsitegenerators, but I missed some features. So drfly provides:

  • the meta information for rendering (template, menue etc) or html metatags are defined
    • in ./meta.yaml in the contentroot, like configuration files in most other ssg like hugo.
    • but additionally in every directory (meta.yaml)
    • or inside the page as jekylleske front matter, but at the bottom of the page and only optional (tried to use my own standard PROSErial).
  • the document or page title is defined with the first H1 and is optional. Most other ssg define the pagetitle in the front matter, but this is complicated and makes front matter mandatory. HTML headings, are part already a part of the document. So I need this:
  • URLs with no mandatory trailing slash.
  • simple one-file templating with mustache, for plain websites. Even the simple hugo layout templates drives me crazy. I would love using Pandoc for this.
  • include sourcefiles in templates (for menus, sidebars, trackingpixels). Instead of defining menus in abstract config files.
  • use source directories as namespace, with customizing namespaceseperators (namespace:pagetitle) and not only /.
  • non .md files (.css, .js or .txt) get rendered with newlines as breaks (<br>).
  • create single pages, not always all pages at once.

When I build sites for other people I use hugo. But then I miss [[Wikilinks]] from Python-Markdown.

usage

cli

Change to source directory and render all pages:

cd /path/to/source/
drfly 

Render all pages from source directory:

drfly /path/to/source/ 

Render single page:

drfly /path/to/source/index.md 

web

You can use git{hu|la}b as content webinterface and versioning system.

Get new commits with webhook.py (depends on webpy.org)

pip3 install -r requirements-web.txt 
python3.6 drfly/webhook.py 8080 /path/to/source/
  • Render a single page: http://localhost:8080/render?page=index.md
  • Render all pages, by setting "webhook: renderall" true in config and: http://localhost:8080/render?all
  • Pull git repository and render all changed pages curl -X PO http://localhost:8080/gitpull

config

There is the global config drfly/meta.global.yaml. You can overwrite this values with a file meta.yaml in the root-directory oder every sub-directory.

rendering

Drfly renders html and json files with Python-Markdown using Markdown Extra with Table of Contents, WikiLinks, Sane Lists and Admonition.

You can add Third-Party-Extensions in config markdown: extensions:

About

static website generator powered by Python, YAML, Markdown and mustache

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •