This repository contains the HTML, JavaScript and CSS for 2fa.directory.
All data used to populate the categories is located
in 2factorauth/twofactorauth.
The website is based on the static site generator Hugo.
To build locally you will need to follow the installation instructions for Hugo.
Ruby is also required for some scripts.
After you've installed Hugo and Ruby, follow these steps to build the site locally:
- Install NPM packages
npm install
- Install Ruby gems
bundle install
- Fetch entries:
./scripts/generate_entries.rb
- Generate regional pages:
./scripts/generate_regions.rb
- Run Hugo locally:
hugo serve
The site should then be reachable at 127.0.0.1:1313.
Note The region-redirection script does not run locally. You will therefore always be directed to the international page when using
hugo serve
.
This repository is built on the frameworks of Cloudflare Pages and requires the build process to be done via Cloudflare.
To publish your fork of this repo, follow these steps:
- Log in to your Cloudflare Dashboard and select Pages. Create a new project and select your fork as the source.
- When prompted for build configuration, enter the following:
- Framework preset:
None
- Build command:
./scripts/build.sh
- Build output directory:
/public
- Framework preset:
When contributing changes to this repository, please make sure your IDE follows our editorconfig.
The general file structure is as follows:
Type | Path |
---|---|
JavaScript | assets/js |
CSS | assets/css |
Layouts | layouts/_default |
Pages | content |
Translations | data/languages.json |
This project is licensed under GPLv3. For the entire license see LICENSE.
Before you make changes to the code, please keep the following in mind:
- The data is licensed separately.
- Attribution is required if you use this project as a template for your own website.
- The initial contents of LICENSE must still be included in distributions and forks but we allow (and encourage) you to prepend your own copyright and GPLv3-compatible license for changes you make.
For a more information on what is and isn't allowed under a GPLv3 license, see this guide.