put short slug in Simple Footnotes
authorM. Taylor Saotome-Westlake <ultimatelyuntruethought@gmail.com>
Sun, 5 Apr 2020 05:13:24 +0000 (22:13 -0700)
committerM. Taylor Saotome-Westlake <ultimatelyuntruethought@gmail.com>
Sun, 5 Apr 2020 05:13:24 +0000 (22:13 -0700)
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.

notes/tech_tasks.txt
plugins/simple_footnotes.py

index 4ce66f7..579ccf3 100644 (file)
@@ -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??
-
index d6e8810..11cf310 100644 (file)
@@ -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")