static-anthology
v2.0.1
Published
Static site renderer for project showcases
Readme
Static Anthology
This project allows the user to easily host multiple web projects as subpages on a single website. Pages can be specified using a sitemap json file, with support for projects on local filesystems as well as on GitHub.
Detecting Projects: Static Web App Manifests
In order to determine if a project is a static web app, each source should have
a file, swa_manifest.json in the root directory. This json file must contain
the following fields:
{
"title":"The title of the web app",
"root":"The root directory of the repository containing static content",
"directory": "The output directory of the static subpage"
}Additionally, tile images for each site are loaded from swa_tile.png if present.
Static Resources
Static resources for the root page may be added to static_src. These will be
copied as-is into the root of the output directory. This is a good location for
styles, images, and any other root-level web assets.
Templates
The rendering process uses three template files:
- index.njk - determines the base landing page. Contains multiple tiles.
- folder.njk - folders store multiple tiles.
- tile.njk - a single tile. One tile is produced per web app.
Configuration
Configuration for any command-line arguments can also be supplied by adding
a config.json file in the current directory. This is the recommended place
for your GitHub username and token.
Running the Compiler
Once configured, run
npx static-anthology
OR
npx static-anthology compileGenerating a SiteMap from GitHub
If you would like to generate a sitemap from all of the static web apps on a user's GitHub account, you can run
npx static-anthology sourceMake sure to configure a username and token.
