Skip to content

About

A redesigned BlackArch Linux website: searchable tools browser, architecture explorer, 15 languages. Built with VitePress and Vue.

Topics

Resources

Security policy

Stars

0 stars

Watchers

1 watching

Forks

Repository files navigation

BlackArch Linux website

A redesign of the BlackArch Linux website, built with VitePress and Vue 3. It is a static site: there is no backend, and every page is generated at build time.

Home page with the animated BlackArch logo and the install command

Tools Architecture Downloads
Tools page: search, sorting and category filters Architecture explorer Download cards with checksums

Getting started

Requirements: Node.js 22 and pnpm 10 (the versions CI uses).

pnpm install
pnpm dev        # dev server with hot reload
Command What it does
pnpm dev Start the dev server
pnpm build Production build into src/.vitepress/dist
pnpm preview Serve the production build locally
pnpm check Everything CI runs: formatting, lint and build
pnpm format Format the code with Prettier
pnpm format:check Check formatting without changing files (what CI should run)
pnpm lint Lint with oxlint
pnpm gen:locales Regenerate the per-language page stubs (see Translating)
pnpm sync:tools Rebuild the tools list from the BlackArch package database
pnpm sync:mirrors Refresh the mirror list from the official pacman mirror list
pnpm sync:wiki Refresh the list of tools that have a page on the BlackArch wiki
pnpm sync:stars Refresh the GitHub stars used for the "Most popular" ordering
pnpm sync:links Update tool links, follow moved sites and list dead links (takes a few minutes)
pnpm seo:indexnow Submit the sitemap pages to Bing/DuckDuckGo through IndexNow (run after a deploy, with the same SITE_URL)

Deploying and updating the tools list

.github/workflows/main.yml checks and builds every push and pull request. It deploys to GitHub Pages on every push to main, once a day, and whenever it is started by hand. Before each deploy it syncs the tools list from the BlackArch package database, so new, updated and removed packages show up on the site without a commit.

To update the site right now, use Actions > main-ci > Run workflow on GitHub, or:

gh workflow run main.yml

To do the same on your own machine or server:

pnpm install
pnpm sync:tools                                   # refresh the tools list
SITE_URL=https://www.blackarch.org/ pnpm build    # the site is written to src/.vitepress/dist

SITE_URL is the address the site will be served from. It defaults to the GitHub Pages address and also sets the base path, the sitemap, robots.txt and the canonical links.

Deploying to blackarch.org

blackarch.org is not on GitHub Pages: nginx serves it from /var/www/blackarch, the same folder that holds the package repository (blackarch/), keyring/, gpgkeys/, strap.sh, blackarch-mirrorlist, the guide PDFs and the screenshots. The auto.sh script of BlackArch/blackarch-site builds this site with the commands above and copies it into that folder:

rsync --chmod "a+rX,ug+w" -avzzl src/.vitepress/dist/ blackarch.org:/var/www/blackarch/

Never add --delete to that command: it would delete the package repository. The pages are served from www.blackarch.org, so build with SITE_URL=https://www.blackarch.org/.

The links have no .html (/tools), so nginx has to look for tools.html:

location / {
    try_files $uri $uri.html $uri/ =404;
}
error_page 404 /404.html;

After a deploy, tell search engines about it with SITE_URL=https://www.blackarch.org/ pnpm seo:indexnow.

Project layout

src/
├── content/                 The pages, one folder per language
│   ├── en/                  English pages (served from the site root)
│   ├── <code>/              Other languages (it/, ar/, ...), see "Translating"
│   └── public/              Static files: logo layers, team avatars, install screenshots
├── components/              Vue components used by the pages
├── composables/             Shared Vue logic (useClipboard)
├── data/                    Site data as JSON (see "Keeping data up to date")
├── i18n/                    Translation helper, language metadata and UI strings
│   ├── index.js             useT(): looks up UI strings for the current language
│   ├── meta.json            Language names, navigation labels and search strings
│   └── locales/<code>.js    UI strings per language
└── .vitepress/
    ├── config.mjs           Site, navigation, languages and search configuration
    ├── seo.mjs              Sitemap, canonical addresses, hreflang and link previews
    └── theme/               Theme entry, sidebar toggle and styles
        └── styles/          tokens.css, base.css, layout.css, rtl.css
scripts/                     Maintenance scripts (see below)

Conventions

  • Colours and sizes come from the CSS variables in theme/styles/tokens.css. Do not hard-code colours in components. The whole site takes its colour from the --ba-accent values there.
  • Component styles are scoped and use CSS logical properties (margin-inline-start, inset-inline-end, ...) so that right-to-left languages work without overrides.
  • User-visible text in components goes through useT(namespace, englishDefaults) so it can be translated. English lives in the component; other languages override it in src/i18n/locales/<code>.js. Missing keys fall back to English.
  • Copy buttons use the useClipboard composable.
  • Static data (ISO list, mirrors, team, screenshots) lives in src/data, not in components.
  • Commit messages follow Conventional Commits (feat:, fix:, chore:, ...).

Git hooks and CI

pnpm install sets up husky hooks:

  • pre-commit formats and lints the staged files (lint-staged, Prettier, oxlint).
  • commit-msg checks the message with commitlint.

CI (main-ci) runs on every push and pull request: formatting check, lint, a check that the generated language pages are up to date, and the production build. Pull requests also have their commit messages linted. Run pnpm check to do the same locally.

Translating

Every language has its own folder, for example src/content/it/. Pages that are not translated yet are small stubs that show the English page under a "not translated yet" banner.

Translate a page. Edit src/content/<code>/<page>.md, replace the <!--@include: ../en/<page>.md--> line with the translated text, and add translated: true to its frontmatter. Keep components, code blocks, URLs and image paths as they are. Pages marked translated: true are never overwritten by the generator. src/content/it/ is a complete example.

Translate the interface. Copy src/i18n/locales/en-style keys from an existing file such as src/i18n/locales/it.js and translate the values.

Add a language.

  1. Add an entry to src/i18n/meta.json (copy an existing one). Set "dir": "rtl" for right-to-left languages.
  2. Create src/i18n/locales/<code>.js and import it in src/i18n/index.js.
  3. Run pnpm gen:locales to create the page stubs, then pnpm build to check.

Keeping data up to date

Data File How to update
Mirrors src/data/mirrors.json pnpm sync:mirrors (reads the pacman mirror list, blackarch.org/blackarch-mirrorlist, and keeps the rsync addresses of mirrors still listed)
ISO images src/data/images.json Edit by hand when a new image is released: release date, size, file name and checksums. Take SHA1 from https://blackarch.org/downloads.html, check the downloaded file against it, then compute the others (sha256sum, openssl dgst -sha3-256)
strap.sh checksum src/content/en/downloads.md, src/content/it/downloads.md Update the sha256sum -c line. Check the script against the SHA1 on the official downloads page first, then run sha256sum strap.sh
Tool popularity src/data/tool-stars.json pnpm sync:stars (GitHub stars; needs GITHUB_TOKEN or the gh CLI)
Tool links src/data/tools/*.json, tool-dead-links.json, tool-link-redirects.json pnpm sync:links follows moved sites and lists dead links (takes a few minutes)
Tools list src/data/tools/*.json pnpm sync:tools rebuilds it from the BlackArch package database: names, versions, descriptions, groups and build dates. One file per category. Also runs on every deploy
Wiki pages src/data/tool-docs.json pnpm sync:wiki (tools with a page on blackarch.wiki)
FAQ src/data/faq.js Edit by hand. Translations override entries by id in src/i18n/locales/<code>.js
Team src/data/developers.json Add github and avatar (a file in src/content/public/team/) when known
Supporters src/data/donors.json Add new donations at the top
Screenshots src/data/screenshots.json Files are loaded from blackarch.org/images/screenshots

After changing data, run pnpm build and check the affected page.

The refresh-data workflow runs all of the sync:* scripts every Monday and pushes the result to a branch for a pull request, after checking that the site still builds. This keeps the data in the repository fresh, including the slower link and star checks.

Contributing

Fixes and translations are welcome. Open an issue first for larger changes. Every page has an "Edit this page on GitHub" link.

  1. Fork the repository and create a branch.
  2. Make your change, then run pnpm check.
  3. Open a pull request and describe what changed and why.

License

The code of this website is released under the MIT License.

The BlackArch name and logo, the screenshots and the texts taken from blackarch.org belong to the BlackArch Linux project. The tool descriptions come from the BlackArch package database and their upstream projects.

BlackArch Linux itself, its packages and its tools are maintained in the BlackArch organization. Problems with the distribution belong there, not here.

About

A redesigned BlackArch Linux website: searchable tools browser, architecture explorer, 15 languages. Built with VitePress and Vue.

Topics

Resources

Security policy

Stars

0 stars

Watchers

1 watching

Forks

Used by

Contributors

Languages