Add basic scaffolding for site.
This commit is contained in:
70
themes/mainroad/layouts/_default/baseof.html
Normal file
70
themes/mainroad/layouts/_default/baseof.html
Normal file
@ -0,0 +1,70 @@
|
||||
<!DOCTYPE html>
|
||||
<html class="no-js" lang="{{ .Site.Language.Lang }}">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<title>{{ block "title" . }}{{ if not .IsHome }}{{ .Title }} - {{ end }}{{ .Site.Title }}{{ end }}</title>
|
||||
<script>(function(d,e){d[e]=d[e].replace("no-js","js");})(document.documentElement,"className");</script>
|
||||
<meta name="description" content="{{ if .IsHome }}{{ .Site.Params.description }}{{ else }}{{ .Params.Description }}{{ end }}">
|
||||
{{- if .Site.Params.opengraph }}
|
||||
{{ template "_internal/opengraph.html" . }}
|
||||
{{- end }}
|
||||
{{- if .Site.Params.schema }}
|
||||
{{ template "_internal/schema.html" . }}
|
||||
{{- end }}
|
||||
{{- if .Site.Params.twitter_cards }}
|
||||
{{ template "_internal/twitter_cards.html" . }}
|
||||
{{- end }}
|
||||
|
||||
{{- $googleFontsLink := .Site.Params.googleFontsLink | default "https://fonts.googleapis.com/css?family=Open+Sans:400,400i,700" }}
|
||||
{{- if hasPrefix $googleFontsLink "https://fonts.googleapis.com/" }}
|
||||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
||||
<link rel="dns-prefetch" href="//fonts.googleapis.com">
|
||||
<link rel="dns-prefetch" href="//fonts.gstatic.com">
|
||||
<link rel="stylesheet" {{ printf `href="%s"` $googleFontsLink | safeHTMLAttr }}>
|
||||
{{- end }}
|
||||
|
||||
{{ $style := resources.Get "css/style.css" | resources.ExecuteAsTemplate "css/style.css" . -}}
|
||||
<link rel="stylesheet" href="{{ $style.RelPermalink }}">
|
||||
{{ range .Site.Params.customCSS -}}
|
||||
<link rel="stylesheet" href="{{ . | relURL }}">
|
||||
{{- end }}
|
||||
|
||||
{{- with .OutputFormats.Get "rss" }}
|
||||
{{ printf `<link rel="%s" type="%s" href="%s" title="%s">` .Rel .MediaType.Type .RelPermalink $.Site.Title | safeHTML }}
|
||||
{{- end }}
|
||||
|
||||
<link rel="shortcut icon" href="{{ "favicon.ico" | relURL }}">
|
||||
{{- if not .Site.IsServer }}
|
||||
{{- if hasPrefix .Site.GoogleAnalytics "G-" }}
|
||||
{{ template "_internal/google_analytics.html" . }}
|
||||
{{- else }}
|
||||
{{ template "_internal/google_analytics_async.html" . }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
</head>
|
||||
<body class="body">
|
||||
<div class="container container--outer">
|
||||
{{ block "header" . }}{{ partial "header.html" . }}{{ end }}
|
||||
<div class="wrapper flex">
|
||||
<div class="primary">
|
||||
{{ block "main" . }}
|
||||
{{ with .Content }}
|
||||
<div class="content main__content clearfix">
|
||||
{{ . }}
|
||||
</div>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
</div>
|
||||
{{ block "sidebar" . }}{{ partial "sidebar.html" . }}{{ end }}
|
||||
</div>
|
||||
{{ block "footer" . }}{{ partial "footer.html" . }}{{ end }}
|
||||
</div>
|
||||
<script async defer src="{{ "js/menu.js" | relURL }}"></script>
|
||||
{{ range .Site.Params.customJS -}}
|
||||
<script src="{{ . | relURL }}"></script>
|
||||
{{- end }}
|
||||
{{- partial "mathjax.html" . -}}
|
||||
</body>
|
||||
</html>
|
18
themes/mainroad/layouts/_default/list.html
Normal file
18
themes/mainroad/layouts/_default/list.html
Normal file
@ -0,0 +1,18 @@
|
||||
{{ define "main" }}
|
||||
<main class="main list" role="main">
|
||||
{{- with .Title }}
|
||||
<header class="main__header">
|
||||
<h1 class="main__title">{{ . }}</h1>
|
||||
</header>
|
||||
{{- end }}
|
||||
{{- with .Content }}
|
||||
<div class="content main__content clearfix">
|
||||
{{ . }}
|
||||
</div>
|
||||
{{- end }}
|
||||
{{- range .Paginator.Pages }}
|
||||
{{- .Render "summary" }}
|
||||
{{- end }}
|
||||
</main>
|
||||
{{ partial "pagination.html" . }}
|
||||
{{ end }}
|
28
themes/mainroad/layouts/_default/single.html
Normal file
28
themes/mainroad/layouts/_default/single.html
Normal file
@ -0,0 +1,28 @@
|
||||
{{ define "main" }}
|
||||
<main class="main" role="main">
|
||||
<article class="post">
|
||||
<header class="post__header">
|
||||
<h1 class="post__title">{{ .Title }}</h1>
|
||||
{{- with .Params.lead }}
|
||||
<p class="post__lead">{{ . }}</p>
|
||||
{{- end }}
|
||||
{{ with partial "post_meta.html" . -}}
|
||||
<div class="post__meta meta">{{ . }}</div>
|
||||
{{- end }}
|
||||
</header>
|
||||
{{ partial "post_thumbnail.html" (dict "class" "post" "page" .) }}
|
||||
{{- partial "post_toc.html" . -}}
|
||||
<div class="content post__content clearfix">
|
||||
{{ .Content }}
|
||||
</div>
|
||||
{{- if .Params.tags }}
|
||||
<footer class="post__footer">
|
||||
{{ partial "post_tags.html" . }}
|
||||
</footer>
|
||||
{{- end }}
|
||||
</article>
|
||||
</main>
|
||||
{{ partial "authorbox.html" . }}
|
||||
{{ partial "pager.html" . }}
|
||||
{{ partial "comments.html" . }}
|
||||
{{ end }}
|
26
themes/mainroad/layouts/_default/summary.html
Normal file
26
themes/mainroad/layouts/_default/summary.html
Normal file
@ -0,0 +1,26 @@
|
||||
<article class="list__item post">
|
||||
{{ partial "post_thumbnail.html" (dict "class" "list" "page" .) }}
|
||||
<header class="list__header">
|
||||
<h2 class="list__title post__title">
|
||||
<a href="{{ .RelPermalink }}" rel="bookmark">
|
||||
{{ .Title }}
|
||||
</a>
|
||||
</h2>
|
||||
{{- with .Params.lead }}
|
||||
<p class="list__lead post__lead">{{ . }}</p>
|
||||
{{- end }}
|
||||
{{ with partial "post_meta.html" . -}}
|
||||
<div class="list__meta meta">{{ . }}</div>
|
||||
{{- end }}
|
||||
</header>
|
||||
<div class="content list__excerpt post__content clearfix">
|
||||
{{ .Summary }}
|
||||
</div>
|
||||
{{- if .Site.Params.readmore }}
|
||||
{{- if .Truncated }}
|
||||
<div class="list__footer clearfix">
|
||||
<a class="list__footer-readmore btn" href="{{ .RelPermalink }}">{{ T "read_more" }}</a>
|
||||
</div>
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
</article>
|
Reference in New Issue
Block a user