summaryrefslogtreecommitdiff
path: root/posts/rss-click.md
diff options
context:
space:
mode:
authorBradley Taunt <brad@bt.ht>2023-11-27 12:25:51 -0500
committerBradley Taunt <brad@bt.ht>2023-11-27 12:25:51 -0500
commit14d227d46a2177a8928333894252d6299f531097 (patch)
treed41d48383d012f53823c9816a820e4e88c572c41 /posts/rss-click.md
parentf6eed1a8c2f4fbf91fac9edd11e50f5c0ec939a2 (diff)
Trying to render posts all at once
Diffstat (limited to 'posts/rss-click.md')
-rw-r--r--posts/rss-click.md45
1 files changed, 45 insertions, 0 deletions
diff --git a/posts/rss-click.md b/posts/rss-click.md
new file mode 100644
index 0000000..d794c1b
--- /dev/null
+++ b/posts/rss-click.md
@@ -0,0 +1,45 @@
+# Clickable Links Inside XML
+
+2022-06-20
+
+With the recent patch to the Shinobi Website project, I thought it would be best to share my experience implementing clickable links inside a rendered XML RSS file directly through a browser. This is made possible thanks to the awesome power of XSL formatting.
+
+Before we begin, it should be noted that both Safari for macOS and *all* browsers on iOS do NOT support the ability to render XML files. Instead you are required to download the feeds as static files to your system. Major bummmer. Hopefully this will be fixed in the near future.
+
+## The Code
+
+Rendering your entry links as interactive URLs is fairly intuitive. You just need to:
+
+1. Tell the file which tag it needs to render as the "a:link" element
+2. Set the inner child attribute to "href"
+3. Set the value of that attribute to use the entry's `link` parameter
+
+
+ <xsl:element name="a">
+ <xsl:attribute name="href">
+ <xsl:value-of select="link"/>
+ </xsl:attribute>
+ <pre><xsl:value-of select="title"/></pre>
+ </xsl:element>
+
+
+In the instance above I am rendering the entry title as a clickable element which will direct users to the specific entry URL. You could simply render the full entry link URL text as the interactive link if you prefer. Something like:
+
+
+ <xsl:element name="a">
+ <xsl:attribute name="href">
+ <xsl:value-of select="link"/>
+ </xsl:attribute>
+ <pre><xsl:value-of select="link"/></pre>
+ </xsl:element>
+
+
+## Live Example
+
+In a supported browser, you can see the code in action here: https://pblog.bt.ht/feed.xml
+
+That's really all there is to it.
+
+## Refs
+
+1. https://shinobi.bt.ht/posts/patch-3.txt