distinguish between repo name and repo path

This commit is contained in:
pho4cexa 2022-12-26 10:49:17 -08:00
parent f1c42b4a6a
commit 57fcccc276
2 changed files with 12 additions and 2 deletions

View file

@ -24,7 +24,7 @@
<body>
<h1>git.example.com</h1>
<h2>{{ repository_name }}</h2>
<p>clone url: git://git.example.com/{{ repository_name }}</p>
<p>clone url: git://git.example.com/{{ repository_path }}</p>
<nav>
{% if readme_file %}
<a href="{{ relative_root }}{{ readme_file }}.html">about</a>

View file

@ -291,7 +291,17 @@
;; the repository name, which we detect from the output directory
;; name. TODO: more heuristics if this doesn't work well
(repository_name
. ,(pathname-strip-directory (string-chomp html-repo-path "/")))
. ,(->
html-repo-path
(string-chomp "/")
(string-chomp ".git")
(pathname-strip-directory)))
;; the path from the URL root to the repository
(repository_path
. ,(->
html-repo-path
(string-chomp "/")
(pathname-strip-directory)))
;; the first README file found, if any.
(readme_file
. ,(find (cut member <> source-files-list)