vole
Clone
Read only, no credentials:
https://rodent.software/git/vole.git
Write over SSH with a registered key:
git clone ssh://git@0.0.0.0:2222/vole.git
A free and open-source forge that lives in your Git repo.
Replace the starter profile README header with a pointer to the instance repo
a407c4affead34b9b2cee929daefca74615b4fe6 · Keenan Nemetz · 1d ago · parent c980fe53
Replace the starter profile README header with a pointer to the instance repo The landing page already renders instance_name as the heading, so the generated profile/README.md repeated it and said nothing about how to change the text. It now names the file to edit and links to the instance repository's own overview, built from the configured instance_repo name. Template and Ensure take the repository name instead of the instance name, which the template no longer uses. Issue: 01M6YFHACAW6KGBTA2KZ3GC36Q
forge/instancerepo/seed.go +15−8
| @@ -7,6 +7,7 @@ package instancerepo | |||
| 7 | 7 | ||
| 8 | 8 | import ( | |
| 9 | 9 | "errors" | |
| 10 | "net/url" | ||
| 10 | 11 | "os" | |
| 11 | 12 | "strings" | |
| 12 | 13 | ||
| @@ -25,7 +26,7 @@ const DefaultDescription = "Instance customization: profile README, custom CSS, | |||
| 25 | 26 | // | |
| 26 | 27 | // It reports whether it wrote anything, so a caller can audit a creation | |
| 27 | 28 | // without inventing its own answer to "was this new?". | |
| 28 | func Ensure(repos *repo.Store, name, owner, author, instanceName string) (*repo.Meta, bool, error) { | ||
| 29 | func Ensure(repos *repo.Store, name, owner, author string) (*repo.Meta, bool, error) { | ||
| 29 | 30 | name = strings.TrimSpace(name) | |
| 30 | 31 | if name == "" || repos == nil { | |
| 31 | 32 | return nil, false, nil | |
| @@ -50,7 +51,7 @@ func Ensure(repos *repo.Store, name, owner, author, instanceName string) (*repo. | |||
| 50 | 51 | if tip != "" { | |
| 51 | 52 | return m, created, nil | |
| 52 | 53 | } | |
| 53 | tree, err := git.WriteFlatTree(g, Template(instanceName)) | ||
| 54 | tree, err := git.WriteFlatTree(g, Template(name)) | ||
| 54 | 55 | if err != nil { | |
| 55 | 56 | return nil, created, err | |
| 56 | 57 | } | |
| @@ -66,11 +67,17 @@ func Ensure(repos *repo.Store, name, owner, author, instanceName string) (*repo. | |||
| 66 | 67 | ||
| 67 | 68 | // Template is the starter tree. The root README explains the fixed paths; the | |
| 68 | 69 | // profile files give an admin something to edit rather than a blank page, and | |
| 69 | // the CSS names the variables worth overriding. | ||
| 70 | func Template(instanceName string) map[string][]byte { | ||
| 71 | name := strings.TrimSpace(instanceName) | ||
| 72 | if name == "" { | ||
| 73 | name = "Vole" | ||
| 70 | // the CSS names the variables worth overriding. repoName is the repository the | ||
| 71 | // starter tree is written to, so the introduction can link back to its overview. | ||
| 72 | func Template(repoName string) map[string][]byte { | ||
| 73 | repoName = strings.TrimSpace(repoName) | ||
| 74 | // The page supplies the heading (instance_name), so the starter file carries | ||
| 75 | // no header of its own: it explains how to replace itself and links to the | ||
| 76 | // repository where the other files live. | ||
| 77 | intro := "This is the landing page introduction. Tell people what this forge is for." | ||
| 78 | if repoName != "" { | ||
| 79 | intro = "This is the landing page introduction. To customize it, edit `profile/README.md` in the [" + | ||
| 80 | repoName + "](/r/" + url.PathEscape(repoName) + ") repository; its README lists every file Vole reads." | ||
| 74 | 81 | } | |
| 75 | 82 | return map[string][]byte{ | |
| 76 | 83 | "README.md": []byte(`# Instance customization | |
| @@ -146,7 +153,7 @@ file small: every theme is linked on every page. | |||
| 146 | 153 | The picker stores the choice in the browser, not on the account. A theme whose | |
| 147 | 154 | file is deleted falls back to System the next time the page loads. | |
| 148 | 155 | `), | |
| 149 | "profile/README.md": []byte("# " + name + "\n\nTell people what this forge is for. This file is the landing page introduction.\n"), | ||
| 156 | "profile/README.md": []byte(intro + "\n"), | ||
| 150 | 157 | "profile/custom.css": []byte(`/* Custom styles. This file is loaded last: after vole.css, everforest.css, and | |
| 151 | 158 | * any profile/themes/<id>.css, so it can override every theme. | |
| 152 | 159 | * | |