Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 0 additions & 10 deletions .github/workflows/pages.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
name: Build and Deploy to GitHub Pages

on:
workflow_run:
workflows: ["Run Tests"]
branches: [main]
types:
- completed
push:
branches:
- main
Expand Down Expand Up @@ -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
Expand Down
12 changes: 6 additions & 6 deletions blog/config/_default/menus/menu.en.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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"
Expand Down
12 changes: 6 additions & 6 deletions blog/config/_default/menus/menu.lt.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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"
Expand Down
14 changes: 14 additions & 0 deletions blog/i18n/en.toml
Original file line number Diff line number Diff line change
@@ -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"
14 changes: 14 additions & 0 deletions blog/i18n/lt.toml
Original file line number Diff line number Diff line change
@@ -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"
1 change: 1 addition & 0 deletions blog/layouts/_default/rss.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
{{- $pages = $pages | first $limit -}}
{{- end -}}
{{- printf "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"yes\"?>" | safeHTML }}
{{- printf "<?xml-stylesheet type=\"text/xsl\" href=%q?>" ("feed.xsl" | absURL) | 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>
Expand Down
37 changes: 37 additions & 0 deletions blog/layouts/partials/follow.html
Original file line number Diff line number Diff line change
@@ -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. */ -}}
<svg width="0" height="0" style="position:absolute" aria-hidden="true" focusable="false">
<symbol id="x" viewBox="0 0 24 24">
<path d="M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z"/>
</symbol>
</svg>
<div class='follow'>
{{- range $items }}
{{- $url := .URL }}
{{- $label := lower .Name }}
{{- if eq $social nil }}
{{ $url = .url }}
{{ $label = lower .item }}
{{- end }}
{{- if and (eq (hasPrefix $url $base) false) (eq (hasPrefix $url "http") false) }}
{{ $url = absLangURL $url }}
{{- end }}
<a href="{{ $url }}">
{{ partial "sprite" (dict "icon" $label) }}
</a>
{{- end }}
<a href="#subscribe" class="follow_subscribe" data-subscribe-open
aria-label="{{ T "subscribe_heading" }}" title="{{ T "subscribe_heading" }}">
{{ partial "sprite" (dict "icon" "mail") }}
</a>
{{- partialCached "mode" . }}
</div>
32 changes: 32 additions & 0 deletions blog/layouts/partials/hooks/body-end.html
Original file line number Diff line number Diff line change
@@ -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" . }}
<script>
(function () {
var dialog = document.getElementById("subscribe-dialog");
if (!dialog) return;

function open(event) {
if (event) event.preventDefault();
if (typeof dialog.showModal === "function") dialog.showModal();
else dialog.setAttribute("open", "");
var field = dialog.querySelector("input[type=email]");
if (field) field.focus();
}
function close() {
if (typeof dialog.close === "function") dialog.close();
else dialog.removeAttribute("open");
}

document.querySelectorAll("[data-subscribe-open]").forEach(function (trigger) {
trigger.addEventListener("click", open);
});
dialog.querySelectorAll("[data-subscribe-close]").forEach(function (button) {
button.addEventListener("click", close);
});
// Close when the backdrop (dialog padding area) is clicked.
dialog.addEventListener("click", function (event) {
if (event.target === dialog) close();
});
})();
</script>
2 changes: 1 addition & 1 deletion blog/layouts/partials/schema.html
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
129 changes: 129 additions & 0 deletions blog/layouts/partials/sidebar.html
Original file line number Diff line number Diff line change
@@ -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 }}
<aside class="sidebar">
<section class="sidebar_inner">
<br>
{{ partial "search/widget" . }}
{{- $introDescription := $s.introDescription }}
{{- with .Params.introDescription }}
{{- $introDescription = . }}
{{- end }}
{{- if $introDescription }}
{{- $author := $s.Author }}
{{- $showAuthorPhoto := false }}
{{- $fullAuthor := reflect.IsMap $author }}
{{- if $fullAuthor }}
{{- if $author.photo }}
{{- $showAuthorPhoto = true }}
{{- end }}
{{- end }}
{{- if $showAuthorPhoto }}
<div class="author_header">
<img src="{{ absURL $author.photo }}" alt="{{ $author.name }} photo">
<h2>{{ $author.name }}</h2>
</div>
{{- else }}
<h2>{{ if $fullAuthor }}{{ $author.name }}{{ else }}{{ $author }}{{ end }}</h2>
{{- end }}
<div class="author_bio">
{{ markdownify $introDescription }}
</div>
{{- if ( ne $s.introURL false ) }}
{{- $r := T "read_more" }}
<a href='{{ absLangURL (default "about/" $s.introURL) }}' class="button mt-1" role="button" title='{{ $r }}'>{{ $r }}</a>
{{- end }}
<button type="button" class="button button_translucent mt-1 subscribe_trigger" data-subscribe-open>
{{ partial "sprite" (dict "icon" "mail") }}<span>{{ T "subscribe_heading" }}</span>
</button>
{{- end }}

{{ if .Site.Params.sidebardisclaimer }}
<div class="sidebardisclaimer">
<h2 class="mt-4">Disclaimer</h2>
{{ .Site.Params.disclaimerText }}
</div>
{{ end }}

{{- $showRelatedInSidebar := $s.showRelatedInSidebar }}
{{- if eq .Params.showRelatedInSidebar true }}
{{- $showRelatedInSidebar = true }}
{{- else if eq .Params.showRelatedInSidebar false }}
{{- $showRelatedInSidebar = false }}
{{- end }}
{{- if (and ($showRelatedInSidebar) (isset .Params "series")) }}
{{$related := where .Site.RegularPages ".Params.series" "eq" .Params.series }}
<h2 class="mt-4">{{ T "series_posts" }}</h2>
<ul>
{{ range sort $related "Date" }}
<li>
<a href="{{ .Permalink }}" class="nav-link" title="{{ .Title }}">{{ .Title | markdownify }}</a>
</li>
{{ end }}
</ul>
{{- end }}

{{- $posts := where .Site.RegularPages "Type" "in" $s.mainSections }}
{{- $featured := default 8 $s.numberOfFeaturedPosts }}
{{- $featuredPosts := first $featured (where $posts "Params.featured" true)}}
{{- with $featuredPosts }}
<h2 class="mt-4">{{ T "featured_posts" }}</h2>
<ul>
{{- range . }}
<li>
<a href="{{ .Permalink }}" class="nav-link" title="{{ .Title }}">{{ .Title | markdownify }}</a>
</li>
{{- end }}
</ul>
{{- end }}
<h2 class="mt-4">{{ T "recent_posts" }}</h2>
<ul class="flex-column">
{{- $recent := default 8 $s.numberOfRecentPosts }}
{{- range first $recent ($posts | symdiff $featuredPosts) }}
<li>
<a href="{{ .Permalink }}" class="nav-link" title="{{ .Title }}">{{ .Title | markdownify }}</a>
</li>
{{- end }}
</ul>
{{- $tagsLimit := (default 100 $s.numberOfTagsShown) }}
{{- range $key, $value := .Site.Taxonomies }}
{{- if gt $value 0 }}
<div>
<h2 class="mt-4 taxonomy" id="{{ $key }}-section">{{ T $key }}</h2>
<nav class="tags_nav">
{{- $onPageTags := $.Page.Params.tags }}
{{- $slicedTags := ($value.ByCount | first $tagsLimit) }}
{{- range $slicedTags }}
<a href='{{ absLangURL $key }}/{{ (replace .Name "#" "%23") | urlize }}/' class="post_tag button button_translucent" title="{{ .Name }}">
{{ upper .Name }}
<span class="button_tally">{{ .Count }}</span>
</a>
{{ end }}
{{ if gt (len $value.ByCount) $tagsLimit }}
<br>
<div class="post_tags_toggle button">{{ T (printf "all_%s" (lower $key)) }}</div>
{{- $tagsInfo := newScratch }}
<div class="post_tags">
<div class="tags_list">
{{- range $value.Alphabetical }}
{{ $tagsInfo.Add "tagsInfo" (slice .Name .Count)}}
<a href='{{ absLangURL $key }}/{{ (replace .Name "#" "%23") | urlize }}/' class=" post_tag button button_translucent" data-position={{ .Count }} title="{{ .Name }}">
{{- upper .Name -}}
<span class="button_tally">{{ .Count }}</span>
</a>
{{ end }}
<div class="tags_sort"><span title="sort alphabetically">[A~Z]</span><span title="sort by count">[0~9]</span>
</div>
<span class="tags_hide"><svg class="icon">
<use xlink:href="#closeme"></use>
</svg></span>
</div>
</div>
{{- end }}
</nav>
</div>
{{- end }}
{{- end }}
</section>
</aside>
6 changes: 6 additions & 0 deletions blog/layouts/partials/subscribe-modal.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{{- /* Subscribe modal: a native <dialog> wrapping the reusable subscribe form.
Opened by any [data-subscribe-open] trigger (follow icon, sidebar button). */ -}}
<dialog id="subscribe-dialog" class="subscribe_modal" aria-label="{{ T "subscribe_heading" }}">
<button type="button" class="subscribe_close" data-subscribe-close aria-label="{{ T "close" }}">&times;</button>
{{ partial "subscribe.html" . }}
</dialog>
20 changes: 20 additions & 0 deletions blog/layouts/partials/subscribe.html
Original file line number Diff line number Diff line change
@@ -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). */ -}}
<section class="subscribe wrap">
<h3 class="subscribe_title">{{ T "subscribe_heading" }}</h3>
<form action="https://buttondown.com/api/emails/embed-subscribe/mikonis"
method="post"
class="subscribe_form embeddable-buttondown-form">
<label class="subscribe_field">
<span class="sr-only">{{ T "subscribe_email_label" }}</span>
<input class="subscribe_input" type="email" name="email" required
placeholder="{{ T "subscribe_email_placeholder" }}" />
</label>
<input class="subscribe_submit" type="submit" value="{{ T "subscribe_button" }}" />
</form>
<p class="subscribe_powered">
<a href="https://buttondown.com/refer/mikonis" target="_blank" rel="noopener">Powered by Buttondown.</a>
</p>
</section>
2 changes: 2 additions & 0 deletions blog/layouts/shortcodes/subscribe.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
{{- /* Drop the email-subscription form into any page: {{< subscribe >}} */ -}}
{{ partial "subscribe.html" . }}
Loading
Loading