add language navigator and fix some styles
This commit is contained in:
parent
10dcb7a324
commit
59ee3f114a
21 changed files with 262 additions and 186 deletions
|
@ -1,11 +1,13 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
{{ partial "head.html" . }}
|
||||
<body class=" sm:mx-5 sm:my-0">
|
||||
|
||||
<body class="sm:mx-5 sm:my-0">
|
||||
{{ partial "header.html" . }}
|
||||
|
||||
|
||||
{{ block "main" . }} {{ end }}
|
||||
|
||||
{{ partial "footer.html" . }}
|
||||
</body>
|
||||
|
||||
</html>
|
|
@ -1,5 +1,5 @@
|
|||
{{ define "main" }}
|
||||
<main>
|
||||
<main class="container">
|
||||
{{ if isset .Data "Term" }}
|
||||
<h2 class="my-8">{{ .Data.Singular | title }} - "{{ .Data.Term }}"</h2>
|
||||
{{ else }}
|
||||
|
|
|
@ -1,52 +1,54 @@
|
|||
{{ define "main" }}
|
||||
{{ if .Params.toc }}
|
||||
{{ partial "toc.html" . }}
|
||||
{{ end }}
|
||||
<h1 class="mt-6 mb-6">{{ .Title }}</h1>
|
||||
<div class="mb-3 text-xs flex justify-between sm:flex-col">
|
||||
<div>
|
||||
{{ if .Site.Params.displayDate }}
|
||||
Posted at — {{ dateFormat .Site.Params.timeformat .Date }}
|
||||
{{ end }}
|
||||
{{ if .Draft }}
|
||||
<span class="ml-3 minima-tag">
|
||||
DRAFT
|
||||
</span>
|
||||
{{ end }}
|
||||
</div>
|
||||
{{ if .Params.tags }}
|
||||
<div class="sm:mt-4">
|
||||
{{ range .Params.tags }}
|
||||
<a class="not-first:ml-3" href="/tags/{{ . }}">#{{ . }}</a>
|
||||
{{ end }}
|
||||
</div>
|
||||
{{ end }}
|
||||
<div class="container">
|
||||
{{ if .Params.toc }}
|
||||
{{ partial "toc.html" . }}
|
||||
{{ end }}
|
||||
<h1 class="mt-6 mb-6">{{ .Title }}</h1>
|
||||
<div class="mb-3 text-xs flex justify-between sm:flex-col">
|
||||
<div>
|
||||
{{ if .Site.Params.displayDate }}
|
||||
Posted at — {{ dateFormat .Site.Params.timeformat .Date }}
|
||||
{{ end }}
|
||||
{{ if .Draft }}
|
||||
<span class="ml-3 minima-tag">
|
||||
DRAFT
|
||||
</span>
|
||||
{{ end }}
|
||||
</div>
|
||||
{{ if .Params.tags }}
|
||||
<div class="sm:mt-4">
|
||||
{{ range .Params.tags }}
|
||||
<a class="not-first:ml-3" href="/tags/{{ . }}">#{{ . }}</a>
|
||||
{{ end }}
|
||||
</div>
|
||||
{{ end }}
|
||||
</div>
|
||||
<main>
|
||||
<p>{{ .Description | markdownify | safeHTML }}</p>
|
||||
<article class="md">
|
||||
{{ .Content }}
|
||||
</article>
|
||||
</main>
|
||||
{{ if or .Params.math .Site.Params.math }}
|
||||
{{ partial "math.html" . }}
|
||||
{{ end }}
|
||||
|
||||
{{ if or .Params.mermaid .Site.Params.mermaid }}
|
||||
{{ partial "mermaid.html" . }}
|
||||
{{ end }}
|
||||
|
||||
{{ if or .Params.comment (and .Site.Params.commentOnAllPosts (ne .Params.comment false)) }}
|
||||
{{ if eq .Site.Params.comment "disqus"}}
|
||||
{{ partial "disqus.html" . }}
|
||||
{{ end }}
|
||||
|
||||
{{ if eq .Site.Params.comment "ovo"}}
|
||||
{{ partial "ovo.html" . }}
|
||||
{{ end }}
|
||||
|
||||
{{ if eq .Site.Params.comment "utterances"}}
|
||||
{{ partial "utterances.html" . }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
</div>
|
||||
<main>
|
||||
<p>{{ .Description | markdownify | safeHTML }}</p>
|
||||
<article class="md">
|
||||
{{ .Content }}
|
||||
</article>
|
||||
</main>
|
||||
{{ if or .Params.math .Site.Params.math }}
|
||||
{{ partial "math.html" . }}
|
||||
{{ end }}
|
||||
|
||||
{{ if or .Params.mermaid .Site.Params.mermaid }}
|
||||
{{ partial "mermaid.html" . }}
|
||||
{{ end }}
|
||||
|
||||
{{ if or .Params.comment (and .Site.Params.commentOnAllPosts (ne .Params.comment false)) }}
|
||||
{{ if eq .Site.Params.comment "disqus"}}
|
||||
{{ partial "disqus.html" . }}
|
||||
{{ end }}
|
||||
|
||||
{{ if eq .Site.Params.comment "ovo"}}
|
||||
{{ partial "ovo.html" . }}
|
||||
{{ end }}
|
||||
|
||||
{{ if eq .Site.Params.comment "utterances"}}
|
||||
{{ partial "utterances.html" . }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{ end }}
|
|
@ -1,5 +1,5 @@
|
|||
{{ define "main" }}
|
||||
<main>
|
||||
<main class="container">
|
||||
<h2>{{ .Title }}</h2>
|
||||
<nav class="flex flex-col">
|
||||
{{ $data := .Data }}
|
||||
|
|
|
@ -1,23 +1,23 @@
|
|||
{{ define "main" }}
|
||||
<main>
|
||||
<h2 class="mt-8 mb-1">{{ .Site.Params.iam }} {{ .Site.Author.name }}</h2>
|
||||
<p class="my-0">{{ .Site.Author.slogon }}</p>
|
||||
<p class="my-3 home-intro">{{ .Site.Author.description | markdownify | safeHTML }}</p>
|
||||
{{ if eq .Paginator.PageNumber 1 }}
|
||||
<h3 class="my-6">{{ .Site.Params.recent }}</h3>
|
||||
{{ else }}
|
||||
<h3 class="my-6">{{ .Site.Params.older }}</h3>
|
||||
{{ end }}
|
||||
<div>
|
||||
{{ $paginator := .Paginate (where .Site.RegularPages "Kind" "page") }}
|
||||
{{ range $paginator.Pages }}
|
||||
{{ partial "list.html" . }}
|
||||
{{ end }}
|
||||
{{ partial "paginator.html" . }}
|
||||
</div>
|
||||
{{ if .Site.Params.friends.feeds }}
|
||||
<h3 class="my-6">{{ .Site.Params.friends.title }}</h3>
|
||||
<div id="friends"></div>
|
||||
{{ end }}
|
||||
</main>
|
||||
<main class="container">
|
||||
<h2 class="mt-8 mb-1">{{ .Site.Params.iam }} {{ .Site.Author.name }}</h2>
|
||||
<p class="my-0">{{ .Site.Author.slogon }}</p>
|
||||
<p class="my-3 home-intro">{{ .Site.Author.description | markdownify | safeHTML }}</p>
|
||||
{{ if eq .Paginator.PageNumber 1 }}
|
||||
<h3 class="mt-6 mb-4">{{ .Site.Params.recent }}</h3>
|
||||
{{ else }}
|
||||
<h3 class="mt-6 mb-4">{{ .Site.Params.older }}</h3>
|
||||
{{ end }}
|
||||
<div>
|
||||
{{ $paginator := .Paginate (where .Site.RegularPages "Kind" "page") }}
|
||||
{{ range $paginator.Pages }}
|
||||
{{ partial "list.html" . }}
|
||||
{{ end }}
|
||||
{{ partial "paginator.html" . }}
|
||||
</div>
|
||||
{{ if .Site.Params.friends.feeds }}
|
||||
<h3 class="my-6">{{ .Site.Params.friends.title }}</h3>
|
||||
<div id="friends"></div>
|
||||
{{ end }}
|
||||
</main>
|
||||
{{ end }}
|
|
@ -1,18 +1,20 @@
|
|||
<footer class="mt-8 flex sm:flex-col-reverse justify-between items-center">
|
||||
<p class="mt-0 text-sm">
|
||||
{{ .Site.Copyright }} |
|
||||
<a href="https://gohugo.io" target="_blank" rel="noopener noreferrer">Hugo</a> on
|
||||
<a href="https://github.com/mivinci/hugo-theme-minima" target="_blank" rel="noopener noreferrer">Minima</a>
|
||||
</p>
|
||||
<p class="flex items-center mt-0">
|
||||
{{ range $_, $key := .Site.Params.Social }}
|
||||
<a class="icon mx-2" href="{{ $key.url }}" title="{{ $key.name }}">
|
||||
{{ if $key.svg }}
|
||||
{{ $key.svg | safeHTML }}
|
||||
{{ else }}
|
||||
{{ index $.Site.Data.svg $key.name | safeHTML }}
|
||||
<footer class="mt-8">
|
||||
<div class="container mt-8 flex sm:flex-col-reverse justify-between items-center">
|
||||
<p class="mt-0 text-sm">
|
||||
{{ .Site.Copyright }} |
|
||||
<a href="https://gohugo.io" target="_blank" rel="noopener noreferrer">Hugo</a> on
|
||||
<a href="https://github.com/mivinci/hugo-theme-minima" target="_blank" rel="noopener noreferrer">Minima</a>
|
||||
</p>
|
||||
<p class="flex items-center mt-0">
|
||||
{{ range $_, $key := .Site.Params.Social }}
|
||||
<a class="icon mx-2" href="{{ $key.url }}" title="{{ $key.name }}">
|
||||
{{ if $key.svg }}
|
||||
{{ $key.svg | safeHTML }}
|
||||
{{ else }}
|
||||
{{ index $.Site.Data.svg $key.name | safeHTML }}
|
||||
{{ end }}
|
||||
</a>
|
||||
{{ end }}
|
||||
</a>
|
||||
{{ end }}
|
||||
</p>
|
||||
</p>
|
||||
</div>
|
||||
</footer>
|
|
@ -15,18 +15,18 @@
|
|||
</title>
|
||||
{{ $favicon := "favicon.ico" }}
|
||||
<link rel="shortcut icon" href="{{ $favicon | relURL }}" type="image/x-icon" />
|
||||
<link rel="preconnect" href="https://fonts.googleapis.com">
|
||||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
||||
<link href="https://fonts.googleapis.com/css2?family=Noto+Serif+SC:wght@400;500;600;700&display=swap"
|
||||
rel="stylesheet">
|
||||
{{ $hash := now.Unix }}
|
||||
{{ $options := (dict "targetPath" (printf `minima.%d.css` $hash) "outputStyle" "compressed" "enableSourceMap" true) }}
|
||||
{{ $style := resources.Get "sass/main.scss" | resources.ToCSS $options }}
|
||||
<link rel="stylesheet" href="{{ $style.RelPermalink }}">
|
||||
|
||||
{{ $options = (dict "targetPath" (printf `minima.%d.js` $hash) "minify" true) }}
|
||||
{{ $js := resources.Get "js/main.js" | js.Build $options | resources.ExecuteAsTemplate (printf `minima.%d.js` $hash) . }}
|
||||
<script defer type="text/javascript" src="{{ $js.RelPermalink }}"></script>
|
||||
{{ if .IsTranslated }}
|
||||
{{ range .Translations }}
|
||||
<link rel="alternate" hreflang="{{ .Language.Lang }}" href="{{ .Permalink }}" title="{{ .Language.LanguageName }}">
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
</head>
|
||||
<script>
|
||||
// We will default to system theme color if no choice was made.
|
||||
|
|
|
@ -1,14 +1,23 @@
|
|||
<header class="flex justify-between items-center mb-6 sm:my-3">
|
||||
<div class="flex items-center">
|
||||
{{ if .Site.Params.brand }}
|
||||
<div class="mr-3 text-3xl"><a href="/">{{ .Site.Params.brand }}</a></div>
|
||||
{{ end }}
|
||||
<div id="theme-switcher" class="text-4xl cursor-pointer">{{ index .Site.Params.switch 1 }}</div>
|
||||
<header class="sm:my-3 my-6">
|
||||
<div class="container">
|
||||
<nav class="flex justify-between items-center">
|
||||
<div class="flex items-center">
|
||||
{{ if .Site.Params.brand }}
|
||||
<div class="mr-3 text-3xl"><a href="/">{{ .Site.Params.brand }}</a></div>
|
||||
{{ end }}
|
||||
<div id="theme-switcher" class="text-left text-4xl cursor-pointer">{{ index .Site.Params.switch 1 }}</div>
|
||||
</div>
|
||||
<ul class="flex items-center font-medium
|
||||
whitespace-nowrap overflow-x-auto overflow-y-hidden">
|
||||
{{ range .Site.Menus.main }}
|
||||
<li class="mx-2"><a href="{{ .URL | absLangURL }}">{{ .Name }}</a></li>
|
||||
{{ end }}
|
||||
</ul>
|
||||
<ul class="flex item-center text-sm font-bold">
|
||||
{{ range $.Site.Home.AllTranslations }}
|
||||
<li class="ml-3"><a href="{{ .Permalink }}">{{ .Language.LanguageName }}</a></li>
|
||||
{{ end}}
|
||||
</ul>
|
||||
</nav>
|
||||
</div>
|
||||
<nav class="flex items-center
|
||||
whitespace-nowrap overflow-x-auto overflow-y-hidden">
|
||||
{{ range .Site.Menus.main }}
|
||||
<a class="ml-5" href="{{ .URL | absLangURL }}">{{ .Name }}</a>
|
||||
{{ end }}
|
||||
</nav>
|
||||
</header>
|
|
@ -1,10 +1,10 @@
|
|||
<div class="flex justify-between sm:flex-col-reverse my-3 sm:mb-6 sm:mt-3">
|
||||
<div class="flex justify-between sm:flex-col my-3 sm:mb-4 sm:mt-3">
|
||||
{{ if .Page.Params.link }}
|
||||
<a class="" href="{{ .Page.Params.link }}">{{ .Title }}</a>
|
||||
{{ else }}
|
||||
<a class="" href="{{ .RelPermalink }}">{{ .Title }}</a>
|
||||
{{ end }}
|
||||
{{ if .Site.Params.displayDate }}
|
||||
<div class="sm:mb-1 sm:text-xs">{{ dateFormat .Site.Params.timeformat .Date }}</div>
|
||||
<div class="sm:mt-1 sm:text-xs">{{ dateFormat .Site.Params.timeformat .Date }}</div>
|
||||
{{ end }}
|
||||
</div>
|
|
@ -1,6 +1,6 @@
|
|||
{{ $page := $.Paginator }}
|
||||
{{ if gt $page.TotalPages 1 }}
|
||||
<div class="my-8 flex justify-between">
|
||||
<div class="mt-6 flex justify-between font-semibold">
|
||||
{{ if $page.HasPrev }}
|
||||
<a href="{{ $page.Prev.URL }}">← Newer</a>
|
||||
{{ end }}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue