💾 Archived View for gemini.rmf-dev.com › repo › Vaati › Gemigit › files › d803731b6c6c451a6121f898d0… captured on 2023-12-28 at 15:34:18. Gemini links have been rewritten to link to archived content
⬅️ Previous capture (2023-09-08)
-=-=-=-=-=-=-
0 package gmi
1
2 import (
3 "gemigit/repo"
4 "github.com/pitr/gig"
5 )
6
7 func PublicFile(c gig.Context) error {
8 data, mtype, err := serveFile(c.Param("repo"), c.Param("user"),
9 c.Param("*"))
10 if err != nil {
11 return c.NoContent(gig.StatusBadRequest, err.Error())
12 }
13 return c.Blob(mtype, data)
14 }
15
16 func PublicFileContent(c gig.Context) error {
17 content, err := repo.GetPublicFile(c.Param("repo"), c.Param("user"),
18 c.Param("blob"))
19 if err != nil {
20 return c.NoContent(gig.StatusBadRequest, err.Error())
21 }
22 header := "=>/repo/" + c.Param("user") + "/" + c.Param("repo") +
23 "/files Go Back\n\n"
24 return c.Gemini(header + showFileContent(content))
25 }
26
27 func PublicRefs(c gig.Context) error {
28 return showRepo(c, pageRefs, false)
29 }
30
31 func PublicLicense(c gig.Context) error {
32 return showRepo(c, pageLicense, false)
33 }
34
35 func PublicReadme(c gig.Context) error {
36 return showRepo(c, pageReadme, false)
37 }
38
39 func PublicLog(c gig.Context) error {
40 return showRepo(c, pageLog, false)
41 }
42
43 func PublicFiles(c gig.Context) error {
44 return showRepo(c, pageFiles, false)
45 }
46