GithubHelp home page GithubHelp logo

littlekid / fn-static-generator Goto Github PK

View Code? Open in Web Editor NEW

This project forked from foss-north/fn-static-generator

0.0 0.0 0.0 9.46 MB

Jinja2 based static site generator

CSS 22.72% Python 2.25% HTML 75.03%

fn-static-generator's Introduction

foss-north static site generator

Copyright(C) 2019 foss-north ek.för

This is the foss-north static site generator. Since I'm tired of Ruby, I decided to drop Jekyll and look into Jinja myself. This small setup allows me to create a data driven site from YAML files and Jinja templates.

The paths are hardcoded and based on the location of the fn-generator.py script. The directories are:

  • _source/ - source *.html files. These are Jinja templates and each file results in the corresponding file being rendered to the _output/ directory.
  • _includes/ - includeable files. These are Jinja templates included or extended from the files in the _source/ directory.
  • _data/ - data set *.yaml files. These files are exposed as variables under the global data variable when rendering pages.
  • _assets/ - raw assets. This subtree is copied into the _output/ directory.
  • _output/ - the _output/ directory. This directory is created or updated by the script and can be removed.

When rendering the pages from the _source/ directory the global variable data is exposed to Jinja. This variable contains the following sub-variables:

  • data.page the name of the current page without file extension, e.g. when rendering index.html the variable data.page is set to index.
  • data.pages a list of all page names without file extensions.
  • data.N, where N corresponds to a YAML file from the _data/ directory. Each N the contains the contents of the associated YAML file.

fn-static-generator's People

Contributors

adriaandegroot avatar bastianilso avatar e8johan avatar zeising avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.