Compare commits

..

10 Commits

Author SHA1 Message Date
Bel LaPointe
ce8826af1c reorder todo 2021-11-30 06:35:01 -07:00
Bel LaPointe
b9e23914b4 upd8 2021-11-29 16:14:14 -07:00
Bel LaPointe
51b4059be9 remove downloaded 2021-11-29 16:12:12 -07:00
Bel LaPointe
0941ebd41d more themes 2021-11-29 16:02:16 -07:00
Bel LaPointe
1b2d58c619 include partials if they exist given theme 2021-11-29 15:53:54 -07:00
Bel LaPointe
6efca3bc62 script to fix anubis 2021-11-29 15:25:43 -07:00
Bel LaPointe
7ee21a8e3f tood 2021-11-29 15:12:17 -07:00
Bel LaPointe
f5b1f9728a mvp 2021-11-29 15:11:49 -07:00
Bel LaPointe
f00003c93a extract converting zip to post 2021-11-29 15:03:20 -07:00
Bel LaPointe
d1c5d8a67c ooo 2021-11-29 14:51:22 -07:00
51 changed files with 192 additions and 212 deletions

13
TODO.md
View File

@@ -2,11 +2,12 @@
* https://stiobhart.net/2017-02-24-isso-comments/
* http://comment-hugo.scratch.com/web/
* http://hugo.scratch.com/posts/
* webserver @netlify w/ scripted setup+release
* comments hosted @anywhere via cloudflare
* convert to work with other themes
* yaml special google doc for title, author, etc
* about me and more special pages
* hugo:posts/
* hugo:meta/{configuration,about}
* yaml special google doc for title, author, etc
* about me and more special pages
* convert to work with other themes
* webserver @netlify w/ scripted setup+release
* comments hosted @anywhere via cloudflare routing
* domain for julie

1
blog/content/about Symbolic link
View File

@@ -0,0 +1 @@
../../meta/about/

View File

@@ -1 +0,0 @@
../../meta/about.md

View File

@@ -11,13 +11,17 @@
<header class="post-header">
<h1 class="p-name post-title{{ if .Params.favorite }} favorite{{end}}{{ if .Params.draft }} draft{{end}}">{{ trim .Title " " }}</h1>
{{ if templates.Exists "partials/theme-switcher.html" }}
{{ partial "post-language-switcher.html" . }}
{{ end }}
</header>
{{ partial "post-toc.html" . }}
<div class="content e-content">
{{ .Content }}
</div>
{{ if templates.Exists "partials/post-info.html" }}
{{ partial "post-info.html" . }}
{{ end }}
</article>
{{ if and (.Site.Params.paginationSinglePost) (ne .Type "page") }}

View File

@@ -24,8 +24,12 @@
</p>
</div>
{{ if templates.Exists "partials/theme-switcher.html" }}
{{ partial "theme-switcher.html" . }}
{{ end }}
</div>
{{ if templates.Exists "partials/h-card.html" }}
{{ partial "h-card.html" . }}
{{ end }}
</footer>

5
blog/themes/anubis.sh Normal file
View File

@@ -0,0 +1,5 @@
#! /bin/bash
sed -i 's/href="{{ (print /href="\/{{ (print /' ./anubis/layouts/_default/terms.html
sed -i 's/href="{{ "categories/href="{{ "\/categories/' ./anubis/layouts/partials/post-info.html
sed -i 's/href="{{ "tags/href="{{ "\/tags/' ./anubis/layouts/partials/post-info.html

View File

@@ -1,7 +1,9 @@
# Anubis Theme for Hugo [![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)](https://opensource.org/licenses/MIT) [![Donate](https://img.shields.io/badge/Donate-PayPal-blue.svg)](https://www.paypal.com/paypalme/mitrichius/1)
# Anubis Theme for Hugo [![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)](https://opensource.org/licenses/MIT) [![Netlify Status](https://api.netlify.com/api/v1/badges/7d9ea909-ad7e-4e47-b7c9-eefb7522d8c6/deploy-status)](https://app.netlify.com/sites/hugo-theme-anubis/deploys) [![Donate](https://img.shields.io/badge/Donate-PayPal-blue.svg)](https://www.paypal.com/paypalme/mitrichius/1)
Anubis is a simple minimalist theme for [Hugo blog engine](https://gohugo.io/).
[Demo](https://hugo-theme-anubis.netlify.app/)
![Anubis Screenshot](https://raw.githubusercontent.com/mitrichius/hugo-theme-anubis/master/images/screenshot.png)
## Features
@@ -119,7 +121,7 @@ Options:
- `auto-without-switcher` - theme based on user system settings, without switcher, JS-free
- `light` - light theme by default, can be switched by user to dark theme and back. Theme settings are saved for user
- `dark` - dark theme by default, can be switched by user to light theme and back. Theme settings are saved for user
- `auto` - theme based on user system settings by default, can be switched by user to dark/light theme. Theme settings are saved for user
- `auto` - theme based on user system settings by default, can be switched by user to dark/light theme. Theme settings are saved for user (by default in example sites)
### Social icons
#### Predefined icons
@@ -167,9 +169,7 @@ Icon should be "static/fa-icons/google.svg"
If you want font awesome icons, download "Font Awesome For Desktop" and open svg directory.
### Google Analytics
Only works for production environment. You either build your site with variable like
`HUGO_ENV=production hugo --minify`
or just put `env: production` to `params` section of config.
Only works for production environment.
### Multilingual mode
Check config/example usage in [exampleSiteMultilingual](https://github.com/Mitrichius/hugo-theme-anubis/tree/master/exampleSiteMultilingual) directory and documentation on [Hugo site](https://gohugo.io/content-management/multilingual/).

View File

@@ -143,8 +143,6 @@ th, td {
/* Code */
pre {
color: var(--pre-color);
background-color: var(--pre-bg-color);
padding: 1em;
max-width: 100%;
overflow: auto;
@@ -153,6 +151,8 @@ pre {
code,
pre,
kbd {
color: var(--pre-color);
background-color: var(--pre-bg-color);
font-family: monospace;
font-size: 0.90em;
line-height: 154%;
@@ -298,6 +298,10 @@ main h1 {
color: var(--link-state-color);
}
.post-short-list .post-title {
display: inline;
}
.post-title.favorite::after {
content: "☆";
display: inline-block;

View File

@@ -15,7 +15,7 @@ author = "Dmitry Kolosov"
description = "Anubis is a simple minimalist theme for Hugo blog engine."
dateFormat = "2006-01-02"
paginationSinglePost = true
style = "light-without-switcher"
style = "auto"
readMore = false
# utteranc.es support

View File

@@ -23,7 +23,7 @@ Hugo ships with several [Built-in Shortcodes](https://gohugo.io/content-manageme
## Twitter Simple Shortcode
{{< twitter_simple 1085870671291310081 >}}
{{< tweet user="DesignReviewed" id="1085870671291310081" >}}
<br>

View File

@@ -16,7 +16,7 @@ author = "Dmitry Kolosov"
description = "Anubis is a simple minimalist theme for Hugo blog engine."
dateFormat = "2006-01-02"
paginationSinglePost = true
style = "light-without-switcher"
style = "auto"
readMore = false
# utteranc.es support

View File

@@ -23,7 +23,7 @@ Hugo ships with several [Built-in Shortcodes](https://gohugo.io/content-manageme
## Twitter Simple Shortcode
{{< twitter_simple 1085870671291310081 >}}
{{< tweet user="DesignReviewed" id="1085870671291310081" >}}
<br>

View File

@@ -23,7 +23,7 @@ Hugo ships with several [Built-in Shortcodes](https://gohugo.io/content-manageme
## Twitter Simple Shortcode
{{< twitter_simple 1085870671291310081 >}}
{{< tweet user="DesignReviewed" id="1085870671291310081" >}}
<br>

View File

@@ -24,7 +24,7 @@
{{ end }}
{{ if .Site.DisqusShortname }}
{{ template "_internal/disqus.html" . }}
{{ partial "disqus.html" . }}
{{ end }}
{{ if .Site.Params.UtterancesRepo }}

View File

@@ -1,7 +1,7 @@
{{ define "main" }}
<h1>{{ i18n .Data.Singular | humanize }}: {{ .Title }}</h1>
<div class="post-info">
<a href="{{ (printf "%s/%s" .Site.LanguagePrefix .Data.Plural) | absLangURL }}">{{ i18n (printf "toAll%s" (.Data.Plural | humanize )) | humanize }}</a>
<a href="{{ (print .Data.Plural "/") | relLangURL }}">{{ i18n (printf "toAll%s" (.Data.Plural | humanize )) | humanize }}</a>
</div>
{{ range .Paginator.Pages }}
{{ partial "post-summary.html" . }}

View File

@@ -0,0 +1 @@
{{ template "_internal/disqus.html" . }}

View File

Before

Width:  |  Height:  |  Size: 754 B

After

Width:  |  Height:  |  Size: 754 B

View File

Before

Width:  |  Height:  |  Size: 524 B

After

Width:  |  Height:  |  Size: 524 B

View File

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

View File

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

View File

Before

Width:  |  Height:  |  Size: 684 B

After

Width:  |  Height:  |  Size: 684 B

View File

Before

Width:  |  Height:  |  Size: 417 B

After

Width:  |  Height:  |  Size: 417 B

View File

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

View File

Before

Width:  |  Height:  |  Size: 2.3 KiB

After

Width:  |  Height:  |  Size: 2.3 KiB

View File

Before

Width:  |  Height:  |  Size: 1.0 KiB

After

Width:  |  Height:  |  Size: 1.0 KiB

View File

Before

Width:  |  Height:  |  Size: 556 B

After

Width:  |  Height:  |  Size: 556 B

View File

Before

Width:  |  Height:  |  Size: 460 B

After

Width:  |  Height:  |  Size: 460 B

View File

Before

Width:  |  Height:  |  Size: 1.0 KiB

After

Width:  |  Height:  |  Size: 1.0 KiB

View File

Before

Width:  |  Height:  |  Size: 869 B

After

Width:  |  Height:  |  Size: 869 B

View File

Before

Width:  |  Height:  |  Size: 730 B

After

Width:  |  Height:  |  Size: 730 B

View File

@@ -0,0 +1,2 @@
<link rel="icon" type="image/x-icon" href="{{ "favicon.ico" | absURL }}">
<link rel="apple-touch-icon-precomposed" href="{{ "favicon.png" | absURL }}">

View File

@@ -3,13 +3,13 @@
{{ $dict := newScratch }}
{{ if (eq .custom true) }}
{{ $dict.Set "filename" (print "static/fa-icons/" .iconName ".svg") }}
{{ $dict.Set "svg" (readFile (print "static/fa-icons/" .iconName ".svg")) }}
{{ else }}
{{ $dict.Set "filename" (print "themes/anubis/static/fa-icons/" .iconName ".svg") }}
{{ $dict.Set "svg" (partial (print "fa-icons/" .iconName ".svg")) }}
{{ end }}
{{- $path:="<path" -}}
{{- $fill:="<path fill=\"currentColor\"" -}}
{{ replace (readFile ($dict.Get "filename")) $path $fill | safeHTML }}
{{ replace ($dict.Get "svg") $path $fill | safeHTML }}
</span>

View File

@@ -4,16 +4,14 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="referrer" content="no-referrer-when-downgrade">
<title>{{ if and (.Title) (not .IsHome) }}{{ .Title }} - {{ end }}{{ .Site.Title }}</title>
<meta name="description" content="{{ .Site.Params.Description }}">
{{ partial "title.html" . }}
<meta name="description" content="{{ with .Description }}{{ . }}{{ else }}{{if .IsPage}}{{ .Summary }}{{ else }}{{ with .Site.Params.description }}{{ . }}{{ end }}{{ end }}{{ end -}}">
{{ with .OutputFormats.Get "rss" -}}
{{ printf `<link rel="%s" type="%s" href="%s" title="%s" />` .Rel .MediaType.Type .Permalink $.Site.Title | safeHTML }}
{{ end -}}
<link rel="icon" type="image/x-icon" href="{{ "favicon.ico" | absURL }}">
<link rel="apple-touch-icon-precomposed" href="{{ "favicon.png" | absURL }}">
{{ partial "favicons.html" . }}
{{ partial "resource.html" (dict "context" . "type" "css" "filename" "css/main.css") }}
{{ range .Site.Params.customJS -}}
@@ -41,7 +39,7 @@
<meta property="article:tag" content="">
<meta property="article:publisher" content="https://www.facebook.com/XXX"> -->
{{ if and (.Site.GoogleAnalytics) (or (eq (getenv "HUGO_ENV") "production") (eq .Site.Params.env "production")) }}
{{ if and (.Site.GoogleAnalytics) (hugo.IsProduction) }}
{{ template "_internal/google_analytics.html" . }}
{{ end }}

View File

@@ -1,5 +1,15 @@
<ul class="language-select">
{{ range $.Site.Home.AllTranslations }}
{{ $pageLang := .Page.Lang}}
{{ $translations := .AllTranslations }}
{{ if not .IsTranslated }}
{{ $translations = $.Site.Home.AllTranslations }}
{{ end }}
{{ range $translations }}
{{ if eq .Lang $pageLang }}
<li>{{ .Language.LanguageName }}</li>
{{ else }}
<li><a href="{{ .Permalink }}">{{ .Language.LanguageName }}</a></li>
{{ end }}
{{ end }}
</ul>

View File

@@ -4,12 +4,12 @@
<div class="pagination">
<div class="left pagination-item {{ if not .Paginator.HasPrev }}disabled{{ end }}">
{{ if .Paginator.HasPrev }}
<a href="{{ .Paginator.Prev.URL | relLangURL }}">{{ $toNewPostsMessage }}</a>
<a href="{{ .Paginator.Prev.URL }}">{{ $toNewPostsMessage }}</a>
{{ end }}
</div>
<div class="right pagination-item {{ if not .Paginator.HasNext }}disabled{{ end }}">
{{ if .Paginator.HasNext }}
<a href="{{ .Paginator.Next.URL | relLangURL }}">{{ $toOldPostsMessage }}</a>
<a href="{{ .Paginator.Next.URL }}">{{ $toOldPostsMessage }}</a>
{{ end }}
</div>
</div>

View File

@@ -16,7 +16,7 @@
{{ if .Params.categories }}
<ul class="post-categories">
{{ range .Params.categories }}
<li><a href="{{ "/categories/" | urlize | absLangURL }}">{{ . }}</a></li>
<li><a href="{{ "/categories/" | absLangURL }}{{ . | urlize }}">{{ . }}</a></li>
{{ end }}
</ul>
{{ end }}

View File

@@ -2,12 +2,12 @@
<div class="pagination post-pagination">
<div class="left pagination-item {{ if not .NextInSection }}disabled{{ end }}">
{{ if .NextInSection }}
<a href="{{ .NextInSection.Permalink | relLangURL }}">{{ .NextInSection.Title }}</a>
<a href="{{ .NextInSection.RelPermalink }}">{{ .NextInSection.Title }}</a>
{{ end }}
</div>
<div class="right pagination-item {{ if not .PrevInSection }}disabled{{ end }}">
{{ if .PrevInSection }}
<a href="{{ .PrevInSection.Permalink | relLangURL }}">{{ .PrevInSection.Title }}</a>
<a href="{{ .PrevInSection.RelPermalink }}">{{ .PrevInSection.Title }}</a>
{{ end }}
</div>
</div>

View File

@@ -9,7 +9,7 @@
{{ if $resource }}
{{ $resource := $resource | resources.ExecuteAsTemplate $targetFilename . }}
{{ if eq (getenv "HUGO_ENV") "production" | or (eq .Site.Params.env "production") }}
{{ if hugo.IsProduction }}
{{ $resource = $resource | resources.Minify }}
{{ end }}
{{ $resource = $resource | resources.Fingerprint "sha256" }}

View File

@@ -0,0 +1 @@
<title>{{ if and (.Title) (not .IsHome) }}{{ .Title }} - {{ end }}{{ .Site.Title }}</title>

View File

@@ -1,6 +1,6 @@
User-agent: *
# robotstxt.org - if ENV production variable is false robots will be disallowed.
{{ if eq (getenv "HUGO_ENV") "production" | or (eq .Site.Params.env "production") }}
# robotstxt.org - if environment is not `production` then robots will be disallowed.
{{ if hugo.IsProduction }}
Disallow:
{{ else }}
Disallow: /

View File

@@ -0,0 +1,15 @@
[build]
publish = "exampleSiteMultilingual/public"
command = "cd exampleSiteMultilingual && hugo --themesDir=../.. --baseURL $URL"
[build.environment]
HUGO_VERSION = "0.89.0"
HUGO_THEME = "repo"
[context.deploy-preview]
command = "cd exampleSiteMultilingual && hugo --themesDir=../.. --buildFuture --buildDrafts --baseURL $DEPLOY_PRIME_URL"
[[headers]]
for = "/*"
[headers.values]
Access-Control-Allow-Origin = "*"

View File

@@ -1 +0,0 @@
<html><head><meta content="text/html; charset=UTF-8" http-equiv="content-type"><style type="text/css">ol{margin:0;padding:0}table td,table th{padding:0}.c1{color:#000000;font-weight:400;text-decoration:none;vertical-align:baseline;font-size:11pt;font-family:"Arial";font-style:normal}.c0{padding-top:0pt;padding-bottom:0pt;line-height:1.15;orphans:2;widows:2;text-align:left}.c2{background-color:#ffffff;max-width:468pt;padding:72pt 72pt 72pt 72pt}.title{padding-top:0pt;color:#000000;font-size:26pt;padding-bottom:3pt;font-family:"Arial";line-height:1.15;page-break-after:avoid;orphans:2;widows:2;text-align:left}.subtitle{padding-top:0pt;color:#666666;font-size:15pt;padding-bottom:16pt;font-family:"Arial";line-height:1.15;page-break-after:avoid;orphans:2;widows:2;text-align:left}li{color:#000000;font-size:11pt;font-family:"Arial"}p{margin:0;color:#000000;font-size:11pt;font-family:"Arial"}h1{padding-top:20pt;color:#000000;font-size:20pt;padding-bottom:6pt;font-family:"Arial";line-height:1.15;page-break-after:avoid;orphans:2;widows:2;text-align:left}h2{padding-top:18pt;color:#000000;font-size:16pt;padding-bottom:6pt;font-family:"Arial";line-height:1.15;page-break-after:avoid;orphans:2;widows:2;text-align:left}h3{padding-top:16pt;color:#434343;font-size:14pt;padding-bottom:4pt;font-family:"Arial";line-height:1.15;page-break-after:avoid;orphans:2;widows:2;text-align:left}h4{padding-top:14pt;color:#666666;font-size:12pt;padding-bottom:4pt;font-family:"Arial";line-height:1.15;page-break-after:avoid;orphans:2;widows:2;text-align:left}h5{padding-top:12pt;color:#666666;font-size:11pt;padding-bottom:4pt;font-family:"Arial";line-height:1.15;page-break-after:avoid;orphans:2;widows:2;text-align:left}h6{padding-top:12pt;color:#666666;font-size:11pt;padding-bottom:4pt;font-family:"Arial";line-height:1.15;page-break-after:avoid;font-style:italic;orphans:2;widows:2;text-align:left}</style></head><body class="c2"><p class="c0"><span class="c1">Welcome :)</span></p></body></html>

View File

@@ -1 +0,0 @@
<html><head><meta content="text/html; charset=UTF-8" http-equiv="content-type"><style type="text/css">ol{margin:0;padding:0}table td,table th{padding:0}.c1{color:#000000;font-weight:400;text-decoration:none;vertical-align:baseline;font-size:11pt;font-family:"Arial";font-style:normal}.c0{padding-top:0pt;padding-bottom:0pt;line-height:1.15;orphans:2;widows:2;text-align:left}.c2{background-color:#ffffff;max-width:468pt;padding:72pt 72pt 72pt 72pt}.title{padding-top:0pt;color:#000000;font-size:26pt;padding-bottom:3pt;font-family:"Arial";line-height:1.15;page-break-after:avoid;orphans:2;widows:2;text-align:left}.subtitle{padding-top:0pt;color:#666666;font-size:15pt;padding-bottom:16pt;font-family:"Arial";line-height:1.15;page-break-after:avoid;orphans:2;widows:2;text-align:left}li{color:#000000;font-size:11pt;font-family:"Arial"}p{margin:0;color:#000000;font-size:11pt;font-family:"Arial"}h1{padding-top:20pt;color:#000000;font-size:20pt;padding-bottom:6pt;font-family:"Arial";line-height:1.15;page-break-after:avoid;orphans:2;widows:2;text-align:left}h2{padding-top:18pt;color:#000000;font-size:16pt;padding-bottom:6pt;font-family:"Arial";line-height:1.15;page-break-after:avoid;orphans:2;widows:2;text-align:left}h3{padding-top:16pt;color:#434343;font-size:14pt;padding-bottom:4pt;font-family:"Arial";line-height:1.15;page-break-after:avoid;orphans:2;widows:2;text-align:left}h4{padding-top:14pt;color:#666666;font-size:12pt;padding-bottom:4pt;font-family:"Arial";line-height:1.15;page-break-after:avoid;orphans:2;widows:2;text-align:left}h5{padding-top:12pt;color:#666666;font-size:11pt;padding-bottom:4pt;font-family:"Arial";line-height:1.15;page-break-after:avoid;orphans:2;widows:2;text-align:left}h6{padding-top:12pt;color:#666666;font-size:11pt;padding-bottom:4pt;font-family:"Arial";line-height:1.15;page-break-after:avoid;font-style:italic;orphans:2;widows:2;text-align:left}</style></head><body class="c2"><p class="c0"><span class="c1">Welcome :)</span></p></body></html>

View File

@@ -1,8 +0,0 @@
title: the title of my blog
theme: anubis
params:
author: bel
email: bel@bel.bel
social:
- id: email
name: bel@bel.bel

View File

@@ -1 +0,0 @@
<html><head><meta content="text/html; charset=UTF-8" http-equiv="content-type"><style type="text/css">ol{margin:0;padding:0}table td,table th{padding:0}.c0{color:#000000;font-weight:400;text-decoration:none;vertical-align:baseline;font-size:11pt;font-family:"Arial";font-style:normal}.c1{padding-top:0pt;padding-bottom:0pt;line-height:1.15;orphans:2;widows:2;text-align:left}.c2{background-color:#ffffff;max-width:468pt;padding:72pt 72pt 72pt 72pt}.title{padding-top:0pt;color:#000000;font-size:26pt;padding-bottom:3pt;font-family:"Arial";line-height:1.15;page-break-after:avoid;orphans:2;widows:2;text-align:left}.subtitle{padding-top:0pt;color:#666666;font-size:15pt;padding-bottom:16pt;font-family:"Arial";line-height:1.15;page-break-after:avoid;orphans:2;widows:2;text-align:left}li{color:#000000;font-size:11pt;font-family:"Arial"}p{margin:0;color:#000000;font-size:11pt;font-family:"Arial"}h1{padding-top:20pt;color:#000000;font-size:20pt;padding-bottom:6pt;font-family:"Arial";line-height:1.15;page-break-after:avoid;orphans:2;widows:2;text-align:left}h2{padding-top:18pt;color:#000000;font-size:16pt;padding-bottom:6pt;font-family:"Arial";line-height:1.15;page-break-after:avoid;orphans:2;widows:2;text-align:left}h3{padding-top:16pt;color:#434343;font-size:14pt;padding-bottom:4pt;font-family:"Arial";line-height:1.15;page-break-after:avoid;orphans:2;widows:2;text-align:left}h4{padding-top:14pt;color:#666666;font-size:12pt;padding-bottom:4pt;font-family:"Arial";line-height:1.15;page-break-after:avoid;orphans:2;widows:2;text-align:left}h5{padding-top:12pt;color:#666666;font-size:11pt;padding-bottom:4pt;font-family:"Arial";line-height:1.15;page-break-after:avoid;orphans:2;widows:2;text-align:left}h6{padding-top:12pt;color:#666666;font-size:11pt;padding-bottom:4pt;font-family:"Arial";line-height:1.15;page-break-after:avoid;font-style:italic;orphans:2;widows:2;text-align:left}</style></head><body class="c2"><p class="c1"><span class="c0">title: the title of my blog</span></p><p class="c1"><span class="c0">theme: anubis</span></p><p class="c1"><span class="c0">params:</span></p><p class="c1"><span class="c0">&nbsp; author: bel</span></p><p class="c1"><span class="c0">&nbsp; email: bel@bel.bel</span></p><p class="c1"><span class="c0">&nbsp; social:</span></p><p class="c1"><span class="c0">&nbsp; - id: email</span></p><p class="c1"><span class="c0">&nbsp; &nbsp; name: bel@bel.bel</span></p></body></html>

View File

@@ -1,31 +0,0 @@
---
title: "About"
description: "Hugo, the worlds fastest framework for building websites"
date: "2019-02-28"
aliases:
- "about-us"
- "about-hugo"
- "contact"
author: "Hugo Authors"
---
Written in Go, Hugo is an open source static site generator available under the [Apache Licence 2.0.](https://github.com/gohugoio/hugo/blob/master/LICENSE) Hugo supports TOML, YAML and JSON data file types, Markdown and HTML content files and uses shortcodes to add rich content. Other notable features are taxonomies, multilingual mode, image processing, custom output formats, HTML/CSS/JS minification and support for Sass SCSS workflows.
Hugo makes use of a variety of open source projects including:
* https://github.com/yuin/goldmark
* https://github.com/alecthomas/chroma
* https://github.com/muesli/smartcrop
* https://github.com/spf13/cobra
* https://github.com/spf13/viper
Hugo is ideal for blogs, corporate websites, creative portfolios, online magazines, single page applications or even a website with thousands of pages.
Hugo is for people who want to hand code their own website without worrying about setting up complicated runtimes, dependencies and databases.
Websites built with Hugo are extremelly fast, secure and can be deployed anywhere including, AWS, GitHub Pages, Heroku, Netlify and any other hosting provider.
Learn more and contribute on [GitHub](https://github.com/gohugoio).

View File

@@ -1,76 +0,0 @@
baseURL: ''
languageCode: 'en-us'
title: 'Site Title'
theme: "anubis"
paginate: 5
paginatePath: "posts/-/pages"
enableRobotsTXT: true
disableLiveReload: true
minify: true
noHTTPCache: true
disableFastRender: true
rssLimit: 5
canonifyurls: true
relativeurls: false
params:
toc: true
author: "me"
email: ""
avatar: ""
description: ""
#customJS: [ "js/main.js" ] # relative to ./assets/
dateFormat: "2006-01-02"
paginationSinglePost: false
style: light
#style: auto-without-switcher
#style: light-without-switcher
readMore: true
disableSummary: false
social:
- id: email
name: contact
#- id: linkedin
# name: lapoba16
#- id: rss
# name: rss
# url: '/index.xml'
menu:
main:
- identifier: archive
name: Archive
title: Archive
url: /posts/
weight: 0
- identifier: about
name: About
title: About
url: /about/
weight: 1
markup:
defaultMarkdownHandler: goldmark
goldmark:
extensions:
linkify: true
strikethrough: true
table: true
taskList: true
parser:
autoHeadingID: true
autoHeadingIDType: github
renderer:
unsafe: true # raw HTML OK
highlight:
anchorLineNos: true
guessSyntax: true
lineNos: true
tabWidth: 3
tableOfContents:
endLevel: 3
ordered: false
startLevel: 2
permalinks:
posts: /posts/:year-:month-:day-:filename

123
posts.sh
View File

@@ -11,7 +11,7 @@ TMPDIR="${TMPDIR:-"/tmp"}"
main() {
flags "$@"
#posts
posts
meta
}
@@ -66,33 +66,7 @@ posts() (
mkdir -p "$extracted_dir"
7z x -o"$extracted_dir" "$pulled_file"
cat "$extracted_dir"/*.html | html_only_body > "$index_html"
local tags=($(cat "$index_html" | html_to_plaintext | grep -o '#[a-zA-Z0-9]*' | grep '[a-zA-Z]' | sed 's/^#//' | sort -u))
local tags_csv="$(first=false; for tag in "${tags[@]}"; do true; if $first; then echo -n ", "; fi; first=true; echo -n "$tag"; done)"
printf '
---
title: "%s"
date: %s
draft: false
tags: [%s]
---
' \
"$(basename "$pulled_file" | sed 's/.zip$//' | sed 's/"/\\"/g')" \
"$u_date_iso" \
"$tags_csv" \
| sed 's/^[ ]*//' \
| grep . \
> "$index_md"
cat "$index_html" >> "$index_md"
echo "" >> "$index_md"
rm "$index_html" "$extracted_dir"/*.html
for ext in png jpg jpeg gif JPG; do find "$extracted_dir" -name "*.$ext"; done | while read -r line; do
convert "$line" -ordered-dither o8x8,8,8,4 "$line.2"
mv "$line.2" "$line"
done
extracted_zip_to_post "$(echo "$1" | jq -r .Name | sed 's/.zip$//')" "$extracted_dir" "$u_date_iso"
}
imported() {
@@ -161,11 +135,11 @@ meta() {
}
meta_file() {
echo "$TMPDIR/.meta.$(echo "$1" | jq -r .Name)"
echo "./meta/.overrides/$(echo "$1" | jq -r .Name)/.meta"
}
up_to_date() {
test -f "$(meta_file "$1")" && test "$1" == "$(cat "$(meta_file "$1")")"
test -f "$(meta_file "$1")" && test "$1" == "$(cat "$(meta_file "$1")")" && test -e "$(must "$1")"
}
extracted_dir() {
@@ -176,6 +150,10 @@ meta() {
echo "./meta/.overrides/$(echo "$1" | jq -r .Name | sed 's/.zip$//')"
}
must() {
echo "./meta/$(basename "$(extracted "$1")")"
}
extract() {
local extracted_dir="$(extracted_dir "$1")"
rm -rf "$extracted_dir" "${extracted_dir%.zip}"
@@ -186,8 +164,7 @@ meta() {
cp "$extracted_file" "$(extracted "$1")"
extracted_file="$(extracted "$1")"
else
mv "$extracted_file" "$(dirname "$extracted_file")"/index.md
mv "$extracted_dir" "$(extracted "$1")"
cp -r "$extracted_dir" "$(extracted "$1")"
fi
local extracted="$(extracted "$1")"
case "${extracted##*.}" in
@@ -197,6 +174,45 @@ meta() {
cat "$extracted" | html_to_plaintext > "$extracted.2"; mv "$extracted.2" "$extracted"
}
merge() {
local extracted="$(extracted "$1")"
case "${extracted##*.}" in
yaml ) merge_yaml "$1" ;;
* )
esac
}
merge_yaml() {
local override="$(extracted "$1")"
local default="$(echo "$override" | sed 's/\.overrides/\.default/')"
if [ ! -f "$default" ]; then
return
fi
cat "$override" | yq -j eval - | jq > "$override.json"
cat "$default" | yq -j eval - | jq > "$default.json"
jq -s '.[0] * .[1]' "$default.json" "$override.json" | yq -P eval - > ./meta/"$(basename "$override")"
rm "$override.json" "$default.json"
}
import() {
local must="$(must "$1")"
if [ -e "$must" ]; then
rm -rf "$must"
fi
log "import: merging $1"
merge "$1"
log "must=$must"
if [ -e "$must" ]; then
return
fi
log "must not created by merge, continuing"
cp -r "${must%/*}/.overrides/${must##*/}" "$must"
local title="$(echo "$1" | jq -r .Name | sed 's/.zip$//')"
local u_date_iso="$(echo "$1" | jq -r .ModTime)"
log "extracting zip to post: title=$title, must=$must, date=$u_date_iso"
extracted_zip_to_post "$title" "$must" "$u_date_iso"
}
for b64_json in $(list); do
local json="$(echo "$b64_json" | base64 --decode | jq .)"
local filename="$(echo "$json" | jq -r .Name)"
@@ -208,10 +224,10 @@ meta() {
pull "$json"
log "$filename: extracting"
extract "$json"
merge "$json"
# todo: echo "$json" > "$(meta_file $json)"
log "$filename: importing"
import "$json"
echo "$json" > "$(meta_file "$json")"
done
false
}
fatal() {
@@ -268,6 +284,43 @@ html_only_body() {
| sed 's/<\/body>.*/<\/body>/'
}
extracted_zip_to_post() {
local title="$1"
local extracted_zip="$2"
local u_date_iso="$3"
local index_md="$extracted_zip/index.md"
local index_html="$extracted_zip/.index.html"
cat "$extracted_zip"/*.html | html_only_body > "$index_html"
local tags=($(cat "$index_html" | html_to_plaintext | grep -o '#[a-zA-Z0-9]*' | grep '[a-zA-Z]' | sed 's/^#//' | sort -u))
local tags_csv="$(first=false; for tag in "${tags[@]}"; do true; if $first; then echo -n ", "; fi; first=true; echo -n "$tag"; done)"
printf '
---
title: "%s"
date: %s
draft: false
tags: [%s]
---
' \
"$(echo "$title" | sed 's/"/\\"/g')" \
"$u_date_iso" \
"$tags_csv" \
| sed 's/^[ ]*//' \
| grep . \
> "$index_md"
cat "$index_html" >> "$index_md"
echo "" >> "$index_md"
rm -f "$index_html" "$extracted_zip"/*.html
for ext in png jpg jpeg gif JPG; do find "$extracted_zip" -name "*.$ext"; done | while read -r line; do
convert "$line" -ordered-dither o8x8,8,8,4 "$line.2"
mv "$line.2" "$line"
done
}
if [ "$0" == "$BASH_SOURCE" ]; then
main "$@"
fi

View File

@@ -6,5 +6,5 @@ scope = drive
#team_drive = 1-p043gwMk88rj4-Sm5otARi_AJZYskbj
#root_folder_id = 1-p043gwMk88rj4-Sm5otARi_AJZYskbj
formats = zip,html,rtf,odt,docx,xlsx,pptx,svg
token = {"access_token":"ya29.a0ARrdaM-P6wKzub3feWIaQlG3YXq2REc0rfS1LDxfeV1m1rr5Zwhe_XqYTInCEcCHP4bHNPvcBcZufAnJpgLZlVBte-abfEOvwfk4Qz25__FboaddAXthlv_EeIxPwVTlKJTy7MOKGLz2Rhg47CjjagfFYMcCKw","token_type":"Bearer","refresh_token":"1//04sQD4800FsqyCgYIARAAGAQSNwF-L9IrB1_7BV8ScFnqmIz8FNWgXfr80--6VG6KX1pTnneQKAz6Ss3YtxqmCdf2tRBy2ndkhek","expiry":"2021-11-29T14:49:21.903576-07:00"}
token = {"access_token":"ya29.a0ARrdaM9IYmxlyxP60MYmYQMgvjduR4AA5OHybGnSnptHjeHJUg5W45qFTJThL9_76do_QICBolbQC3Wjz_5aZ7RPRyj0ygOe5nBG_CDvlzHP5mccb4GC7-5-4-9nJMvf5BNIlK0jVY7IlPJ-_aT8n3X9xPEsPw","token_type":"Bearer","refresh_token":"1//04sQD4800FsqyCgYIARAAGAQSNwF-L9IrB1_7BV8ScFnqmIz8FNWgXfr80--6VG6KX1pTnneQKAz6Ss3YtxqmCdf2tRBy2ndkhek","expiry":"2021-11-29T17:13:06.786674-07:00"}