The website uses Hugo and Node.js. We're using asdf to manage versions, so
first install the hugo and nodejs plugins if you haven't already.
asdf plugin add hugo
asdf plugin add nodejsThen install dependencies:
asdf install
bin/setupRun the development server.
bin/serverThe stylesheets are compiled with Dart Sass, which bin/setup installs through
the sass-embedded npm package. bin/server puts it on the PATH for Hugo, so
use it rather than running hugo server directly.
Visit localhost:1313.
hex_packages.txt lists the Nerves packages on Hex.pm that we track, one per
line. bin/sync_hex_packages looks each of them up and writes data/hex.json:
the latest version and publishing date per package, who wrote the commits
since the release before it (from GitHub, with their avatars saved to
static/img/hex-authors), and a summary (releases and
packages released in the last 30, 90 and 365 days) that templates read as
hugo.Data.hex. The Code page shows a line from it.
The github pages workflow runs the script before each deploy and once a day
on a schedule, without committing the result. The committed data/hex.json is
what local builds, pull request builds and a build that cannot reach Hex.pm
use. To refresh it:
GITHUB_TOKEN=$(gh auth token) ./bin/sync_hex_packagesWithout a token the authors are left as they are.
The Newsletter sync workflow runs every Friday and opens a pull request with
any issues that are in the archive on underjord.io
but not here yet. To do the same locally:
./bin/sync_newsletters --dry-run # list what's missing
./bin/sync_newslettersTo add a single issue by hand, get the URL to the HTML source
(usually found at the top where it says No images? Click here) then run the
script:
./bin/add_newsletter URLSee ./bin/add_newsletter --help for customization and more info.
Both scripts strip the email markup (inline styles, the logo header, the
unsubscribe footer, the recurring "how to help" sections) and replace
Campaign Monitor's click-tracking links with where they point, so the issue
reads like a regular page on the site. Pass --raw to keep the email as-is. The cleaning lives in
bin/newsletter_cleaner.exs. To re-run it over issues that still contain the
raw email HTML:
./bin/clean_newsletters [FILE...]