Skip to content

AuthorCarpentry/varnish

 
 

Repository files navigation

{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.

About

Template for pkgdown site

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages

  • SCSS 43.8%
  • HTML 42.5%
  • JavaScript 10.8%
  • Shell 2.5%
  • R 0.4%