summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMirai Kumiko <murrr@macaw.me>2025-02-02 07:35:21 +0000
committerMirai Kumiko <murrr@macaw.me>2025-02-02 07:37:49 +0000
commit224768e9fa8110832aaa38ec1b8b0bf598933b15 (patch)
tree74ebbccd9d817b7341cbc1570ec958139fd5d79a
parent4165e97622aa87c59b1d4a135b47e6e3cbcd0bef (diff)
downloadmiraikumiko.com-224768e9fa8110832aaa38ec1b8b0bf598933b15.tar.gz
miraikumiko.com-224768e9fa8110832aaa38ec1b8b0bf598933b15.tar.bz2
Updated
-rw-r--r--content/en/_index.md (renamed from content/_index.md)0
-rw-r--r--content/en/blog/_index.md (renamed from content.es/blog/_index.md)0
-rw-r--r--content/en/blog/chess.md (renamed from content/blog/chess.md)0
-rw-r--r--content/en/blog/introduction.md (renamed from content/blog/introduction.md)0
-rw-r--r--content/en/contacts.md (renamed from content/contacts.md)0
-rw-r--r--content/es/_index.md (renamed from content.es/_index.md)0
-rw-r--r--content/es/blog/_index.md (renamed from content.ru/blog/_index.md)0
-rw-r--r--content/es/blog/chess.md (renamed from content.es/blog/chess.md)0
-rw-r--r--content/es/blog/introduction.md (renamed from content.es/blog/introduction.md)0
-rw-r--r--content/es/contacts.md (renamed from content.es/contacts.md)0
-rw-r--r--content/ru/_index.md (renamed from content.ru/_index.md)0
-rw-r--r--content/ru/blog/_index.md (renamed from content/blog/_index.md)0
-rw-r--r--content/ru/blog/chess.md (renamed from content.ru/blog/chess.md)0
-rw-r--r--content/ru/blog/introduction.md (renamed from content.ru/blog/introduction.md)0
-rw-r--r--content/ru/contacts.md (renamed from content.ru/contacts.md)0
-rw-r--r--hugo.toml10
-rw-r--r--layouts/partials/social_card.html136
17 files changed, 141 insertions, 5 deletions
diff --git a/content/_index.md b/content/en/_index.md
index fb42b32..fb42b32 100644
--- a/content/_index.md
+++ b/content/en/_index.md
diff --git a/content.es/blog/_index.md b/content/en/blog/_index.md
index 0f7daa9..0f7daa9 100644
--- a/content.es/blog/_index.md
+++ b/content/en/blog/_index.md
diff --git a/content/blog/chess.md b/content/en/blog/chess.md
index d5413a3..d5413a3 100644
--- a/content/blog/chess.md
+++ b/content/en/blog/chess.md
diff --git a/content/blog/introduction.md b/content/en/blog/introduction.md
index 044f7cc..044f7cc 100644
--- a/content/blog/introduction.md
+++ b/content/en/blog/introduction.md
diff --git a/content/contacts.md b/content/en/contacts.md
index ed4d77e..ed4d77e 100644
--- a/content/contacts.md
+++ b/content/en/contacts.md
diff --git a/content.es/_index.md b/content/es/_index.md
index 30154ef..30154ef 100644
--- a/content.es/_index.md
+++ b/content/es/_index.md
diff --git a/content.ru/blog/_index.md b/content/es/blog/_index.md
index 0f7daa9..0f7daa9 100644
--- a/content.ru/blog/_index.md
+++ b/content/es/blog/_index.md
diff --git a/content.es/blog/chess.md b/content/es/blog/chess.md
index 14e3019..14e3019 100644
--- a/content.es/blog/chess.md
+++ b/content/es/blog/chess.md
diff --git a/content.es/blog/introduction.md b/content/es/blog/introduction.md
index 81158c9..81158c9 100644
--- a/content.es/blog/introduction.md
+++ b/content/es/blog/introduction.md
diff --git a/content.es/contacts.md b/content/es/contacts.md
index 26d4e40..26d4e40 100644
--- a/content.es/contacts.md
+++ b/content/es/contacts.md
diff --git a/content.ru/_index.md b/content/ru/_index.md
index bad0a57..bad0a57 100644
--- a/content.ru/_index.md
+++ b/content/ru/_index.md
diff --git a/content/blog/_index.md b/content/ru/blog/_index.md
index 0f7daa9..0f7daa9 100644
--- a/content/blog/_index.md
+++ b/content/ru/blog/_index.md
diff --git a/content.ru/blog/chess.md b/content/ru/blog/chess.md
index 3a4b261..3a4b261 100644
--- a/content.ru/blog/chess.md
+++ b/content/ru/blog/chess.md
diff --git a/content.ru/blog/introduction.md b/content/ru/blog/introduction.md
index 3c15b3a..3c15b3a 100644
--- a/content.ru/blog/introduction.md
+++ b/content/ru/blog/introduction.md
diff --git a/content.ru/contacts.md b/content/ru/contacts.md
index c985da9..c985da9 100644
--- a/content.ru/contacts.md
+++ b/content/ru/contacts.md
diff --git a/hugo.toml b/hugo.toml
index 41b9490..dd18a8a 100644
--- a/hugo.toml
+++ b/hugo.toml
@@ -29,21 +29,21 @@ enableRobotsTXT = true
title = "Mirai Kumiko's website"
languageName = "🇺🇸"
LanguageCode = "en-US"
- contentDir = "content"
+ contentDir = "content/en"
[languages.en.params]
madeWith = "Personal site"
[languages.es]
title = "Sitio web de Mirai Kumiko"
languageName = "🇪🇸"
LanguageCode = "es-ES"
- contentDir = "content.es"
+ contentDir = "content/es"
[languages.es.params]
madeWith = "Sitio personal"
[languages.ru]
title = "Бложик Mirai Kumiko"
languageName = "🇷🇺"
LanguageCode = "ru-RU"
- contentDir = "content.ru"
+ contentDir = "content/ru"
[languages.ru.params]
madeWith = "Персональный сайт"
@@ -95,5 +95,5 @@ enableRobotsTXT = true
# email is also added to the footer of each post. You can hide the "reply to"
# link by using a `hideReply` param in front matter.
[params.author]
- name = "Mirai Kumiko" # Your name as shown in the RSS feed metadata
- email = "murrr@macaw.me" # Added to the footer so readers can reply to posts
+ name = "Mirai Kumiko"
+ email = "murrr@macaw.me"
diff --git a/layouts/partials/social_card.html b/layouts/partials/social_card.html
new file mode 100644
index 0000000..7c9fc4f
--- /dev/null
+++ b/layouts/partials/social_card.html
@@ -0,0 +1,136 @@
+<!-- Dynamic social card generation -->
+{{ $font := resources.GetRemote "https://github.com/google/fonts/raw/main/ofl/firamono/FiraMono-Bold.ttf" }}
+{{ $fg := resources.Get "images/social_card_fg.png"}}
+{{ $bg := resources.Get "images/social_card_bg.png"}}
+
+{{ if gt (len .Title) 40 }}
+ {{ $fg = $fg.Filter (images.Text .Title (dict
+ "font" $font
+ "color" "#fafafa"
+ "size" 95
+ "linespacing" 16
+ "x" 0
+ "y" 0
+ )) }}
+{{ else }}
+ {{ $fg = $fg.Filter (images.Text .Title (dict
+ "font" $font
+ "color" "#fafafa"
+ "size" 130
+ "linespacing" 20
+ "x" 0
+ "y" 0
+ )) }}
+{{ end }}
+
+{{ $date := .Date.Format (default "2006-01-02" .Site.Params.dateFormat) }}
+{{ $author := (default $.Site.Params.author.name ($.Param "author.name")) }}
+{{ $byline := (printf "%s | %s" $author $date) }}
+
+{{ $fg = $fg.Filter (images.Text $byline (dict
+ "font" $font
+ "color" "#898a8d"
+ "size" 60
+ "linespacing" 30
+ "x" 0
+ "y" 425
+)) }}
+
+{{ $card := $bg.Filter (images.Overlay $fg 112 140 ) }}
+{{ $card := $card.Resize "900x webp q100" }}
+
+<!-- Open Graph / Facebook -->
+<!-- Source: https://github.com/gohugoio/hugo/blob/master/tpl/tplimpl/embedded/templates/opengraph.html -->
+<meta property="og:title" content="{{ .Title }}" />
+<meta property="og:description" content="{{ with .Description }}{{ . }}{{ else }}{{if .IsPage}}{{ .Summary }}{{ else }}{{ with .Site.Params.description }}{{ . }}{{ end }}{{ end }}{{ end }}" />
+<meta property="og:type" content="{{ if .IsPage }}article{{ else }}website{{ end }}" />
+<meta property="og:url" content="{{ .Permalink }}" />
+
+<meta property="og:image" content="{{ $card.Permalink | absURL }}"/>
+
+{{- if .IsPage }}
+{{- $iso8601 := "2006-01-02T15:04:05-07:00" -}}
+<meta property="article:section" content="{{ .Section }}" />
+{{ with .PublishDate }}<meta property="article:published_time" {{ .Format $iso8601 | printf "content=%q" | safeHTMLAttr }} />{{ end }}
+{{ with .Lastmod }}<meta property="article:modified_time" {{ .Format $iso8601 | printf "content=%q" | safeHTMLAttr }} />{{ end }}
+{{- end -}}
+
+{{- with .Params.audio }}<meta property="og:audio" content="{{ . }}" />{{ end }}
+{{- with .Params.locale }}<meta property="og:locale" content="{{ . }}" />{{ end }}
+{{- with .Site.Params.title }}<meta property="og:site_name" content="{{ . }}" />{{ end }}
+{{- with .Params.videos }}{{- range . }}
+<meta property="og:video" content="{{ . | absURL }}" />
+{{ end }}{{ end }}
+
+{{- /* If it is part of a series, link to related articles */}}
+{{- $permalink := .Permalink }}
+{{- $siteSeries := .Site.Taxonomies.series }}
+{{- if $siteSeries }}
+{{ with .Params.series }}{{- range $name := . }}
+ {{- $series := index $siteSeries ($name | urlize) }}
+ {{- range $page := first 6 $series.Pages }}
+ {{- if ne $page.Permalink $permalink }}<meta property="og:see_also" content="{{ $page.Permalink }}" />{{ end }}
+ {{- end }}
+{{ end }}{{ end }}
+{{- end }}
+
+{{- /* Deprecate site.Social.facebook_admin in favor of site.Params.social.facebook_admin */}}
+{{- $facebookAdmin := "" }}
+{{- with site.Params.social }}
+ {{- if reflect.IsMap . }}
+ {{- $facebookAdmin = .facebook_admin }}
+ {{- end }}
+{{- else }}
+ {{- with site.Social.facebook_admin }}
+ {{- $facebookAdmin = . }}
+ {{- warnf "The social key in site configuration is deprecated. Use params.social.facebook_admin instead." }}
+ {{- end }}
+{{- end }}
+
+{{- /* Facebook Page Admin ID for Domain Insights */}}
+{{ with $facebookAdmin }}<meta property="fb:admins" content="{{ . }}" />{{ end }}
+
+<!-- Twitter -->
+<!-- Source: https://github.com/gohugoio/hugo/blob/master/tpl/tplimpl/embedded/templates/twitter_cards.html -->
+<meta name="twitter:card" content="summary_large_image"/>
+<meta name="twitter:image" content="{{ $card.Permalink | absURL }}"/>
+<meta name="twitter:title" content="{{ .Title }}"/>
+<meta name="twitter:description" content="{{ with .Description }}{{ . }}{{ else }}{{if .IsPage}}{{ .Summary }}{{ else }}{{ with .Site.Params.description }}{{ . }}{{ end }}{{ end }}{{ end -}}"/>
+
+{{- /* Deprecate site.Social.twitter in favor of site.Params.social.twitter */}}
+{{- $twitterSite := "" }}
+{{- with site.Params.social }}
+ {{- if reflect.IsMap . }}
+ {{- $twitterSite = .twitter }}
+ {{- end }}
+{{- else }}
+ {{- with site.Social.twitter }}
+ {{- $twitterSite = . }}
+ {{- warnf "The social key in site configuration is deprecated. Use params.social.twitter instead." }}
+ {{- end }}
+{{- end }}
+
+{{- with $twitterSite }}
+ {{- $content := . }}
+ {{- if not (strings.HasPrefix . "@") }}
+ {{- $content = printf "@%v" $twitterSite }}
+ {{- end }}
+<meta name="twitter:site" content="{{ $content }}"/>
+{{- end }}
+
+<!-- Microdata -->
+<!-- Source: https://github.com/gohugoio/hugo/blob/master/tpl/tplimpl/embedded/templates/schema.html -->
+<meta itemprop="name" content="{{ .Title }}">
+<meta itemprop="description" content="{{ with .Description }}{{ . }}{{ else }}{{if .IsPage}}{{ .Summary }}{{ else }}{{ with .Site.Params.description }}{{ . }}{{ end }}{{ end }}{{ end }}">
+
+{{- if .IsPage -}}
+{{- $iso8601 := "2006-01-02T15:04:05-07:00" -}}
+{{ with .PublishDate }}<meta itemprop="datePublished" {{ .Format $iso8601 | printf "content=%q" | safeHTMLAttr }} />{{ end}}
+{{ with .Lastmod }}<meta itemprop="dateModified" {{ .Format $iso8601 | printf "content=%q" | safeHTMLAttr }} />{{ end}}
+<meta itemprop="wordCount" content="{{ .WordCount }}">
+
+<meta itemprop="image" content="{{ $card.Permalink | absURL }}"/>
+
+<!-- Output all taxonomies as schema.org keywords -->
+<meta itemprop="keywords" content="{{ if .IsPage}}{{ range $index, $tag := .Params.tags }}{{ $tag }},{{ end }}{{ else }}{{ range $plural, $terms := .Site.Taxonomies }}{{ range $term, $val := $terms }}{{ printf "%s," $term }}{{ end }}{{ end }}{{ end }}" />
+{{- end -}}