From dcfb172704f3afb68a30425029ec834be2883274 Mon Sep 17 00:00:00 2001 From: bt Date: Sat, 8 Jun 2024 13:22:19 -0400 Subject: More content porting, on-going markdown changes for lowdown support --- build/rss-click/index.html | 65 +++++++++++++++++++++++++++------------------- 1 file changed, 38 insertions(+), 27 deletions(-) (limited to 'build/rss-click') diff --git a/build/rss-click/index.html b/build/rss-click/index.html index 1dbe5d9..5913050 100644 --- a/build/rss-click/index.html +++ b/build/rss-click/index.html @@ -1,51 +1,62 @@ - + Clickable Links Inside XML - - + + +
-

Clickable Links Inside XML

+

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

+ +

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. -
  3. Set the inner child attribute to "href"
  4. -
  5. Set the value of that attribute to use the entry's link parameter
  6. +
  7. Tell the file which tag it needs to render as the “a:link” element

  8. +
  9. Set the inner child attribute to “href”

  10. +
  11. Set the value of that attribute to use the entry’s link parameter

    + +

    /xsl:attribute + +/xsl:element

-
<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>
+
+
<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

+ +

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
  2. +
  3. https://shinobi.bt.ht/posts/patch-3.txt