Skip to content

Repository Structure

The v8s.link repository was generated from the vanityURLs/vanityURLs template. Here is every file, annotated.

  • v8s.link/
    • .github/
      • workflows/
        • deploy.yml// CI/CD — triggers on push to main
    • build/// committed generated output
      • _headers// HTTP headers served by Cloudflare
      • _redirects// generated by make build / CI
    • scripts/// CLI tools installed by make setup
      • lnk// redirect management CLI
      • validateURL// URL reachability checker
    • .gitignore
    • LICENSE// MIT
    • Makefile// setup, build, config targets
    • README.md// update for your domain
    • dynamic.lnk// temporary / campaign links
    • logo.png// optional branding, not used by Cloudflare
    • static.lnk// permanent links
    • vanityURLs.conf// your local config — never commit secrets

File-by-file guide

vanityURLs.conf — your local configuration

The only file you must edit before running make setup. It is read by the Makefile and by the lnk script. See the full configuration reference.

SCRIPT_DIR=~/.config/bin
REPO_DIR="/Volumes/Tarmac/codePublic/vanityURLs/v8s.link"   # ← change this
MY_DOMAIN="v8s.link"            # ← your domain
MY_PAGE="v8s-link.pages.dev"    # ← your Cloudflare Pages URL
SHORTCODE_LENGTH=3
#DRY_RUN=true

static.lnk — permanent redirects

Plain text, one rule per line. See Link Examples for the full annotated content.

dynamic.lnk — temporary / campaign redirects

Same format as static.lnk. The v8s.link deployment uses one splat rule here:

/github/*  https://github.com/vanityURLs/:splat

This means v8s.link/github/vanityURLsgithub.com/vanityURLs/vanityURLs, v8s.link/github/websitegithub.com/vanityURLs/website, and so on.

build/_redirects — generated, but committed

Produced by cat static.lnk dynamic.lnk > build/_redirects. Cloudflare Pages reads it from the build/ output directory. The file is committed so Cloudflare Pages can serve it without running a build command.

Why commit the generated file?

Cloudflare Pages’ build command is cat static.lnk dynamic.lnk > build/_redirects. Committing the output means the repo always shows the current state of all redirects — useful for code review and rollback.

build/_headers — generated by make setup, then committed

Created once by make setup based on your MY_DOMAIN and MY_PAGE. See the DNS Setup page for context on why two zones need separate header rules.

https://v8s-link.pages.dev/*
  X-Robots-Tag: noindex
  X-Content-Type-Options: nosniff

https://v8s.link/*
  X-Robots-Tag: noindex
  X-Content-Type-Options: nosniff

Update _headers if you change your domain

Run make headers any time MY_DOMAIN or MY_PAGE changes. The file is not regenerated automatically.

scripts/lnk — the CLI

The primary tool for managing redirects. Installed to SCRIPT_DIR by make setup. See the Commands reference.

scripts/validateURL — URL reachability checker

A companion script that performs live HTTP checks on redirect destinations. Called by lnk validate --live. Can also be used standalone:

validateURL https://github.com/vanityURLs
# → 200 OK (87ms) ✓

Makefile — task runner

Key targets:

TargetWhat it does
make configOpen vanityURLs.conf in $EDITOR (defaults to vi)
make setupInstall scripts, generate _headers, create starter link files
make buildLocal build: cat static.lnk dynamic.lnk > build/_redirects
make debugPrint MY_DOMAIN to verify config is loaded

.github/workflows/ — CI/CD

The deploy workflow triggers on every push to main and runs the build command. Cloudflare Pages detects the push via webhook and serves the updated build/ directory within ~15 seconds.

Edit this page Last modified: