diff --git a/gen/index.go b/gen/index.go index fb14ad6..fbaeaf5 100644 --- a/gen/index.go +++ b/gen/index.go @@ -87,11 +87,11 @@ func CreateHead(base string, titleText string, color Colors) *html.Node { }) icons := createHTMLElement("link", map[string]string{"rel": "stylesheet", "href": "https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css", "defer": ""}) - highlightcss := createHTMLElement("link", map[string]string{"rel": "stylesheet", "href": "default.min.css", "defer": ""}) - highlightjs := createHTMLElement("script", map[string]string{"src": "highlight.min.js", "defer": ""}) - highlightjsGo := createHTMLElement("script", map[string]string{"src": "go.min.js", "defer": ""}) + highlightcss := createHTMLElement("link", map[string]string{"rel": "stylesheet", "href": "/default.min.css"}) + highlightjs := createHTMLElement("script", map[string]string{"src": "/highlight.min.js"}) + highlightjsGo := createHTMLElement("script", map[string]string{"src": "/go.min.js"}) - favicon := createHTMLElement("link", map[string]string{"rel": "icon", "type": "image/png", "href": "icon.png"}) + favicon := createHTMLElement("link", map[string]string{"rel": "icon", "type": "image/png", "href": "/icon.png"}) b := createHTMLElement("base", map[string]string{"href": base}) @@ -189,11 +189,6 @@ func CreateIndex(summaryData []byte, pageData []byte, marker string, base string main := createHTMLElement("div", id("main"), headerBar, nav, page) body.AppendChild(main) - highlightInit := createHTMLElement("script", nil, &html.Node{ - Type: html.TextNode, - Data: "hljs.highlightAll();", - }) - body.AppendChild(highlightInit) docsJs := createHTMLElement("script", nil, &html.Node{ Type: html.TextNode, diff --git a/gen/script.js b/gen/script.js index 3e0c4dd..3a38176 100644 --- a/gen/script.js +++ b/gen/script.js @@ -3,6 +3,7 @@ window.addEventListener("load", start) function start () { console.log("hello world!") + hljs.highlightAll(); const menuButton = document.getElementById("menu") const nav = document.getElementById("navbar")