aboutsummaryrefslogtreecommitdiff
path: root/static
diff options
context:
space:
mode:
authorMitja Felicijan <mitja.felicijan@gmail.com>2022-10-08 02:43:24 +0200
committerMitja Felicijan <mitja.felicijan@gmail.com>2022-10-08 02:43:24 +0200
commit73fae3cb403711254d40d62db6ac3260919f0769 (patch)
treeaf7279b7e12b4cac15fa6d18844fc9aaaea62ca3 /static
parent739f2a9cf6db3e852a3fcc5d4572f058111ddb09 (diff)
downloadmitjafelicijan.com-73fae3cb403711254d40d62db6ac3260919f0769.tar.gz
Added Yap microblog
Diffstat (limited to 'static')
-rw-r--r--static/yap/feed.xml57
-rw-r--r--static/yap/theme.xsl98
2 files changed, 155 insertions, 0 deletions
diff --git a/static/yap/feed.xml b/static/yap/feed.xml
new file mode 100644
index 0000000..a993335
--- /dev/null
+++ b/static/yap/feed.xml
@@ -0,0 +1,57 @@
1<?xml version="1.0" encoding="utf-8"?>
2<?xml-stylesheet type="text/xsl" href="theme.xsl"?>
3<rss version="2.0">
4 <channel>
5
6 <title>Mitja Felicijan</title>
7 <link>https://mitjafelicijan.com/yap/feed.xml</link>
8 <description>You do not learn by relaxing. You learn by violently assaulting your problem until it surrenders its mysteries to you.</description>
9 <managingEditor>m@mitjafelicijan.com (Mitja Felicijan)</managingEditor>
10 <generator>YapYap</generator>
11
12 <!-- RFC 2882 generator: https://epochtimestamp.com/ -->
13
14 <!-- October, 2022 -->
15
16 <item>
17 <description>Gtk4 is really missing some quality Python documentation! All that you can find is examples for Gtk3, and it is not really completely compatible with v4. This makes working with it extremely frustrating. 😠</description>
18 <pubDate>Sat, 08 Oct 2022 02:42:52 +02:00</pubDate>
19 </item>
20
21 <item>
22 <description>I started work on a hobby project that uses Gtk4 to display various data like CSV, SQLite, MySQL and Redis. Essentially, a data exploration tool with some plotting features.</description>
23 <pubDate>Sat, 08 Oct 2022 02:22:04 +02:00</pubDate>
24 </item>
25
26 <item>
27 <description>An interesting use-case for this type of blogging is also that it is by default RSS reader friendly, making subscribing to these feeds incredibly convenient.</description>
28 <pubDate>Sat, 08 Oct 2022 01:47:47 +02:00</pubDate>
29 </item>
30
31 <item>
32 <description>I added comments to my site finally. I choose https://cactus.chat/. Really simple implementation and uses Matrix protocol, which makes it even more cool. 🎉</description>
33 <pubDate>Sat, 08 Oct 2022 00:38:18 +02:00</pubDate>
34 </item>
35
36 <item>
37 <description>I have been testing ideas how to implement microblogging as a replacement for Twitter. Using XSL and XML is an interesting idea that is supported through major browser. View the source of this page and check it out in action.</description>
38 <pubDate>Sat, 07 Oct 2022 01:38:18 +02:00</pubDate>
39 </item>
40
41 <!--
42 Examples:
43
44 <item>
45 <guid>1</guid>
46 <description>Example of Image post</description>
47 <pubDate>Wed, 02 Oct 2002 08:00:00 EST</pubDate>
48 <enclosure url="https://placeimg.com/550/300/tech" />
49 </item>
50 <item>
51 <description>Example of Text post</description>
52 <pubDate>Wed, 02 Oct 2002 08:00:00 EST</pubDate>
53 </item>
54 -->
55
56 </channel>
57</rss>
diff --git a/static/yap/theme.xsl b/static/yap/theme.xsl
new file mode 100644
index 0000000..e6f80f8
--- /dev/null
+++ b/static/yap/theme.xsl
@@ -0,0 +1,98 @@
1<?xml version="1.0" encoding="utf-8"?>
2<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
3 <xsl:template match="/">
4
5 <html>
6
7 <head>
8
9 <meta charset="utf-8" />
10 <meta name="theme-color" content="#ffffff" />
11 <meta name="viewport" content="width=device-width, initial-scale=1.0" />
12 <meta http-equiv="X-UA-Compatible" content="ie=edge" />
13
14 <title>Microblog - Mitja Felicijan</title>
15 <link rel="icon" type="image/gif" href="/general/favicon.gif" />
16
17 <link href="https://unpkg.com/tailwindcss@^2/dist/tailwind.min.css" rel="stylesheet" />
18
19 <style>
20 .container-blog {
21 max-width: 700px;
22 }
23 </style>
24
25 <script src="https://cdn.jsdelivr.net/npm/dayjs@1/dayjs.min.js"></script>
26 <script>
27 window.addEventListener('load', () => {
28 document.querySelectorAll('time').forEach(el => {
29 const formattedDate = dayjs(el.getAttribute('datetime')).format('dddd, MMMM D, YYYY h:mm A');
30 el.innerText = formattedDate;
31 });
32 });
33 </script>
34
35 </head>
36
37 <body>
38
39 <header class="container-blog mx-auto px-6 md:p-0">
40 <div class="flex py-4 mt-4 mb-6 items-center gap-2">
41 <h1>
42 <a href="/" class="text-xl font-bold hover:bg-yellow-100">
43 <xsl:value-of select="rss/channel/title" />
44 </a>
45 </h1>
46 </div>
47 </header>
48
49 <main class="container-blog mx-auto px-6 md:p-0 mb-32">
50
51 <xsl:for-each select="rss/channel/item">
52 <xsl:sort select="guid" data-type="number" order="descending" />
53
54 <article class="flex flex-col md:flex-row gap-4 mb-10">
55
56 <xsl:if test="enclosure/@url">
57 <a class="w-full md:w-80" target="_blank">
58 <xsl:attribute name="href">
59 <xsl:value-of select="enclosure/@url" />
60 </xsl:attribute>
61
62 <img class="rounded w-full object-contain md:object-fill">
63 <xsl:attribute name="src">
64 <xsl:value-of select="enclosure/@url" />
65 </xsl:attribute>
66 </img>
67 </a>
68 </xsl:if>
69
70 <section>
71 <xsl:if test="pubDate">
72 <div class="text-gray-400 text-xs font-medium mb-1">
73 <time>
74 <xsl:attribute name="datetime">
75 <xsl:value-of select="pubDate" />
76 </xsl:attribute>
77 <xsl:value-of select="pubDate" />
78 </time>
79 </div>
80 </xsl:if>
81
82 <xsl:if test="description">
83 <div class="description">
84 <xsl:value-of select="description" />
85 </div>
86 </xsl:if>
87 </section>
88
89 </article>
90 </xsl:for-each>
91
92 </main>
93
94 </body>
95 </html>
96
97 </xsl:template>
98</xsl:stylesheet>