Skip to content

Commit

Permalink
Make assets directory structure better
Browse files Browse the repository at this point in the history
  • Loading branch information
radiden committed Mar 25, 2021
1 parent 93db267 commit 66e6d18
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 6 deletions.
4 changes: 2 additions & 2 deletions assets/static/page.html → assets/page.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
{{ end }}
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.2/css/all.min.css"/>
<link href="https://fonts.googleapis.com/css2?family=Fira+Mono&family=Fira+Sans&display=swap" rel="stylesheet">
<link href="{{ .Prefix }}/serve/style.css" rel="stylesheet">
<link href="{{ .Prefix }}/serve/vars.css" rel="stylesheet">
<link href="{{ .Prefix }}/static/style.css" rel="stylesheet">
<link href="{{ .Prefix }}/static/vars.css" rel="stylesheet">
</head>

<body>
Expand Down
File renamed without changes.
File renamed without changes.
2 changes: 2 additions & 0 deletions docs/usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
Title: usage
---

# usage

### yaml header

in the document we use the yaml header for certain things. these things are:
Expand Down
2 changes: 1 addition & 1 deletion example.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,4 @@ linenumbersintable = true
tabwidth = 4
# determines whether the syntax highlighter uses class names or hardcoded css
# if you enable this it renders highlightstyle useless
useclasses = false
useclasses = false
2 changes: 1 addition & 1 deletion handler/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,6 @@ func Handler(rw http.ResponseWriter, req *http.Request) {

page.Raw = path

tmpl := template.Must(template.ParseFiles(structure.Conf.General.WorkDir + "assets/static/page.html"))
tmpl := template.Must(template.ParseFiles(structure.Conf.General.WorkDir + "assets/page.html"))
tmpl.Execute(rw, page)
}
4 changes: 2 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ func main() {

log.Debug(structure.Conf.General.WorkDir)

fs := http.FileServer(http.Dir(structure.Conf.General.WorkDir + "assets/serve"))
http.Handle(structure.Conf.General.Prefix+"/serve/", http.StripPrefix(structure.Conf.General.Prefix+"/serve/", fs))
fs := http.FileServer(http.Dir(structure.Conf.General.WorkDir + "assets/static"))
http.Handle(structure.Conf.General.Prefix+"/static/", http.StripPrefix(structure.Conf.General.Prefix+"/static/", fs))

fs2 := http.FileServer(http.Dir(structure.Conf.General.WorkDir + "assets/public"))
http.Handle(structure.Conf.General.Prefix+"/public/", http.StripPrefix(structure.Conf.General.Prefix+"/public/", fs2))
Expand Down

0 comments on commit 66e6d18

Please sign in to comment.