djcev.com

//

Git Repos / blogofile_gitview

Last commit to this repo was on 2022-01-23 at 14:14.
You can jump to the README, the file list, the commit log, the branches, or tags.

Description

static git page generator (for blogofile) .

You can clone this repo with:

git clone https://djcev.com/git/blogofile_gitview.git

Readme

### blogofile_gitview

This is a git repository viewer that generates static HTML pages
(like [stagit][st] or [git-arr][ga]) implemented as a controller for
blogofile_blog.

This is really only a program fragment; it may be most useful as an
example.

This script and all files in this repository are provided under the
MIT License, please see the file LICENSE for more information.

### Requirements

In short: you need blogofile, blogofile_blog, pygit2, and pygments.

To run this you'll need a working installation of blogofile and
blogofile_blog, at least version 0.8.3, with all its dependencies,
configured to work with Python 3. You'll also need pygit2, at least
version 1.5.0.

### Installation

First copy "\_controllers/gitview.py" to your
"blogofile_blog/site_src/\_controllers" directory, then copy the
"\_templates/gitview" directory into "blogofile_blog/site_src/\_templates".
Then add the lines in sample_config.py to your \_config.py changing
the values as necessary.

### Usage and Configuration

Create a directory in your blogofile_blog site_src with the same name
as the value of gitview.reporoot (default "repos") and copy any
git repositories you want to display into it. Re-build your site
to run the gitview controller and check your site output dir (default
"\_site") for a directory named after gitview.path (default "code") for
the script's output.

This script has only been tested with bare repos (and pretty simple ones
at that - no submodules or anything fancy).

You'll want to edit the templates, I think. A bit of sample CSS to go
with the template is available in css/style.css . The default repo list
function reads the files "description" and "owner" in the git repo (the
same way stagit does). If those files aren't found then "Empty description"
and "Undefined" will appear as the description and owner.

### Future Improvements

Further commit statistics could be added. Submodule handling and other
features found in more complex repos could also be implemented.

This script could be expanded into a full blogofile plugin. I doubt I'll
ever have need to do that myself, but it's an option.

There are a number of output-caching strategies that could be implemented
for this script, to avoid building static files for a repo that hasn't
changed. I'll look into it when it eventually becomes a problem for me.

Lastly I am not at all convinced I did any of this right, as I know very
little about the workings of git. So that's something to double-check.

### Contact

If you find this useful, or want to report bugs, or send patches, or
have any questions or comments, I can be reached at <cvanderz@gmail.com>.

[st]: https://git.codemadness.org/stagit/
[ga]: https://blitiri.com.ar/git/r/git-arr/

File List

Mode Name Size
-rw-r--r-- .gitignore 34.0 B
-rw-r--r-- LICENSE 1.1 K
-rw-r--r-- README.md 2.7 K
-rwxr-xr-x _config.py 437.0 B
-rw-r--r-- _controllers/gitview.py 15.0 K
-rw-r--r-- _templates/gitview/git_branch_list.mako 697.0 B
-rw-r--r-- _templates/gitview/git_commit.mako 2.3 K
-rw-r--r-- _templates/gitview/git_commit_list.mako 844.0 B
-rw-r--r-- _templates/gitview/git_file.mako 658.0 B
-rw-r--r-- _templates/gitview/git_file_list.mako 674.0 B
-rw-r--r-- _templates/gitview/git_files.mako 910.0 B
-rw-r--r-- _templates/gitview/git_header.mako 657.0 B
-rw-r--r-- _templates/gitview/git_log.mako 917.0 B
-rw-r--r-- _templates/gitview/git_repo.mako 1.5 K
-rw-r--r-- _templates/gitview/git_repos.mako 829.0 B
-rw-r--r-- _templates/gitview/git_tag_list.mako 621.0 B
-rw-r--r-- css/style.css 1.3 K

Return to the top of this page

Commit Log

Return to the top of this page

Branches

Branch Last Commit Commit Message Author
main 2022-01-23 More file extension handling, small template fix cev

Return to the top of this page

Tags

Tag Date Commit Message Author
0.2 2021-08-01 Add missing stats to templates, change tag check cev
0.1 2021-07-25 Initial commit cev

Return to the top of this page