mirror of
https://github.com/loikein/hugo-tufte.git
synced 2025-08-06 03:12:43 +02:00
Started refactoring
This commit is contained in:
parent
e2af7d63ca
commit
c454c6f4ca
19 changed files with 186 additions and 124 deletions
13
layouts/_default/baseof.html
Normal file
13
layouts/_default/baseof.html
Normal file
|
@ -0,0 +1,13 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="{{ .Site.LanguageCode }}">
|
||||
{{- partial "header.html" . -}}
|
||||
|
||||
<body >
|
||||
{{ block "main" . }}{{ end }}
|
||||
|
||||
<script>
|
||||
feather.replace()
|
||||
</script>
|
||||
</body>
|
||||
|
||||
</html>
|
23
layouts/_default/home.html
Normal file
23
layouts/_default/home.html
Normal file
|
@ -0,0 +1,23 @@
|
|||
<!-- +++
|
||||
layout: "baseof"
|
||||
+++ -->
|
||||
|
||||
{{ define "main" }}
|
||||
|
||||
|
||||
|
||||
<div id="layout" class="pure-g">
|
||||
<article class="pure-u-1">
|
||||
{{ partial "brand.html" . }}
|
||||
{{ range first 5 .Site.Pages }}
|
||||
{{ partial "content.header.html" . }}
|
||||
<p>{{ .Summary }}</p>
|
||||
{{ if .Truncated }}
|
||||
<p><a href="{{ .RelPermalink }}">Read On →</a></p>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{ partial "footer.html" . }}
|
||||
</article>
|
||||
</div>
|
||||
|
||||
{{ end }}
|
|
@ -1,5 +1,6 @@
|
|||
{{ partial "header.html" . }}
|
||||
|
||||
|
||||
{{ partial "header.html" . }}
|
||||
<body>
|
||||
<div id="layout" class="pure-g">
|
||||
<article class="pure-u-1">
|
||||
|
|
|
@ -1,3 +1,11 @@
|
|||
{{/*
|
||||
|
||||
This template render single pages
|
||||
|
||||
*/}}
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html lang="{{ .Site.LanguageCode }}">
|
||||
{{ partial "header.html" . }}
|
||||
|
||||
<body>
|
||||
|
|
|
@ -1,17 +1,25 @@
|
|||
{{ partial "header.html" . }}
|
||||
<body>
|
||||
{{ define "main" }}
|
||||
<div id="layout" class="pure-g">
|
||||
<article class="pure-u-1">
|
||||
{{ partial "brand.html" . }}
|
||||
{{ range first 5 .Site.Pages }}
|
||||
{{ partial "content.header.html" . }}
|
||||
<p>{{ .Summary }}</p>
|
||||
{{ if .Truncated }}
|
||||
<p><a href="{{ .RelPermalink }}">Read On →</a></p>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{ partial "footer.html" . }}
|
||||
</article>
|
||||
<article class="pure-u-1">
|
||||
{{ partial "brand.html" . }}
|
||||
{{ range where .Site.RegularPages "Type" "post"}}
|
||||
|
||||
<h1 class="content-title">
|
||||
{{ if .IsNode }}
|
||||
<a href="{{ .Permalink }}">{{ .Title}}</a>
|
||||
{{ else }}
|
||||
<a href="{{ .RelPermalink }}">{{ .Title }}{{ if .Draft }} :: Draft {{end}}</a>
|
||||
{{ end }}
|
||||
</h1>
|
||||
|
||||
|
||||
<p>{{ truncate 120 .Summary }}</p>
|
||||
{{/* {{ if .Truncated }} */}}
|
||||
<p><a href="{{ .RelPermalink }}">Read On →</a></p>
|
||||
{{/* {{ end }} */}}
|
||||
|
||||
{{ end }}
|
||||
{{ partial "footer.html" . }}
|
||||
</article>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
{{ end }}
|
|
@ -1,39 +1,42 @@
|
|||
<section>
|
||||
<h1 class="content-title">
|
||||
{{ if .IsNode }}
|
||||
<a href="{{ .Permalink }}">{{ .Title}}</a>
|
||||
{{ else }}
|
||||
<a href="{{ .RelPermalink }}">{{ .Title }}{{ if .Draft }} :: Draft {{end}}</a>
|
||||
|
||||
<h1 class="content-title">
|
||||
{{ if .IsNode }}
|
||||
<a href="{{ .Permalink }}">{{ .Title}}</a>
|
||||
{{ else }}
|
||||
<a href="{{ .RelPermalink }}">{{ .Title }}{{ if .Draft }} :: Draft {{end}}</a>
|
||||
{{ end }}
|
||||
</h1>
|
||||
{{ if .IsPage }}
|
||||
{{ if .Params.subtitle }}
|
||||
<p class=subtitle>{{ .Params.subtitle }}</p>
|
||||
{{ end }}
|
||||
{{ if or (eq .Type "post") (.Params.meta) }}
|
||||
<span class="content-meta">
|
||||
{{ if .Params.author }}
|
||||
<i class="fa fa-user"> </i><span class="author">
|
||||
{{ .Params.author }}</span> <br>
|
||||
{{ end }}
|
||||
|
||||
|
||||
{{ if not .Params.hidedate }}
|
||||
<i class="fa fa-calendar"></i>
|
||||
{{ .Date.Format "Jan 2, 2006" }}
|
||||
{{end }}
|
||||
|
||||
{{ if not .Params.hidereadtime }}
|
||||
<i class="fa fa-clock-o"></i>
|
||||
{{ .ReadingTime }} min read
|
||||
{{ end }}
|
||||
|
||||
{{ if .Params.categories }}
|
||||
<br>
|
||||
<i class="fa fa-tags"> </i>
|
||||
{{ range .Params.categories }}
|
||||
<a href="{{ "/categories/" | absURL }}{{ . | urlize }}">{{ . }}</a>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
</span>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
</h1>
|
||||
{{ if .IsPage }}
|
||||
{{ if .Params.subtitle }}<p class=subtitle>{{ .Params.subtitle }}</p>{{ end }}
|
||||
{{ if or (eq .Type "post") (.Params.meta) }}
|
||||
<span class="content-meta">
|
||||
{{ if .Params.author }}
|
||||
<i class="fa fa-user"> </i><span class="author">
|
||||
{{ .Params.author }}</span> <br>
|
||||
{{ end }}
|
||||
|
||||
|
||||
{{ if not .Params.hidedate }}
|
||||
<i class="fa fa-calendar"></i>
|
||||
{{ .Date.Format "Jan 2, 2006" }}
|
||||
{{end }}
|
||||
|
||||
{{ if not .Params.hidereadtime }}
|
||||
<i class="fa fa-clock-o"></i>
|
||||
{{ .ReadingTime }} min read
|
||||
{{ end }}
|
||||
|
||||
{{ if .Params.categories }}
|
||||
<br>
|
||||
<i class="fa fa-tags"> </i>
|
||||
{{ range .Params.categories }}
|
||||
<a href="{{ "/categories/" | absURL }}{{ . | urlize }}">{{ . }}</a>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
</span>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
</section>
|
||||
</section>
|
|
@ -1,2 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en-us">
|
|
@ -1,7 +1,10 @@
|
|||
{{ partial "doctype.html" . }}
|
||||
<head>
|
||||
<title>{{ .Site.Title }} - {{ .Title }}</title>
|
||||
{{ partial "meta.html" . }}
|
||||
{{ partial "opengraph.html" }}
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover">
|
||||
<meta name="description"
|
||||
content="{{ with .Description }}{{ . }}{{ else }}{{ with .Summary }}{{ . }}{{ else }}{{ .Site.Params.description }}{{end }}{{ end }} ">
|
||||
<link rel="canonical" href="{{ .Permalink }}" />
|
||||
|
||||
{{ partial "header.includes.html" . }}
|
||||
</head>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<!-- Load MathJax, if necessary. -->
|
||||
<!-- Load Katex, if necessary. -->
|
||||
{{ if or .Params.math .IsHome }}
|
||||
{{ partial "math.html" . }}
|
||||
{{ partial "math.html" . }}
|
||||
{{ end }}
|
||||
|
||||
<!-- Syntax highlighting -->
|
||||
|
@ -23,6 +23,7 @@
|
|||
<!-- Font Awesome -->
|
||||
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css">
|
||||
|
||||
<script defer src="{{ "/js/main.js" | absURL }}"></script>
|
||||
<!-- Main CSS file based on Pure blog layout -->
|
||||
<link rel="stylesheet" href="{{ "/css/tufte.css" | absURL }}">
|
||||
<link rel="stylesheet" href="{{ "/css/hugo-tufte.css" | absURL }}">
|
||||
|
|
|
@ -1,18 +1,4 @@
|
|||
<script type="text/x-mathjax-config">
|
||||
MathJax.Hub.Config({
|
||||
tex2jax: {
|
||||
inlineMath: [['$','$'], ['\\(','\\)']],
|
||||
displayMath: [['$$','$$'], ['\\[','\\]']],
|
||||
processEscapes: true,
|
||||
processEnvironments: true,
|
||||
menuSettings: { zoom: "Double-Click" },
|
||||
skipTags: ['script', 'noscript', 'style', 'textarea', 'pre'],
|
||||
TeX: { equationNumbers: { autoNumber: "AMS" },
|
||||
extensions: ["AMSmath.js", "AMSsymbols.js"] }
|
||||
}
|
||||
});
|
||||
</script>
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.12.0/dist/katex.min.css">
|
||||
<script defer src="https://cdn.jsdelivr.net/npm/katex@0.12.0/dist/katex.min.js"></script>
|
||||
<script defer src="https://cdn.jsdelivr.net/npm/katex@0.12.0/dist/contrib/auto-render.min.js" onload="renderMathInElement(document.body);"></script>
|
||||
|
||||
<script type="text/javascript"
|
||||
src="//cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML">
|
||||
</script>
|
||||
|
|
|
@ -1,7 +0,0 @@
|
|||
<meta http-equiv="content-type" content="text/html; charset=utf-8">
|
||||
<!-- Enable responsiveness on mobile devices-->
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<meta name="description" content="{{ .Description }}">
|
||||
<meta name="keywords" content="{{ range .Keywords }}{{ . }},{{ end }}">
|
||||
<meta name="author" content="{{ .Site.Title }}">
|
||||
{{ hugo.Generator }}
|
|
@ -1,3 +1,6 @@
|
|||
{{ $marginnoteDomIdSuffix := .Ordinal }}<label for="marginnote-{{.Page.File.UniqueID}}-{{ $marginnoteDomIdSuffix }}" class="margin-toggle">⊕</label>
|
||||
<input type="checkbox" id="marginnote-{{.Page.File.UniqueID}}-{{ $marginnoteDomIdSuffix }}" class="margin-toggle"/>
|
||||
<span class="marginnote">{{ .Inner }}</span>
|
||||
{{ $marginnoteDomIdSuffix := .Ordinal }}
|
||||
<label for="marginnote-{{.Page.File.UniqueID}}-{{ $marginnoteDomIdSuffix }}">
|
||||
class="margin-toggle">⊕
|
||||
</label>
|
||||
<input type="checkbox" id="marginnote-{{.Page.File.UniqueID}}-{{ $marginnoteDomIdSuffix }}" class="margin-toggle" />
|
||||
<span class="marginnote">{{ .Inner }}</span>
|
Loading…
Add table
Add a link
Reference in a new issue