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,7 +1,5 @@
{{ define "main" }} {{ define "main" }}
{{ $baseurl := .Site.BaseURL }} {{ $baseurl := .Site.BaseURL }}
<div class="container">
<div class="columns"> <div class="columns">
<div class="column"> <div class="column">
{{ if eq .Data.Singular "tag" }} {{ if eq .Data.Singular "tag" }}
@ -16,7 +14,7 @@
{{ range (.Paginate (.Data.Pages.GroupByDate "2006")).PageGroups }} {{ range (.Paginate (.Data.Pages.GroupByDate "2006")).PageGroups }}
<h3 class="is-size-4">{{ .Key }}</h3> <h3 class="is-size-4">{{ .Key }}</h3>
{{ range .Pages }} {{ range .Pages }}
<article class="tile is-child"> <article>
<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">
@ -33,7 +31,6 @@
{{ end }} {{ end }}
</div> </div>
</div> </div>
</div>
{{ partial "pagination" . }} {{ partial "pagination" . }}

View File

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

View File

@ -1,12 +1,6 @@
{{ define "main" }} {{ define "main" }}
<section class="section">
<div class="container">
<div class="tile is-ancestor">
<div class="tile is-vertical">
<div class="tile">
<div class="tile is-parent is-vertical">
{{ range $index, $page := first 10 (where .Site.RegularPages "Section" "in" .Site.Params.mainSections) }} {{ range $index, $page := first 10 (where .Site.RegularPages "Section" "in" .Site.Params.mainSections) }}
<article class="tile is-child"> <article>
<span class="is-size-2"> <span class="is-size-2">
<a href="{{ .Permalink }}" title="{{ .Title }}">{{ .Title }}</a> <a href="{{ .Permalink }}" title="{{ .Title }}">{{ .Title }}</a>
{{ if .Params.tags }} {{ if .Params.tags }}
@ -28,11 +22,4 @@
<hr> <hr>
</article> </article>
{{ end }} {{ end }}
</div>
</div>
</div>
</div>
</div>
</section>
{{ end }} {{ end }}

View File

@ -1,4 +1,3 @@
<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">
@ -9,8 +8,9 @@
{{ end }} {{ end }}
</span> </span>
{{ partial "aside" . }} {{ partial "aside" . }}
<hr> <div class="is-clearfix">
</div>
<div class="content">
{{.Content}} {{.Content}}
</div>
</article>

View File

@ -1,5 +1,7 @@
</main> </div>
</div>
</div>
</section>
<footer class="footer"> <footer class="footer">
<div class="container"> <div class="container">
<div class="content has-text-centered"> <div class="content has-text-centered">
@ -11,5 +13,4 @@
</div> </div>
</footer> </footer>
</body> </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">
</div> <p class="panel-heading">
</div>
<div class="navbar-end">
{{ range .Site.Menus.main }}
<a class="navbar-item" href="{{.URL}}">{{ .Name }}</a>
{{ end }}
</div>
</nav>
</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 class="column is-9">
<main> <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 }} {{ end }}
</div>
{{ else }}
<br> {{ end }}