Browse Source

[WIP] Initial work on layout

main
Jez Cope 4 months ago
parent
commit
35adcc1141
  1. 22
      assets/style/main.scss
  2. 50
      layouts/_default/single.html
  3. 28
      layouts/_default/summary.html
  4. 21
      layouts/index.html
  5. 35
      layouts/partials/header.html
  6. 6
      layouts/partials/pagination.html

22
assets/style/main.scss

@ -1,9 +1,21 @@
@import '_variables.scss';
@charset "utf-8";
html {
font-family: $main-font-family;
}
$family-sans-serif: "Iosevka Aile", sans-serif;
$family-serif: "Iosevka Etoile", serif;
$family-monospace: "Iosevka", monospace;
$family-primary: $family-serif;
@import 'bulma/bulma.sass';
h1, h2, h3, h4, h5, h6 {
font-family: $header-font-family;
font-family: $family-sans-serif;
}
h1 {
font-size: $size-large;
}
.site-title {
@extend h1;
}

50
layouts/_default/single.html

@ -1,26 +1,36 @@
{{ define "main" }}
<main>
<article>
<h1>{{ .Title }}</h1>
<time>{{ .Date.Format "02.01.2006 15:04" }}</time>
<div>
{{ .Content }}
<main class="container">
<article>
<div class="columns">
<div class="column is-8 is-offset-2">
<h1>{{ .Title }}</h1>
</div>
{{ with .Params.tags }}
<div>
<ul id="tags">
{{ range . }}
<li><a href="{{ "/tags/" | relLangURL }}{{ . | urlize }}">{{ . }}</a></li>
{{ end }}
</ul>
</div>
<div class="columns">
<div class="column is-2">
<time>{{ .Date.Format .Site.Params.DateFormat }}</time>
{{ with .Params.tags }}
<div>
<ul id="tags">
{{ range . }}
<li><a href="{{ "/tags/" | relLangURL }}{{ . | urlize }}">{{ . }}</a></li>
{{ end }}
</ul>
</div>
{{ end }}
</div>
{{ end }}
{{ with .Site.DisqusShortname }}
<div>
{{ template "_internal/disqus.html" . }}
<div class="column is-8">
<div class="content">
{{ .Content }}
</div>
</div>
{{ end }}
</article>
</main>
</div>
{{ with .Site.DisqusShortname }}
<div>
{{ template "_internal/disqus.html" . }}
</div>
{{ end }}
</article>
</main>
{{ partial "sidebar.html" . }}
{{ end }}

28
layouts/_default/summary.html

@ -1,13 +1,21 @@
<article>
<h1><a href="{{ .Permalink }}">{{ .Title }}</a></h1>
<time>{{ .Date.Format "02.01.2006 15:04" }}</time>
{{ range .Params.tags }}
<a href="{{ "/tags/" | relLangURL }}{{ . | urlize }}">{{ . }}</a>
{{ end }}
<div>
{{ .Summary }}
{{ if .Truncated }}
<article class="my-6">
<div class="columns">
<div class="column is-8 is-offset-2">
<h2><a href="{{ .Permalink }}">{{ .Title }}</a></h1>
</div>
</div>
<div class="columns">
<div class="column is-2">
<time>{{ .Date.Format .Site.Params.DateFormat }}</time>
{{ range .Params.tags }}
<a href="{{ "/tags/" | relLangURL }}{{ . | urlize }}">{{ . }}</a>
{{ end }}
</div>
<div class="column is-8">
{{ .Summary }}
{{ if .Truncated }}
<a href="{{ .Permalink }}">Read more...</a>
{{ end }}
{{ end }}
</div>
</div>
</article>

21
layouts/index.html

@ -1,10 +1,23 @@
{{ define "main" }}
<main>
<section class="hero">
<div class="hero-body">
<div class="container">
<div class="columns">
<div class="column is-8 is-offset-2">
{{ with .Site.Params.Description }}{{.}}{{ end }}
</div>
</div>
</div>
</div>
</section>
<main class="section">
<div class="container">
{{ $paginator := .Paginate (where .Site.RegularPages "Type" "in" .Site.Params.mainSections) }}
{{ range $paginator.Pages }}
{{ .Render "summary" }}
{{ .Render "summary" }}
{{ end }}
{{ partial "pagination.html" . }}
</main>
{{ partial "sidebar.html" . }}
</div>
</main>
{{ end }}

35
layouts/partials/header.html

@ -1,12 +1,23 @@
<header>
<a href="{{ .Site.BaseURL }}">{{ .Site.Title }}</a>
{{ with .Site.Menus.main }}
<nav>
<ul>
{{ range . }}
<li><a href="{{ .URL | relURL }}">{{ .Name }}</a></li>
{{ end }}
</ul>
</nav>
{{ end }}
</header>
<div class="container">
<div class="columns">
<div class="column is-8 is-offset-2">
<nav class="navbar" role="navigation" aria-label="main navigation">
<div class="navbar-brand">
{{- if .IsHome -}}<h1 class="site-title navbar-item">{{- else -}}<div class="site-title navbar-item">{{- end -}}
<a href="{{ .Site.BaseURL }}">{{ .Site.Title }}</a>
{{- if .IsHome -}}</h1>{{- else -}}</div>{{- end -}}
</div>
{{ with .Site.Menus.main }}
<div class="navbar-menu">
<div class="navbar-end">
{{ range . }}
<a class="navbar-item" href="{{ .URL | relURL }}">{{ .Name }}</a>
{{ end }}
</div>
</div>
{{ end }}
</nav>
</div>
</div>
</div>

6
layouts/partials/pagination.html

@ -1,4 +1,5 @@
<div>
<footer class="columns">
<div class="column is-8 is-offset-2">
{{ if .Paginator.HasPrev }}
<a href="{{ .Paginator.Prev.URL }}">Previous Page</a>
{{ end }}
@ -6,4 +7,5 @@
{{ if .Paginator.HasNext }}
<a href="{{ .Paginator.Next.URL }}">Next Page</a>
{{ end }}
</div>
</div>
</footer>
Loading…
Cancel
Save