diff options
| author | Mitja Felicijan <mitja.felicijan@gmail.com> | 2022-01-29 06:35:54 +0100 |
|---|---|---|
| committer | Mitja Felicijan <mitja.felicijan@gmail.com> | 2022-01-29 06:35:54 +0100 |
| commit | 29231c17524aa55ff5915b207d1e697c709b7073 (patch) | |
| tree | 7b0f4c949f0861c8a1e7565f0b7358b33fb74f7c /yapyap | |
| parent | c843640f0f015c77dadb687b51b0f79696ecaa9b (diff) | |
| download | mitjafelicijan.com-29231c17524aa55ff5915b207d1e697c709b7073.tar.gz | |
Added YapYap
Diffstat (limited to 'yapyap')
| -rw-r--r-- | yapyap/feed.yaml | 10 | ||||
| -rw-r--r-- | yapyap/template.xml | 26 | ||||
| -rw-r--r-- | yapyap/theme.xsl | 192 | ||||
| -rw-r--r-- | yapyap/yapyap.xml | 26 |
4 files changed, 254 insertions, 0 deletions
diff --git a/yapyap/feed.yaml b/yapyap/feed.yaml new file mode 100644 index 0000000..a347a92 --- /dev/null +++ b/yapyap/feed.yaml | |||
| @@ -0,0 +1,10 @@ | |||
| 1 | feed: | ||
| 2 | author: Mitja Felicijan | ||
| 3 | link: https://mitjafelicijan.com | ||
| 4 | email: m@mitjafelicijan.com | ||
| 5 | |||
| 6 | posts: | ||
| 7 | |||
| 8 | - text: My first post! It has to start somewhere! | ||
| 9 | date: Sat, 29 Jan 2022 08:00:00 EST | ||
| 10 | image: /assets/yapyap/hello.png | ||
diff --git a/yapyap/template.xml b/yapyap/template.xml new file mode 100644 index 0000000..e90cabb --- /dev/null +++ b/yapyap/template.xml | |||
| @@ -0,0 +1,26 @@ | |||
| 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>{{ .Feed.Author }}</title> | ||
| 7 | <link>{{ .Feed.Link }}</link> | ||
| 8 | <managingEditor>{{ .Feed.Email }} ({{ .Feed.Author }})</managingEditor> | ||
| 9 | <generator>YapYap</generator> | ||
| 10 | |||
| 11 | {{ range $i, $e := .Posts }} | ||
| 12 | <item> | ||
| 13 | |||
| 14 | <guid>aaa{{ $i }}</guid> | ||
| 15 | <description>{{ .Text }}</description> | ||
| 16 | <pubDate>{{ .Date }}</pubDate> | ||
| 17 | |||
| 18 | {{if .Image }} | ||
| 19 | <enclosure url="{{ .Image }}" type="image/jpeg" /> | ||
| 20 | {{end}} | ||
| 21 | |||
| 22 | </item> | ||
| 23 | {{ end }} | ||
| 24 | |||
| 25 | </channel> | ||
| 26 | </rss> | ||
diff --git a/yapyap/theme.xsl b/yapyap/theme.xsl new file mode 100644 index 0000000..b2fefc0 --- /dev/null +++ b/yapyap/theme.xsl | |||
| @@ -0,0 +1,192 @@ | |||
| 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 | <style> | ||
| 15 | :root { | ||
| 16 | --base-document-width: 500px; | ||
| 17 | } | ||
| 18 | |||
| 19 | * { | ||
| 20 | box-sizing: border-box; | ||
| 21 | background-color: transparent; | ||
| 22 | margin: 0; | ||
| 23 | padding: 0; | ||
| 24 | border: 0; | ||
| 25 | list-style-type: none; | ||
| 26 | outline: none; | ||
| 27 | text-decoration: none; | ||
| 28 | position: relative; | ||
| 29 | box-shadow: none; | ||
| 30 | |||
| 31 | -moz-osx-font-smoothing: grayscale !important; | ||
| 32 | text-rendering: optimizeLegibility !important; | ||
| 33 | -webkit-font-smoothing: antialiased !important; | ||
| 34 | } | ||
| 35 | |||
| 36 | body { | ||
| 37 | font-family: system-ui, -apple-system, BlinkMacSystemFont, sans-serif; | ||
| 38 | font-size: 14px; | ||
| 39 | line-height: 140%; | ||
| 40 | background: #fff; | ||
| 41 | } | ||
| 42 | |||
| 43 | h1 { font-size: 140%; } | ||
| 44 | h2 { font-size: 130%; } | ||
| 45 | h3 { font-size: 120%; } | ||
| 46 | |||
| 47 | .fixed { | ||
| 48 | position: fixed; | ||
| 49 | top: 0; | ||
| 50 | left: 0; | ||
| 51 | right: 0; | ||
| 52 | width: 100%; | ||
| 53 | background: #fff; | ||
| 54 | z-index: 2; | ||
| 55 | border-bottom: 1px solid #eee; | ||
| 56 | } | ||
| 57 | |||
| 58 | header { | ||
| 59 | max-width: var(--base-document-width); | ||
| 60 | margin: 0 auto; | ||
| 61 | padding: 20px; | ||
| 62 | } | ||
| 63 | |||
| 64 | header .meta { | ||
| 65 | flex-grow: 1; | ||
| 66 | } | ||
| 67 | |||
| 68 | header a { | ||
| 69 | color: #111; | ||
| 70 | } | ||
| 71 | |||
| 72 | main { | ||
| 73 | max-width: var(--base-document-width); | ||
| 74 | margin: 0 auto; | ||
| 75 | padding: 20px; | ||
| 76 | padding-top: 110px; | ||
| 77 | } | ||
| 78 | |||
| 79 | article { | ||
| 80 | border: 1px solid #eee; | ||
| 81 | margin-block-end: 20px; | ||
| 82 | max-width: 100%; | ||
| 83 | |||
| 84 | border-radius: 10px; | ||
| 85 | overflow: hidden; | ||
| 86 | } | ||
| 87 | |||
| 88 | article figure img { | ||
| 89 | width: 100%; | ||
| 90 | max-height: 250px; | ||
| 91 | object-fit: cover; | ||
| 92 | } | ||
| 93 | |||
| 94 | article section { | ||
| 95 | padding: 15px; | ||
| 96 | } | ||
| 97 | |||
| 98 | article section p { | ||
| 99 | margin-block-end: 15px; | ||
| 100 | font-size: 120%; | ||
| 101 | } | ||
| 102 | |||
| 103 | article section .meta { | ||
| 104 | color: #808080; | ||
| 105 | font-weight: 500; | ||
| 106 | } | ||
| 107 | |||
| 108 | |||
| 109 | @media (prefers-color-scheme: dark) { | ||
| 110 | body, .fixed { | ||
| 111 | background: #222; | ||
| 112 | color: #fff; | ||
| 113 | border-color: #444; | ||
| 114 | } | ||
| 115 | |||
| 116 | header a { | ||
| 117 | color: #fff; | ||
| 118 | } | ||
| 119 | |||
| 120 | article { | ||
| 121 | border-color: #444; | ||
| 122 | } | ||
| 123 | } | ||
| 124 | |||
| 125 | </style> | ||
| 126 | |||
| 127 | </head> | ||
| 128 | |||
| 129 | <body> | ||
| 130 | |||
| 131 | <div class="fixed"> | ||
| 132 | <header> | ||
| 133 | <div class="meta"> | ||
| 134 | <h1><xsl:value-of select="rss/channel/title" /></h1> | ||
| 135 | <p> | ||
| 136 | <a target="_blank"> | ||
| 137 | |||
| 138 | <xsl:attribute name="href"> | ||
| 139 | <xsl:value-of select="rss/channel/link" /> | ||
| 140 | </xsl:attribute> | ||
| 141 | |||
| 142 | <xsl:value-of select="rss/channel/link" /> | ||
| 143 | </a> | ||
| 144 | </p> | ||
| 145 | </div> | ||
| 146 | </header> | ||
| 147 | </div> | ||
| 148 | |||
| 149 | <main> | ||
| 150 | |||
| 151 | <xsl:for-each select="rss/channel/item"> | ||
| 152 | <xsl:sort select="guid" data-type="number" order="ascending" /> | ||
| 153 | |||
| 154 | <article> | ||
| 155 | |||
| 156 | <xsl:if test="enclosure/@url"> | ||
| 157 | <figure> | ||
| 158 | <img> | ||
| 159 | <xsl:attribute name="src"> | ||
| 160 | <xsl:value-of select="enclosure/@url" /> | ||
| 161 | </xsl:attribute> | ||
| 162 | </img> | ||
| 163 | </figure> | ||
| 164 | </xsl:if> | ||
| 165 | |||
| 166 | <section> | ||
| 167 | <xsl:if test="description"> | ||
| 168 | <p><xsl:value-of select="description" /></p> | ||
| 169 | </xsl:if> | ||
| 170 | |||
| 171 | <xsl:if test="pubDate"> | ||
| 172 | <div class="meta"> | ||
| 173 | <time> | ||
| 174 | <xsl:attribute name="datetime"> | ||
| 175 | <xsl:value-of select="pubDate" /> | ||
| 176 | </xsl:attribute> | ||
| 177 | <xsl:value-of select="pubDate" /> | ||
| 178 | </time> | ||
| 179 | </div> | ||
| 180 | </xsl:if> | ||
| 181 | </section> | ||
| 182 | |||
| 183 | </article> | ||
| 184 | </xsl:for-each> | ||
| 185 | |||
| 186 | </main> | ||
| 187 | |||
| 188 | </body> | ||
| 189 | </html> | ||
| 190 | |||
| 191 | </xsl:template> | ||
| 192 | </xsl:stylesheet> | ||
diff --git a/yapyap/yapyap.xml b/yapyap/yapyap.xml new file mode 100644 index 0000000..bbde2f3 --- /dev/null +++ b/yapyap/yapyap.xml | |||
| @@ -0,0 +1,26 @@ | |||
| 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</link> | ||
| 8 | <managingEditor>m@mitjafelicijan.com (Mitja Felicijan)</managingEditor> | ||
| 9 | <generator>YapYap</generator> | ||
| 10 | |||
| 11 | |||
| 12 | <item> | ||
| 13 | |||
| 14 | <guid>aaa0</guid> | ||
| 15 | <description>My first post! It has to start somewhere!</description> | ||
| 16 | <pubDate>Sat, 29 Jan 2022 08:00:00 EST</pubDate> | ||
| 17 | |||
| 18 | |||
| 19 | <enclosure url="/assets/yapyap/hello.png" type="image/jpeg" /> | ||
| 20 | |||
| 21 | |||
| 22 | </item> | ||
| 23 | |||
| 24 | |||
| 25 | </channel> | ||
| 26 | </rss> | ||
