Skip to content

alxmrs/pandoc-website-template

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

57 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Pandoc Website Template

pages-deploy shellcheck

A template to build static websites with Pandoc.

Demo site: pandoc.merose.com.

Use

build

bin/build walks the source directory, invokes Pandoc on each file, and copies assets to a destination folder. It also gathers all files not named "index.md" into an RSS feed.

This tool is configurable by environment variables.

Variable Description Default
SRC Root directory of input sources. src/
DST Root directory for generated output. public/
STATIC Directory for static assets. $SRC/static
SRC_EXT Input sources file extension. md
DST_EXT Output generation file extension. html
HEADER path/to/header.html (--include-before-body). $SRC/header.html
FOOTER path/to/footer.html (--include-after-body). $SRC/footer.html
CSS path/to/style.css embedded in header of a web page. /main.css
PANOPTS Arguments to pass to Pandoc for each input file. --css $CSS --metadata-file=$ROOT/defaults.yml -B $HEADER -A $FOOTER

To make it easier to edit metadata for every page, consider making changes to the defaults.yml at the project root.

Note: Configuring RSS still needs to happen in the bin/build file today.

The defaults of this script are oriented for creating static websites. However, the configuration could be molded to support a wide variety of tasks; for instance, generating a CV or a slide deck. See these examples for more inspiration.

watch

bin/watch will watch the source directory. On any changes, it will invoke the build script.

Deployment

This template will publish the static site to Github Pages via Github Actions.

Thanks to