mirror of
https://git.sr.ht/~seirdy/seirdy.one
synced 2024-11-10 00:12:09 +00:00
Internal: markdown extension for adding link attrs
More concise than using <a> every time i need to add an attr to a link
This commit is contained in:
parent
b1678bbc0e
commit
3c00cfd4e8
5 changed files with 46 additions and 10 deletions
|
@ -17,7 +17,7 @@ It me! This is the personal website for <a itemprop="url" href="https://seirdy.o
|
||||||
Other versions of this website
|
Other versions of this website
|
||||||
------------------------------
|
------------------------------
|
||||||
|
|
||||||
In addition to its <a class="u-url" href="https://seirdy.one" rel="me canonical author">canonical URL</a>, a "rough draft" of this website also exists on my <a itemprop="sameAs" class="u-url" href="https://envs.net/~seirdy" rel="me">Tildeverse page</a>. This site's content also appears on my <a class="u-syndication" itemprop="sameAs" href="gemini://seirdy.one" rel="me">Gemini space</a>.
|
In addition to its [canonical url](https://seirdy.one "{rel='me canonical author' class='u-url'}"), a "rough draft" of this website also exists on my [Tildeverse page](https://envs.net/~seirdy "{itemprop='sameAs' class='u-url' rel='me'}").net/~seirdy" rel="me">Tildeverse page</a>. This site's content also appears on my [Gemini capsule](gemini://seirdy.one "{itemprop='sameAs' class='u-syndication' rel='me'}").one" rel="me">Gemini space</a>.
|
||||||
|
|
||||||
About me
|
About me
|
||||||
--------
|
--------
|
||||||
|
@ -28,14 +28,14 @@ The Director's Cut of my bio is at my [About page](/about.html).
|
||||||
I'm a <abbr title="Free, Libre, and Open-Source">FLOSS</abbr> enthusiast, software minimalist, and a CS+Math undergrad who likes watching anime and tweaking his Linux setup.
|
I'm a <abbr title="Free, Libre, and Open-Source">FLOSS</abbr> enthusiast, software minimalist, and a CS+Math undergrad who likes watching anime and tweaking his Linux setup.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
Git repos: <a href="https://sr.ht/~seirdy" rel="me">Sourcehut</a>, <a href="https://github.com/Seirdy" rel="me">GitHub</a>, and <a href="https://gitlab.com/Seirdy" rel="me">GitLab</a>
|
Git repos: [Sourcehut](https://sr.ht/~seirdy "{rel='me'}"), [GitHub](https://github.com/Seirdy "{rel='me'}") , and [GitLab](https://gitlab.com/Seirdy "{rel='me'}")
|
||||||
|
|
||||||
Contact
|
Contact
|
||||||
-------
|
-------
|
||||||
|
|
||||||
Contact me via <a class="u-email" href="mailto:seirdy@seirdy.one" itemprop="email" rel="me">email</a> (<a rel="pgpkey authn" type="application/pgp-keys" class="u-key" href="./publickey.asc">PGP</a>), or on the Fediverse where I'm <a class="u-url" href="https://pleroma.envs.net/seirdy" rel="me" itemprop="sameAs">@Seirdy@pleroma.envs.net</a>.
|
Contact me via [email](mailto:seirdy@seirdy.one "{class='u-email' itemprop='email' rel='me'}") ([PGP](./publickey.asc "{rel='pgpkey authn' type='application/pgp-keys' class='u-key'}")), or on the Fediverse where I'm [@Seirdy@pleroma.envs.net](https://pleroma.envs.net/seirdy "{rel='me' itemprop='sameAs' class='u-url'}").
|
||||||
|
|
||||||
Chat with me: I prefer IRC, where my nick is Seirdy on Libera.chat, Snoonet, OFTC, Tilde.Chat, and a few smaller networks. Alternatively, I'm <a class="u-url" href="https://matrix.to/#/@seirdy:seirdy.one" rel="me">@seirdy:seirdy.one</a> on Matrix. My secondary Matrix account for Synapse-only rooms is `@seirdy:fairydust.space`. I was previously `@seirdy:envs.net`.
|
Chat with me: I prefer IRC, where my nick is Seirdy on Libera.chat, Snoonet, OFTC, Tilde.Chat, and a few smaller networks. Alternatively, I'm [@seirdy:seirdy.one](https://matrix.to/#/@seirdy:seirdy.one "{class='u-url' rel='me'}") on Matrix. My secondary Matrix account for Synapse-only rooms is `@seirdy:fairydust.space`. I was previously `@seirdy:envs.net`.
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
|
@ -23,8 +23,6 @@ Location (Rohan, meatspace)
|
||||||
|
|
||||||
Currently living at home in Cupertino, CA
|
Currently living at home in Cupertino, CA
|
||||||
|
|
||||||
Would normally be in Portland, OR during the school year, but COVID-19 happened.
|
|
||||||
|
|
||||||
Location (Seirdy, online)
|
Location (Seirdy, online)
|
||||||
-------------------------
|
-------------------------
|
||||||
|
|
||||||
|
|
|
@ -155,9 +155,9 @@ If you want to get started with fuzzing, I recommend checking out [the quick-sta
|
||||||
|
|
||||||
A recent example of how fuzzing helps spot a vulnerability in an open-source project is [CVE-2022-0185](https://www.openwall.com/lists/oss-security/2022/01/18/7): a Linux 0-day found by the Crusaders of Rust a few weeks ago. It was discovered using the [syzkaller](https://github.com/google/syzkaller) kernel fuzzer. The process was documented on Will's Root:
|
A recent example of how fuzzing helps spot a vulnerability in an open-source project is [CVE-2022-0185](https://www.openwall.com/lists/oss-security/2022/01/18/7): a Linux 0-day found by the Crusaders of Rust a few weeks ago. It was discovered using the [syzkaller](https://github.com/google/syzkaller) kernel fuzzer. The process was documented on Will's Root:
|
||||||
|
|
||||||
<span class="h-cite" itemprop="citation" itemscope itemtype="https://schema.org/BlogPosting">
|
<p class="h-cite" itemprop="citation" itemscope itemtype="https://schema.org/BlogPosting">
|
||||||
<cite><a class="u-url p-name" itemprop="name" href="https://www.willsroot.io/2022/01/cve-2022-0185.html">CVE-2022-0185 - Winning a $31337 Bounty after Pwning Ubuntu and Escaping Google's KCTF Containers</a></cite> by <span itemprop="author">{{<indieweb-person nickname="willsroot" url="https://willsroot.io">}}</span>
|
<cite><a class="u-url p-name" itemprop="name" href="https://www.willsroot.io/2022/01/cve-2022-0185.html">CVE-2022-0185 - Winning a $31337 Bounty after Pwning Ubuntu and Escaping Google's KCTF Containers</a></cite> by {{<indieweb-person nickname="willsroot" url="https://willsroot.io" itemprop="author">}}
|
||||||
</span>
|
</p>
|
||||||
|
|
||||||
I _highly_ encourage giving it a read; it's the perfect example of fuzzing with sanitizers to find a vulnerability, reproducing the vulnerability (by writing a tiny C program), _then_ diving into the source code to find and fix the cause, and finally reporting the issue (with a patch!). When source isn't available, the vendor would assume responsibility for the "find and fix" steps.
|
I _highly_ encourage giving it a read; it's the perfect example of fuzzing with sanitizers to find a vulnerability, reproducing the vulnerability (by writing a tiny C program), _then_ diving into the source code to find and fix the cause, and finally reporting the issue (with a patch!). When source isn't available, the vendor would assume responsibility for the "find and fix" steps.
|
||||||
|
|
||||||
|
|
15
layouts/_default/_markup/render-link.html
Normal file
15
layouts/_default/_markup/render-link.html
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
{{- $parsedTitle := dict -}}
|
||||||
|
{{- with .Title -}}
|
||||||
|
{{- $parsedTitle = partial "functions/parse-title-attribute.html" . -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
<a href="{{ .Destination | safeURL }}"
|
||||||
|
{{- with $parsedTitle.title }} title="{{ . }}"{{- end -}}
|
||||||
|
{{- with $parsedTitle.attributes -}}
|
||||||
|
{{- range $k, $v := . -}}
|
||||||
|
{{- printf " %s=%q" $k $v | safeHTMLAttr -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
>{{ .Text | safeHTML }}</a>
|
||||||
|
|
||||||
|
{{- /* Strip trailing space. */ -}}
|
23
layouts/partials/functions/parse-title-attribute.html
Normal file
23
layouts/partials/functions/parse-title-attribute.html
Normal file
|
@ -0,0 +1,23 @@
|
||||||
|
{{/* Split .Title into two parts, title and attributes. */}}
|
||||||
|
{{- $parts := split . "{" -}}
|
||||||
|
{{- $parts = apply $parts "trim" "." " " -}}
|
||||||
|
{{- $parts = apply $parts "trim" "." "}" -}}
|
||||||
|
|
||||||
|
{{/* Extract title into a string. */}}
|
||||||
|
{{- $title := index $parts 0 -}}
|
||||||
|
|
||||||
|
{{/* Extract attributes into a dictionary. */}}
|
||||||
|
{{- $temp := index $parts 1 -}}
|
||||||
|
{{- $temp = split $temp "'" -}}
|
||||||
|
{{- $temp = first (sub (len $temp) 1) $temp -}}
|
||||||
|
{{- $temp = apply $temp "replace" "." "=" "" -}}
|
||||||
|
{{- $temp = apply $temp "trim" "." " " -}}
|
||||||
|
{{- $attributes := dict -}}
|
||||||
|
{{- if $temp -}}
|
||||||
|
{{- range (seq 0 2 (sub (len $temp) 1)) -}}
|
||||||
|
{{- $attributes = merge $attributes (dict (index $temp . ) (index $temp (add 1 .))) -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{- $parsedTitle := dict "title" $title "attributes" $attributes -}}
|
||||||
|
{{- return $parsedTitle -}}
|
Loading…
Reference in a new issue