From: Ardis Lu Date: Thu, 11 Sep 2025 06:08:44 +0000 (-0700) Subject: Improve web view styling X-Git-Url: https://git.ardis.lu/?a=commitdiff_plain;h=e7a8c3f0fbb3f6345c0a4aeb324c784ca0976f39;p=git.ardis.lu Improve web view styling This set of changes is intended to retain the original "feel" but improve usability. Mainly just making things bigger to better utilize screen space, and horizontal centering. More opinionated stylistic changes to come later. --- diff --git a/etc/gitweb.conf b/etc/gitweb.conf index 1e605ea..66e892f 100644 --- a/etc/gitweb.conf +++ b/etc/gitweb.conf @@ -1,6 +1,11 @@ $projectroot = '/srv/git'; $git_temp = '/tmp'; +# https://git-scm.com/docs/gitweb.conf#_links_and_their_targets +$home_link_str = 'git.ardis.lu'; +push @stylesheets, 'static/custom.css'; +$site_html_head_string = ''; + # https://git-scm.com/docs/gitweb.conf#_changing_gitwebs_look $site_name = 'git.ardis.lu'; $projects_list_description_width = 120; # Increase project description character limit from 25 diff --git a/setup.sh b/setup.sh index c6a277a..379f402 100644 --- a/setup.sh +++ b/setup.sh @@ -34,6 +34,16 @@ git config --system safe.directory '*' # Otherwise HEAD will point to "master" when using init, even if the pushed repo has renamed main branch git config --system init.defaultBranch main +# Better git defaults +# See https://blog.gitbutler.com/how-git-core-devs-configure-git +git config --system column.ui auto +git config --system branch.sort -committerdate +git config --system tag.sort version:refname +git config --system diff.algorithm histogram +git config --system diff.colorMoved plain +git config --system diff.mnemonicPrefix true +git config --system diff.renames true + # Setup gitweb cp -f ./etc/gitweb.conf /etc cp -f ./etc/caddy/Caddyfile /etc/caddy diff --git a/usr/share/gitweb/static/custom.css b/usr/share/gitweb/static/custom.css new file mode 100644 index 0000000..19e1228 --- /dev/null +++ b/usr/share/gitweb/static/custom.css @@ -0,0 +1,50 @@ +body { + font-size: 16px; + min-inline-size: min(100% - 22px, 1440px); + inline-size: fit-content; + margin-inline: auto; +} + +table.project_list, +table.shortlog, +table.tags, +table.heads, +table.tree, +table.history, +table.commit_search, +table.search { + inline-size: 100%; +} + +table.project_list { + & th, + td { + line-height: 2; + padding-block: 8px; + padding-inline: 4px 16px; + } +} + +/* Gitweb replaces all spaces in commit descriptions (log) with   which will not wrap by default. */ +div.log, +div.log_body, +div.page_body { + overflow-wrap: break-word; + /* Otherwise body will stretch to fit longest line. */ + max-inline-size: min(100dvi - 38px, 1440px); +} + +div.log_body { + padding: 8px; +} + +td.link, +td.selflink { + font-size: 80%; +} + +td.pre, +div.pre, +div.diff { + font-size: 14px; +} \ No newline at end of file