Skip to content

Latest commit

 

History

History
93 lines (73 loc) · 2.9 KB

File metadata and controls

93 lines (73 loc) · 2.9 KB

{varnish}: Template for The Carpentries Workbench

This project is a work in progress template for carpentries lessons adapted from {pkgdown}. There is no need to call this package directly, it is installed via the {sandpaper} package.

The html templates use mustache templating language

To use this template in a {pkgdown} site, add the following to your _pkgdown.yml file:

title: {{ title }} # needed to set the site title
home:
  title: Home
  strip_header: true
  description: ~
template:
  package: varnish
  params:
    time: {{ time }}
    source: {{ source }}
    branch: {{ branch }}
    contact: {{ contact }}
    license: {{ license }}
    handout: {{ handout }}
    cp: {{ cp }}
    lc: {{ lc }}
    dc: {{ dc }}
    swc: {{ swc }}
    carpentry: {{ carpentry }}
    carpentry_name: {{ carpentry_name }}
    carpentry_icon: {{ carpentry_icon }}
    life_cycle: {{ life_cycle }}
    pre_alpha: {{ pre_alpha }}
    alpha: {{ alpha }}
    beta: {{ beta }}

Replace everything in the curly braces with a value. These are elements that are constant across the entire site. Page-specific parameters are added via mustache.

Parameters

The parameters used are a combination of global parameters stored in the _pkgdown.yaml file and local parameters passed on to pkgdown::render_html().

Global

(TODO: write descriptions of these parameters)

Page-specific

(TODO: write descriptions of these parameters)

HTML Templates

We have customized the following templates:

  • content-chapter displays the episodes for the lessons
  • content-syllabus is the landing page for the lessons
  • content-extra is used for pages that are not chapters and do not need positional navigation
  • head contains the metadata and script loading
  • navbar is a bit of misnomer, but it contains the sidebar navigation
  • header contains metadata and favicons
  • footer contains navigation, credits, and JSON metadata
  • layout pulls everything together

CSS and JavaScript

The CSS and JavaScript used for the lessons are minified. Their sources live in the source/ folder with directives to include their dependencies (bootstrap, jquery, feather).

The minified versions are built via GitHub actions any time one of the source files is changed.

Instructions to build locally forthcoming.