forked from tangled.org/core
this repo has no description

improve markdown styles; cache all static

Changed files
+39 -31
appview
db
pages
templates
repo
state
+1 -1
appview/db/registration.go
···
_, err = e.Exec(`
insert into registrations (domain, did, secret)
values (?, ?, ?)
-
on conflict(domain) do update set did = excluded.did, secret = excluded.secret
`, domain, did, secret)
if err != nil {
···
_, err = e.Exec(`
insert into registrations (domain, did, secret)
values (?, ?, ?)
+
on conflict(domain) do update set did = excluded.did, secret = excluded.secret, created = excluded.created
`, domain, did, secret)
if err != nil {
+1 -3
appview/pages/pages.go
···
func Cache(h http.Handler) http.Handler {
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
-
if strings.HasPrefix(r.URL.Path, "/static/fonts") {
-
w.Header().Set("Cache-Control", "public, max-age=31536000, immutable")
-
}
h.ServeHTTP(w, r)
})
}
···
func Cache(h http.Handler) http.Handler {
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
+
w.Header().Set("Cache-Control", "public, max-age=31536000, immutable")
h.ServeHTTP(w, r)
})
}
+1 -1
appview/pages/templates/repo/index.html
···
{{ define "repoAfter" }}
{{- if .Readme }}
-
<section class="mt-4 p-6 rounded bg-white w-full mx-auto overflow-auto">
<article class="readme">
{{- .Readme -}}
</article>
···
{{ define "repoAfter" }}
{{- if .Readme }}
+
<section class="mt-4 p-6 rounded bg-white w-full mx-auto overflow-auto prose">
<article class="readme">
{{- .Readme -}}
</article>
+2 -2
appview/pages/templates/repo/issues/issue.html
···
</div>
{{ if .Issue.Body }}
-
<article id="body" class="mt-8">
{{ .Issue.Body | markdown }}
</article>
{{ end }}
···
{{ .Created | timeFmt }}
</a>
</div>
-
<div class="">
{{ .Body | markdown }}
</div>
</div>
···
</div>
{{ if .Issue.Body }}
+
<article id="body" class="mt-8 prose">
{{ .Issue.Body | markdown }}
</article>
{{ end }}
···
{{ .Created | timeFmt }}
</a>
</div>
+
<div class="prose">
{{ .Body | markdown }}
</div>
</div>
+3 -3
appview/state/state.go
···
func (s *State) RemoveMember(w http.ResponseWriter, r *http.Request) {
}
-
func (s *State) AddRepo(w http.ResponseWriter, r *http.Request) {
switch r.Method {
case http.MethodGet:
user := s.auth.GetUser(r)
···
r.Route("/repo", func(r chi.Router) {
r.Route("/new", func(r chi.Router) {
r.Use(AuthMiddleware(s))
-
r.Get("/", s.AddRepo)
-
r.Post("/", s.AddRepo)
})
// r.Post("/import", s.ImportRepo)
})
···
func (s *State) RemoveMember(w http.ResponseWriter, r *http.Request) {
}
+
func (s *State) NewRepo(w http.ResponseWriter, r *http.Request) {
switch r.Method {
case http.MethodGet:
user := s.auth.GetUser(r)
···
r.Route("/repo", func(r chi.Router) {
r.Route("/new", func(r chi.Router) {
r.Use(AuthMiddleware(s))
+
r.Get("/", s.NewRepo)
+
r.Post("/", s.NewRepo)
})
// r.Post("/import", s.ImportRepo)
})
+1 -1
flake.nix
···
services.tangled-knotserver = {
enable = true;
server = {
-
secret = "21c9c8b2a405bcfb14694481e32bab09d842c2f4cc0437906b68015d32f15b97";
hostname = "localhost:6000";
listenAddr = "0.0.0.0:6000";
};
···
services.tangled-knotserver = {
enable = true;
server = {
+
secret = "61120605bf85e8b036c922221ae0d740efb1e93a1ebe5cd71e4aca552d7d8a86";
hostname = "localhost:6000";
listenAddr = "0.0.0.0:6000";
};
+30 -20
tailwind.config.js
···
/** @type {import('tailwindcss').Config} */
module.exports = {
-
content: ["./appview/pages/templates/**/*.html"],
-
theme: {
-
container: {
-
padding: "2rem",
-
center: true,
-
screens: {
-
sm: "540px",
-
md: "650px",
-
lg: "900px",
-
xl: "1100px",
-
"2xl": "1300px"
-
},
-
},
-
extend: {
-
fontFamily: {
-
sans: ["iA Writer Quattro S", "Inter", "system-ui", "sans-serif", "ui-sans-serif"],
-
mono: ["iA Writer Mono S", "ui-monospace", "SFMono-Regular", "Menlo", "Monaco", "Consolas", "Liberation Mono", "Courier New", "monospace"],
-
},
-
},
-
},
};
···
/** @type {import('tailwindcss').Config} */
module.exports = {
+
content: ["./appview/pages/templates/**/*.html"],
+
theme: {
+
container: {
+
padding: "2rem",
+
center: true,
+
screens: {
+
sm: "540px",
+
md: "650px",
+
lg: "900px",
+
xl: "1100px",
+
"2xl": "1300px"
+
},
+
},
+
extend: {
+
fontFamily: {
+
sans: ["iA Writer Quattro S", "Inter", "system-ui", "sans-serif", "ui-sans-serif"],
+
mono: ["iA Writer Mono S", "ui-monospace", "SFMono-Regular", "Menlo", "Monaco", "Consolas", "Liberation Mono", "Courier New", "monospace"],
+
},
+
typography: {
+
DEFAULT: {
+
css: {
+
maxWidth: 'none',
+
}
+
},
+
},
+
},
+
},
+
plugins: [
+
require('@tailwindcss/typography'),
+
]
};