mirror of
https://git.sr.ht/~seirdy/seirdy.one
synced 2024-11-10 00:12:09 +00:00
Compare commits
12 commits
672d89d007
...
840bf38de6
Author | SHA1 | Date | |
---|---|---|---|
|
840bf38de6 | ||
|
74842ce644 | ||
|
f271291f49 | ||
|
a9ebc9e0c4 | ||
|
f52aaed4f2 | ||
|
1d43cce53e | ||
|
cb26956bca | ||
|
b02a619260 | ||
|
449a1be659 | ||
|
c1f991efff | ||
|
6a47371a05 | ||
|
e77046bf99 |
29 changed files with 254 additions and 108 deletions
|
@ -7,7 +7,7 @@ packages:
|
|||
- rsync
|
||||
- git # for Hugo's gitInfo
|
||||
- bmake
|
||||
- moreutils
|
||||
- libxml2-utils # for xmllint
|
||||
sources:
|
||||
- https://git.sr.ht/~seirdy/seirdy.one
|
||||
secrets:
|
||||
|
|
27
Makefile
27
Makefile
|
@ -42,7 +42,7 @@ lint-css: $(CSS_DIR)/*.css
|
|||
|
||||
.PHONY: lint-html
|
||||
lint-html:
|
||||
$(VNU) --stdout --format json --skip-non-html --also-check-svg $(OUTPUT_DIR) | jq --from-file linter-configs/vnu_filter.jq
|
||||
$(VNU) --stdout --format json --skip-non-html --also-check-svg $(OUTPUT_DIR) | sh scripts/filter-vnu.sh
|
||||
|
||||
.PHONY: hint
|
||||
hint: hugo .hintrc-local
|
||||
|
@ -105,11 +105,11 @@ deploy: deploy-html deploy-gemini
|
|||
@$(MAKE) clean
|
||||
@$(MAKE) hugo
|
||||
@$(MAKE) xhtmlize
|
||||
@$(MAKE) compress
|
||||
|
||||
# deploy steps need to happen one at a time
|
||||
.PHONY: deploy-prod
|
||||
deploy-prod: .prepare-deploy
|
||||
@$(MAKE) compress
|
||||
@$(MAKE) deploy
|
||||
|
||||
.PHONY: deploy-onion
|
||||
|
@ -119,23 +119,18 @@ deploy-onion:
|
|||
# we only deploy html to the staging site
|
||||
.PHONY: deploy-staging
|
||||
deploy-staging:
|
||||
@$(MAKE) HUGO_FLAGS='--gc' DOMAIN=staging.seirdy.one USER=deploy@seirdy.one OUTPUT_DIR=public_staging .prepare-deploy
|
||||
@$(MAKE) HUGO_FLAGS='--gc' DOMAIN=staging.seirdy.one USER=deploy@seirdy.one OUTPUT_DIR=public_staging deploy-html
|
||||
|
||||
# we can lint and compress in parallel if cores are available
|
||||
.PHONY: .lint-and-prepare-deploy
|
||||
.lint-and-prepare-deploy:
|
||||
@$(MAKE) clean
|
||||
@$(MAKE) hugo
|
||||
@$(MAKE) xhtmlize
|
||||
@$(MAKE) lint-local compress
|
||||
@$(MAKE) HUGO_FLAGS='' DOMAIN=staging.seirdy.one USER=deploy@seirdy.one OUTPUT_DIR=public_staging .prepare-deploy
|
||||
@$(MAKE) HUGO_FLAGS='' DOMAIN=staging.seirdy.one USER=deploy@seirdy.one OUTPUT_DIR=public_staging compress
|
||||
@$(MAKE) HUGO_FLAGS='' DOMAIN=staging.seirdy.one USER=deploy@seirdy.one OUTPUT_DIR=public_staging deploy-html
|
||||
|
||||
.PHONY: lint-and-deploy-staging
|
||||
lint-and-deploy-staging:
|
||||
@$(MAKE) HUGO_FLAGS='--gc' DOMAIN=staging.seirdy.one USER=deploy@seirdy.one OUTPUT_DIR=public_staging .lint-and-prepare-deploy
|
||||
@$(MAKE) HUGO_FLAGS='--gc' DOMAIN=staging.seirdy.one USER=deploy@seirdy.one OUTPUT_DIR=public_staging deploy-html
|
||||
@$(MAKE) HUGO_FLAGS='' DOMAIN=staging.seirdy.one USER=deploy@seirdy.one OUTPUT_DIR=public_staging .prepare-deploy
|
||||
@$(MAKE) HUGO_FLAGS='' DOMAIN=staging.seirdy.one USER=deploy@seirdy.one OUTPUT_DIR=public_staging compress lint-local
|
||||
@$(MAKE) HUGO_FLAGS='' DOMAIN=staging.seirdy.one USER=deploy@seirdy.one OUTPUT_DIR=public_staging deploy-html
|
||||
|
||||
.PHONY: deploy-envs
|
||||
deploy-envs:
|
||||
@$(MAKE) NO_STATIC=1 HUGO_FLAGS='--gc' USER=seirdy@envs.net WWW_ROOT=/home/seirdy/public_html GEMINI_ROOT=/home/seirdy/public_gemini HUGO_BASEURL='https://envs.net/~seirdy/' OUTPUT_DIR=public_envs .lint-and-prepare-deploy
|
||||
@$(MAKE) NO_STATIC=1 HUGO_FLAGS='--gc' USER=seirdy@envs.net WWW_ROOT=/home/seirdy/public_html GEMINI_ROOT=/home/seirdy/public_gemini HUGO_BASEURL='https://envs.net/~seirdy/' OUTPUT_DIR=public_envs deploy
|
||||
@$(MAKE) NO_STATIC=1 HUGO_FLAGS='' USER=seirdy@envs.net WWW_ROOT=/home/seirdy/public_html GEMINI_ROOT=/home/seirdy/public_gemini HUGO_BASEURL='https://envs.net/~seirdy/' OUTPUT_DIR=public_envs .prepare-deploy
|
||||
@$(MAKE) NO_STATIC=1 HUGO_FLAGS='' USER=seirdy@envs.net WWW_ROOT=/home/seirdy/public_html GEMINI_ROOT=/home/seirdy/public_gemini HUGO_BASEURL='https://envs.net/~seirdy/' OUTPUT_DIR=public_envs lint-local
|
||||
@$(MAKE) NO_STATIC=1 HUGO_FLAGS='' USER=seirdy@envs.net WWW_ROOT=/home/seirdy/public_html GEMINI_ROOT=/home/seirdy/public_gemini HUGO_BASEURL='https://envs.net/~seirdy/' OUTPUT_DIR=public_envs deploy
|
||||
|
|
|
@ -9,8 +9,8 @@
|
|||
"description": "{{ .Site.Params.Description }}",
|
||||
"lang": "en-US",
|
||||
"display": "minimal-ui",
|
||||
"theme_color": "#0f0f0b",
|
||||
"background_color": "#0f0f0b",
|
||||
"theme_color": "#191919",
|
||||
"background_color": "#191919",
|
||||
"scope": "/",
|
||||
"start_url": "/",
|
||||
"icons": [
|
||||
|
|
|
@ -13,7 +13,7 @@ sitemap:
|
|||
Seirdy’s Home
|
||||
=============
|
||||
|
||||
I'm <a itemprop="url" href="https://seirdy.one" rel="author me home canonical" class="u-url u-uid url"> {{% indieweb-icon %}} <span itemprop="name" class="p-name fn n"> <span itemprop="givenName" class="p-given-name given-name">Rohan</span> <span itemprop="familyName" class="p-family-name family-name">Kumar</span></span></a>, a.k.a. <span itemprop="alternateName" class="p-nickname nickname">Seirdy</span> (online handle).
|
||||
I'm <a itemprop="url" href="https://seirdy.one" rel="author me home canonical" class="u-url u-uid url"> {{% indieweb-icon %}} <span itemprop="name" class="p-name fn n"> <span itemprop="givenName" class="p-given-name given-name">Rohan</span> <span itemprop="familyName" class="p-family-name family-name">Kumar</span></span></a>, a.k.a. <span itemprop="alternateName" class="p-nickname nickname">Seirdy</span> (online handle).
|
||||
|
||||
Other versions of this website
|
||||
------------------------------
|
||||
|
|
14
content/notes/JS-enabled-engines.md
Normal file
14
content/notes/JS-enabled-engines.md
Normal file
|
@ -0,0 +1,14 @@
|
|||
---
|
||||
title: "JS-enabled engines"
|
||||
date: 2022-06-02T18:30:30-07:00
|
||||
replyURI: "https://mk.nixnet.social/notes/911asmc9rn"
|
||||
replyTitle: "if search engine crawlers didn't run JavaScript the Web would be better"
|
||||
replyType: "SocialMediaPosting"
|
||||
replyAuthor: "Alexandra"
|
||||
replyAuthorURI: "https://www.alm.website/me"
|
||||
---
|
||||
The only engines I know of that run JavaScript are Google, Bing, and maybe Petal. None of the other engines in my list appear to support it. I don't even think Yandex does.
|
||||
|
||||
It's common practice for sites to give a JavaScript-lite version to search engines, though if the content differs heavily you run the risk of hitting a manual action. I'd imagine that search-crawler-exclusive editions would become the norm if crawlers stopped handling JavaScript.
|
||||
|
||||
Marginalia actually seems to penalize its use.
|
|
@ -1,12 +1,13 @@
|
|||
---
|
||||
title: "Answer engines"
|
||||
date: 2022-05-25T19:59:08+00:00
|
||||
lastMod: 2022-05-25T19:59:08+00:00
|
||||
replyURI: "https://kevq.uk/is-duckduckgo-duckduckdone/"
|
||||
replyTitle: "Is DuckDuckGo, DuckDuckDone?"
|
||||
replyType: "BlogPosting"
|
||||
replyAuthor: "Kev Quirk"
|
||||
replyAuthorURI: "https://kevq.uk/about/"
|
||||
---
|
||||
<aside role="note">
|
||||
|
||||
Reply to {{< mention-work itemprop="about" itemtype="BlogPosting" reply=true >}}{{<cited-work name="Is DuckDuckGo, DuckDuckDone?" extraName="headline" url="https://kevq.uk/is-duckduckgo-duckduckdone/">}} by {{<indieweb-person first-name="Kev" last-name="Quirk" url="https://kevq.uk/about/" itemprop="author">}}{{</mention-work>}}
|
||||
|
||||
</aside>
|
||||
|
||||
I read your article and share similar concerns. Using Microsoft Bing and Google Search's commercial APIs generally requires accepting some harsh terms, including a ban on mixing <abbr title="Search Engine Result Pages">SERPs</abbr> from multiple sources (this is why Ixquick shut down and the company pivoted to the Google-exclusive Startpage search service). But the requirement to allow trackers in a companion web browser was new to me.
|
||||
|
||||
|
|
|
@ -1,13 +1,15 @@
|
|||
---
|
||||
title: "Commodified and commoditized"
|
||||
date: 2022-06-01T00:47:55-07:00
|
||||
lastMod: 2022-06-01T00:47:55-07:00
|
||||
replyURI: "https://toot.cat/@idlestate/108396947965094826"
|
||||
replyTitle: "not only are we not the customer, we aren't even the product: We're the commodified complement of the product"
|
||||
replyType: "SocialMediaPosting"
|
||||
replyAuthor: "@idlestate@toot.cat"
|
||||
replyAuthorURI: https://toot.cat/@idlestate/
|
||||
---
|
||||
<aside role="note">
|
||||
Reply to {{< mention-work itemprop="about" itemtype="SocialMediaPosting" reply=true >}}{{<cited-work name="not only are we not the customer, we aren't even the product: We're the commodified complement of the product." url="https://toot.cat/@idlestate/108396947965094826">}} by {{<indieweb-person name="@idlestate@toot.cat" url="https://toot.cat/@idlestate" itemprop="author">}}
|
||||
{{</mention-work>}}
|
||||
</aside>
|
||||
|
||||
Commodification means something else; I'm assuming you're referring to "commoditize", as in "commoditize your complement". Although in this context the words have some _really interesting_ overlap, which is why I brought it up. See {{<mention-work itemprop="citation" role="doc-credit" itemtype="BlogPosting">}}{{<cited-work url="https://rushkoff.com/commodified-vs-commoditized/" name="Commodified vs. Commoditized">}} by {{<indieweb-person first-name="Douglas" last-name="Rushkoff" url="https://rushkoff.com">}}{{</mention-work>}}.
|
||||
Commodification means something else; I'm assuming you're referring to "commoditize", as in "commoditize your complement". Although in this context the words have some _really interesting_ overlap, which is why I brought it up. See {{<mention-work itemprop="citation" role="doc-credit" itemtype="BlogPosting">}}{{<cited-work url="https://rushkoff.com/commodified-vs-commoditized/" name="Commodified vs. Commoditized">}} by {{<indieweb-person first-name="Douglas" last-name="Rushkoff" url="https://rushkoff.com" itemprop="author">}}{{</mention-work>}}.
|
||||
|
||||
We are first commodified by being made a complement to a product, then gradually commoditized as complements ideally are.
|
||||
|
||||
|
|
|
@ -1,12 +1,13 @@
|
|||
---
|
||||
title: "On displaying word counts"
|
||||
date: 2022-05-29T12:00:04-07:00
|
||||
lastMod: 2022-05-29T12:00:04-07:00
|
||||
replyURI: "https://social.treehouse.systems/@ayushnix/108364036611051719"
|
||||
replyTitle: "What's your opinion on writing the number of words in a blog post and the estimated time it'll take to read it?"
|
||||
replyType: "SocialMediaPosting"
|
||||
replyAuthor: "Ayush Agarwal"
|
||||
replyAuthorURI: "https://microblog.ayushnix.com/"
|
||||
---
|
||||
<aside role="note">
|
||||
Reply to {{< mention-work itemprop="about" itemtype="SocialMediaPosting" reply=true >}}{{<cited-work name="What's your opinion on writing the number of words in a blog post and the estimated time it'll take to read it?" url="https://social.treehouse.systems/@ayushnix/108364036611051719">}} by {{<indieweb-person first-name="Ayush" last-name="Agarwal" url="https://microblog.ayushnix.com/" itemprop="author">}}
|
||||
{{</mention-work>}}
|
||||
</aside>
|
||||
|
||||
Some of my posts are long. My longest post is almost 20k words as of right now (60-80 pages printed out), and will get longer as I update it.
|
||||
|
||||
Length is an imperfect yet useful measure of the amount of detail one can expect. There are many "lists of practices" on the Web about web design. By communicating that mine would take an hour and a half to read, I communicate that my list has some more thought put into it.
|
||||
|
|
|
@ -1,11 +1,12 @@
|
|||
---
|
||||
title: "Pale Moon"
|
||||
date: 2022-06-01T09:59:32-07:00
|
||||
replyURI: "https://social.treehouse.systems/@ayushnix/108403066213035358"
|
||||
replyTitle: "I've never used Pale Moon but I also don't understand why anyone would use it. If I'm not mistaken, Pale Moon exists because it didn't want to part ways with XUL extensions?"
|
||||
replyType: "SocialMediaPosting"
|
||||
replyAuthor: "Ayush Agarwal"
|
||||
replyAuthorURI: "https://microblog.ayushnix.com/"
|
||||
---
|
||||
<aside role="note">
|
||||
Reply to {{< mention-work itemprop="about" itemtype="SocialMediaPosting" reply=true >}}{{<cited-work name="I've never used Pale Moon but I also don't understand why anyone would use it. If I'm not mistaken, Pale Moon exists because it didn't want to part ways with XUL extensions?" url="https://social.treehouse.systems/@ayushnix/108403066213035358">}} by {{<indieweb-person first-name="Ayush" last-name="Agarwal" url="https://microblog.ayushnix.com/" itemprop="author">}}
|
||||
{{</mention-work>}}
|
||||
</aside>
|
||||
|
||||
Pale Moon's inception pre-dates Firefox 57 by many years; before its notoriety following the removal of XUL/XPCOM, it was popular among people who didn't like Electrolysis.
|
||||
|
||||
|
@ -16,3 +17,4 @@ WebExtensions that fill in missing functionality often require content injection
|
|||
I still wouldn't recommend it due to extremely weak sandboxing and a naive approach to security. The devs respond to sandboxing queries by saying it's secure because "it separates the content and application" which tells you how little they care or understand; untrusted content needs isolation not just from the browser but from other untrusted content. Given the scope of a browser, even Firefox isn't where it should be (even given their commendable progress on Fission, RLBox, and their utility process overhaul), let alone caught up to the mitigations in Chromium's Blink or WebKit's JavaScriptCore but I digress.
|
||||
|
||||
It'd be totally fine if they described their browser as a complement to a more airtight one or as a dev tool (it's honestly a great dev tool given some addons, I'll happily concede that). But when you describe yourself as a replacement to other browsers but lack the security architecture to back it up, you're being irresponsible.
|
||||
|
||||
|
|
|
@ -1,12 +1,14 @@
|
|||
---
|
||||
title: "Signal security"
|
||||
date: 2022-05-26T12:18:24-07:00
|
||||
lastMod: 2022-05-26T12:18:24-07:00
|
||||
replyURI: "https://disqordia.space/notice/AJqmgRLFlyVENIXcDA"
|
||||
replyTitle: "europe wants to ban signal"
|
||||
replyType: "SocialMediaPosting"
|
||||
replyAuthor: "chjara"
|
||||
replyAuthorURI: "https://tuxcrafting.online/"
|
||||
---
|
||||
<aside role="note">
|
||||
Reply to {{< mention-work itemprop="about" itemtype="SocialMediaPosting" reply=true >}}{{<cited-work name="europe wants to ban signal" url="https://disqordia.space/notice/AJqmgRLFlyVENIXcDA">}} by {{<indieweb-person name="chjara" url="https://tuxcrafting.online/" itemprop="author">}}
|
||||
{{</mention-work>}}
|
||||
</aside>
|
||||
|
||||
What do you mean by "false sense of security"? Signal's cryptography is pretty solid. It's one of the only messengers with such a lack of metadata leakage; if you combine it with Tor you can add enough noise to the network-layer metadata to be more private than almost any alternative.
|
||||
|
||||
Don't get me wrong, [I dislike it on the grounds of being a closed platform](../../../../../posts/2021/01/27/whatsapp-and-the-domestication-of-users/), but few alternatives exist that support both offline messaging and have such little metadata leakage. I'm willing to hear suggested alternatives that do not bake a "cryptographically-secure, decentralized pyramid scheme" (cryptocurrency) into the protocol. I'm not aware of any such alternative at the moment.
|
||||
|
||||
|
|
|
@ -1,18 +1,20 @@
|
|||
---
|
||||
title: "Things can get better"
|
||||
date: 2022-05-30T13:24:30-07:00
|
||||
lastMod: 2022-05-30T13:24:30-07:00
|
||||
replyURI: "https://mastodon.art/@TerryHancock/108392295120692087"
|
||||
replyTitle: "Being annoyed with software is always going to be a part of the experience"
|
||||
replyType: "SocialMediaPosting"
|
||||
replyAuthor: "Terry Hancock"
|
||||
replyAuthorURI: "https://mastodon.art/@TerryHancock"
|
||||
---
|
||||
<aside role="note">
|
||||
Reply to {{< mention-work itemprop="about" itemtype="SocialMediaPosting" reply=true >}}{{<cited-work name="Being annoyed with software is always going to be a part of the experience" url="https://mastodon.art/@TerryHancock/108392295120692087">}} by {{<indieweb-person first-name="Terry" last-name="Hancock" url="https://mastodon.art/@TerryHancock" itemprop="author">}}
|
||||
{{</mention-work>}}
|
||||
</aside>
|
||||
|
||||
I'm in partial agreement with this take.
|
||||
|
||||
On one hand, expectations change with time. Most people outside my bubble look at interfaces I like using and say they look "ugly" and that they're "weird" (their words); they wouldn't have said that when I was younger.
|
||||
|
||||
On the other hand, some "annoyances" are actually removable *barriers*. Accessibility comes to mind. If you take software that does not work with assistive technologies (ATs) and fix it, AT-users might move on to the next accessibility issue. But they'll be markedly happier than before, when they just couldn't use it.
|
||||
On the other hand, some "annoyances" are actually removable _barriers_. Accessibility comes to mind. If you take software that does not work with assistive technologies (ATs) and fix it, AT-users might move on to the next accessibility issue. But they'll be markedly happier than before, when they just couldn't use it.
|
||||
|
||||
Similar examples include localization and compatibility.
|
||||
|
||||
Man, positive takes like this feel really out of character for me.
|
||||
|
||||
|
|
|
@ -2,21 +2,8 @@
|
|||
<html xmlns="http://www.w3.org/1999/xhtml" lang="{{- default "" .Site.LanguageCode }}" xml:lang="{{- default "" .Site.LanguageCode }}" prefix="cc: http://creativecommons.org/ns#">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="disabled-adaptations" content="watch" /><meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />
|
||||
<meta name="robots" content="noindex,nofollow" />
|
||||
<title>{{ .Title }}</title>
|
||||
{{ if not (in site.BaseURL ".onion") -}}
|
||||
{{ $icon_svg := resources.Get "/favicon.svg" | resources.Fingerprint "md5" }}
|
||||
{{- printf `<link rel="icon" sizes="any" href="%s" type="image/svg+xml" />` $icon_svg.RelPermalink | safeHTML }}
|
||||
{{- end }}
|
||||
{{ $icon_192 := resources.Get "/apple-touch-icon.png" | resources.Fingerprint "md5" }}
|
||||
{{- printf `<link rel="icon" sizes="192x192" href="%s" type="image/png" />` $icon_192.RelPermalink | safeHTML -}}
|
||||
{{ $favicon := resources.Get "/favicon.png" -}}
|
||||
{{ $favicon_base64 := $favicon.Content | base64Encode }}
|
||||
{{ printf `<link rel="icon" sizes="32x32" href="data:image/png;base64,%s" type="image/png" />` $favicon_base64 | safeHTML }}
|
||||
<meta name="color-scheme" content="light dark" />
|
||||
<meta name="theme-color" content="#111" media="(prefers-color-scheme:dark)" />
|
||||
<meta name="theme-color" content="#fff" media="(prefers-color-scheme:light)" />
|
||||
<meta name="disabled-adaptations" content="watch" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />
|
||||
<!-- inline CSS; remember to allow it with a hash in the CSP -->
|
||||
{{- $resources := slice -}}
|
||||
{{- $resources = $resources | append (resources.Get "/css/main.css") -}}
|
||||
|
@ -27,7 +14,17 @@
|
|||
{{ $resources = $resources | append (resources.Get "css/print.css" | resources.ExecuteAsTemplate "print.css" .) -}}
|
||||
{{- $css := $resources | resources.Concat "css/style.css" | minify -}}
|
||||
<style>{{ $css.Content | safeCSS }}</style>
|
||||
{{ hugo.Generator }}
|
||||
<meta name="robots" content="noindex,nofollow" />
|
||||
<title>{{ .Title }}</title>
|
||||
{{ if not (in site.BaseURL ".onion") -}}
|
||||
{{ $icon_svg := resources.Get "/favicon.svg" | resources.Fingerprint "md5" }}
|
||||
{{- printf `<link rel="icon" sizes="any" href="%s" type="image/svg+xml" />` $icon_svg.RelPermalink | safeHTML }}
|
||||
{{- end }}
|
||||
{{ $icon_192 := resources.Get "/apple-touch-icon.png" | resources.Fingerprint "md5" }}
|
||||
{{- printf `<link rel="icon" sizes="192x192" href="%s" type="image/png" />` $icon_192.RelPermalink | safeHTML -}}
|
||||
<meta name="color-scheme" content="light dark" />
|
||||
<meta name="theme-color" content="#191919" media="(prefers-color-scheme:dark)" />
|
||||
<meta name="theme-color" content="#fff" media="(prefers-color-scheme:light)" />
|
||||
</head>
|
||||
<body>
|
||||
<header>
|
||||
|
|
|
@ -2,13 +2,35 @@
|
|||
{{- if .IsHome }}
|
||||
{{- $pages = where .Site.RegularPages "Section" "" -}}
|
||||
{{ end -}}
|
||||
{{- $type := "article" -}}
|
||||
{{- $period := "daily" -}}
|
||||
{{- if eq .Section "notes" -}}
|
||||
{{- $type = "note" -}}
|
||||
{{- $period = "hourly" -}}
|
||||
{{- end -}}
|
||||
{{- $icon_svg := resources.Get "/favicon.svg" | resources.Fingerprint "md5" -}}
|
||||
{{- $icon_png := resources.Get "/apple-touch-icon.png" | resources.Fingerprint "md5" -}}
|
||||
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
|
||||
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="{{ .Site.LanguageCode }}">
|
||||
<feed
|
||||
xmlns="http://www.w3.org/2005/Atom"
|
||||
xmlns:activity="http://activitystrea.ms/spec/1.0/"
|
||||
xmlns:media="http://search.yahoo.com/mrss/"
|
||||
xmlns:ostatus="http://ostatus.org/schema/1.0"
|
||||
xmlns:poco="http://portablecontacts.net/spec/1.0"
|
||||
xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
|
||||
xmlns:thr="http://purl.org/syndication/thread/1.0"
|
||||
xml:lang="{{ .Site.LanguageCode }}">
|
||||
<title>{{ .Section | humanize}} on {{ .Site.Title }}</title>
|
||||
<link rel="self" type="application/atom+xml" href="{{ .Permalink }}atom.xml" />
|
||||
<logo>{{ $icon_png.Permalink }}</logo>
|
||||
<icon>{{ .Site.Params.icon | absURL }}</icon>
|
||||
<subtitle>{{ .Params.Description }}</subtitle>
|
||||
<sy:updatePeriod>{{ $period }}</sy:updatePeriod>
|
||||
<sy:updateFrequency>2</sy:updateFrequency>
|
||||
<author>
|
||||
<activity:object-type>http://activitystrea.ms/schema/1.0/person</activity:object-type>
|
||||
<poco:preferredUsername>Seirdy</poco:preferredUsername>
|
||||
<poco:displayName>Seirdy</poco:displayName>
|
||||
<name>Rohan Kumar</name>
|
||||
<uri>https://seirdy.one/</uri>
|
||||
</author>
|
||||
|
@ -16,8 +38,8 @@
|
|||
<id>{{ .Permalink }}</id>
|
||||
{{ range $pages }}
|
||||
<entry>
|
||||
<title type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml">{{ .Title | safeHTML }}</div></title>
|
||||
<link href="{{ .Permalink }}" />
|
||||
<title>{{ .Title }}</title>
|
||||
<link rel="alternate" type="text/html" href="{{ .Permalink }}" />
|
||||
<published>{{ .Date.Format "2006-01-02T15:04:05-07:00" | safeHTML }}</published>
|
||||
<updated>{{ .Lastmod.Format "2006-01-02T15:04:05-07:00" | safeHTML }}</updated>
|
||||
<author>
|
||||
|
@ -26,18 +48,22 @@
|
|||
</author>
|
||||
<id>{{ .Permalink }}</id>
|
||||
<rights>CC-BY-SA 4.0 by Rohan Kumar</rights>
|
||||
{{- with .Params.replyURI }}
|
||||
<thr:in-reply-to ref="{{ . }}" href="{{ . }}" />
|
||||
{{- end -}}
|
||||
{{- with .Params.replyAuthorURI }}
|
||||
<link rel="mentioned" ostatus:object-type="http://activitystrea.ms/schema/1.0/person" href="{{ . }}"/>
|
||||
{{- end -}}
|
||||
<content type="xhtml" xml:base="{{ .Permalink }}">
|
||||
<div xmlns="http://www.w3.org/1999/xhtml">
|
||||
{{- if .Params.replyURI -}}
|
||||
{{- partial "reply-context" .Params | replaceRE `(?: )?(?:item(type|scope|prop|id|ref)="[^"]*"|class="language-figure")` "" | safeHTML }}
|
||||
{{- end -}}
|
||||
{{ partial "processed-content.html" . | replaceRE `(?: )?(?:item(type|scope|prop|id|ref)="[^"]*"|class="language-figure")` "" | safeHTML }}
|
||||
</div>
|
||||
</content>
|
||||
<object-type xmlns="http://activitystrea.ms/spec/1.0/">
|
||||
{{- if eq .Section "notes" -}}
|
||||
note
|
||||
{{- else if eq .Section "posts" -}}
|
||||
article
|
||||
{{- end -}}
|
||||
</object-type>
|
||||
<activity:object-type>http://activitystrea.ms/schema/1.0/{{ $type }}</activity:object-type>
|
||||
<activity:verb>http://activitystrea.ms/schema/1.0/post</activity:verb>
|
||||
</entry>
|
||||
{{ end }}
|
||||
</feed>
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
<main itemprop="mainEntity" class="h-feed hfeed" itemscope="" itemtype="https://schema.org/DataFeed">
|
||||
<h1 class="p-name" itemprop="name headline" id="notes">Notes</h1>
|
||||
<p>This is my microblog. These are my short informal entries, sorted by date (newest first). For longer entries, <a href="../posts/">see my blog</a>.</p>
|
||||
<p>An <a href="./atom.xml">Atom</a> and <a href="./index.xml">RSS</a> feed is availabe, containing the full text of all my notes.</p>
|
||||
<p>An <a href="./atom.xml">Atom</a> feed is availabe, containing the full text of all my notes. A legacy <a href="./index.xml">RSS</a> feed also exists.</p>
|
||||
<p role="doc-tip">
|
||||
Timestamp format: <code>YYYY-MM-DD HH:MM:SS</code>, as per <cite><a href="https://www.ietf.org/rfc/rfc3339.txt">RFC 3339</a></cite>
|
||||
</p>
|
||||
|
@ -21,7 +21,12 @@
|
|||
{{- if gt (sub .Lastmod.Unix .Date.Unix) 3600 -}}
|
||||
, updated <time{{ if not (.Params.evergreen) }} itemprop="dateModified" class="dt-updated updated"{{ end }} datetime="{{ .Lastmod.Format "2006-01-02 15:04:05Z07:00" }}">{{ .Lastmod.Format "2006-01-02 15:04:05" }}</time>
|
||||
{{- end }}
|
||||
<div class="e-content entry-content" itemprop="articleBody">{{ partial "processed-content.html" . }}</div>
|
||||
<div class="e-content entry-content" itemprop="articleBody">
|
||||
{{- if .Params.replyURI -}}
|
||||
{{- partial "reply-context" .Params -}}
|
||||
{{- end -}}
|
||||
{{ partial "processed-content.html" . }}
|
||||
</div>
|
||||
</article>
|
||||
</li>
|
||||
{{- end }}
|
||||
|
|
|
@ -11,13 +11,26 @@
|
|||
{{- $pages = $pages | first $limit -}}
|
||||
{{- end -}}
|
||||
{{- $currentSection := .Section -}}
|
||||
{{- $type := "article" -}}
|
||||
{{- $period := "daily" -}}
|
||||
{{- $mins := "1440" -}}
|
||||
{{- if eq .Section "notes" -}}
|
||||
{{- $type = "note" -}}
|
||||
{{- $period = "hourly" -}}
|
||||
{{- $mins = "60" -}}
|
||||
{{- end -}}
|
||||
{{- printf "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"yes\"?>" | safeHTML }}
|
||||
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
|
||||
<rss version="2.0"
|
||||
xmlns:atom="http://www.w3.org/2005/Atom"
|
||||
xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
|
||||
xml:lang="{{ .Site.LanguageCode }}">
|
||||
<channel>
|
||||
<title>{{ if eq .Title .Site.Title }}{{ .Site.Title }}{{ else }}{{ with .Title }}{{.}} on {{ end }}{{ .Site.Title }}{{ end }}</title>
|
||||
<link>{{ .Permalink }}</link>
|
||||
<description>Recent content {{ if ne .Title .Site.Title }}{{ with .Title }}in {{.}} {{ end }}{{ end }}on {{ .Site.Title }}</description>
|
||||
<ttl>1440</ttl>
|
||||
<ttl>{{ $mins }}</ttl>
|
||||
<sy:updatePeriod>{{ $period }}</sy:updatePeriod>
|
||||
<sy:updateFrequency>1</sy:updateFrequency>
|
||||
<generator>Hugo -- gohugo.io</generator>{{ with .Site.LanguageCode }}
|
||||
<language>{{.}}</language>{{end}}{{ with .Site.Author.email }}
|
||||
<managingEditor>{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}</managingEditor>{{end}}{{ with .Site.Author.email }}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<footer>
|
||||
<p>
|
||||
Copyright<span aria-hidden="true"> ©</span> <time itemprop="copyrightYear" datetime="{{now.Year}}">{{now.Year}}</time> {{- partial "indieweb-author.html" -}}
|
||||
Copyright <time itemprop="copyrightYear" datetime="{{now.Year}}">{{now.Year}}</time> {{ partial "indieweb-author.html" -}}
|
||||
</p>
|
||||
{{ partial "search.html" }}
|
||||
<nav aria-label="site info">
|
||||
|
|
|
@ -9,6 +9,9 @@
|
|||
<div class="e-content entry-content" itemprop="articleBody">
|
||||
<meta itemprop="author" content="Rohan Kumar" />
|
||||
<!--That was needed bc some reading modes get confused by other authors referenced in the text-->
|
||||
{{- if .Params.replyURI -}}
|
||||
{{- partial "reply-context" .Params -}}
|
||||
{{- end -}}
|
||||
{{- partial "processed-content" . -}}
|
||||
</div>
|
||||
</article>
|
||||
|
|
|
@ -1,7 +1,18 @@
|
|||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
{{- $canonicalRelPermalink := .RelPermalink | replaceRE "^/~seirdy/" "/" }}
|
||||
<meta name="disabled-adaptations" content="watch" /><meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />
|
||||
<meta name="disabled-adaptations" content="watch" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />
|
||||
<!-- inline CSS; remember to allow it with a hash in the CSP -->
|
||||
{{- $resources := slice -}}
|
||||
{{- $resources = $resources | append (resources.Get "/css/main.css") -}}
|
||||
{{ $dark := .Site.Params.dark | default "auto" -}}
|
||||
{{- if not (eq $dark "off") -}}
|
||||
{{ $resources = $resources | append (resources.Get "css/dark.css" | resources.ExecuteAsTemplate "dark.css" .) -}}
|
||||
{{- end -}}
|
||||
{{ $resources = $resources | append (resources.Get "css/print.css" | resources.ExecuteAsTemplate "print.css" .) -}}
|
||||
{{- $css := $resources | resources.Concat "css/style.css" | minify -}}
|
||||
<style>{{ $css.Content | safeCSS }}</style>
|
||||
{{ if or (eq site.BaseURL site.Params.CanonicalBaseURL) (in site.BaseURL "wgq3bd2kqoybhstp77i3wrzbfnsyd27wt34psaja4grqiezqircorkyd.onion") -}}
|
||||
<meta name="robots" content="index,follow,max-image-preview:large,max-snippet=-1" />
|
||||
{{ end -}}
|
||||
|
@ -44,18 +55,8 @@
|
|||
{{- printf `<link rel="icon" sizes="192x192" href="%s" type="image/png" />` $icon_192.RelPermalink | safeHTML -}}
|
||||
<meta name="color-scheme" content="light dark" />
|
||||
<meta name="format-detection" content="telephone=no" /><!-- Why does apple do this -->
|
||||
<meta name="theme-color" content="#111" media="(prefers-color-scheme:dark)" />
|
||||
<meta name="theme-color" content="#191919" media="(prefers-color-scheme:dark)" />
|
||||
<meta name="theme-color" content="#fff" media="(prefers-color-scheme:light)" />
|
||||
<!-- inline CSS; remember to allow it with a hash in the CSP -->
|
||||
{{- $resources := slice -}}
|
||||
{{- $resources = $resources | append (resources.Get "/css/main.css") -}}
|
||||
{{ $dark := .Site.Params.dark | default "auto" -}}
|
||||
{{- if not (eq $dark "off") -}}
|
||||
{{ $resources = $resources | append (resources.Get "css/dark.css" | resources.ExecuteAsTemplate "dark.css" .) -}}
|
||||
{{- end -}}
|
||||
{{ $resources = $resources | append (resources.Get "css/print.css" | resources.ExecuteAsTemplate "print.css" .) -}}
|
||||
{{- $css := $resources | resources.Concat "css/style.css" | minify -}}
|
||||
<style>{{ $css.Content | safeCSS }}</style>
|
||||
<meta property="og:title" content="{{ .Title }}" />
|
||||
<meta property="og:site_name" content="{{ $.Site.Title }}" />
|
||||
{{- if not (or (ne "page" .Kind) (eq $canonicalRelPermalink "/bookmarks/") (eq $canonicalRelPermalink "/posts/")) }}
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
{{- else -}}
|
||||
{{- $logURL = $logURL | strings.ReplaceRE `\.md` `.gmi` -}}
|
||||
{{- end -}}
|
||||
{{- $action }} <time{{ if not (.Params.evergreen) }} itemprop="dateCreated datePublished" class="dt-published published"{{ end }} datetime="{{ .Date.Format "2006-01-02T15:04:05Z07:00" }}">{{ .Date.Format "2006-01-02" }}</time> by {{- partial "indieweb-author.html" -}} on his <a rel="canonical" itemprop="mainEntityOfPage url" class="u-url url" href="{{ .Site.Params.CanonicalBaseURL }}{{ $canonicalRelPermalink }}">Website</a>{{- with .OutputFormats.Get "gemtext" -}}{{- printf " " -}}and <a rel="syndication" class="u-syndication" href="{{replace .Permalink "/gemini" "" 1 | safeURL}}">Gemini capsule</a>{{- end -}}.
|
||||
{{- $action }} <time{{ if not (.Params.evergreen) }} itemprop="dateCreated datePublished" class="dt-published published"{{ end }} datetime="{{ .Date.Format "2006-01-02T15:04:05Z07:00" }}">{{ .Date.Format "2006-01-02" }}</time> by {{ partial "indieweb-author.html" -}} on his <a rel="canonical" itemprop="mainEntityOfPage url" class="u-url url" href="{{ .Site.Params.CanonicalBaseURL }}{{ $canonicalRelPermalink }}">Website</a>{{- with .OutputFormats.Get "gemtext" -}}{{- printf " " -}}and <a rel="syndication" class="u-syndication" href="{{replace .Permalink "/gemini" "" 1 | safeURL}}">Gemini capsule</a>{{- end -}}.
|
||||
{{- if gt (sub .Lastmod.Unix .Date.Unix) 900 -}}
|
||||
<br />
|
||||
Last updated <time itemprop="dateModified" class="dt-updated updated" datetime="{{ .Lastmod.Format "2006-01-02T15:04:05Z07:00" }}">{{ .Lastmod.Format "2006-01-02" }}</time>. <a href="{{ $logURL }}">Changelog</a>.
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
<main itemprop="mainEntity" class="h-feed hfeed" itemscope="" itemtype="https://schema.org/CompleteDataFeed">
|
||||
<h1 class="p-name" itemprop="name headline" id="posts">Posts</h1>
|
||||
<p>These are all of my posts, sorted by date (newest first).</p>
|
||||
<p>An <a href="./atom.xml">Atom</a> and <a href="./index.xml">RSS</a> feed is availabe, containing the full text of all my posts.</p>
|
||||
<p>An <a href="./atom.xml">Atom</a> feed is availabe, containing the full text of all my posts. A legacy <a href="./index.xml">RSS</a> feed also exists.</p>
|
||||
{{- else -}}
|
||||
<section class="h-feed hfeed" itemprop="hasPart" itemscope="" itemtype="https://schema.org/DataFeed">
|
||||
<h2 class="p-name" itemprop="name" id="posts">Posts</h2>
|
||||
|
|
|
@ -50,4 +50,9 @@
|
|||
{{- $endNotesNotFocusable := `<li id="fn:([0-9]*)">` -}}
|
||||
{{- $endNotesFocusable := `<li id="fn:${1}" tabindex="-1">` -}}
|
||||
|
||||
{{- .Content | replaceRE $referencesWithoutHeading $referencesWithHeading | replaceRE $badNoteRef $goodNoteRef | replaceRE $endnotesClosingDiv $endnotesClosingSection | replaceRE $tocHeadingOutside $tocHeadingInside | replaceRE $footnoteBacklinksBad $footnoteBacklinksGood | replaceRE $repeatedFootnoteBacklinksBad $repeatedFootnoteBacklinksGood | replaceRE $endNotesNotFocusable $endNotesFocusable | replaceRE `\’` `’` | replaceRE `\ ` `\ ` | replaceRE `\“` `“` | replaceRE `\”` `”` | replaceRE `\…` `—` | replaceRE `\—` `—` | replaceRE `\­` `\­` | replaceRE `‘` `‘`| safeHTML -}}
|
||||
|
||||
<!--Since language-figure doesn't seem to work for some reason just use regex to replace it-->
|
||||
{{- $extraLanguageFigure := `<pre><code class="language-figure">` -}}
|
||||
{{- $replacedLanguageFigure := `<pre tabindex="0"><code translate="no" itemprop="text">` -}}
|
||||
|
||||
{{- .Content | replaceRE $referencesWithoutHeading $referencesWithHeading | replaceRE $badNoteRef $goodNoteRef | replaceRE $endnotesClosingDiv $endnotesClosingSection | replaceRE $tocHeadingOutside $tocHeadingInside | replaceRE $footnoteBacklinksBad $footnoteBacklinksGood | replaceRE $repeatedFootnoteBacklinksBad $repeatedFootnoteBacklinksGood | replaceRE $endNotesNotFocusable $endNotesFocusable | replaceRE $extraLanguageFigure $replacedLanguageFigure | replaceRE `\’` `’` | replaceRE `\ ` ` ` | replaceRE `\“` `“` | replaceRE `\”` `”` | replaceRE `\…` `—` | replaceRE `\—` `—` | replaceRE `\­` `­` | replaceRE `‘` `‘`| safeHTML -}}
|
||||
|
|
15
layouts/partials/reply-context.html
Normal file
15
layouts/partials/reply-context.html
Normal file
|
@ -0,0 +1,15 @@
|
|||
{{- $schemaType := "SocialMediaPosting" -}}
|
||||
{{- with .replyType -}}
|
||||
{{- $schemaType = . -}}
|
||||
{{- end -}}
|
||||
<aside role="note">
|
||||
Reply to <span class="h-cite in-reply-to" itemprop="about" itemscope="" itemtype="https://schema.org/{{ $schemaType }}">
|
||||
<cite itemprop="name" class="p-name">
|
||||
<a class="u-url" itemprop="url" href="{{ .replyURI }}">{{ .replyTitle | safeHTML}}</a>
|
||||
</cite> by
|
||||
<span itemprop="author" itemscope="" itemtype="https://schema.org/Person" class="h-card vcard p-author">
|
||||
<a itemprop="url" href="{{ .replyAuthorURI }}" class="u-url url">
|
||||
<span itemprop="name" class="p-name fn n">{{ .replyAuthor }}</span></a>
|
||||
</span>
|
||||
</span>
|
||||
</aside>
|
|
@ -8,5 +8,5 @@
|
|||
just use the beginning for the label and the full thing for the aria description.
|
||||
-->
|
||||
<figure aria-labelledby="{{ $id }}" itemprop="hasPart" itemscope="" itemtype="https://schema.org/SoftwareSourceCode">
|
||||
{{ .Inner | markdownify -}}
|
||||
{{ .Inner | .Page.RenderString -}}
|
||||
</figure>
|
||||
|
|
|
@ -24,6 +24,5 @@
|
|||
<a itemprop="url" href="https://seirdy.one/" rel="author me home cc:attributionURL" class="u-url u-uid url" property="cc:attributionName">
|
||||
{{ partial "indieweb-icon.html" -}}
|
||||
<span itemprop="name" class="p-name fn n">
|
||||
<span itemprop="givenName" class="p-given-name given-name">Rohan</span>
|
||||
<span itemprop="familyName" class="p-family-name family-name">Kumar</span></span></a>
|
||||
<span itemprop="givenName" class="p-given-name given-name">Rohan</span> <span itemprop="familyName" class="p-family-name family-name">Kumar</span></span></a>
|
||||
</span>
|
||||
|
|
|
@ -15,4 +15,4 @@
|
|||
)
|
||||
) | not
|
||||
)
|
||||
)
|
||||
) | del(..|select(. == [])) | del(..|select(. == {})) | select(. != null)
|
||||
|
|
|
@ -10,7 +10,7 @@ set -e -u
|
|||
output_dir="$1"
|
||||
format="$2"
|
||||
|
||||
alias find_compressible='find "$output_dir" -type f \( -name "*.html" -o -name "*.xml" -o -name "*.webmanifest" -o -name "*.*.svg" \)'
|
||||
alias find_compressible='find "$output_dir" -type f \( -name "*.html" -o -name "*.xhtml" -o -name "*.xml" -o -name "*.webmanifest" -o -name "*.*.svg" \)'
|
||||
|
||||
if [ "$format" = "gzip" ]; then
|
||||
compress_level="$3"
|
||||
|
|
13
scripts/filter-vnu.sh
Normal file
13
scripts/filter-vnu.sh
Normal file
|
@ -0,0 +1,13 @@
|
|||
#!/bin/sh
|
||||
# filters the Nu HTML Validator's JSON output. Operates on stdin.
|
||||
set -e -u
|
||||
|
||||
root_dir="$(dirname "$0")/.."
|
||||
vnu_output="$(jq --from-file "$root_dir/linter-configs/vnu_filter.jq")"
|
||||
if [ "$vnu_output" = '' ]; then
|
||||
echo "All markup is valid"
|
||||
else
|
||||
echo "Markup errors found!" 1>&2
|
||||
echo "$vnu_output"
|
||||
exit 1
|
||||
fi
|
42
scripts/xhtmlize-single-file.sh
Normal file
42
scripts/xhtmlize-single-file.sh
Normal file
|
@ -0,0 +1,42 @@
|
|||
#!/bin/sh
|
||||
# copies an .html file to an equivalent .xhtml file, but replaces
|
||||
# the meta charset with an XML declaration for compatibility with some
|
||||
# XML tooling.
|
||||
# Expects polygot XHTML(5) markup.
|
||||
# Formats both the .html and .xhtml file.
|
||||
# this means that every index.html file has an equivalent index.xhtml file.
|
||||
# content negotiation allows an agent to pick html or xhtml.
|
||||
|
||||
# use xmllint to do the formatting.
|
||||
# xmllint ruins inline CSS so delete the inline CSS and re-insert it.
|
||||
# xmllint also adds extra whitespace around <pre><code> which we remove
|
||||
# with "sd". I chose sd since it handles newlines well.
|
||||
|
||||
set -e -u
|
||||
|
||||
export html_file="$1"
|
||||
export tmp_file="$html_file.tmp"
|
||||
export xhtml_file=${html_file%*.html}.xhtml
|
||||
|
||||
cleanup() {
|
||||
rm -f "$tmp_file"
|
||||
}
|
||||
trap cleanup EXIT
|
||||
|
||||
trap cleanup EXIT
|
||||
sed 7d "$html_file" | xmllint --format --encode UTF-8 --noent - -o "$tmp_file"
|
||||
{
|
||||
head -n7 "$tmp_file"
|
||||
cat tmp.css
|
||||
tail -n +8 "$tmp_file" \
|
||||
| sd '<pre(?: tabindex="0")?>\n\t*<code ' '<pre tabindex="0"><code ' \
|
||||
| sd '(?:\n)?</code>\n(?:[\t\s]*)?</pre>' '</code></pre>' \
|
||||
| sd '</span>.span itemprop="familyName"' '</span> <span itemprop="familyName"'
|
||||
} >>"$xhtml_file"
|
||||
|
||||
# replace the html file with the formatted xhtml5 file, excluding the xml declaration
|
||||
tail -n +2 "$xhtml_file" > "$html_file"
|
||||
|
||||
# remove the redundant charset declaration from the xhtml file. It's the
|
||||
# first thing in the <head>
|
||||
sed -i 5d "$xhtml_file" # busybox sed supports "-i"
|
|
@ -1,11 +1,19 @@
|
|||
#!/bin/sh
|
||||
# takes an arg for the output dir.
|
||||
# copies every .html file to an equivalent .xhtml file, but replaces
|
||||
# the meta charset with an XML declaration for compatibility with some
|
||||
# XML tooling.
|
||||
# this means that every index.html file has an equivalent index.xhtml file.
|
||||
# content negotiation allows an agent to pick html or xhtml.
|
||||
# Runs xhtmlize-single-file.sh on every single html file in the output dir.
|
||||
|
||||
find "$1" -type f -name '*.html' \
|
||||
-exec sh -c 'echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" >"${0%*.html}.xhtml" && xmlfmt -i " " -f "$0" | busybox sed -e :a -e "/./,\$!d;/^\n*\$/{\$d;N;};/\n\$/ba" | sd -f m "\n(?:\t*)?</" "</" | sd -f m "<pre>\n\t*<code" "<pre><code" | sd -f m "\(\n\t*<abbr" "(<abbr" | pee "sed 5d >>\"${0%*.html}.xhtml\"" "sponge \"$0\""' {} \;
|
||||
set -e -u
|
||||
|
||||
output_dir="$1"
|
||||
script_dir="$(dirname "$0")"
|
||||
|
||||
printf '\t\t<style>%s</style>\n' "$(htmlq -t style <"$output_dir/index.html")" >tmp.css
|
||||
cleanup() {
|
||||
rm -f "tmp.css"
|
||||
}
|
||||
trap cleanup EXIT
|
||||
|
||||
export XMLLINT_INDENT=' '
|
||||
find "$output_dir" -type f -name '*.html' \
|
||||
-exec sh "$script_dir/xhtmlize-single-file.sh" {} \;
|
||||
# done
|
||||
|
|
Loading…
Reference in a new issue