Code and content of https://privacybadger.org.
- Install the extended version of Hugo version 0.55.3.
- Install node and npm. Run
npm install
to get the node dependencies. - Run
hugo serve
.
See also our Dockerfile and Travis config for how we get set up on Docker and Travis.
Frequently asked questions are stored as Markdown in content/en/faqs
. Each file holds a question, an answer, and a weight that indicates how high up the FAQ should appear on the page.
As Weblate does not yet support Markdown, FAQ translations are handled via Po4a. Translations live in .po
files in the po
directory.
- All
.po
translation updates should be followed by regenerating the localized Markdown files used by Hugo (in locale-specific content directories defined inconfig.toml
) by runningnpm run po4a
. - Adding/removing FAQ entries or locales should be followed by first regenerating the Po4a config file using
po/genconf.sh > po/po4a.conf
, and then updating the.po
files withnpm run po4a
. - Adding a new locale should at some point be followed by telling Privacy Badger to use the localized FAQ link when the user's browser is in that locale.
To install Po4a, check out its repository, switch to the v0.66
tag, and then create a helper script to run po4a
from the checkout. For example, create ~/.local/bin/po4a
, set the file as executable, and save the following text there, replacing /PATH/TO/CHECKOUT/
with your actual checkout path:
#!/usr/bin/env bash
PERLLIB=/PATH/TO/CHECKOUT/lib /PATH/TO/CHECKOUT/po4a "$@"
Non-FAQ translations can be found in /i18n
. These strings are used to render templates in the layouts
directory. See Hugo's multilingual documentation for more on using translated strings.
A list of supported browsers and download links can be found in data/browsers.toml
.