mirror of
https://git.sr.ht/~seirdy/seirdy.one
synced 2024-12-18 06:42:10 +00:00
Compare commits
2 commits
4bf85b23c6
...
6070431bbc
Author | SHA1 | Date | |
---|---|---|---|
|
6070431bbc | ||
|
a22528a3b5 |
6 changed files with 9 additions and 13 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -19,3 +19,4 @@ public.eac
|
|||
styles/
|
||||
.vale.ini
|
||||
.webmentiond-token
|
||||
data/*.json
|
||||
|
|
3
Makefile
3
Makefile
|
@ -26,7 +26,6 @@ csv/webrings.csv:
|
|||
hugo: csv/webrings.csv $(SRCFILES)
|
||||
sh scripts/get-token.sh
|
||||
hugo -b $(HUGO_BASEURL) $(HUGO_FLAGS) -d $(OUTPUT_DIR)
|
||||
rm .webmentiond-token
|
||||
mv $(OUTPUT_DIR)/about/_index.gmi $(OUTPUT_DIR)/about/index.gmi
|
||||
|
||||
# .hintrc-local for linting local files
|
||||
|
@ -39,7 +38,7 @@ hugo: csv/webrings.csv $(SRCFILES)
|
|||
|
||||
.PHONY: clean
|
||||
clean:
|
||||
rm -rf $(OUTPUT_DIR) .lighthouseci lighthouse-reports mentions.json
|
||||
rm -rf $(OUTPUT_DIR) .lighthouseci lighthouse-reports mentions.json data/webmentions.json
|
||||
|
||||
.PHONY: lint-css
|
||||
lint-css: $(CSS_DIR)/*.css
|
||||
|
|
|
@ -6,6 +6,9 @@ replyTitle: "I run Lighthouse and WAVE as…a baseline of sorts"
|
|||
replyType: "SocialMediaPosting"
|
||||
replyAuthor: "Todd Libby"
|
||||
replyAuthorURI: "https://toddl.dev/"
|
||||
syndicatedCopies:
|
||||
- title: 'The Fediverse'
|
||||
url: 'https://pleroma.envs.net/notice/AQs97KWObcsL5o0flw'
|
||||
---
|
||||
|
||||
> I run Lighthouse and WAVE as a "Hey, let's see what I have ahead of me" kind of thing. A baseline of sorts. Then I go into manual testing
|
||||
|
|
0
data/.webmentions-will-go-here
Normal file
0
data/.webmentions-will-go-here
Normal file
|
@ -7,13 +7,7 @@
|
|||
<p>This site supports <a href="https://indieweb.org/webmention">Webmentions</a>, a backlink-based alternative to traditional comment forms.</p>
|
||||
{{ partial "webmention-form.html" . }}
|
||||
{{- /* Fetch all webmentions with bearer token */ -}}
|
||||
{{ $bearer_token := "" }}
|
||||
{{- with readFile ".webmentiond-token" -}}
|
||||
{{- $auth := printf "Bearer %s" . -}}
|
||||
{{- $bearer_token = dict "Authorization" $auth -}}
|
||||
{{- end -}}
|
||||
{{- $mentionsURL := "https://seirdy.one/webmentions/manage/mentions?limit=9999&status=approved" -}}
|
||||
{{- $allMentions := (getJSON $mentionsURL $bearer_token).items -}}
|
||||
{{- $allMentions := (index .Site.Data "webmentions").items -}}
|
||||
{{- /* Filter webmentions to just the ones for the current targets */ -}}
|
||||
{{- $canonicalRelPermalink := .RelPermalink | replaceRE "^/~seirdy/" "/" -}}
|
||||
{{- $target := printf "%s%s" .Site.Params.CanonicalBaseURL $canonicalRelPermalink -}}
|
||||
|
|
|
@ -18,9 +18,7 @@ key="$(_key)"
|
|||
set -u
|
||||
|
||||
# just a lil curl wrapper I use on seirdy.one
|
||||
ccurl() {
|
||||
curl --proto "=https" --proto-default https --tlsv1.3 --cert-status --compressed $*
|
||||
}
|
||||
alias ccurl='curl --proto "=https" --proto-default https --tlsv1.3 --cert-status --compressed'
|
||||
|
||||
_token() {
|
||||
ccurl -sX POST https://seirdy.one/webmentions/authenticate/access-key -d "key=$key"
|
||||
|
@ -29,4 +27,5 @@ _token() {
|
|||
token="$(_token)"
|
||||
|
||||
set +u
|
||||
printf '%s' "$token" >.webmentiond-token
|
||||
ccurl -H "Authorization: Bearer $token" 'https://seirdy.one/webmentions/manage/mentions?limit=9999&status=approved' >data/webmentions.json
|
||||
# printf '%s' "$token" >.webmentiond-token
|
||||
|
|
Loading…
Reference in a new issue