Layout rework, two-column style

master
Vladimir Hodakov 2018-01-13 03:38:00 +04:00
parent db02c6922b
commit 5b5619fa57
8 changed files with 104 additions and 121 deletions

View File

@ -1,37 +1,34 @@
{{ define "main" }} {{ define "main" }}
{{ $baseurl := .Site.BaseURL }} {{ $baseurl := .Site.BaseURL }}
<div class="columns">
<div class="column">
{{ if eq .Data.Singular "tag" }}
<h2 class="is-size-2">#{{ .Title | lower }}</h2>
{{ else }}
<h2 class="is-size-2">{{ .Title }}</h2>
{{ end }}
<div class="container"> {{ .Content }}
<div class="columns">
<div class="column"> <hr>
{{ if eq .Data.Singular "tag" }} {{ range (.Paginate (.Data.Pages.GroupByDate "2006")).PageGroups }}
<h2 class="is-size-2">#{{ .Title | lower }}</h2> <h3 class="is-size-4">{{ .Key }}</h3>
{{ else }} {{ range .Pages }}
<h2 class="is-size-2">{{ .Title }}</h2> <article>
<span class="is-size-2"><a href="{{ .Permalink }}" title="{{ .Title }}">{{ .Title }}</a>
{{ if .Params.tags }}
<div class="tags is-pulled-right">
{{ range $i, $t := .Params.tags }}
<span class="tag"><a href="/tags/{{$t | urlize }}/">#{{ $t }}</a></span>
{{ end }}
</div>
{{ end }}
</span>
{{ partial "aside" . }}
<hr>
</article>
{{ end }} {{ end }}
{{ end }}
{{ .Content }}
<hr>
{{ range (.Paginate (.Data.Pages.GroupByDate "2006")).PageGroups }}
<h3 class="is-size-4">{{ .Key }}</h3>
{{ range .Pages }}
<article class="tile is-child">
<span class="is-size-2"><a href="{{ .Permalink }}" title="{{ .Title }}">{{ .Title }}</a>
{{ if .Params.tags }}
<div class="tags is-pulled-right">
{{ range $i, $t := .Params.tags }}
<span class="tag"><a href="/tags/{{$t | urlize }}/">#{{ $t }}</a></span>
{{ end }}
</div>
{{ end }}
</span>
{{ partial "aside" . }}
<hr>
</article>
{{ end }}
{{ end }}
</div>
</div> </div>
</div> </div>

View File

@ -1,10 +1,5 @@
{{ define "main" }} {{ define "main" }}
{{ partial "article" . }}
<div class="container"> {{ partial "single_footer" . }}
<br>
{{ partial "article" . }}
{{ partial "single_footer" . }}
</div>
{{ end }} {{ end }}

View File

@ -1,38 +1,25 @@
{{ define "main" }} {{ define "main" }}
<section class="section"> {{ range $index, $page := first 10 (where .Site.RegularPages "Section" "in" .Site.Params.mainSections) }}
<div class="container"> <article>
<div class="tile is-ancestor"> <span class="is-size-2">
<div class="tile is-vertical"> <a href="{{ .Permalink }}" title="{{ .Title }}">{{ .Title }}</a>
<div class="tile"> {{ if .Params.tags }}
<div class="tile is-parent is-vertical"> <div class="tags is-pulled-right">
{{ range $index, $page := first 10 (where .Site.RegularPages "Section" "in" .Site.Params.mainSections) }} {{ range $i, $t := .Params.tags }}
<article class="tile is-child"> <span class="tag">
<span class="is-size-2"> <a href="/tags/{{$t | urlize }}/">#{{ $t }}</a>
<a href="{{ .Permalink }}" title="{{ .Title }}">{{ .Title }}</a> </span>
{{ if .Params.tags }} {{ end }}
<div class="tags is-pulled-right">
{{ range $i, $t := .Params.tags }}
<span class="tag">
<a href="/tags/{{$t | urlize }}/">#{{ $t }}</a>
</span>
{{ end }}
</div>
{{ end }}
</span>
{{ partial "aside" . }}
<br>
<p>{{ .Summary }}</p>
{{ if .Truncated }}
<a href="{{ .RelPermalink }}">{{ .Site.Params.i18n_read_more }}</a>
{{ end }}
<hr>
</article>
{{ end }}
</div>
</div>
</div>
</div> </div>
</div> {{ end }}
</section> </span>
{{ partial "aside" . }}
<br>
<p>{{ .Summary }}</p>
{{ if .Truncated }}
<a href="{{ .RelPermalink }}">{{ .Site.Params.i18n_read_more }}</a>
{{ end }}
<hr>
</article>
{{ end }}
{{ end }} {{ end }}

View File

@ -1,16 +1,16 @@
<article class="content"> <span class="is-size-2"><a href="{{ .Permalink }}" title="{{ .Title }}">{{ .Title }}</a>
<span class="is-size-2"><a href="{{ .Permalink }}" title="{{ .Title }}">{{ .Title }}</a> {{ if .Params.tags }}
{{ if .Params.tags }} <div class="tags is-pulled-right">
<div class="tags is-pulled-right"> {{ range $i, $t := .Params.tags }}
{{ range $i, $t := .Params.tags }} <span class="tag"><a href="/tags/{{$t | urlize }}/">#{{ $t }}</a></span>
<span class="tag"><a href="/tags/{{$t | urlize }}/">#{{ $t }}</a></span>
{{ end }}
</div>
{{ end }} {{ end }}
</span> </div>
{{ partial "aside" . }} {{ end }}
<hr> </span>
{{ partial "aside" . }}
<div class="is-clearfix">
</div>
<div class="content">
{{.Content}} {{.Content}}
</div>
</article>

View File

@ -1,15 +1,16 @@
</main> </div>
<footer class="footer">
<div class="container">
<div class="content has-text-centered">
<h6>{{ .Site.Copyright | markdownify }} | Rendered by
<a href="https://gohugo.io" title="Hugo">Hugo</a> |
<a href="{{.Site.BaseURL}}index.xml">Subscribe</a>
</h6>
</div> </div>
</div> </div>
</footer> </section>
</body> <footer class="footer">
<div class="container">
<div class="content has-text-centered">
<h6>{{ .Site.Copyright | markdownify }} | Rendered by
<a href="https://gohugo.io" title="Hugo">Hugo</a> |
<a href="{{.Site.BaseURL}}index.xml">Subscribe</a>
</h6>
</div>
</div>
</footer>
</body>
</html> </html>

View File

@ -3,23 +3,31 @@
<html lang="{{ .Site.LanguageCode | default " en-us " }}"> <html lang="{{ .Site.LanguageCode | default " en-us " }}">
<head> <head>
<title>{{ .Site.Title }}</title> <title>{{ if ne .Page.Title .Site.Title }}{{ .Page.Title }} | {{ .Site.Title }} {{ else }}{{ .Site.Title }}{{ end }}</title>
{{ partial "meta" . }} {{ partial "header_includes" . -}} {{ partial "meta" . }} {{ partial "header_includes" . -}}
</head> </head>
<body> <body>
<div id="container"> <section class="section">
<nav class="navbar is-dark is-active" role="navigation" aria-label="main navigation"> <div class="container">
<div class="navbar-start"> <div class="columns">
<div class="navbar-brand"> <div class="column is-3">
<a class="navbar-item" href="{{ relURL " / " }}">{{ .Site.Title | markdownify }}</a> <nav class="panel">
<p class="panel-heading">
</p>
<div class="panel-block">
<div class="media">
<div class="media-content">
<p class="title is-4"><a href="{{ relURL "/" }}">{{ .Site.Title | markdownify }}</a></p>
<p class="subtitle is-5">{{ .Site.Params.description }} </p>
</div>
</div>
</div>
{{ range .Site.Menus.main }}
<a class="panel-block" href="{{.URL}}">{{ .Name }}</a>
{{ end }}
</nav>
</div> </div>
</div> <div class="column is-9">
<div class="navbar-end"> <main>
{{ range .Site.Menus.main }}
<a class="navbar-item" href="{{.URL}}">{{ .Name }}</a>
{{ end }}
</div>
</nav>
<main>

View File

@ -1,9 +1,7 @@
{{ $pag := $.Paginator }} {{ if gt $pag.TotalPages 1 }} {{ $pag := $.Paginator }} {{ if gt $pag.TotalPages 1 }}
<nav class="pagination is-centered" role="navigation" aria-label="pagination"> <nav class="pagination is-centered" role="navigation" aria-label="pagination">
<a href="{{ if $pag.HasPrev }}{{ $pag.Prev.URL }}{{ end }}" class="pagination-previous" {{ if not $pag.HasPrev }}disabled{{ <a href="{{ if $pag.HasPrev }}{{ $pag.Prev.URL }}{{ end }}" class="pagination-previous" {{ if not $pag.HasPrev }}disabled{{ end }}></a>
end }}>←</a> <a href="{{ if $pag.HasNext }}{{ $pag.Next.URL }}{{ end }}" class="pagination-next" {{ if not $pag.HasNext }}disabled{{ end }}></a>
<a href="{{ if $pag.HasNext }}{{ $pag.Next.URL }}{{ end }}" class="pagination-next" {{ if not $pag.HasNext }}disabled{{ end
}}>→</a>
<ul class="pagination-list"> <ul class="pagination-list">
{{ range $pag.Pagers }} {{ range $pag.Pagers }}
<li> <li>

View File

@ -1,10 +1,7 @@
{{ if not .Params.meta }} {{ if not .Params.meta }}
<div class="column">
{{ with .PrevInSection }} {{ with .PrevInSection }}
<a class="button is-pulled-left" href="{{.Permalink}}">← {{ .Title }}</a> <a class="button is-pulled-left" href="{{.Permalink}}">← {{ .Title }}</a>
{{ end }} {{ with .NextInSection }} {{ end }} {{ with .NextInSection }}
<a class="button is-pulled-right" href="{{.Permalink}}">{{ .Title }} -></a> <a class="button is-pulled-right" href="{{.Permalink}}">{{ .Title }} </a>
{{ end }} {{ end }}
</div> {{ end }}
{{ else }}
<br> {{ end }}