Don't make assets configurable
This commit is contained in:
parent
da11dbd1c8
commit
868d2a7bbd
4 changed files with 16 additions and 18 deletions
|
|
@ -58,17 +58,24 @@ type Config struct {
|
|||
Extension string
|
||||
NotesDir string
|
||||
Templates struct {
|
||||
Dir string
|
||||
Base string
|
||||
Dir string
|
||||
}
|
||||
Static struct {
|
||||
Dir string
|
||||
Root string
|
||||
Assets []Asset
|
||||
Dir string
|
||||
Root string
|
||||
}
|
||||
}
|
||||
|
||||
var Conf Config
|
||||
var (
|
||||
Conf Config
|
||||
assets []Asset = []Asset{
|
||||
{Path: "css/bootstrap.min.css", Url: "https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css"},
|
||||
{Path: "css/tiny-mde.min.css", Url: "https://unpkg.com/tiny-markdown-editor/dist/tiny-mde.min.css"},
|
||||
{Path: "js/tiny-mde.min.js", Url: "https://unpkg.com/tiny-markdown-editor/dist/tiny-mde.min.js"},
|
||||
{Path: "icons/eye.svg", Url: "https://raw.githubusercontent.com/twbs/icons/refs/heads/main/icons/eye.svg"},
|
||||
}
|
||||
BaseTemplate string = "base.tmpl.html"
|
||||
)
|
||||
|
||||
func LoadConfig(path string) {
|
||||
var err error
|
||||
|
|
@ -83,7 +90,7 @@ func LoadConfig(path string) {
|
|||
log.Fatal(err)
|
||||
}
|
||||
|
||||
for _, asset := range Conf.Static.Assets {
|
||||
for _, asset := range assets {
|
||||
asset.FetchIfNotExists(Conf.Static.Dir)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue