1
0
Fork 0
mirror of https://git.sr.ht/~seirdy/seirdy.one synced 2024-11-10 00:12:09 +00:00

Compare commits

..

No commits in common. "7de728fdfec8f28bb5745454677ee7b4c904ee6d" and "9ae8d879080632def11a9539a77c0ddf3281c328" have entirely different histories.

7 changed files with 12 additions and 70 deletions

View file

@ -22,11 +22,8 @@ ECT_LEVEL=6
csv/webrings.csv: csv/webrings.csv:
sh scripts/populate-webrings.sh sh scripts/populate-webrings.sh
data/bookmarks.json:
sh scripts/get-bookmarks.sh
.PHONY: hugo .PHONY: hugo
hugo: csv/webrings.csv data/bookmarks.json $(SRCFILES) hugo: csv/webrings.csv $(SRCFILES)
sh scripts/get-webmentions.sh sh scripts/get-webmentions.sh
hugo -b $(HUGO_BASEURL) $(HUGO_FLAGS) -d $(OUTPUT_DIR) hugo -b $(HUGO_BASEURL) $(HUGO_FLAGS) -d $(OUTPUT_DIR)
mv $(OUTPUT_DIR)/about/_index.gmi $(OUTPUT_DIR)/about/index.gmi mv $(OUTPUT_DIR)/about/_index.gmi $(OUTPUT_DIR)/about/index.gmi
@ -41,7 +38,7 @@ hugo: csv/webrings.csv data/bookmarks.json $(SRCFILES)
.PHONY: clean .PHONY: clean
clean: clean:
rm -rf $(OUTPUT_DIR) .lighthouseci lighthouse-reports data/webmentions.json csv/webrings.csv data/bookmarks.json rm -rf $(OUTPUT_DIR) .lighthouseci lighthouse-reports
.PHONY: lint-css .PHONY: lint-css
lint-css: $(CSS_DIR)/*.css lint-css: $(CSS_DIR)/*.css
@ -126,16 +123,16 @@ compress: gzip brotli
.PHONY: gzip brotli compress .PHONY: gzip brotli compress
.PHONY: xhtmlize .PHONY: xhtmlize
xhtmlize: hugo xhtmlize:
sh scripts/xhtmlize.sh $(OUTPUT_DIR) sh scripts/xhtmlize.sh $(OUTPUT_DIR)
.PHONY: copy-to-xhtml .PHONY: copy-to-xhtml
copy-to-xhtml: xhtmlize copy-to-xhtml:
find $(OUTPUT_DIR) -type f -name "*.html" | grep -v 'resume/index.html' | xargs -n1 sh scripts/copy-file-to-xhtml.sh find $(OUTPUT_DIR) -type f -name "*.html" | grep -v 'resume/index.html' | xargs -n1 sh scripts/copy-file-to-xhtml.sh
.PHONY: deploy-html .PHONY: deploy-html
deploy-html: deploy-html:
rsync $(RSYNCFLAGS) $(RSYNCFLAGS_EXTRA) --exclude 'gemini' --exclude '*.gmi' --exclude-from .rsyncignore $(OUTPUT_DIR)/ $(WWW_RSYNC_DEST) --delete | grep -v 'l\.gz$$' rsync $(RSYNCFLAGS) $(RSYNCFLAGS_EXTRA) --exclude 'gemini' --exclude '*.gmi' --exclude-from .rsyncignore $(OUTPUT_DIR)/ $(WWW_RSYNC_DEST) --delete
.PHONY: deploy-gemini .PHONY: deploy-gemini
deploy-gemini: deploy-gemini:

View file

@ -9,9 +9,9 @@
{{- if eq .Section "notes" -}} {{- if eq .Section "notes" -}}
{{- $period = "hourly" -}} {{- $period = "hourly" -}}
{{- end -}} {{- end -}}
{{- $faviconSvg := resources.Get "/favicon.svg" | resources.Fingerprint "md5" -}} {{- $icon := resources.Get "/favicon.svg" | resources.Fingerprint "md5" -}}
{{- $image := resources.Get "/favicon192.png" | resources.Fingerprint "md5" -}} {{- $image := resources.Get "/favicon192.png" | resources.Fingerprint "md5" -}}
{{- $atomLogo := resources.Get "/atom.svg" | resources.Fingerprint "md5" -}} {{- $logo := resources.Get "/atom.svg" | resources.Fingerprint "md5" -}}
<?xml version="1.0" encoding="utf-8" standalone="yes"?> <?xml version="1.0" encoding="utf-8" standalone="yes"?>
<feed <feed
xmlns="http://www.w3.org/2005/Atom" xmlns="http://www.w3.org/2005/Atom"
@ -22,7 +22,6 @@
xmlns:ostatus="http://ostatus.org/schema/1.0" xmlns:ostatus="http://ostatus.org/schema/1.0"
xmlns:poco="http://portablecontacts.net/spec/1.0" xmlns:poco="http://portablecontacts.net/spec/1.0"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
xmlns:thr="http://purl.org/syndication/thread/1.0" xmlns:thr="http://purl.org/syndication/thread/1.0"
xmlns:webfeeds="http://webfeeds.org/rss/1.0"> xmlns:webfeeds="http://webfeeds.org/rss/1.0">
@ -35,10 +34,10 @@
{{- end -}} {{- end -}}
</subtitle> </subtitle>
<link rel="self" type="application/atom+xml" href="{{ .Permalink }}atom.xml" /> <link rel="self" type="application/atom+xml" href="{{ .Permalink }}atom.xml" />
<icon>{{ $faviconSvg.Permalink }}</icon> <icon>{{ $icon.Permalink }}</icon>
<webfeeds:icon>{{ $image.Permalink }}</webfeeds:icon> <webfeeds:icon>{{ $icon.Permalink }}</webfeeds:icon>
<webfeeds:cover>{{ $atomLogo.Permalink }}</webfeeds:cover> <webfeeds:cover>{{ $logo.Permalink }}</webfeeds:cover>
<logo>{{ $atomLogo.Permalink }}</logo> <logo>{{ $logo.Permalink }}</logo>
<webfeeds:accentColor>191919</webfeeds:accentColor> <webfeeds:accentColor>191919</webfeeds:accentColor>
<sy:updatePeriod>{{ $period }}</sy:updatePeriod> <sy:updatePeriod>{{ $period }}</sy:updatePeriod>
<sy:updateFrequency>2</sy:updateFrequency> <sy:updateFrequency>2</sy:updateFrequency>
@ -58,6 +57,7 @@
{{ range $pages -}} {{ range $pages -}}
{{- if not .Params.Private -}} {{- if not .Params.Private -}}
<entry> <entry>
{{- .Page.Scratch.Set "codeIndex" 1 -}}
<title>{{ .Title }}</title> <title>{{ .Title }}</title>
<link rel="alternate" type="text/html" href="{{ .Permalink }}" /> <link rel="alternate" type="text/html" href="{{ .Permalink }}" />
<id>{{ .Permalink }}</id> <id>{{ .Permalink }}</id>
@ -90,7 +90,6 @@
{{ partial "processed-content.html" . | replaceRE `(?: )?(?:item(type|scope|prop|id|ref)="[^"]*"|class="language-figure")` "" | replaceRE `<meta content="true" ?/>` "" | safeHTML -}} {{ partial "processed-content.html" . | replaceRE `(?: )?(?:item(type|scope|prop|id|ref)="[^"]*"|class="language-figure")` "" | replaceRE `<meta content="true" ?/>` "" | safeHTML -}}
</div> </div>
</content> </content>
<slash:comments>{{ .Page.Scratch.Get "webmentionCount" }}</slash:comments>
</entry> </entry>
{{ end -}} {{ end -}}
{{- end }} {{- end }}

View file

@ -25,7 +25,6 @@
{{- end -}} {{- end -}}
{{- /* Render webmentions if they exist */ -}} {{- /* Render webmentions if they exist */ -}}
{{- $count := (len $webmentions) -}} {{- $count := (len $webmentions) -}}
{{- .Page.Scratch.Set "webmentionCount" $count -}}<!--For use in atom feed-->
{{- if gt $count 0 -}} {{- if gt $count 0 -}}
<details> <details>
<summary>Toggle {{ $count }} Webmentions</summary> <summary>Toggle {{ $count }} Webmentions</summary>

View file

@ -1,8 +1,6 @@
{{- define "main" -}} {{- define "main" -}}
{{- $canonicalRelPermalink := .RelPermalink | replaceRE "^/~seirdy/" "/" }} {{- $canonicalRelPermalink := .RelPermalink | replaceRE "^/~seirdy/" "/" }}
{{- .Scratch.Set "codeIndex" 1 -}} {{- .Scratch.Set "codeIndex" 1 -}}
{{- .Scratch.Set "codeIndexAtom" 1 -}}
{{- .Scratch.Set "codeIndexRss" 1 -}}
<main <main
itemprop="mainEntity" itemscope="" itemtype="https://schema.org/BlogPosting{{ with .Params.articleType }} https://schema.org/{{ . }}{{ end }}" itemid="{{ .Site.Params.CanonicalBaseURL }}{{ $canonicalRelPermalink }}"> itemprop="mainEntity" itemscope="" itemtype="https://schema.org/BlogPosting{{ with .Params.articleType }} https://schema.org/{{ . }}{{ end }}" itemid="{{ .Site.Params.CanonicalBaseURL }}{{ $canonicalRelPermalink }}">
<link itemprop="isPartOf" href="{{ .Site.Params.CanonicalBaseURL }}/" /> <link itemprop="isPartOf" href="{{ .Site.Params.CanonicalBaseURL }}/" />

View file

@ -1,17 +0,0 @@
{{- $codeIndex := (.Page.Scratch.Get "codeIndexAtom") -}}
{{- $id := (printf `code-%d` $codeIndex) -}}
{{- with .Get "id" -}}
{{- $id = . -}}
{{- end -}}
{{ with .Parent }}
{{- with .Get "id" -}}
{{- $id = . -}}
{{- end -}}
{{- end -}}
<figcaption id="{{ $id }}-caption">
<span id="{{ $id }}" tabindex="-1">
<strong itemprop="name"> <span itemprop="codeSampleType">Code snippet</span> {{ $codeIndex }}</strong>{{with .Get "lang"}} (<span itemprop="programmingLanguage">{{ . }}</span>){{ end -}}
</span>:
{{ .Inner | .Page.RenderString | safeHTML }}
</figcaption>
{{- .Page.Scratch.Set "codeIndexAtom" (add 1 $codeIndex) -}}

View file

@ -1,17 +0,0 @@
{{- $codeIndex := (.Page.Scratch.Get "codeIndexRss") -}}
{{- $id := (printf `code-%d` $codeIndex) -}}
{{- with .Get "id" -}}
{{- $id = . -}}
{{- end -}}
{{ with .Parent }}
{{- with .Get "id" -}}
{{- $id = . -}}
{{- end -}}
{{- end -}}
<figcaption id="{{ $id }}-caption">
<span id="{{ $id }}" tabindex="-1">
<strong itemprop="name"> <span itemprop="codeSampleType">Code snippet</span> {{ $codeIndex }}</strong>{{with .Get "lang"}} (<span itemprop="programmingLanguage">{{ . }}</span>){{ end -}}
</span>:
{{ .Inner | .Page.RenderString | safeHTML }}
</figcaption>
{{- .Page.Scratch.Set "codeIndexRss" (add 1 $codeIndex) -}}

View file

@ -1,17 +0,0 @@
#!/bin/sh
set -e -u
#shellcheck disable=SC3040 # This only sets pipefail if it's available and otherwise does nothing
set -o pipefail 2>/dev/null || true
dirname="$(dirname "$0")"
curl_wrapper="$dirname/curl-wrapper.sh"
bookmarks_file="$dirname/../data/bookmarks.json"
if command -v buku >/dev/null; then
buku -t public -j >"$bookmarks_file"
elif [ ! -f "$bookmarks_file" ]; then
"$curl_wrapper" 'https://seirdy.one/data/bookmarks.json' >"$bookmarks_file"
else
echo 'using cached bookmarks'
fi