mirror of
https://git.sr.ht/~seirdy/seirdy.one
synced 2024-11-27 14:12:09 +00:00
Compare commits
No commits in common. "7de728fdfec8f28bb5745454677ee7b4c904ee6d" and "9ae8d879080632def11a9539a77c0ddf3281c328" have entirely different histories.
7de728fdfe
...
9ae8d87908
7 changed files with 12 additions and 70 deletions
13
Makefile
13
Makefile
|
@ -22,11 +22,8 @@ ECT_LEVEL=6
|
|||
csv/webrings.csv:
|
||||
sh scripts/populate-webrings.sh
|
||||
|
||||
data/bookmarks.json:
|
||||
sh scripts/get-bookmarks.sh
|
||||
|
||||
.PHONY: hugo
|
||||
hugo: csv/webrings.csv data/bookmarks.json $(SRCFILES)
|
||||
hugo: csv/webrings.csv $(SRCFILES)
|
||||
sh scripts/get-webmentions.sh
|
||||
hugo -b $(HUGO_BASEURL) $(HUGO_FLAGS) -d $(OUTPUT_DIR)
|
||||
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
|
||||
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
|
||||
lint-css: $(CSS_DIR)/*.css
|
||||
|
@ -126,16 +123,16 @@ compress: gzip brotli
|
|||
.PHONY: gzip brotli compress
|
||||
|
||||
.PHONY: xhtmlize
|
||||
xhtmlize: hugo
|
||||
xhtmlize:
|
||||
sh scripts/xhtmlize.sh $(OUTPUT_DIR)
|
||||
|
||||
.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
|
||||
|
||||
.PHONY: 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
|
||||
deploy-gemini:
|
||||
|
|
|
@ -9,9 +9,9 @@
|
|||
{{- if eq .Section "notes" -}}
|
||||
{{- $period = "hourly" -}}
|
||||
{{- 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" -}}
|
||||
{{- $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"?>
|
||||
<feed
|
||||
xmlns="http://www.w3.org/2005/Atom"
|
||||
|
@ -22,7 +22,6 @@
|
|||
xmlns:ostatus="http://ostatus.org/schema/1.0"
|
||||
xmlns:poco="http://portablecontacts.net/spec/1.0"
|
||||
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:thr="http://purl.org/syndication/thread/1.0"
|
||||
xmlns:webfeeds="http://webfeeds.org/rss/1.0">
|
||||
|
@ -35,10 +34,10 @@
|
|||
{{- end -}}
|
||||
</subtitle>
|
||||
<link rel="self" type="application/atom+xml" href="{{ .Permalink }}atom.xml" />
|
||||
<icon>{{ $faviconSvg.Permalink }}</icon>
|
||||
<webfeeds:icon>{{ $image.Permalink }}</webfeeds:icon>
|
||||
<webfeeds:cover>{{ $atomLogo.Permalink }}</webfeeds:cover>
|
||||
<logo>{{ $atomLogo.Permalink }}</logo>
|
||||
<icon>{{ $icon.Permalink }}</icon>
|
||||
<webfeeds:icon>{{ $icon.Permalink }}</webfeeds:icon>
|
||||
<webfeeds:cover>{{ $logo.Permalink }}</webfeeds:cover>
|
||||
<logo>{{ $logo.Permalink }}</logo>
|
||||
<webfeeds:accentColor>191919</webfeeds:accentColor>
|
||||
<sy:updatePeriod>{{ $period }}</sy:updatePeriod>
|
||||
<sy:updateFrequency>2</sy:updateFrequency>
|
||||
|
@ -58,6 +57,7 @@
|
|||
{{ range $pages -}}
|
||||
{{- if not .Params.Private -}}
|
||||
<entry>
|
||||
{{- .Page.Scratch.Set "codeIndex" 1 -}}
|
||||
<title>{{ .Title }}</title>
|
||||
<link rel="alternate" type="text/html" href="{{ .Permalink }}" />
|
||||
<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 -}}
|
||||
</div>
|
||||
</content>
|
||||
<slash:comments>{{ .Page.Scratch.Get "webmentionCount" }}</slash:comments>
|
||||
</entry>
|
||||
{{ end -}}
|
||||
{{- end }}
|
||||
|
|
|
@ -25,7 +25,6 @@
|
|||
{{- end -}}
|
||||
{{- /* Render webmentions if they exist */ -}}
|
||||
{{- $count := (len $webmentions) -}}
|
||||
{{- .Page.Scratch.Set "webmentionCount" $count -}}<!--For use in atom feed-->
|
||||
{{- if gt $count 0 -}}
|
||||
<details>
|
||||
<summary>Toggle {{ $count }} Webmentions</summary>
|
||||
|
|
|
@ -1,8 +1,6 @@
|
|||
{{- define "main" -}}
|
||||
{{- $canonicalRelPermalink := .RelPermalink | replaceRE "^/~seirdy/" "/" }}
|
||||
{{- .Scratch.Set "codeIndex" 1 -}}
|
||||
{{- .Scratch.Set "codeIndexAtom" 1 -}}
|
||||
{{- .Scratch.Set "codeIndexRss" 1 -}}
|
||||
<main
|
||||
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 }}/" />
|
||||
|
|
|
@ -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) -}}
|
|
@ -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) -}}
|
|
@ -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
|
Loading…
Reference in a new issue