From 84a012cb490e1669cc9063f5086bb024487f625b Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Fri, 22 Jan 2021 05:07:48 +0800 Subject: [PATCH] Give the homepage a makeover --- assets/scss/extend.scss | 42 +++++++++---------- assets/templates/openring-input.html | 1 - content/_index.adoc | 15 ++++++- content/archives.adoc | 2 +- data/blogs.json | 3 +- data/more-contentful/contacts.toml | 2 +- go.mod | 2 +- go.sum | 4 +- .../single.html => _default/archives.html} | 0 layouts/index.html | 2 + layouts/partials/components.html | 2 +- layouts/shortcodes/homepage/links.html | 16 +++++++ layouts/shortcodes/homepage/posts.html | 10 +++++ layouts/shortcodes/homepage/social-links.html | 23 ++++++++++ layouts/shortcodes/links.html | 20 --------- 15 files changed, 93 insertions(+), 51 deletions(-) rename layouts/{archive/single.html => _default/archives.html} (100%) create mode 100644 layouts/shortcodes/homepage/links.html create mode 100644 layouts/shortcodes/homepage/posts.html create mode 100644 layouts/shortcodes/homepage/social-links.html delete mode 100644 layouts/shortcodes/links.html diff --git a/assets/scss/extend.scss b/assets/scss/extend.scss index 022dfed..7844b45 100644 --- a/assets/scss/extend.scss +++ b/assets/scss/extend.scss @@ -8,42 +8,31 @@ color: var(--base05); } -article { - h1 { - margin: 1rem auto; - } - - h1, h2, h3 { - margin-bottom: 1rem; - } -} - -hr { - border-color: var(--base0C); -} - pre, code { max-height: var(--code-size); } -footer[aria-label="Site footer"] { - > * { - margin-top: 1em; - margin-bottom: 0; - } -} - // Layouts .site__title { --size: 2rem; margin-bottom: unset; font-size: var(--size); + line-height: unset; } .site__socials { margin-top: 1em; } +.site__social-icon svg { + fill: currentColor; +} + +article.post { + padding: 0.5em; + background: var(--base01); +} + .post__meta--single { p > span:first-child { white-space: nowrap; @@ -63,6 +52,15 @@ footer[aria-label="Site footer"] { } // Custom layouts +// Asciidoctor roles (e.g., [.text-center]) on a block. +.text-center { + text-align: center; +} + +.line-through { + text-decoration: line-through; +} + #logo { svg { --size: 4em; @@ -106,9 +104,9 @@ footer[aria-label="Site footer"] { // Prism CSS code[class*="language-"], pre[class*="language-"] { color: var(--base05); - font-size: 0.9em; } + // Asciidoctor-specific styles sup.footnote { vertical-align: baseline; diff --git a/assets/templates/openring-input.html b/assets/templates/openring-input.html index 5d18e97..7180770 100644 --- a/assets/templates/openring-input.html +++ b/assets/templates/openring-input.html @@ -40,6 +40,5 @@ .webring__attribution { text-align: right; font-size: 0.8rem; - color: var(--base03); } diff --git a/content/_index.adoc b/content/_index.adoc index d951f55..bdb4699 100644 --- a/content/_index.adoc +++ b/content/_index.adoc @@ -16,6 +16,19 @@ Have a seat and take a look in my digital cavern. .Here's my renewed logo. Oooh, personal branding! image::logo.webp[My renewed logo composed of a stylized drawing of a dog, width=60%] -{{< links >}} +[.text-center] +{{< homepage/links >}} + +You can also find me on a bunch of platforms where I may be inactive for some time. + +[.text-center] +{{< homepage/social-links >}} If you want the old way on getting contact with me, you can shoot an email at `foo.dogsquared{at}gmail{dot}com`. + +TIP: This site also have web feeds available in multiple formats such as in link:index.rss[RSS], link:index.atom[Atom], and link:index.json[JSON]. +It's also available in individual sections (such as link:posts/[my writings] — i.e., `posts/index.{rss,atom,json}`). + +If you're curious about the site, you can view the link:https://github.com/foo-dogsquared/foo-dogsquared.github.io[source code] of it. +It's built with link:https://gohugo.io/[Hugo], uses a link:https://github.com/foo-dogsquared/hugo-theme-more-contentful/[theme that I created], and all of my posts are written with link:https://asciidoctor.org/[Asciidoctor]. + diff --git a/content/archives.adoc b/content/archives.adoc index 7486e2e..98aecda 100644 --- a/content/archives.adoc +++ b/content/archives.adoc @@ -1,6 +1,6 @@ --- title: "Archives" -type: "archive" +layout: "archives" --- = Archives diff --git a/data/blogs.json b/data/blogs.json index 55ad88d..2dd91f8 100644 --- a/data/blogs.json +++ b/data/blogs.json @@ -12,5 +12,6 @@ "https://protesilaos.com/codelog.xml", "https://sachachua.com/blog/feed/", "http://malloc47.com/rss.xml", - "https://www.copetti.org/index.xml" + "https://www.copetti.org/index.xml", + "https://jvns.ca/atom.xml" ] diff --git a/data/more-contentful/contacts.toml b/data/more-contentful/contacts.toml index fa0ef84..1cd175e 100644 --- a/data/more-contentful/contacts.toml +++ b/data/more-contentful/contacts.toml @@ -28,5 +28,5 @@ name = "Keybase" [[links]] id = "rss" url = "index.atom" -name = "RSS" +name = "Atom feed" weight = -1 diff --git a/go.mod b/go.mod index 98042ba..6fbd751 100644 --- a/go.mod +++ b/go.mod @@ -3,6 +3,6 @@ module github.com/foo-dogsquared/blog go 1.15 require ( - github.com/foo-dogsquared/hugo-theme-more-contentful v0.1.4-0.20210115024857-46de6a9b626b // indirect + github.com/foo-dogsquared/hugo-theme-more-contentful v0.1.4-0.20210121010829-e0277a50bbe3 // indirect github.com/foo-dogsquared/hugo-web-feeds v0.0.2 // indirect ) diff --git a/go.sum b/go.sum index fd4ea16..8ce51bc 100644 --- a/go.sum +++ b/go.sum @@ -1,7 +1,7 @@ github.com/foo-dogsquared/hugo-mod-simple-icons v0.0.0-20210112174729-cd5a37e6a772/go.mod h1:Zj/H5B3seQ4WGPwEOE/LtRoMsVy7ooEB0xhUN3k9PnY= github.com/foo-dogsquared/hugo-theme-contentful v1.2.1-0.20201106111203-fd6a6c7a3839/go.mod h1:BL7L5CENEhUx+miRRaOZ9SVC92j9MAMztirBWtTpiPc= -github.com/foo-dogsquared/hugo-theme-more-contentful v0.1.4-0.20210115024857-46de6a9b626b h1:VNxwPjFCagsvz3w7WGqh8wYz4SX4Wst+m9JaWq+WV08= -github.com/foo-dogsquared/hugo-theme-more-contentful v0.1.4-0.20210115024857-46de6a9b626b/go.mod h1:zDZAiZgXJA3VWK++nLjajTaCW7Gk8DD8yUHJfNvHWxc= +github.com/foo-dogsquared/hugo-theme-more-contentful v0.1.4-0.20210121010829-e0277a50bbe3 h1:kIM1XMhf3U/6m9frM1dKi4SZQljUzroGb381+tLwBKI= +github.com/foo-dogsquared/hugo-theme-more-contentful v0.1.4-0.20210121010829-e0277a50bbe3/go.mod h1:zDZAiZgXJA3VWK++nLjajTaCW7Gk8DD8yUHJfNvHWxc= github.com/foo-dogsquared/hugo-web-feeds v0.0.2 h1:688h38JdIvxKSTdvAFfskEM2n9VJNNNacHwlFc4lvkg= github.com/foo-dogsquared/hugo-web-feeds v0.0.2/go.mod h1:0WxK3+xNIj/Wpk2kkUW0p6Uqmr/OZjPsRtQDCMazNmI= github.com/refactoringui/heroicons v0.4.2/go.mod h1:82HsLWQga7MkEl5aK8TctxPPIBlXrsyWcVTB57uipuk= diff --git a/layouts/archive/single.html b/layouts/_default/archives.html similarity index 100% rename from layouts/archive/single.html rename to layouts/_default/archives.html diff --git a/layouts/index.html b/layouts/index.html index ba692fa..ed01209 100644 --- a/layouts/index.html +++ b/layouts/index.html @@ -1,6 +1,8 @@ {{ define "main" }} +
{{ .Content }} +

{{- partial "openring.html" . }} diff --git a/layouts/partials/components.html b/layouts/partials/components.html index c0d1238..4cafbbd 100644 --- a/layouts/partials/components.html +++ b/layouts/partials/components.html @@ -7,7 +7,7 @@ If the partial is short enough, it should be put here. {{- define "partials/components/icon.html" }} {{- $icon := . }} {{- $res := resources.ExecuteAsTemplate (printf $icon.output $icon.id) $icon.id (resources.Get $icon.template) }} - + {{- end }} diff --git a/layouts/shortcodes/homepage/links.html b/layouts/shortcodes/homepage/links.html new file mode 100644 index 0000000..33cd3e2 --- /dev/null +++ b/layouts/shortcodes/homepage/links.html @@ -0,0 +1,16 @@ + + + diff --git a/layouts/shortcodes/homepage/posts.html b/layouts/shortcodes/homepage/posts.html new file mode 100644 index 0000000..515f3a4 --- /dev/null +++ b/layouts/shortcodes/homepage/posts.html @@ -0,0 +1,10 @@ +{{- $pages := where $.Site.RegularPages "Type" "in" $.Site.Params.mainSections }} + +{{- $limit := cond (ge $.Site.Config.Services.RSS.Limit 0) $.Site.Config.Services.RSS.Limit 3 }} +{{- range (first $limit $pages) }} +
+

{{ .Title }}

+ {{ partial "partials/components/post-meta.html" . }} +
+{{- end }} + diff --git a/layouts/shortcodes/homepage/social-links.html b/layouts/shortcodes/homepage/social-links.html new file mode 100644 index 0000000..61a28ea --- /dev/null +++ b/layouts/shortcodes/homepage/social-links.html @@ -0,0 +1,23 @@ + +{{ with (index $.Site.Data "more-contentful").contacts }} + + +{{ end }} + diff --git a/layouts/shortcodes/links.html b/layouts/shortcodes/links.html deleted file mode 100644 index fdbec29..0000000 --- a/layouts/shortcodes/links.html +++ /dev/null @@ -1,20 +0,0 @@ - - -