🐙 Templated web page generator for your git repositories
git clone https://github.com/m-col/gitja
Files | Refs | Readme | License

Commit 8bfa24dc75f64b8e01ed719ac0db7d9ee2e40952
Parent: ebe8be8e6ccb83a5d9beff950217d802e304d682
Author: mcol <mcol@posteo.net>
Date: 2021-10-05 23:49:51 +0100
Committer: mcol <mcol@posteo.net>
Committed: 2021-10-05 23:49:51 +0100

Fix hyperlinks from directory to contents pages

templates/file.html Modified

@@ -17,7 +17,7 @@
     <hr>
       <ul>
 {% for item in file.contents %}
-        <li><a href="{{- host }}/{{ item }}">{{ item }}</a></li>
+        <li><a href="{{ host }}/{{ name }}/file/{{ file }}.{{ item }}.html">{{ item }}</a></li>
 {% endfor %}
       </ul>
 

src/Types.hs Modified

@@ -7,6 +7,7 @@
 
 module Types where
 
+import Data.ByteString.UTF8 (toString)
 import Data.Default (def)
 import Data.Tagged (untag)
 import Data.Text (pack, Text, strip)
@@ -94,7 +95,7 @@
 instance ToGVal m TreeFile where
     toGVal :: TreeFile -> GVal m
     toGVal treefile = def
-        { asHtml = html . pack . show . treeFilePath $ treefile
+        { asHtml = html . pack . toString . treeFilePath $ treefile
         , asText = pack . show . treeFilePath $ treefile
         , asLookup = Just . treeAsLookup $ treefile
         }

gitserve.cabal Modified

@@ -31,3 +31,4 @@
                      , text
                      , transformers
                      , unordered-containers
+                     , utf8-string