diff --git a/models/html_template.go b/models/html_template.go index 3bb0626..3915058 100644 --- a/models/html_template.go +++ b/models/html_template.go @@ -107,13 +107,14 @@ func readHtmlTemplate(htmlFileName []string, viewDir string) ([]TemplatePointer, var htmlTemplate []TemplatePointer head := viewDir + "/layouts/head.html" + nav := viewDir + "/layouts/nav.html" footer := viewDir + "/layouts/footer.html" reviews := viewDir + "/layouts/reviews.html" for _, name := range htmlFileName { tp, err := template.New(name+".html"). Funcs(template.FuncMap{"SpreadDigit": SpreadDigit}). - ParseFiles(viewDir+"/"+name+".html", head, footer, reviews) + ParseFiles(viewDir+"/"+name+".html", head, nav, footer, reviews) if err != nil { return nil, err } diff --git a/themes/blog/layouts/head.html b/themes/blog/layouts/head.html index 19208a2..64244d9 100644 --- a/themes/blog/layouts/head.html +++ b/themes/blog/layouts/head.html @@ -10,9 +10,12 @@ {{ .Title }} - {{ .Config.SiteName }} + + + + - @@ -40,37 +43,33 @@ if(key)return paramsData.hasOwnProperty(key) ? paramsData[key] : null; return paramsData; } - function searchArticle() { - var searchKey = document.getElementById('search-input').value; - searchKey = searchKey.replace(/^\s+|\s+$/g,"") - if("" === searchKey){return} - - window.location.href = '/?search=' + searchKey - } - +
+ + + + + + + + + + + + + + + + + + + + + + + {{template "nav" .}} +
{{ end }} diff --git a/themes/blog/layouts/nav.html b/themes/blog/layouts/nav.html new file mode 100644 index 0000000..b97a79f --- /dev/null +++ b/themes/blog/layouts/nav.html @@ -0,0 +1,71 @@ +{{define "nav"}} + + + + +{{ end }} \ No newline at end of file diff --git a/themes/blog/public/css/app.css b/themes/blog/public/css/app.css index 87d7fc7..a1a2736 100644 --- a/themes/blog/public/css/app.css +++ b/themes/blog/public/css/app.css @@ -41,7 +41,6 @@ a{ } a:hover{ - color: #673ab7; color: var(--primary,#673ab7); } @@ -61,7 +60,6 @@ blockquote::before{ content: '“'; font-family: fantasy; font-size: 40px; - color: #673ab7; color: var(--primary,#673ab7); } @@ -80,35 +78,6 @@ blockquote::before{ } -.container { - width: auto; - max-width: 1200px; - text-align: center; - margin: 0 auto; - -} - -.head{ - width: 100%; - height: 64px; -} -.head-content{ - display: flex; - height: 100%; - align-items: center; - justify-content: space-between; -} -@media screen and (max-width: 860px){ - .head-content{ - padding-top: 10px; - flex-direction: column; - } -} - -.nav a{ - padding: 0 8px; -} - .sub-title { position: relative; width: 100%; @@ -248,7 +217,6 @@ hr:after{ padding-bottom: 6px; } .pagination li a:hover,.pagination .active a{ - border-bottom: 3px solid #673ab7; border-bottom: 3px solid var(--primary,#673ab7); } @@ -283,8 +251,6 @@ hr:after{ padding: 4px 20px; font-size: 14px; color: #fff; - background: #673ab7; - border: 2px solid #673ab7; background: var(--primary,#673ab7); border: 2px solid var(--primary,#673ab7); text-decoration: none; @@ -305,7 +271,6 @@ hr:after{ font-weight: normal; } .articles li .title:hover{ - color: #673ab7; color: var(--primary,#673ab7); } .article-info{ @@ -374,7 +339,6 @@ hr:after{ border-radius: 16px; align-items: center; justify-content: space-between; - border: 1px solid #673ab7; border: 2px solid var(--primary,#673ab7); width: 320px; } @@ -382,7 +346,7 @@ hr:after{ text-align: center; flex: 1; border: none; - border-radius: 16px;border-radius: 16px; + border-radius: 16px; height: 30px; padding: 0 10px; } @@ -435,7 +399,6 @@ hr:after{ border-radius: 2px; opacity: .8; color: #fff; - background-color: #673ab7; background-color: var(--primary,#673ab7); font-size: 14px; } @@ -445,7 +408,6 @@ hr:after{ } .action-tip{ font-size: 14px; - color: #673ab7; color: var(--primary,#673ab7); } .action-msg{ @@ -464,7 +426,6 @@ hr:after{ opacity: 1; min-width: 288px; border-radius: 4px; - background-color: #673ab7; background-color: var(--primary,#673ab7); box-shadow: 0 3px 5px -1px rgba(0,0,0,0.2), 0 6px 10px 0 rgba(0,0,0,0.14), 0 1px 18px 0 rgba(0,0,0,0.12); } @@ -476,3 +437,13 @@ hr:after{ font-size: 16px; right: 24px; } + +.btn-outline-success { + border: 2px solid var(--primary, #673ab7); + filter: invert(100%); +} + +.btn-outline-success img{ + width:26px; + height: 24px; +}