Contributing

Architecture Overview

 graph TD
main["universtar-org/universtar"]
deploy["Deploy to GitHub Pages"]
bind["Bind to Cooresponding Domain"]
main -->|Reuse the main repository| xmum["universtar-org/xmum"] --> deploy
main -->|Reuse the main repository| mit["universtar-org/mit"] --> deploy
main -->|Reuse the main repository| dots[...] --> deploy
deploy --> bind

How it Works

This project is based on Hugo, which supports adding themes. The main repository universtar-org/universtar serves as a theme, so that other repositories could reuse it.

There are some GitHub actions used to:

  1. Fetch and update project data using universtar-org/tools, which calls GitHub REST API.
  2. Automatically upgrade the theme.
  3. Deploy the site to GitHub Pages.

Overall, this project is serverless, costless, and highly automatic.

Requirement

Build ToolVersion
Hugov0.153.3+extended+withdeploy
Node.JSv24.12.0
Go1.25.5
just (Optional)v1.46.0

Set up Development Environment

  1. Fork, clone and enter the repository

    Create a fork on GitHub.

    Then,

    git clone git@github.com:universtar-org/universtar.git
    cd universtar/

    Replace universtar-org/universtar with your forked repository.

  2. Add Upstream

    git remote add upstream https://github.com/universtar-org/universtar.git
    git fetch upstream
  3. Create a new branch (based on the develop branch)

    git switch --create new-branch-name upstream/develop
  4. Install dependencies

    For NixOS users, run one of the following command to enter dev shell.

    direnv allow # With `direnv`
    nix develop # Without `direnv`

    For other uses, run this command to install dependencies via npm:

    npm install
  5. Command list

    Preview the website:

    hugo server --config ./dev.yaml --disableFastRender
    # Or
    just dev

    Clean build caches:

    rm -rf public resources ./hugo_stats.json
    # Or
    just gc

    Format files:

    npx prettier -w "./**/*.html" "./**/*.md"
    # Or
    just format

    Update project data:

    curl -L -o updater https://github.com/universtar-org/tools/releases/latest/download/updater-linux-amd64
    chmod +x updater
    ./updater ./data/projects ; rm ./updater
    # Or
    just update
  6. Commit changes

    The commit message should follow Conventional Commits.

  7. Push changes

    git push -u origin your/branch
  8. Open pull request

    All changes should be submitted to develop branch at first, so please remember to change the target branch in the pull request.