diff --git a/.github/workflows/pages.yml b/.github/workflows/pages.yml index 9de9763..9cee4ec 100644 --- a/.github/workflows/pages.yml +++ b/.github/workflows/pages.yml @@ -1,11 +1,6 @@ name: Build and Deploy to GitHub Pages on: - workflow_run: - workflows: ["Run Tests"] - branches: [main] - types: - - completed push: branches: - main @@ -36,11 +31,6 @@ defaults: jobs: build: - # Fixed: Handle case where workflow_run doesn't exist for push/workflow_dispatch - if: | - github.event_name == 'workflow_dispatch' || - github.event_name == 'push' || - (github.event_name == 'workflow_run' && github.event.workflow_run.conclusion == 'success') runs-on: ubuntu-22.04 env: HUGO_VERSION: 0.163.3 diff --git a/blog/config/_default/menus/menu.en.toml b/blog/config/_default/menus/menu.en.toml index b3b5b6f..a15baed 100644 --- a/blog/config/_default/menus/menu.en.toml +++ b/blog/config/_default/menus/menu.en.toml @@ -53,9 +53,9 @@ weight = 1 url = "https://github.com/itohio" [[social]] - name = "twitter" + name = "x" weight = 2 - url = "https://twitter.com/andriusmikonis" + url = "https://x.com/andriusmikonis" [[social]] name = "facebook" weight = 2 @@ -68,10 +68,10 @@ name = "instagram" weight = 3 url = "https://www.instagram.com/nopperabo_" -# [[social]] -# name = "rss" -# weight = 4 -# url = "index.xml" +[[social]] + name = "rss" + weight = 4 + url = "index.xml" # other supported social links # name = "youtube" diff --git a/blog/config/_default/menus/menu.lt.toml b/blog/config/_default/menus/menu.lt.toml index 15720e9..739aeaa 100644 --- a/blog/config/_default/menus/menu.lt.toml +++ b/blog/config/_default/menus/menu.lt.toml @@ -45,9 +45,9 @@ weight = 1 url = "https://github.com/itohio" [[social]] - name = "twitter" + name = "x" weight = 2 - url = "https://twitter.com/andriusmikonis" + url = "https://x.com/andriusmikonis" [[social]] name = "facebook" weight = 2 @@ -60,10 +60,10 @@ name = "instagram" weight = 3 url = "https://www.instagram.com/nopperabo_" -# [[social]] -# name = "rss" -# weight = 4 -# url = "index.xml" +[[social]] + name = "rss" + weight = 4 + url = "index.xml" # other supported social links # name = "youtube" diff --git a/blog/i18n/en.toml b/blog/i18n/en.toml new file mode 100644 index 0000000..1a2304e --- /dev/null +++ b/blog/i18n/en.toml @@ -0,0 +1,14 @@ +[subscribe_heading] +other = "Get new posts by email" + +[subscribe_email_label] +other = "Email address" + +[subscribe_email_placeholder] +other = "you@example.com" + +[subscribe_button] +other = "Subscribe" + +[close] +other = "Close" diff --git a/blog/i18n/lt.toml b/blog/i18n/lt.toml new file mode 100644 index 0000000..3aefaf5 --- /dev/null +++ b/blog/i18n/lt.toml @@ -0,0 +1,14 @@ +[subscribe_heading] +other = "Gaukite naujus įrašus el. paštu" + +[subscribe_email_label] +other = "El. pašto adresas" + +[subscribe_email_placeholder] +other = "jus@pavyzdys.lt" + +[subscribe_button] +other = "Prenumeruoti" + +[close] +other = "Uždaryti" diff --git a/blog/layouts/_default/rss.xml b/blog/layouts/_default/rss.xml index 8c511b0..e797b45 100644 --- a/blog/layouts/_default/rss.xml +++ b/blog/layouts/_default/rss.xml @@ -13,6 +13,7 @@ {{- $pages = $pages | first $limit -}} {{- end -}} {{- printf "" | safeHTML }} +{{- printf "" ("feed.xsl" | absURL) | safeHTML }} {{ if eq .Title .Site.Title }}{{ .Site.Title }}{{ else }}{{ with .Title }}{{.}} on {{ end }}{{ .Site.Title }}{{ end }} diff --git a/blog/layouts/partials/follow.html b/blog/layouts/partials/follow.html new file mode 100644 index 0000000..9217aa1 --- /dev/null +++ b/blog/layouts/partials/follow.html @@ -0,0 +1,37 @@ +{{- /* Local override: adds an email button among the follow icons that opens the + subscribe modal (see partials/subscribe-modal.html). Keep the rest in sync + with upstream. */ -}} +{{- $base := absURL "" }} +{{- $items := hugo.Data.social }} +{{- $social := .Site.Menus.social }} +{{- with $social }} + {{- $items = . }} +{{- end }} +{{- /* The theme sprite only ships the legacy Twitter bird; define the X logo so + the "x" social entry renders correctly. */ -}} + + diff --git a/blog/layouts/partials/hooks/body-end.html b/blog/layouts/partials/hooks/body-end.html new file mode 100644 index 0000000..07b72d4 --- /dev/null +++ b/blog/layouts/partials/hooks/body-end.html @@ -0,0 +1,32 @@ +{{- /* Local override of the theme's (empty) body-end hook: render the subscribe + modal once per page and wire the open/close behaviour. */ -}} +{{ partial "subscribe-modal.html" . }} + diff --git a/blog/layouts/partials/schema.html b/blog/layouts/partials/schema.html index 5a83ddc..47ffad5 100644 --- a/blog/layouts/partials/schema.html +++ b/blog/layouts/partials/schema.html @@ -7,7 +7,7 @@ "sameAs": [ "https://github.com/itohio", "https://linkedin.com/in/andriusmikonis", - "https://twitter.com/andriusmikonis" + "https://x.com/andriusmikonis" ], "jobTitle": "Software & AI Consultant", "worksFor": { diff --git a/blog/layouts/partials/sidebar.html b/blog/layouts/partials/sidebar.html new file mode 100644 index 0000000..86b12db --- /dev/null +++ b/blog/layouts/partials/sidebar.html @@ -0,0 +1,129 @@ +{{- /* Local override: adds a subscribe button under the intro/tagline that opens + the subscribe modal (see partials/subscribe-modal.html). Keep the rest in + sync with upstream. */ -}} +{{ $s := site.Params }} + diff --git a/blog/layouts/partials/subscribe-modal.html b/blog/layouts/partials/subscribe-modal.html new file mode 100644 index 0000000..8d13840 --- /dev/null +++ b/blog/layouts/partials/subscribe-modal.html @@ -0,0 +1,6 @@ +{{- /* Subscribe modal: a native wrapping the reusable subscribe form. + Opened by any [data-subscribe-open] trigger (follow icon, sidebar button). */ -}} + diff --git a/blog/layouts/partials/subscribe.html b/blog/layouts/partials/subscribe.html new file mode 100644 index 0000000..5aec5be --- /dev/null +++ b/blog/layouts/partials/subscribe.html @@ -0,0 +1,20 @@ +{{- /* Email-subscription form (Buttondown). Single source of truth: rendered by + the footer and by the {{< subscribe >}} shortcode. Labels are i18n-driven. + No id/for on the field so the form stays valid even when it appears twice + on a page (e.g. footer + an in-content shortcode). */ -}} + diff --git a/blog/layouts/shortcodes/subscribe.html b/blog/layouts/shortcodes/subscribe.html new file mode 100644 index 0000000..3c519af --- /dev/null +++ b/blog/layouts/shortcodes/subscribe.html @@ -0,0 +1,2 @@ +{{- /* Drop the email-subscription form into any page: {{< subscribe >}} */ -}} +{{ partial "subscribe.html" . }} diff --git a/blog/static/css/custom.css b/blog/static/css/custom.css index ed9f3ef..db9cbd5 100644 --- a/blog/static/css/custom.css +++ b/blog/static/css/custom.css @@ -17,3 +17,99 @@ max-width: none; margin: 0; } + +/* Email-subscription form (shared by the modal and the {{< subscribe >}} shortcode) */ +.subscribe { + text-align: center; + padding: 0.5rem 0.25rem; +} +.subscribe_title { + margin: 0 0 0.75rem; + font-size: 1.1rem; +} +.subscribe_form { + display: flex; + flex-wrap: wrap; + gap: 0.5rem; + justify-content: center; + align-items: center; +} +.subscribe_field { + margin: 0; +} +.subscribe_input { + padding: 0.55rem 0.75rem; + min-width: 16rem; + max-width: 100%; + border: 1px solid rgba(128, 128, 128, 0.5); + border-radius: 6px; + font: inherit; +} +.subscribe_submit { + padding: 0.55rem 1.1rem; + border: 0; + border-radius: 6px; + background: var(--theme, #0077b8); + color: #fff; + font: inherit; + cursor: pointer; +} +.subscribe_submit:hover { + filter: brightness(1.08); +} +.subscribe_powered { + margin: 0.5rem 0 0; + font-size: 0.8rem; + opacity: 0.7; +} + +/* Subscribe modal (native ). Centering is forced here because the theme's + margin reset overrides the UA-centered dialog. Solid white card reads well over + the dimmed backdrop in both light and dark modes. */ +.subscribe_modal:not([open]) { + display: none; +} +.subscribe_modal { + position: fixed; + inset: 0; + margin: auto; + width: min(28rem, calc(100vw - 2rem)); + height: max-content; + max-height: calc(100vh - 2rem); + padding: 1.75rem 1.5rem 1.25rem; + border: 0; + border-radius: 12px; + box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35); + color: #1a1a1a; + background: #ffffff; +} +.subscribe_modal::backdrop { + background: rgba(0, 0, 0, 0.5); +} +.subscribe_close { + position: absolute; + top: 0.4rem; + right: 0.6rem; + border: 0; + background: none; + font-size: 1.6rem; + line-height: 1; + cursor: pointer; + color: inherit; + opacity: 0.6; +} +.subscribe_close:hover { + opacity: 1; +} + +/* Email trigger in the follow-icons row inherits .follow a styling; only the + sidebar trigger needs icon+label spacing. */ +.subscribe_trigger { + display: inline-flex; + align-items: center; + gap: 0.4rem; +} +.subscribe_trigger .icon { + width: 1em; + height: 1em; +} diff --git a/blog/static/feed.xsl b/blog/static/feed.xsl new file mode 100644 index 0000000..058a86a --- /dev/null +++ b/blog/static/feed.xsl @@ -0,0 +1,85 @@ + + + + + + + + + + + + <xsl:value-of select="title"/> • RSS feed + + + +
+ + +

+

+ + +
+

+ +

+ +
+
+
+
+ + +
+