git-site-gen

spesk1 8640ef4190 Added coloring for diffs. A few issues but basics are there 5 years ago
lib 8640ef4190 Added coloring for diffs. A few issues but basics are there 5 years ago
tools 331a45688a Base, nothing functional 5 years ago
.gitignore 9f65c01dc7 Tidying up a bit 5 years ago
LICENSE.md ca59c476c6 Added the majority of basic features. Useful on a basic level now 5 years ago
README.md 8640ef4190 Added coloring for diffs. A few issues but basics are there 5 years ago
config.default ca59c476c6 Added the majority of basic features. Useful on a basic level now 5 years ago
gsg 64665331e9 Updated log level to ERROR 5 years ago
install.sh 82221df19f Basics of data gathering done. Need to redo all HTML writing still 5 years ago

README.md

git-site-gen

  • Tool used to generate a bare bones, pure HTML static website from information availble in a git project dir. See: https://spwbk.site/git.
  • Inspired by the much better/full-featured cgit.
  • Not sure if this will be widely useful, mostly written for learning purposes.

Design Goals

  • General purpose/easy to use
  • Easy to hack/customize
  • Small library dependency footprint

Features

DONE:

  • Generate top level index with links to all projects
  • Generate project specific index with links to git log/diffs and file content of repo
  • Extremely basic markdown parser (only supports headings and non nested bullets
  • Line numbers for file browsing
  • Diff highlighting for log

TODO:

  • Show git:// address for cloning (configurable via config file)
  • Code needs to be more robust / handle failure cases
  • Need to recurse git home, right now will only pull dirs in root of git home
  • Fix issue with diff highlight where if the diff contains HTML it gets rendered in the browser (isolate/sanitize it somehow)
  • README.md markdown renderer/parser / display in project index
  • (Stretch Goal) HTML based syntax highlighting for files
  • Support detection of misconfig of config file

Framework Plans

  • gsg -- Perl script to generate the site, uses modules below
  • Gsg::Gather.pm -- module to assemble data structures from git trees that need to be obtained as part of generating the site
  • Gsg::Html.pm -- probably a bad name, used for writing HTML files and/or editing text in other data structures with html content
  • Gsg::MdParse.pm -- module for parsing markdown. Likely a fools errand to be writing this myself but I'd like to try
  • Gsg::ConfigParse.pm -- module to parse gsg config, might be overkill to have it's own module
  • gsg.config -- Config file that gsg reads to inform behavior (git repos dir, what to include/exclude, etc)

Deps/Compatibility

How to use

  1. Clone this repo and run the install script ( must have also cloned/installed aforementioned Shellex dep )
  2. Edit the config file with your desired params or create one and pass it in with gsg --config-file $path_to_config , delete any that you are not using
  3. Run ./gsg

Contributions/Issues/Bugs

Reach out to me at via email at pm dot me, spesk@. If it turns out that people actually want to use this I'll move it to another git host that provides more features for a collaborative workflow.

License

GPLv3 - see LICENSE.md