From: M. Taylor Saotome-Westlake Date: Sun, 5 Apr 2020 05:13:24 +0000 (-0700) Subject: put short slug in Simple Footnotes X-Git-Url: http://232903.hjopswx29.asia/source?a=commitdiff_plain;h=e046c7c9b3e73c12a008d55874900034928cf98c;p=Ultimately_Untrue_Thought.git put short slug in Simple Footnotes Currently, "Does General Intelligence ...?" and "Reply to Ozymandias on Fully Consensual Gender" are both on the front page, and the earlier-on-the-page footnote fragments clobber later ones of the same number. Including part of the post slug in the fragment solves the problem, and I'm going all the way to five segments because you could imagine two "Reply to Author on Topic" posts being on the same page (even though I'm likely to abandon this plugin (for future posts, or altogether) because native-Markdown footnotes (those are a thing!!) are friendlier to read and write than the `[ref]` notation. --- diff --git a/notes/tech_tasks.txt b/notes/tech_tasks.txt index 4ce66f7..579ccf3 100644 --- a/notes/tech_tasks.txt +++ b/notes/tech_tasks.txt @@ -1,7 +1,6 @@ rework footnotes plugin!? (Markdown footnote format is better than [ref][/ref] tags) self-host a copy of Source Sans Pro (I'm annoyed that my devserver preview fonts are ugly when I've killed my network connection so I can focus for once) comments?! https://github.com/posativ/isso/ -put (partial?) post slug back in footnotes (needed to disambiguate on multi-post pages) bigger click-target pagination links verify my domain with Search Console so that I can see search keywords restrict "fiction" to "longform" (not dialogues) (I made the opposite call at some point, and I think I want to reverse it) @@ -15,6 +14,4 @@ other image width more Korra cosplay photos?? even more fine-grained tag size?? (I tried this once and made it look worse :/) Atom vs. RSS proper?? -maybe switch back to absolute links?? (copy-paste broke all self-links when Bailey copy-paste shared to SEXNET; but it looks like many browsers/applications silently correct that) line at bottom of image links?? - diff --git a/plugins/simple_footnotes.py b/plugins/simple_footnotes.py index d6e8810..11cf310 100644 --- a/plugins/simple_footnotes.py +++ b/plugins/simple_footnotes.py @@ -56,7 +56,9 @@ def parse_for_footnotes(article_or_page_generator): if leavealone: continue count += 1 - fnid = u"note-%s" % (count) + + short_slug = "-".join(article.slug.split('-')[:5]) + fnid = u"%s-note-%s" % (short_slug, count) fnbackid = u"%s-back" % (fnid,) endnotes.append((footnote, fnid, fnbackid)) number = dom.createElement(u"sup")