Migrate from templates to Gomponents (#103)
This commit is contained in:
parent
0bf9ab7189
commit
051d032038
104 changed files with 2768 additions and 2824 deletions
18
pkg/ui/ui.go
Normal file
18
pkg/ui/ui.go
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
package ui
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"time"
|
||||
|
||||
"github.com/mikestefanello/pagoda/config"
|
||||
)
|
||||
|
||||
var (
|
||||
// cacheBuster stores the current time as a cache buster for static files.
|
||||
cacheBuster = fmt.Sprint(time.Now().Unix())
|
||||
)
|
||||
|
||||
// File generates a relative URL to a static file including a cache-buster query parameter.
|
||||
func File(filepath string) string {
|
||||
return fmt.Sprintf("/%s/%s?v=%s", config.StaticPrefix, filepath, cacheBuster)
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue