Giter Club home page Giter Club logo

blagger's Introduction

blagger

Crates.io MIT OR Apache licensed

fer yer blag

blagger is the world's dumbest static site generator, rivaled only by that pipeline of Bash and Python scripts everyone thinks about making once.

Usage

USAGE:
    blagger [FLAGS] [OPTIONS] --out-dir <out-dir>

FLAGS:
    -h, --help       Prints help information
    -a               Include hidden files
    -V, --version    Prints version information

OPTIONS:
    -I, --ignored-files <ignored-files>...    List of files to ignore [default: ]
    -i, --in-dir <in-dir>                     Input directory [default: .]
    -o, --out-dir <out-dir>                   Output directory
        --tag-html <tag-html>                 Template for tag pages. If not given, tag pages are not generated
        --tag-hub <tag-hub>                   Template for the special "all tags" tag page. If not given, defaults to
                                              tag_html
        --tag-pages-dir <tag-pages-dir>       Directory relative to `${out-dir}` that tag pages will be rendered to
                                              [default: tags]
    -t, --template-html <template-html>       Path to template file for Markdown posts

Templating

Everything in in-dir except Markdown files (files with an extension of md or markdown) and files with a path Rust considers equal to template-html is copied as-is into out-dir. This is your CSS, JavaScript, images, hand-written HTML (you psycho), whatever. The directory structure is preserved - in/css/what/why.css becomes out/css/what/why.css.

Markdown files are processed as follows:

  1. The post is pre-processed and rendered.
    1. The file is spit at the first occurrence of ::===::\n (that is, ::===:: and a newline.)
      • The first string split off is the "front matter". This is TOML with the following schema:
        • title: Required. A string.
        • tags: Required. A (possibly empty) list of strings.
        • subtitle: Optional string.
        • date: Optional TOML date-time.
      • The second string split off is the Markdown content of the post.
    2. The template file given by template-html is rendered. The front matter is provided to the template as an object called front, and the markdown content of the post as md_content.
      • In the template, a formatter named markdown is available for rendering Markdown strings.
  2. The rendered file is written to out-dir using the same directory-preserving scheme as other files, with the extension changed to html so browsers know what the heck is going on.

The template file is never emitted to out-dir.

To-do list

blagger's People

Contributors

c-x-berger avatar

Stargazers

 avatar

Watchers

 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.