FEAT: Using hugo
This commit is contained in:
0
themes/risotto/layouts/404.html
Normal file
0
themes/risotto/layouts/404.html
Normal file
36
themes/risotto/layouts/_default/baseof.html
Normal file
36
themes/risotto/layouts/_default/baseof.html
Normal file
@@ -0,0 +1,36 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="{{- site.Language.Lang -}}">
|
||||
|
||||
<head>
|
||||
{{- partial "head.html" . -}}
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div class="page">
|
||||
|
||||
<header class="page__header">
|
||||
{{- partial "header.html" . -}}
|
||||
</header>
|
||||
|
||||
<section class="page__body">
|
||||
{{- block "main" . }}{{- end }}
|
||||
</section>
|
||||
|
||||
<section class="page__aside">
|
||||
<div class="aside__about">
|
||||
{{- partial "about.html" . -}}
|
||||
</div>
|
||||
<hr>
|
||||
<div class="aside__content">
|
||||
{{- block "aside" . }}{{- end }}
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<footer class="page__footer">
|
||||
{{- partial "footer.html" . -}}
|
||||
</footer>
|
||||
|
||||
</div>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
1
themes/risotto/layouts/_default/li.html
Normal file
1
themes/risotto/layouts/_default/li.html
Normal file
@@ -0,0 +1 @@
|
||||
<li><a href="{{ .Permalink }}">{{ .Title | markdownify }}</a></li>
|
||||
12
themes/risotto/layouts/_default/list.html
Normal file
12
themes/risotto/layouts/_default/list.html
Normal file
@@ -0,0 +1,12 @@
|
||||
{{ define "main" }}
|
||||
<h1 id="{{ .Title | urlize }}">{{ .Title | markdownify }}</h1>
|
||||
|
||||
{{ .Content }}
|
||||
|
||||
<ul>
|
||||
{{ range .Pages.ByDate.Reverse }} {{ .Render "li" }} {{ end }}
|
||||
</ul>
|
||||
|
||||
{{ end }} {{define "aside" }} {{ if .Params.description }}
|
||||
<p>{{ .Params.description }}</p>
|
||||
{{ end }} {{ end }}
|
||||
20
themes/risotto/layouts/_default/single.html
Normal file
20
themes/risotto/layouts/_default/single.html
Normal file
@@ -0,0 +1,20 @@
|
||||
{{ define "main" }}
|
||||
<header class="content__header">
|
||||
<h1>{{ .Title | markdownify }}</h1>
|
||||
</header>
|
||||
{{ if .Params.toc }}
|
||||
<aside></aside>
|
||||
{{ end }}
|
||||
<div class="content__body">{{ .Content }}</div>
|
||||
<footer class="content__footer"></footer>
|
||||
{{ end }} {{define "aside" }} {{ partial "tags.html" .}} {{ if
|
||||
.Params.description }}
|
||||
<p>{{ .Params.description }}</p>
|
||||
{{ end }} {{ if or (.Params.author) (.Params.date) }}
|
||||
<p>
|
||||
{{ if .Params.author }}By {{ .Params.author }}{{ if .Date }}, {{ end }}{{ end
|
||||
}} {{ if .Date }}{{ .Date.Format "2006-01-02" }}{{ end }}
|
||||
</p>
|
||||
{{ end }} {{ if and (.Params.toc) (.TableOfContents) }}
|
||||
<hr />
|
||||
On this page: {{ .TableOfContents }} {{ end }} {{ end }}
|
||||
4
themes/risotto/layouts/index.html
Normal file
4
themes/risotto/layouts/index.html
Normal file
@@ -0,0 +1,4 @@
|
||||
{{ define "main" }}
|
||||
{{ .Content }}
|
||||
{{ end }}
|
||||
|
||||
15
themes/risotto/layouts/partials/about.html
Normal file
15
themes/risotto/layouts/partials/about.html
Normal file
@@ -0,0 +1,15 @@
|
||||
{{ with .Site.Params.about }}
|
||||
<div class="aside__about">
|
||||
{{ with .logo }}<img class="about__logo" src="{{ . | absURL }}" alt="Logo">{{ end }}
|
||||
<h1 class="about__title">{{ .title }}</h1>
|
||||
{{ with .description }}<p class="about__description">{{ . | markdownify }}</p>{{ end }}
|
||||
</div>
|
||||
{{ end }}
|
||||
|
||||
<ul class="aside__social-links">
|
||||
{{ range $item := .Site.Params.socialLinks }}
|
||||
<li>
|
||||
<a href="{{ $item.url }}" rel="me" aria-label="{{ $item.title }}" title="{{ $item.title }}"><i class="{{ $item.icon }}" aria-hidden="true"></i></a>
|
||||
</li>
|
||||
{{ end }}
|
||||
</ul>
|
||||
3
themes/risotto/layouts/partials/footer.html
Normal file
3
themes/risotto/layouts/partials/footer.html
Normal file
@@ -0,0 +1,3 @@
|
||||
{{- partial "lang.html" . -}}
|
||||
<p class="copyright">{{ .Site.Copyright | markdownify }}</p>
|
||||
<p class="advertisement">Powered by <a href="https://gohugo.io/">hugo</a> and <a href="https://github.com/joeroe/risotto">risotto</a>.</p>
|
||||
24
themes/risotto/layouts/partials/head.html
Normal file
24
themes/risotto/layouts/partials/head.html
Normal file
@@ -0,0 +1,24 @@
|
||||
<title>{{ with .Title }}{{ . }} – {{end}}{{ .Site.Title }}</title>
|
||||
{{ with .Site.Params.about }}<meta name="description" content="{{ .description }}">{{ end }}
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<meta charset="UTF-8"/>
|
||||
{{ if .Site.Params.noindex }}<meta name="robots" content="noindex" /> {{ end }}
|
||||
|
||||
<!-- FontAwesome <https://fontawesome.com/> -->
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.1.2/css/all.min.css" integrity="sha512-1sCRPdkRXhBV2PBLUdRb4tMg1w2YPf37qatUFeS7zlBy7jJI8Lf4VHwWfZZfpXtYSLy85pkm9GaYVYMfw5BC1A==" crossorigin="anonymous" />
|
||||
|
||||
<!-- Academicons <https://jpswalsh.github.io/academicons/> -->
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/academicons/1.9.1/css/academicons.min.css" integrity="sha512-b1ASx0WHgVFL5ZQhTgiPWX+68KjS38Jk87jg7pe+qC7q9YkEtFq0z7xCglv7qGIs/68d3mAp+StfC8WKC5SSAg==" crossorigin="anonymous" />
|
||||
|
||||
<!-- risotto theme -->
|
||||
<link rel="stylesheet" href="{{ printf "css/palettes/%s.css" (.Site.Params.theme.palette | default "base16-dark") | absURL }}">
|
||||
<link rel="stylesheet" href="{{ "css/risotto.css" | absURL }}">
|
||||
<link rel="stylesheet" href="{{ "css/custom.css" | absURL }}">
|
||||
|
||||
<!-- favicon -->
|
||||
{{ if os.FileExists "static/favicon.ico" }}<link rel="icon" href="{{ "favicon.ico" | absURL }}">{{ end }}
|
||||
{{ if os.FileExists "static/favicon-32x32.png" }}<link rel="icon" type="image/png" sizes="32x32" href="{{ "favicon-32x32.png" | absURL }}">{{ end }}
|
||||
{{ if os.FileExists "static/favicon-16x16.png" }}<link rel="icon" type="image/png" sizes="16x16" href="{{ "favicon-16x16.png" | absURL }}">{{ end }}
|
||||
{{ if os.FileExists "static/apple-touch-icon.png" }}<link rel="apple-touch-icon" href="{{ "apple-touch-icon.png" | absURL }}">{{ end }}
|
||||
{{ if os.FileExists "static/site.webmanifest" }}<link rel="manifest" href="{{ "site.webmanifest" | absURL }}">{{ end }}
|
||||
10
themes/risotto/layouts/partials/header.html
Normal file
10
themes/risotto/layouts/partials/header.html
Normal file
@@ -0,0 +1,10 @@
|
||||
<nav class="page__nav main-nav">
|
||||
<ul>
|
||||
<h1 class="page__logo"><a href="{{ .Site.BaseURL }}" class="page__logo-inner">{{ .Site.Title }}</a></h1>
|
||||
{{ $currentPage := . }}
|
||||
{{ range .Site.Menus.main }}
|
||||
<li class="main-nav__item"><a class="nav-main-item{{ if or ($currentPage.IsMenuCurrent "main" .) ($currentPage.HasMenuCurrent "main" .) (eq ($currentPage.Permalink) (.URL | absLangURL)) }} active{{end}}" href="{{ .URL | absLangURL }}" title="{{ .Title }}">{{ .Name }}</a></li>
|
||||
{{ end }}
|
||||
</ul>
|
||||
</nav>
|
||||
|
||||
28
themes/risotto/layouts/partials/lang.html
Normal file
28
themes/risotto/layouts/partials/lang.html
Normal file
@@ -0,0 +1,28 @@
|
||||
<p>
|
||||
{{ $siteLanguages := .Site.Languages }}
|
||||
{{ $pageLang := .Page.Lang }}
|
||||
|
||||
{{ $currentPage := . }}
|
||||
{{ $pageName := "" }}
|
||||
{{ range .Site.Menus.main }}
|
||||
{{ if eq ($currentPage.Permalink) (.URL | absLangURL) }}
|
||||
{{ $pageName = .Name }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
||||
{{ range .Page.AllTranslations }}
|
||||
{{ $translation := .}}
|
||||
{{ range $siteLanguages }}
|
||||
{{ if eq $translation.Lang .Lang }}
|
||||
{{ $selected := false }}
|
||||
{{ if eq $pageLang .Lang }}
|
||||
<br/><span class="active">$ echo $LANG<br/><b>{{ .LanguageName }}</b></span><br/>
|
||||
|
||||
{{ else }}
|
||||
<br/><a href="{{ $translation.Permalink }}">export LANG={{ .LanguageName }}; ./{{ $pageName }}</a><br/>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
</p>
|
||||
<br /><br />
|
||||
26
themes/risotto/layouts/post/list.html
Normal file
26
themes/risotto/layouts/post/list.html
Normal file
@@ -0,0 +1,26 @@
|
||||
{{ define "main" }}
|
||||
<header class="content__header">
|
||||
<h1>{{ .Title | markdownify }}</h1>
|
||||
{{ .Content }}
|
||||
</header>
|
||||
|
||||
{{ range .Pages }}
|
||||
<article class="post">
|
||||
<header class="post__header">
|
||||
<h1><a href="{{ .Permalink }}">{{ .Title | markdownify }}</a></h1>
|
||||
<p class="post__meta">
|
||||
{{ .Params.author }},
|
||||
<span class="date">{{ .Date.Format "2 January 2006" }}</span>
|
||||
</p>
|
||||
</header>
|
||||
|
||||
<section class="post__summary">
|
||||
{{ .Summary }}
|
||||
</section>
|
||||
</article>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
||||
{{define "aside" }}
|
||||
{{ if .Params.description }}<p>{{ .Params.description }}</p>{{ end }}
|
||||
{{ end }}
|
||||
Reference in New Issue
Block a user