all repos — archive/hugo-xmin @ 6365d4b5a9a28222c4b14237f53adb1bee367083

Customised minimal hugo theme

Improve semanticity

Alan Pearce
commit

6365d4b5a9a28222c4b14237f53adb1bee367083

parent

ccbf84f5d6a14968fe1a218f344b729365f39512

3 files changed, 25 insertions(+), 20 deletions(-)

jump to
M layouts/_default/baseof.htmllayouts/_default/baseof.html
@@ -12,7 +12,7 @@ </head>
<body> <nav> - <ul class="menu"> + <ul> {{ range .Site.Menus.main }} <li><a href="{{ .URL | relURL }}">{{ .Name }}</a></li> {{ end }}
M layouts/_default/single.htmllayouts/_default/single.html
@@ -1,19 +1,24 @@
{{ define "main" }} -<div class="article-meta"> -<h1><span class="title">{{ .Title | markdownify }}</span></h1> -{{ with .Params.author }}<h2 class="author">{{ . }}</h2>{{ end }} -{{ if (gt .Params.date 0) }}<h2 class="date">{{ .Date.Format "2006-01-02" }}</h2>{{ end }} -<p class="terms"> - {{ range $i := (slice "categories" "tags") }} - {{ with ($.Param $i) }} - {{ $i | title }}: {{ range $k := . }}<a href="{{ relURL (print "/" $i "/" $k | urlize) }}">{{$k}}</a> {{ end }} - {{ end }} - {{ end }} -</p> -</div> +<article> + <header> + <h1><span class="title">{{ .Title | markdownify }}</span></h1> + {{ with .Params.author }}<h2 class="author">{{ . }}</h2>{{ end }} + {{ if (gt .Params.date 0) }}<h2 class="date">{{ .Date.Format "2006-01-02" }}</h2>{{ end }} + <p class="terms"> + {{ range $i := (slice "categories" "tags") }} + {{ with ($.Param $i) }} + {{ $i | title }}: {{ range $k := . }}<a href="{{ relURL (print "/" $i "/" $k | urlize) }}">{{$k}}</a> {{ end }} + {{ end }} + {{ end }} + </p> + </header> + + <main> + {{ .Content }} + </main> -<main> -{{ .Content }} -</main> + <footer> + </footer> +</article> {{- end }}
M static/css/style.cssstatic/css/style.css
@@ -7,16 +7,16 @@ padding: 1em;
} /* header and footer areas */ -.menu { padding: 0; } -.menu li { display: inline-block; } -.article-meta, .menu a { +nav > ul { padding: 0; } +nav > ul > li { display: inline-block; } +article > header, nav > ul a { background: #eee; border-radius: 5px; padding: 5px; text-decoration: none; } -.menu, .article-meta, footer { text-align: center; } .terms { font-size: .9em; } +nav > ul, article > header, footer { text-align: center; } .title { font-size: 1.1em; } footer a { text-decoration: none; } hr {