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

20
LICENSE Normal file
View File

@ -0,0 +1,20 @@
The MIT License (MIT)
Copyright (c) 2020 Dmitry Kolosov
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

66
README.md Normal file
View File

@ -0,0 +1,66 @@
# Anubis Theme for Hugo
Anubis is a simple minimalist theme for [Hugo blog engine](https://gohugo.io/).
![Anubis Screenshot](https://raw.githubusercontent.com/mitrichius/hugo-theme-anubis/master/static/images/screenshot.png)
## Features
- Pagination
- Tags
- Archive
## Installation
Inside the folder of your Hugo site run:
$ git submodule add https://github.com/mitrichius/hugo-theme-anubis.git themes/anubis
For more information read the official [setup guide](//gohugo.io/overview/installing/) of Hugo.
## Getting started
After installing the theme successfully it requires a just a few more steps to get your site running.
### Update config file
Example:
```yaml
languageCode: "en-us"
baseUrl = ""
title: "Anubis"
author: ""
theme: "anubis"
paginate: 10
menu:
main:
- identifier: archive
name: Archive
title: Archive
url: /posts/
weight: 0
params:
description: ""
```
### Check your site
In order to see your site in action, run Hugo's built-in local server.
`$ hugo server`
Now enter [`localhost:1313`](http://localhost:1313/) in the address bar of your browser.
## Contributing
If you find a bug or have an idea for a feature, feel free to write an [issue](https://github.com/mitrichius/hugo-theme-anubis/issues).
## TODO
See [issues](https://github.com/mitrichius/hugo-theme-anubis/issues).
## License
MIT
(c) Dmitry Kolosov
2020

6
archetypes/default.md Normal file
View File

@ -0,0 +1,6 @@
---
title: "{{ replace .Name "-" " " | title }}"
date: {{ .Date }}
draft: true
---

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 }}

32
layouts/index.html Normal file
View File

@ -0,0 +1,32 @@
{{ define "main" }}
{{ range .Paginator.Pages }}
<article class="post-list">
<header>
<h1>
<a href="{{ .RelPermalink }}">{{ .Title }}</a>
</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>
{{ .Summary }}
<div class="read-more">
<a href="{{ .RelPermalink }}">Читать дальше</a>
</div>
</article>
{{ end }}
{{ partial "pagination.html" . }}
{{ end }}

View File

@ -0,0 +1,3 @@
<p>© Дмитрий Колосов, 2020<br>
Движок <a target="_blank" href="https://gohugo.io/">Hugo</a>, тема <a target="_blank" href="https://github.com/mitrichius/hugo-theme-anubis">Anubis</a>.
</p>

View File

@ -0,0 +1,41 @@
<!-- Basic stuff -->
<meta charset="utf-8">
<meta name="HandheldFriendly" content="True">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="referrer" content="no-referrer-when-downgrade">
<title>{{ .Title }} - {{ .Site.Title }}</title>
<meta name="description" content="{{ .Site.Params.Description }}">
<link rel="alternate" type="application/rss+xml" title="RSS" href="{{ "/rss/" }}">
<link rel="icon" type="image/x-icon" href="/favicon.ico">
<link rel="apple-touch-icon-precomposed" href="/favicon.png">
<link rel="stylesheet" href="{{ "/css/style.css" | relURL }}" />
<!-- OG Tags: -->
<meta property="og:site_name" content="{{ .Site.Title }}">
<!-- <meta property="og:type" content="article"> -->
<meta property="og:title" content="{{ .Title }}">
<!-- <meta property="og:description" content=""> -->
<!-- <meta property="og:url" content=""> -->
<!-- <meta property="og:image" content=""> -->
<!-- <meta property="og:image:width" content=""> -->
<!-- <meta property="og:image:height" content=""> -->
<!-- Article tags -->
<!-- <meta property="article:published_time" content="">
<meta property="article:modified_time" content="">
<meta property="article:tag" content="">
<meta property="article:publisher" content="https://www.facebook.com/XXX"> -->
<!-- Twitter Cards -->
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:title" content="{{ .Title }}">
<!-- <meta name="twitter:description" content=""> -->
<!-- <meta name="twitter:url" content=""> -->
<!-- <meta name="twitter:image" content=""> -->
<meta name="twitter:site" content="@XXX">

View File

@ -0,0 +1,9 @@
<h1>
<a href="{{ .Site.BaseURL }}">{{ .Site.Title }}</a>
</h1>
<nav>
{{ $currentPage := . }}
{{ range .Site.Menus.main }}
<a class="{{if or ($currentPage.IsMenuCurrent "main" .) ($currentPage.HasMenuCurrent "main" .) }} active{{end}}" href="{{ .URL }}" title="{{ .Title }}">{{ .Name }}</a>
{{ end }}
</nav>

View File

@ -0,0 +1,22 @@
{{ if or ( .Paginator.HasPrev ) ( .Paginator.HasNext ) }}
<div class="pagination">
<div class="left">
{{ if .Paginator.HasPrev }}
{{ if eq .Paginator.PageNumber 2 }}
<a class="pagination-item" href="{{ .Site.BaseURL }}{{ .Site.LanguagePrefix }}">К новым постам</a>
{{ else }}
<a class="pagination-item" href="{{ .Paginator.Prev.URL }}">К новым постам</a>
{{ end }}
{{ else }}
<span class="pagination-item disabled">К новым постам</span>
{{ end }}
</div>
<div class="right">
{{ if .Paginator.HasNext }}
<a class="pagination-item" href="{{ .Paginator.Next.URL }}">К старым постам</a>
{{ else }}
<span class="pagination-item disabled">К старым постам</span>
{{ end }}
</div>
</div>
{{ end }}

28
layouts/taxonomy/tag.html Normal file
View File

@ -0,0 +1,28 @@
{{ define "main" }}
<h1>Tag: {{ .Title }}</h1>
<div class="article-info">
<a href="/tags/">Ко списку всех тегов</a>
</div>
{{ range .Data.Pages }}
<article class="post-list">
<header>
<h1>
<a href="{{ .RelPermalink }}">{{ .Title }}</a>
</h1>
</header>
<div class="article-info">
{{ if .Params.date }}
<div class="article-date">{{ .Params.date.Format "2006-01-02" }}</div>
{{ end }}
</div>
{{ .Summary }}
<div class="read-more">
<a href="{{ .RelPermalink }}">Читать дальше</a>
</div>
</article>
{{ end }}
{{ end }}

253
static/css/style.css Normal file
View File

@ -0,0 +1,253 @@
/* Basic */
@import url('https://fonts.googleapis.com/css?family=Montserrat&display=swap');
html {
font-family: -apple-system, BlinkMacSystemFont, 'Montserrat', 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
/* 1 */
-ms-text-size-adjust: 100%;
/* 2 */
-webkit-text-size-adjust: 100%;
/* 2 */
}
body {
margin: 0;
background: #ffffff;
color: #333;
font-size: 18px;
line-height: 1.5;
-webkit-font-smoothing: antialiased;
}
article,
aside,
details,
figcaption,
figure,
footer,
header,
hgroup,
main,
menu,
nav,
section,
summary {
display: block;
}
.container {
max-width: 42em;
margin: 0 auto;
}
/* Links */
a {
color: #1d60a3;
text-decoration: none;
}
a:active,
a:hover {
outline: 0;
}
a:hover,
a:focus {
color: #a31d1d;
border-bottom: 1px solid rgba(163, 29, 29, .5);
}
a:active {
color: #a31d1d;
opacity: 0.9;
border-bottom: 1px solid rgba(163, 29, 29, .5);
}
/* Styles */
blockquote {
border-left: 2px solid #cccccc;
padding: 0.1em 1em;
margin-left: 0.75em;
}
p {
margin-top: 0.5em;
margin-bottom: 0.5em;
}
hr {
height: 1px;
border: 0;
border-top: 1px solid #cccccc;
}
/* Header */
header {
display: flex;
justify-content: space-between;
}
header h1 {
font-size: 1em;
margin-top: 1em;
margin-bottom: 0;
font-weight: normal;
}
header h2 {
font-size: 1em;
margin: 0;
font-weight: normal;
}
header nav {
margin-top: 1em;
max-width: 100%;
text-align: right;
}
header nav a {
margin-left: 2em;
}
header a {
color: #333;
}
/* Pages */
main h1 {
margin-top: 1em;
margin-bottom: 0 ;
}
.post-short-list:first-of-type {
margin-top: 1em;
}
/* Articles */
article:not(:last-of-type) {
border-bottom: thin solid #f3f3f3;
padding-bottom: 2em;
}
article header h1 {
font-size: 2.1em;
line-height: 1.3em;
margin-bottom: 0;
font-weight: bold;
}
article header h1 a {
border: none;
text-decoration: none;
color: #333;
}
.article-info {
display: inline-block;
font-size: 0.75em;
color: grey;
margin-bottom: 1em;
}
.article-date {
display: inline;
}
.article-tags {
display: inline;
list-style-type: none;
padding: 0;
margin: 0;
}
.article-tags li {
display: inline;
margin-left: 1em;
}
article img {
max-width: 100%;
display: block;
height: auto;
margin: 0 auto .5em;
}
.read-more {
font-size: 0.85em;
text-align: right;
}
.divider {
display: block;
height: 1px;
border: 0;
border-top: thin solid #f3f3f3;;
width: 25%;
margin: 1em auto;
}
/* Other pages */
.terms {
list-style-type: none;
padding: 0;
line-height: 2em;
}
/* Pagination */
.pagination {
display: flex;
justify-content: space-between;
margin-top: 3em;
}
.pagination {
text-align: center;
}
.pagination a, .pagination .disabled {
background: #fafafa;
border: thin solid #f3f3f3;
color: #333333;
padding: 0.75em 0.75em;
}
.pagination .disabled {
visibility: hidden;
}
.pagination a:hover, .pagination a:focus {
color: #a31d1d;
}
/* Footer */
footer {
border-top: thin solid #f3f3f3;;
margin-top: 3em;
font-size: 16px;
}
/* Media Queries */
@media (max-width: 840px) {
.main-wrapper {
margin: 0;
max-width: none;
overflow-x: hidden;
padding-left: 25px;
padding-right: 25px;
}
.container {
max-width: 90%;
margin: 0 auto;
}
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 107 KiB

15
theme.yaml Normal file
View File

@ -0,0 +1,15 @@
name: "Anubis"
license: "MIT"
description: "A minimal Hugo theme"
homepage: "http://dmitrykolosov.ru"
tags:
- blog
- minimal
- simple
- clean
features:
- blog
author:
name: "Dmitry Kolosov"
homepage: "http://dmitrykolosov.ru"