mirror of
https://github.com/Misterio77/Foundry.git
synced 2026-09-24 07:15:07 -05:00
fix gmi/html permalink issue
This commit is contained in:
@@ -37,15 +37,18 @@ stdenv.mkDerivation {
|
||||
sed -n '/---/,/---/p' "$mdfile" > "$gmifile"
|
||||
|
||||
# Turn markdown linebreaks into actual breaks, as well as link lists, so md2gemini respects it
|
||||
sed -r 's/(^\[.*\]\(.*\))(\s*\\+|\s\s+)$/\1\n/gm' "$mdfile" | \
|
||||
sed -r 's/^-\s+(\[.*\]\(.*\))$/\1\n/gm' | \
|
||||
md2gemini \
|
||||
--frontmatter --links copy --plain --md-links >> "$gmifile"
|
||||
sed -E 's/(^\[.*\]\(.*\))(\s*\\+|\s\s+)$/\1\n/gm' "$mdfile" | \
|
||||
sed -E 's/^-\s+(\[.*\]\(.*\))$/\1\n/gm' | \
|
||||
md2gemini --frontmatter --links copy --plain --md-links >> "$gmifile"
|
||||
|
||||
# Fix CRLF
|
||||
dos2unix "$gmifile"
|
||||
# Strip SVGs
|
||||
sed -ri 's@\{% include icons/.*\.svg %\}@@g' "$gmifile"
|
||||
sed -Ei 's/\{% include icons\/.*\.svg %\}//g' "$gmifile"
|
||||
# Rewrite frontmatter containing .html permalinks into .gmi ones
|
||||
sed -Ei 's/(^permalink:.*)\.html/\1\.gmi/g' "$gmifile"
|
||||
# Rewrite relative .html links into .gmi
|
||||
sed -Ei 's/(^=>\s+\..*)\.html/\1\.gmi/g' "$gmifile"
|
||||
# Trim double newlines between links
|
||||
perl -0777 -pe 's/(^=>.*$)\n\n=>/\1\n=>/mg' -i "$gmifile"
|
||||
perl -0777 -pe 's/(^=>.*$)\n\n=>/\1\n=>/mg' -i "$gmifile"
|
||||
|
||||
@@ -8,7 +8,7 @@ Hey! Welcome to my website and personal wiki.
|
||||
## What's this?
|
||||
|
||||
If you're here for info about me, visit the [homepage](../index.md). If you're interested
|
||||
in more polished writing, check the [blog](../blog.md) (if I ever get to write
|
||||
in more polished writing, check the [blog](../blog.html) (if I ever get to write
|
||||
something better, that is). If you're interested in my personal knowledge and
|
||||
work-in-progress notes, you're in the right place!
|
||||
|
||||
@@ -24,7 +24,7 @@ This section of my website ("notes") is my "second brain", "digital garden",
|
||||
You'll find random notes, class notes, links, work in progress guides, and more
|
||||
here.
|
||||
|
||||
To start browsing, check the [notes homepage](../notes.md). You'll find everything
|
||||
To start browsing, check the [notes homepage](../notes.html). You'll find everything
|
||||
grouped by tags they belong to.
|
||||
|
||||
All notes have backlinking, so just click away!
|
||||
|
||||
Reference in New Issue
Block a user