git clone https://github.com/picosh/pgit.git
1# pgit
2
3A static site generator for git.
4
5This golang binary will generate a commit log, files, and references based on a
6git repository and the provided revisions.
7
8It will only generate a commit log and files for the provided revisions.
9
10## usage
11
12```bash
13make build
14```
15
16```bash
17./pgit --revs main --label pico --out ./public
18```
19
20To learn more about the options run:
21
22```bash
23./pgit --help
24```
25
26## custom nav buttons
27
28We support adding additional buttons to the nav bar:
29
30- `--issues-url` redirects users to bug tracking site
31- `--contrib-url` redirects users to code collab site (e.g. gh pulls, patches, etc.)
32
33## themes
34
35We support all [chroma](https://xyproto.github.io/splash/docs/all.html) themes.
36We do our best to adapt the theme of the entire site to match the chroma syntax
37highlighting theme. This is a "closet approximation" as we are not testing every
38single theme.
39
40```bash
41./pgit --revs main --label pico --out ./public --theme onedark
42```
43
44The default theme is `dracula`. If you want to change the colors for your site,
45we generate a `vars.css` file that you are welcome to overwrite before
46deploying, it will _not_ change the syntax highlighting colors, only the main
47site colors.
48
49## with multiple repos
50
51`--root-relative` sets the prefix for all links (default: `/`). This makes it so
52you can run multiple repos and have them all live inside the same static site.
53
54```bash
55pgit \
56 --out ./public/pico \
57 --home-url "https://git.erock.io" \
58 --revs main \
59 --repo ~/pico \
60 --root-relative "/pico/"
61
62pgit \
63 --out ./public/starfx \
64 --home-url "https://git.erock.io" \
65 --revs main \
66 --repo ~/starfx \
67 --root-relative "/starfx/"
68
69echo '<html><body><a href="/pico">pico</a><a href="/starfx">starfx</a></body></html>' > ./public/index.html
70
71rsync -rv ./public/ pgs.sh:/git
72```
73
74## inspiration
75
76This project was heavily inspired by
77[stagit](https://codemadness.org/stagit.html)