diff options
author | Max le Fou <buttbadger@gmail.com> | 2020-03-11 14:41:47 +0300 |
---|---|---|
committer | Max le Fou <buttbadger@gmail.com> | 2020-03-11 14:41:47 +0300 |
commit | b9199a3dd12f2f56ba9f954fd1b84a368d8a9cbd (patch) | |
tree | 354c758ce317b7347cb5947c031ca9d94b435f7d /layouts | |
parent | 7728633b4e99ee945febd9c37dd83e0a5e9f2010 (diff) |
examplesite is conform to hugo standards
Diffstat (limited to 'layouts')
-rw-r--r-- | layouts/_default/list.html | 7 | ||||
-rw-r--r-- | layouts/index.html | 2 | ||||
-rw-r--r-- | layouts/partials/head.html | 4 | ||||
-rw-r--r-- | layouts/partials/header.html | 37 |
4 files changed, 29 insertions, 21 deletions
diff --git a/layouts/_default/list.html b/layouts/_default/list.html index 43fef57..d011a1b 100644 --- a/layouts/_default/list.html +++ b/layouts/_default/list.html @@ -10,12 +10,7 @@ <!-- Ranges through content/posts/*.md --> {{ range .Pages }} <li> - <a href="{{.Permalink}}"> - {{ if eq .Site.GetPage "/posts" }} - {{.Date.Format "2006-01-02"}} | - {{ end }} - {{.Title}} - </a> + <a href="{{.Permalink}}">{{.Date.Format "2006-01-02"}} | {{.Title}}</a> </li> {{ end }} </ul> diff --git a/layouts/index.html b/layouts/index.html index 01c40ff..80216a5 100644 --- a/layouts/index.html +++ b/layouts/index.html @@ -17,7 +17,7 @@ <h1>{{ i18n "postslist" }}</h1> <ul> {{ range first 10 .Site.RegularPages }} - {{ if eq .Type "posts" }} + {{ if eq .Type "post" }} <li><a href="{{ .Permalink }}">{{ .Date.Format "2006-01-02" }} | {{ .Title }}</a></li> {{ end }} {{ end }} diff --git a/layouts/partials/head.html b/layouts/partials/head.html index b52ed97..7795acb 100644 --- a/layouts/partials/head.html +++ b/layouts/partials/head.html @@ -1,9 +1,9 @@ <head> - <title>{{ .Site.Title }} | {{ .Title }}</title> + <title>{{ .Site.Title }}</title> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="format-detection" content="telephone=no" /> <meta name="theme-color" content="#000084" /> - <link rel="icon" href="/favicon.ico"> + <link rel="icon" href="{{ .Site.BaseURL }}/favicon.ico"> <link rel="canonical" href="{{ .Site.BaseURL }}"> {{/* Don't ask why it's like this. This original theme is a mess... */}} <link rel="stylesheet" href="{{ "/css/bootstrap.css" | relURL }}"> diff --git a/layouts/partials/header.html b/layouts/partials/header.html index f146e96..7fe2281 100644 --- a/layouts/partials/header.html +++ b/layouts/partials/header.html @@ -7,18 +7,31 @@ <a class="brand" href="{{ .Site.BaseURL }}">{{ .Site.Title }}</a> <div class="nav-collapse collapse"> <ul class="nav"> - <li> - <a href="{{ .Site.BaseURL }}">{{ i18n "home" }}</a> - </li> - <li> - <a href="{{.Site.BaseURL}}posts">{{ i18n "posts" }}</a> - </li> - <li> - <a href="{{.Site.BaseURL}}categories">{{ i18n "categories" }}</a> - </li> - <li> - <a href="{{.Site.BaseURL}}tags">{{ i18n "tags" }}</a> - </li> + {{ $currentPage := . }} + {{ range .Site.Menus.main }} + {{ if .HasChildren }} + <li class="{{ if $currentPage.HasMenuCurrent "main" . }}active{{ end }}"> + <a href="#"> + {{ .Pre }} + <span>{{ .Name }}</span> + </a> + </li> + <ul class="sub-menu"> + {{ range .Children }} + <li class="{{ if $currentPage.IsMenuCurrent "main" . }}active{{ end }}"> + <a href="{{ .URL }}">{{ .Name }}</a> + </li> + {{ end }} + </ul> + {{ else }} + <li> + <a href="{{ .URL }}"> + {{ .Pre }} + <span>{{ .Name }}</span> + </a> + </li> + {{ end }} + {{ end }} </ul> </div> </div> |