docs

git clone https://github.com/notamitgamer/docs.git
· rebuilt hourlyOpen on GitHub
root / git-mirror / build-process.mdx

build-process.mdx (2347B)


      1 ---
      2 title: "How the Build Works"
      3 ---
      4 
      5 import Copyright from "/snippets/copyright.mdx";
      6 
      7 `build.sh` runs the whole pipeline, driven by GitHub Actions. Here's what it does, step by step.
      8 
      9 ## 1. Setup & metadata
     10 
     11 - Detects the repo owner (`GITHUB_REPOSITORY_OWNER`, falling back to `notamitgamer` locally)
     12 - Resolves the site's base URL from a configured Pages CNAME, or falls back to `https://<username>.github.io`
     13 - Captures the git-mirror repo's own commit hash and build timestamp for the footer
     14 
     15 ## 2. Copy root assets
     16 
     17 `style.css`, `favicon.png`, `logo.png`, and `icon.png` are copied from `assets/` into the site root (with `favicon.png` also duplicated as `favicon.ico`).
     18 
     19 ## 3. Fetch & process each public repository
     20 
     21 For every public repo (minus the filtered ones):
     22 
     23 1. Clone it as a **bare repo** into `raw_repos/`
     24 2. Overwrite stagit's placeholder `description` and `owner` files
     25 3. Run `stagit` to generate the standard Log / Files / Refs / README / LICENSE pages
     26 4. Copy `style.css`, `logo.png`, and `favicon.png` into that repo's subfolder
     27 5. Inject an **Activity** link into stagit's nav bar on every generated page
     28 6. Generate a custom `activity.html` page with:
     29    - Clone URL and GitHub link
     30    - Last commit hash + timestamp
     31    - Approximate repo size
     32    - A small dependency-free SVG bar graph of weekly commit activity
     33 7. Inject a recursive, collapsible **folder tree** script into `files.html`, with hash-based URLs (`#folder=path/to/dir`) so specific folders can be linked directly and auto-expanded
     34 8. Add a static **breadcrumb** to every individual file page under `file/`, built by walking the file's path
     35 9. Write a `last_commit` file into the repo subfolder recording the mirror's build metadata
     36 
     37 ## 4. Generate the central index
     38 
     39 `stagit-index` runs over all the bare repos to produce the root `site/index.html` landing page, listing every mirrored repository.
     40 
     41 ## 5. Site-wide finishing touches
     42 
     43 - Injects a formatted build-info footer (owner, build time, git-mirror commit, stagit credit) into every generated HTML page
     44 - Copies `CNAME` into the site output, if present
     45 - Injects a mobile viewport meta tag into every page's `<head>`
     46 - Generates `sitemap.xml` from every HTML file in the output
     47 - Generates a styled `404.html`
     48 
     49 The final output lands in `./site`, ready to be deployed via GitHub Pages.
     50 
     51 <Copyright />