Example Repo for Static Site Generators

Dr. Greg Bernstein

Updated February 27th, 2020

Using the Static Site Repo Example

Static Site Repo Zip

MetalsmithExampleRepo.zip

An Archived Repo?

  • The MetalsmithExampleRepo.zip contains our Metalsmith examples
  • Unzip this somewhere on your system
  • Take a look, where are the files?
  • I compressed just the .git directory into this repo

Getting the different demos

Using git branches to hold the different demonstrations

Branches in Demonstration Order

  1. basic – Just getting Metalsmith installed and trivial example
  2. basicPlug – Write our own basic plugin
  3. markdown – Processing Markdown files with plugin
  4. layout – Using templates (Nunjucks.js)
  5. yml – Using YAML and Metalsmith processing flow
  6. nav – Adding navigation via JSON file and template

Checkout basic

Put the repository in the proper state of the last commit to branch basic:

git reset --hard
git checkout basic

Reset the Branch

File Tree

.
├── README.md
├── build.js
├── package-lock.json
├── package.json
└── src
    ├── MyTest.txt
    ├── anotherTest.txt
    ├── strange.dat1
    ├── test1.txt
    └── weird.dat1

1 directory, 9 files

Re-populate node_modules

  • We have a package.json for the branch
  • Use npm install
  • Be patient for NPM to install modules
  • You can now run demonstration
  • If you switch branches you may need to run npm install again