initial commit

This commit is contained in:
Dmitry Kolosov 2020-01-12 09:51:51 +03:00
commit 8ae4ae106c
17 changed files with 623 additions and 0 deletions

View file

@ -0,0 +1,25 @@
<!DOCTYPE html>
<html>
<head>
{{ block "head" . }}
{{ partial "head.html" . }}
{{ end }}
</head>
<body>
<div class="container">
<header>
{{ block "header" . }}
{{ partial "header.html" . }}
{{ end }}
</header>
<main>
{{ block "main" . }}{{ end }}
</main>
<footer>
{{ block "footer" . }}
{{ partial "footer.html" . }}
{{ end }}
</footer>
</div>
</body>
</html>

View file

@ -0,0 +1,29 @@
{{ define "main" }}
<h1>{{ .Title }}</h1>
{{ range (.Site.RegularPages.GroupByPublishDate "2006") }}
{{ range .Pages }}
<div class="post-short-list">
<header>
<h2>
<a href="{{ .RelPermalink }}">{{ .Title }}</a>
</h2>
</header>
<div class="article-info">
{{ if .Params.date }}
<div class="article-date">{{ .Params.date.Format "2006-01-02" }}</div>
{{ end }}
{{ if .Params.tags }}
<ul class="article-tags">
{{ range .Params.tags }}
<li><a href="/tags/{{ . }}">{{ . }}</a></li>
{{ end }}
</ul>
{{ end }}
</div>
</div>
{{ end }}
{{ end }}
{{ end }}

34
layouts/_default/rss.xml Normal file
View file

@ -0,0 +1,34 @@
{{- $pctx := . -}}
{{- if .IsHome -}}{{ $pctx = .Site }}{{- end -}}
{{- $pages := $pctx.RegularPages -}}
{{- $limit := .Site.Config.Services.RSS.Limit -}}
{{- if ge $limit 1 -}}
{{- $pages = $pages | first $limit -}}
{{- end -}}
{{- printf "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"yes\"?>" | safeHTML }}
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
<title>{{ if eq .Title .Site.Title }}{{ .Site.Title }}{{ else }}{{ with .Title }}{{.}} on {{ end }}{{ .Site.Title }}{{ end }}</title>
<link>{{ .Permalink }}</link>
<description>{{ .Site.Title }}{{ if ne .Title .Site.Title }}{{ with .Title }} ({{.}}){{ end }}{{ end }}</description>
<generator>Hugo -- gohugo.io</generator>{{ with .Site.LanguageCode }}
<language>{{.}}</language>{{end}}{{ with .Site.Author.email }}
<managingEditor>{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}</managingEditor>{{end}}{{ with .Site.Author.email }}
<webMaster>{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}</webMaster>{{end}}{{ with .Site.Copyright }}
<copyright>{{.}}</copyright>{{end}}{{ if not .Date.IsZero }}
<lastBuildDate>{{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</lastBuildDate>{{ end }}
{{ with .OutputFormats.Get "RSS" }}
{{ printf "<atom:link href=%q rel=\"self\" type=%q />" .Permalink .MediaType | safeHTML }}
{{ end }}
{{ range $pages }}
<item>
<title>{{ .Title }}</title>
<link>{{ .Permalink }}</link>
<pubDate>{{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</pubDate>
{{ with .Site.Author.email }}<author>{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}</author>{{end}}
<guid>{{ .Permalink }}</guid>
<description>{{ .Content | html }}</description>
</item>
{{ end }}
</channel>
</rss>

View file

@ -0,0 +1,24 @@
{{ define "main" }}
<article class="post">
<header>
<h1>{{ .Title }}</h1>
</header>
<div class="article-info">
{{ if .Params.date }}
<div class="article-date">{{ .Params.date.Format "2006-01-02" }}</div>
{{ end }}
{{ if .Params.tags }}
<ul class="article-tags">
{{ range .Params.tags }}
<li><a href="/tags/{{ . }}">{{ . }}</a></li>
{{ end }}
</ul>
{{ end }}
</div>
{{ .Content }}
</article>
{{ end }}

View file

@ -0,0 +1,16 @@
{{ define "main" }}
<h1>{{ .Title }}</h1>
<ul class="terms">
{{ range $key, $value := .Data.Terms }}
<li>
<a href="{{ (print "/" $.Data.Plural "/" (lower $key)) | relURL }}">
{{ $key }}
</a>
({{ len $value }})
</li>
{{ end }}
</ul>
{{ end }}