Merge branch 'redesign'
This commit is contained in:
commit
9ae600d8ce
36 changed files with 1236 additions and 851 deletions
|
@ -3,11 +3,41 @@
|
|||
{{ partial "head.html" . }}
|
||||
|
||||
<body>
|
||||
<main class="main">
|
||||
{{ block "body" . }}
|
||||
{{ block "header" . }}{{ end }}
|
||||
<main class="{{ .Type }}">
|
||||
{{ block "main" . }}{{ end }}
|
||||
</main>
|
||||
{{ partial "footer.html" . }}
|
||||
{{ partial "development/page_info.html" . }}
|
||||
{{ block "footer" . }}{{ end }}
|
||||
{{ end }}
|
||||
</body>
|
||||
|
||||
<style>
|
||||
@font-face {
|
||||
font-family: "Museo_Slab";
|
||||
src: url("{{ `/fonts/Museo_Slab_500.woff2` | absURL }}") format("woff2"),
|
||||
url("{{ `/fonts/Museo_Slab_500.woff` | absURL }}") format("woff");
|
||||
font-weight: normal;
|
||||
font-style: normal;
|
||||
}
|
||||
</style>
|
||||
<link rel="stylesheet" as="style" href="{{ `/styles/reset.css` | absURL }}">
|
||||
<link rel="stylesheet" as="style" href="{{ `/styles/root.css` | absURL }}">
|
||||
{{ if not hugo.IsProduction }}
|
||||
<link rel="stylesheet" as="style" href="/styles/development.css">
|
||||
{{ end }}
|
||||
{{ block "styles" . }}{{ end }}
|
||||
{{ if gt (len .Section) 0 }}
|
||||
{{ range .FirstSection.Resources.Match "*.css" }}
|
||||
<link rel="stylesheet" as="style" href="{{ .Permalink }}">
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{ range .Resources.Match "*.css" }}
|
||||
<link rel="stylesheet" as="style" href="{{ .Permalink }}">
|
||||
{{ end }}
|
||||
|
||||
{{ block "scripts" . }}{{ end }}
|
||||
|
||||
<script src="{{ `scripts/site.js` | absURL }}"></script>
|
||||
</html>
|
||||
|
|
|
@ -1,11 +1,22 @@
|
|||
{{ define "main" }}
|
||||
|
||||
{{ if .Title }}
|
||||
<h1 class="main-title">{{ .Title }}</h1>
|
||||
{{ end }}
|
||||
|
||||
<section id="homepage-content">
|
||||
{{ .Content }}
|
||||
</section>
|
||||
|
||||
<div class="platter">
|
||||
<div class="grid">
|
||||
<div id="title">
|
||||
<h1 class="site">{{ .Title }}</h1>
|
||||
</div>
|
||||
<div id="content">
|
||||
{{ .Content }}
|
||||
</div>
|
||||
{{ with site.Menus.main }}
|
||||
{{ $url := $.RelPermalink }}
|
||||
<div id="nav">
|
||||
<nav class="site bulleted">
|
||||
{{ range . }}
|
||||
<li><a class="{{ if eq .URL $url }}active{{ end }}" href="{{ .URL }}"><span>{{ .Name }}</span></a></li>
|
||||
{{ end }}
|
||||
</nav>
|
||||
</div>
|
||||
{{ end }}
|
||||
</div>
|
||||
</div>
|
||||
{{ end }}
|
||||
|
|
|
@ -1,44 +0,0 @@
|
|||
|
||||
{{ define "main" }}
|
||||
{{ if .Title }}
|
||||
<header>
|
||||
<h1 class="main-title">{{ .Title }}</h1>
|
||||
</header>
|
||||
{{ end }}
|
||||
|
||||
{{ $pages := union .RegularPages .Sections }}
|
||||
{{ if .IsHome }}
|
||||
{{ $pages = where site.RegularPages "Type" "in" site.Params.mainSections }}
|
||||
{{ end }}
|
||||
|
||||
{{ .Content }}
|
||||
|
||||
<ul class="post-list">
|
||||
{{ $paginator := .Paginate $pages }}
|
||||
{{ range $index, $page := $paginator.Pages }}
|
||||
<li class="post-entry">
|
||||
<header>
|
||||
<h2><a href="{{ .Permalink }}">{{ .Title }}</a></h2>
|
||||
<div class="post-date">
|
||||
<time class="nobreak" datetime="{{ .Date | time.Format " 2006-01-02" }}">{{ .Date | time.Format "January 2, 2006" }}</time>
|
||||
</div>
|
||||
{{ partial "development/draft_tag.html" . }}
|
||||
</header>
|
||||
{{ if .Description }}
|
||||
<article>{{ .Description }}</article>
|
||||
{{ end }}
|
||||
</li>
|
||||
{{ end }}
|
||||
</ul>
|
||||
|
||||
{{ if gt $paginator.TotalPages 1 }}
|
||||
<nav class="main-nav">
|
||||
{{ if $paginator.HasPrev }}
|
||||
<a class="prev" href="{{ $paginator.Prev.URL }}">← {{ i18n "prev_page" }}</a>
|
||||
{{ end }}<!---->
|
||||
{{ if $paginator.HasNext }}
|
||||
<a class="next" href="{{ $paginator.Next.URL }}">{{ i18n "next_page" }} →</a>
|
||||
{{ end }}
|
||||
</nav>
|
||||
{{ end }}
|
||||
{{ end }}
|
|
@ -1,39 +1,37 @@
|
|||
{{ define "header" }}
|
||||
{{ partial "header.html" . }}
|
||||
{{ end }}
|
||||
|
||||
{{ define "main" }}
|
||||
<article class="post-single">
|
||||
<header>
|
||||
{{ partial "development/draft_tag.html" . }}
|
||||
<div class="post-title">
|
||||
<h1>{{ .Title }}</h1>
|
||||
<div class="post-date"><time>{{ .Date | time.Format "January 2, 2006" }}</time></div>
|
||||
</div>
|
||||
</header>
|
||||
<section class="post-content">
|
||||
{{ .Content }}
|
||||
</section>
|
||||
{{ partial "single_main.html" . }}
|
||||
{{ end }}
|
||||
|
||||
<!-- Post Tags -->
|
||||
{{ if .Params.tags }}
|
||||
<footer>
|
||||
<ul class="post-tags">
|
||||
{{ range .Params.tags }} {{ $href := print (absURL "tags/") (urlize .) }}
|
||||
<li><a href="{{ $href }}">{{ . }}</a></li>
|
||||
{{ end }}
|
||||
</ul>
|
||||
</footer>
|
||||
{{ define "styles" }}
|
||||
{{ if .Page.Scratch.Get "includes_railroad_diagram" }}
|
||||
<link rel="preload stylesheet" as="style" href="{{ `styles/railroad.css` | absURL }}">
|
||||
{{ end }}
|
||||
<link rel="preload stylesheet" as="style" href="{{ `styles/monokai.css` | absURL }}">
|
||||
{{ end }}
|
||||
|
||||
{{ define "scripts" }}
|
||||
{{ if and .IsPage (.Page.Scratch.Get "includes_railroad_diagram") }}
|
||||
<script defer type="module" src="{{ `scripts/railroad.js` | absURL }}"></script>
|
||||
<script defer type="module" src="{{ `scripts/railroad-utils.js` | absURL }}"></script>
|
||||
{{ end }}
|
||||
|
||||
<!-- Post Nav -->
|
||||
{{ $pages := where site.RegularPages "Type" "in" site.Params.mainSections }}<!---->
|
||||
{{ if and (gt (len $pages) 1) (in $pages . ) }}
|
||||
<nav class="post-nav">
|
||||
{{ with $pages.Next . }}
|
||||
<a class="prev" href="{{ .Permalink }}"><span>←</span><span>{{ .Name }}</span></a>
|
||||
{{ end }} {{ with $pages.Prev . }}
|
||||
<a class="next" href="{{ .Permalink }}"><span>{{ .Name }}</span><span>→</span></a>
|
||||
{{ end }}
|
||||
</nav>
|
||||
{{ if .Page.Scratch.Get "includes_p5_sketch" }}
|
||||
<script defer src="{{ `scripts/p5-1.4.1.min.js` | absURL }}"></script>
|
||||
<script defer src="{{ `scripts/sketch-utils.js` | absURL }}"></script>
|
||||
{{ end }}
|
||||
</article>
|
||||
|
||||
{{ range $script := .Resources.Match "*.js" }}
|
||||
{{ $isModule := default true $script.Params.is_module }}
|
||||
<script defer {{ if $isModule }}type="module"{{ end }} src="{{ $script.Permalink | relURL }}"></script>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
||||
{{ define "footer" }}
|
||||
{{ partial "footer.html" . }}
|
||||
{{ end }}
|
||||
|
||||
{{ define "scripts" }}
|
||||
|
|
4
layouts/_default/single.json
Normal file
4
layouts/_default/single.json
Normal file
|
@ -0,0 +1,4 @@
|
|||
{
|
||||
"title": "{{ .Title }}",
|
||||
"main": "{{ partial `single_main.html` . }}"
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue