Monorepo for Tangled tangled.org

improve markdown styles; cache all static

Changed files
+39 -31
appview
db
pages
templates
repo
state
+1 -1
appview/db/registration.go
··· 130 _, err = e.Exec(` 131 insert into registrations (domain, did, secret) 132 values (?, ?, ?) 133 - on conflict(domain) do update set did = excluded.did, secret = excluded.secret 134 `, domain, did, secret) 135 136 if err != nil {
··· 130 _, err = e.Exec(` 131 insert into registrations (domain, did, secret) 132 values (?, ?, ?) 133 + on conflict(domain) do update set did = excluded.did, secret = excluded.secret, created = excluded.created 134 `, domain, did, secret) 135 136 if err != nil {
+1 -3
appview/pages/pages.go
··· 421 422 func Cache(h http.Handler) http.Handler { 423 return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { 424 - if strings.HasPrefix(r.URL.Path, "/static/fonts") { 425 - w.Header().Set("Cache-Control", "public, max-age=31536000, immutable") 426 - } 427 h.ServeHTTP(w, r) 428 }) 429 }
··· 421 422 func Cache(h http.Handler) http.Handler { 423 return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { 424 + w.Header().Set("Cache-Control", "public, max-age=31536000, immutable") 425 h.ServeHTTP(w, r) 426 }) 427 }
+1 -1
appview/pages/templates/repo/index.html
··· 192 193 {{ define "repoAfter" }} 194 {{- if .Readme }} 195 - <section class="mt-4 p-6 rounded bg-white w-full mx-auto overflow-auto"> 196 <article class="readme"> 197 {{- .Readme -}} 198 </article>
··· 192 193 {{ define "repoAfter" }} 194 {{- if .Readme }} 195 + <section class="mt-4 p-6 rounded bg-white w-full mx-auto overflow-auto prose"> 196 <article class="readme"> 197 {{- .Readme -}} 198 </article>
+2 -2
appview/pages/templates/repo/issues/issue.html
··· 41 </div> 42 43 {{ if .Issue.Body }} 44 - <article id="body" class="mt-8"> 45 {{ .Issue.Body | markdown }} 46 </article> 47 {{ end }} ··· 82 {{ .Created | timeFmt }} 83 </a> 84 </div> 85 - <div class=""> 86 {{ .Body | markdown }} 87 </div> 88 </div>
··· 41 </div> 42 43 {{ if .Issue.Body }} 44 + <article id="body" class="mt-8 prose"> 45 {{ .Issue.Body | markdown }} 46 </article> 47 {{ end }} ··· 82 {{ .Created | timeFmt }} 83 </a> 84 </div> 85 + <div class="prose"> 86 {{ .Body | markdown }} 87 </div> 88 </div>
+3 -3
appview/state/state.go
··· 508 func (s *State) RemoveMember(w http.ResponseWriter, r *http.Request) { 509 } 510 511 - func (s *State) AddRepo(w http.ResponseWriter, r *http.Request) { 512 switch r.Method { 513 case http.MethodGet: 514 user := s.auth.GetUser(r) ··· 885 r.Route("/repo", func(r chi.Router) { 886 r.Route("/new", func(r chi.Router) { 887 r.Use(AuthMiddleware(s)) 888 - r.Get("/", s.AddRepo) 889 - r.Post("/", s.AddRepo) 890 }) 891 // r.Post("/import", s.ImportRepo) 892 })
··· 508 func (s *State) RemoveMember(w http.ResponseWriter, r *http.Request) { 509 } 510 511 + func (s *State) NewRepo(w http.ResponseWriter, r *http.Request) { 512 switch r.Method { 513 case http.MethodGet: 514 user := s.auth.GetUser(r) ··· 885 r.Route("/repo", func(r chi.Router) { 886 r.Route("/new", func(r chi.Router) { 887 r.Use(AuthMiddleware(s)) 888 + r.Get("/", s.NewRepo) 889 + r.Post("/", s.NewRepo) 890 }) 891 // r.Post("/import", s.ImportRepo) 892 })
+1 -1
flake.nix
··· 363 services.tangled-knotserver = { 364 enable = true; 365 server = { 366 - secret = "21c9c8b2a405bcfb14694481e32bab09d842c2f4cc0437906b68015d32f15b97"; 367 hostname = "localhost:6000"; 368 listenAddr = "0.0.0.0:6000"; 369 };
··· 363 services.tangled-knotserver = { 364 enable = true; 365 server = { 366 + secret = "61120605bf85e8b036c922221ae0d740efb1e93a1ebe5cd71e4aca552d7d8a86"; 367 hostname = "localhost:6000"; 368 listenAddr = "0.0.0.0:6000"; 369 };
+30 -20
tailwind.config.js
··· 1 /** @type {import('tailwindcss').Config} */ 2 module.exports = { 3 - content: ["./appview/pages/templates/**/*.html"], 4 - theme: { 5 - container: { 6 - padding: "2rem", 7 - center: true, 8 - screens: { 9 - sm: "540px", 10 - md: "650px", 11 - lg: "900px", 12 - xl: "1100px", 13 - "2xl": "1300px" 14 - }, 15 - }, 16 - extend: { 17 - fontFamily: { 18 - sans: ["iA Writer Quattro S", "Inter", "system-ui", "sans-serif", "ui-sans-serif"], 19 - mono: ["iA Writer Mono S", "ui-monospace", "SFMono-Regular", "Menlo", "Monaco", "Consolas", "Liberation Mono", "Courier New", "monospace"], 20 - }, 21 - }, 22 - }, 23 };
··· 1 /** @type {import('tailwindcss').Config} */ 2 module.exports = { 3 + content: ["./appview/pages/templates/**/*.html"], 4 + theme: { 5 + container: { 6 + padding: "2rem", 7 + center: true, 8 + screens: { 9 + sm: "540px", 10 + md: "650px", 11 + lg: "900px", 12 + xl: "1100px", 13 + "2xl": "1300px" 14 + }, 15 + }, 16 + extend: { 17 + fontFamily: { 18 + sans: ["iA Writer Quattro S", "Inter", "system-ui", "sans-serif", "ui-sans-serif"], 19 + mono: ["iA Writer Mono S", "ui-monospace", "SFMono-Regular", "Menlo", "Monaco", "Consolas", "Liberation Mono", "Courier New", "monospace"], 20 + }, 21 + typography: { 22 + DEFAULT: { 23 + css: { 24 + maxWidth: 'none', 25 + } 26 + }, 27 + }, 28 + }, 29 + }, 30 + plugins: [ 31 + require('@tailwindcss/typography'), 32 + ] 33 };