stagit-fork

My forked version of stagit
git clone git://shipwreckt.co.uk/stagit-fork.git
Log | Files | Refs | README | LICENSE

commit 643223d169f1d9b53e9080ed78b13868a18d7973
parent 293e00857a1605229efa888988392d1c16f67e63
Author: Shipwreckt <me@shipwreckt.co.uk>
Date:   Sat, 22 Feb 2025 20:35:48 +0000

Dumbed things down in README and added some themes

Diffstat:
MREADME | 79+++++++++++++++++++++++++++++++++++++++++++++++++++++++++----------------------
Mexample_create.sh | 2+-
Athemes/default.css | 154+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Athemes/shipwreckt.css | 151++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
4 files changed, 363 insertions(+), 23 deletions(-)

diff --git a/README b/README @@ -1,43 +1,64 @@ -stagit ------- -static git page generator. +Intro +----- -It generates static HTML pages for a git repository. +Note: I am not the original creator; that would be codemadness. I have forked his repository to make it simpler and easier to understand for users like myself. In simple works a dummies version of staggit! If you have any suggestions or questions, please email me at me@shipwreckt.co.uk. +Original creator's website: +https://codemadness.org/stagit.html -Usage +There are themes for Staggit in the themes directory. I have taken them from various websites. If you recognize your theme and are unhappy with its inclusion, please contact me. +If you want to try out a theme just copy it to your style.css. + +Websites that I love the feel of ! +https://git.shipwreckt.co.uk +https://git.pyratebeard.net +https://git.drkhsh.at + +About ----- +stagit is a static page generator for your git server. It generates static HTML pages from a selection of git repos. -Make files per repository: +The creator is codemadness, highly suggest looking at his website it is a good read. +https://codemadness.org - $ mkdir -p htmlroot/htmlrepo1 && cd htmlroot/htmlrepo1 - $ stagit path/to/gitrepo1 - repeat for other repositories - $ ... -Make index file for repositories: +Dependencies +------------ - $ cd htmlroot - $ stagit-index path/to/gitrepo1 \ - path/to/gitrepo2 \ - path/to/gitrepo3 > index.html +- C compiler (C99). +- libc (tested with OpenBSD, FreeBSD, NetBSD, Linux: glibc and musl). +- libgit2 (v0.22+). +- POSIX make (optional). Build and install ----------------- - +cd stagit $ make # make install -Dependencies ------------- -- C compiler (C99). -- libc (tested with OpenBSD, FreeBSD, NetBSD, Linux: glibc and musl). -- libgit2 (v0.22+). -- POSIX make (optional). +Usage +----- +I am going to assume that your git server is located in /srv/git like the official website directs. If in a diffrent directory change the command to fit where your git repos are located. +I am also going to assume that you are using nginx. I do not use apache so I am unsure if websites are located in /var/www/ so if they are not change the command to fit where you want your website located please. + + +Make files per repo: + + $ mkdir -p /var/www/git/htmldir/<name of your repo> && cd /var/www/git/htmldir/<name of your repo> + $ stagit /srv/git/<name of your repo>.git + repeat for other repositories + + +Make index.html file for all of your repositories: + + $ cd htmlroot + $ stagit-index path/to/gitrepo1 \ + path/to/gitrepo2 \ + path/to/gitrepo3 > index.html Documentation @@ -46,6 +67,20 @@ Documentation See man pages: stagit(1) and stagit-index(1). +Set owner of a repo +------------------- + +cd /srv/git/<name of your repo>.git +echo YourName > owner + + +Set URL link of a repo +---------------------- + +cd /srv/git/<name of your repo>.git +echo git://<your domain or ip>/<name of your repo without .git> > url + + Building a static binary ------------------------ diff --git a/example_create.sh b/example_create.sh @@ -11,7 +11,7 @@ # - write owner of repo to the "owner" file. # - write description in "description" file. # -# Usage: +# How to use # - mkdir -p htmldir && cd htmldir # - sh example_create.sh diff --git a/themes/default.css b/themes/default.css @@ -0,0 +1,154 @@ +body { + color: #000; + background-color: #fff; + font-family: monospace; +} + +h1, h2, h3, h4, h5, h6 { + font-size: 1em; + margin: 0; +} + +img, h1, h2 { + vertical-align: middle; +} + +img { + border: 0; +} + +a:target { + background-color: #ccc; +} + +a.d, +a.h, +a.i, +a.line { + text-decoration: none; +} + +#blob a { + color: #555; +} + +#blob a:hover { + color: blue; + text-decoration: none; +} + +table thead td { + font-weight: bold; +} + +table td { + padding: 0 0.4em; +} + +#content table td { + vertical-align: top; + white-space: nowrap; +} + +#branches tr:hover td, +#tags tr:hover td, +#index tr:hover td, +#log tr:hover td, +#files tr:hover td { + background-color: #eee; +} + +#index tr td:nth-child(2), +#tags tr td:nth-child(3), +#branches tr td:nth-child(3), +#log tr td:nth-child(2) { + white-space: normal; +} + +td.num { + text-align: right; +} + +.desc { + color: #555; +} + +hr { + border: 0; + border-top: 1px solid #555; + height: 1px; +} + +pre { + font-family: monospace; +} + +pre a.h { + color: #00a; +} + +.A, +span.i, +pre a.i { + color: #070; +} + +.D, +span.d, +pre a.d { + color: #e00; +} + +pre a.h:hover, +pre a.i:hover, +pre a.d:hover { + text-decoration: none; +} + +@media (prefers-color-scheme: dark) { + body { + background-color: #000; + color: #bdbdbd; + } + hr { + border-color: #222; + } + a { + color: #56c8ff; + } + a:target { + background-color: #222; + } + .desc { + color: #aaa; + } + #blob a { + color: #555; + } + #blob a:target { + color: #eee; + } + #blob a:hover { + color: #56c8ff; + } + pre a.h { + color: #00cdcd; + } + .A, + span.i, + pre a.i { + color: #00cd00; + } + .D, + span.d, + pre a.d { + color: #cd0000; + } + #branches tr:hover td, + #tags tr:hover td, + #index tr:hover td, + #log tr:hover td, + #files tr:hover td { + background-color: #111; + } +} diff --git a/themes/shipwreckt.css b/themes/shipwreckt.css @@ -0,0 +1,151 @@ + +body { + color: #FBF5E5; + background-color: #212121; + font-family: 'Hack Nerd Font', monospace; + letter-spacing: 1.1px; + font-size: 0.9em; + line-height: 1.3; +} + +h1, h2, h3, h4, h5, h6 { + font-size: 1em; + margin: 0; +} +h1 { + color: #8446d9; +} + +h2, h3, h4, h5, h6 { + color: #8b6268; +} + +img, h1, h2 { + vertical-align: middle; +} + +img { + border: 0; +} + +a { + color: #6a5acd; + text-decoration: none; +} + +a:hover { + color: #8e80e5; + text-decoration: none; +} + +#blob a { + color: #454545; +} + +#blob a:hover { + color: #69c884; + text-decoration: none; +} + +table thead td { + font-weight: lighter; + color: #7151ba; +} + +table td { + padding: 0 0.4em; +} + +table#files > tbody > tr:hover > td > a, +table#files > tbody > tr:hover > td > a:hover, +table#log > tbody > tr:hover > td > a, +table#log > tbody > tr:hover > td > a:hover, +table#index > tbody > tr:hover > td > a, +table#index > tbody > tr:hover > td > a:hover { + color: #181512; +} + +#content table td { + vertical-align: top; + white-space: nowrap; +} + +#branches tr:hover td, +#tags tr:hover td, +#index tr:hover td, +#log tr:hover td, +#files tr:hover td { + background-color: #6a5acd; + color: #181512; +} + +#index tr td:nth-child(2), +#tags tr td:nth-child(3), +#branches tr td:nth-child(3), +#log tr td:nth-child(2) { + white-space: normal; +} + +td.num { + text-align: right; +} + +.desc { + color: #FFFFFF; +} + +hr { + border: 0; + border-top: 1px dotted #454545; + height: 1px; + width: 80%; + margin-inline-start: 0; +} + +pre { + font-family: "envy"; + font-size: 0.9em; + width: 80%; + overflow-x: auto; +} + +@media (max-width: 767px) { + hr, pre {width: 100%;} +} + +pre a, +pre a:hover { + border: 0px; +} + +pre a.h { + color: #fbf0d2; + background-color: #454545; +} + +span.i, +pre a.i { + color: #bcc92e; +} + +span.d, +pre a.d { + color: #ae424b; +} + +pre a.h:hover, +pre a.i:hover, +pre a.d:hover { + text-decoration: none; +} + +pre b { + font-weight: normal; +} + +pre#blob { + background-color: #181512; + /*color: #bcc92e;*/ + color: #dab733; + overflow-x: auto; +}