Skip to content

Commit

Permalink
chore: query param for cache busting css
Browse files Browse the repository at this point in the history
  • Loading branch information
neurosnap committed Nov 18, 2024
1 parent 1ca4804 commit 2ee5dd6
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 7 deletions.
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ module github.com/picosh/docs

go 1.21.5

// replace github.com/picosh/pdocs => /home/erock/dev/pico/pdocs
replace github.com/picosh/pdocs => /home/erock/dev/pico/pdocs

require github.com/picosh/pdocs v0.0.0-20241118043636-3059918103f6
require github.com/picosh/pdocs v0.0.0-20241118044720-1a43b70d33b7

require (
github.com/alecthomas/chroma v0.10.0 // indirect
Expand Down
2 changes: 0 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSs
github.com/dlclark/regexp2 v1.4.0/go.mod h1:2pZnwuY/m+8K6iRw6wQdMtk+rH5tNGR1i55kozfMjCc=
github.com/dlclark/regexp2 v1.10.0 h1:+/GIL799phkJqYW+3YbOd8LCcbHzT0Pbo8zl70MHsq0=
github.com/dlclark/regexp2 v1.10.0/go.mod h1:DHkYz0B9wPfa6wondMfaivmHpzrQ3v9q8cnmRbL6yW8=
github.com/picosh/pdocs v0.0.0-20241118043636-3059918103f6 h1:yU+cusov9cu4tcxL1E12GpBibMyxnwIWMRKRFbEffwY=
github.com/picosh/pdocs v0.0.0-20241118043636-3059918103f6/go.mod h1:KXO3Z0EVdA811AX6mlK4lwFDT+KgmegRVrEmZU5uLXU=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
Expand Down
3 changes: 3 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ package main

import (
"log/slog"
"math/rand"
"strconv"

"github.com/picosh/pdocs"

Check failure on line 8 in main.go

View workflow job for this annotation

GitHub Actions / release

github.com/picosh/[email protected]: replacement directory /home/erock/dev/pico/pdocs does not exist
)
Expand Down Expand Up @@ -221,6 +223,7 @@ func main() {
Out: "./public",
Tmpl: "./tmpl",
PageTmpl: "post.page.tmpl",
CacheId: strconv.Itoa(rand.Intn(10000)),
}

err := config.GenSite()
Expand Down
6 changes: 3 additions & 3 deletions tmpl/base.layout.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
<link href="/logo.svg" rel="icon" type="image/svg+xml"/>
<link href="/logo.png" rel="icon" sizes="any" type="image/png"/>

<link rel="stylesheet" href="/syntax.css" />
<link rel="stylesheet" href="/smol.css" />
<link rel="stylesheet" href="/main.css" />
<link rel="stylesheet" href="/syntax.css?v={{.CacheId}}" />
<link rel="stylesheet" href="/smol.css?v={{.CacheId}}" />
<link rel="stylesheet" href="/main.css?v={{.CacheId}}" />
{{template "meta" .}}
</head>

Expand Down

0 comments on commit 2ee5dd6

Please sign in to comment.