summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorache <ache@ache.one>2022-05-04 00:25:25 +0200
committerache <ache@ache.one>2022-05-04 00:25:25 +0200
commitbab7c183c719fe314d84beae319722f7d529f8f4 (patch)
treec04b7ffc07892a746d42c50a1f674a161d37c83d
parentAdd svgo config (diff)
I forgot the xsl ! 😱
-rw-r--r--style.xsl160
1 files changed, 160 insertions, 0 deletions
diff --git a/style.xsl b/style.xsl
new file mode 100644
index 0000000..d59cd9a
--- /dev/null
+++ b/style.xsl
@@ -0,0 +1,160 @@
+<?xml version="1.0" encoding="utf-8"?>
+<xsl:stylesheet version='2.0'
+xmlns:html="http://www.w3.org/TR/REC-html40"
+xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+<xsl:output method="html" version="1.0" encoding="UTF-8" indent="yes"/>
+<xsl:template match="/">
+ <html>
+ <head>
+ <title>Syndication <xsl:value-of select="rss/channel/title"/></title>
+ <link rel="stylesheet" href="/s/css/style.css" />
+ <meta charset="utf-8" />
+ <meta name="viewport" content="width=device-width, initial-scale=1" />
+ </head>
+ <xsl:apply-templates select="rss/channel"/>
+ </html>
+</xsl:template>
+<xsl:template match="channel">
+ <html>
+ <head>
+ <meta charset="utf-8"/>
+ <title><xsl:value-of select="title"/></title>
+ <style>
+ <![CDATA[
+ html {
+ width: 100%;
+ margin: 0;
+ padding: 0;
+ overflow-x: hidden;
+ }
+ body {
+ font-size: 10pt;
+ font-family: -apple-system, BlinkMacSystemFont, avenir next, avenir, segoe ui, helvetica neue, helvetica, Ubuntu, roboto, noto, arial, sans-serif;
+ background: #eee;
+ margin: 0;
+ padding: 20px;
+ }
+ .channel {
+ margin: 20px;
+ border: 1px solid #aaa;
+ background: #fff;
+ padding: 20px;
+ }
+ .header {
+ font-size: 12pt;
+ max-width:800px;
+ }
+ .header .title {
+ padding-bottom: 5px;
+ margin-bottom: 5px;
+ display: block;
+ border-bottom: 1px solid #ccc;
+ font-size: 18pt;
+ }
+ .header .description {
+ color: #666;
+ margin-top: 0;
+ }
+ .title {
+ font-size: 14pt;
+ font-weight: bold;
+ }
+ .description {
+ display:inline;
+ }
+ .header {
+ }
+ .channel>* {
+ display: block;
+ }
+ .channel>*:before,
+ .channel>*:after {
+ content: ' ';
+ line-height: 0;
+ font-size: 0px;
+ clear: both;
+ visibility: hidden;
+ display: table;
+ }
+ .header .image {
+ display: block;
+ float: right;
+ margin: 0 0 10px 0;
+ }
+ .header .copyright {
+ font-size: 10pt;
+ color: #888;
+ }
+ .item {
+ margin-top: 20px;
+ margin-bottom: 20px;
+ border-top: 1px solid #ccc;
+ }
+ .item .title {
+ font-size: 12pt;
+ }
+ .pub-date {
+ display:inline;
+ }
+ .category {
+ display: none;
+ }
+ .media {
+ border: 1px solid #888;
+ background: #eee;
+ margin: 20px 0;
+ padding: 10px;
+ }
+ .media-item {
+ list-style-type: none;
+ }
+ ]]>
+ </style>
+ </head>
+ <body>
+ <section class="channel">
+ <header class="header">
+ <xsl:apply-templates select="title"/>
+ <p><b>Ceci est un flux RSS</b> à destination des agrégateurs de contenu.<br/>
+ En tant qu'être humain vous cherchez certain <a href="https://ache.one">mon site web.</a></p>
+ </header>
+ <xsl:apply-templates select="item"/>
+ </section>
+ </body>
+ </html>
+ </xsl:template>
+ <xsl:template match="title">
+ <h1 class="title"><xsl:value-of select="text()"/></h1>
+ </xsl:template>
+ <xsl:template match="description">
+ <span class="description"><xsl:value-of select="substring-before(text(),'Visit')"/><br /></span>
+ </xsl:template>
+ <xsl:template match="category">
+ <span class="category"><xsl:value-of select="text()"/></span>
+ </xsl:template>
+ <xsl:template match="pubDate">
+ <span class="pub-date"><xsl:value-of select="substring-before(text(),' 202')"/>: </span>
+ </xsl:template>
+ <xsl:template match="item">
+ <html>
+ <article class="item">
+ <a>
+ <xsl:attribute name="href">
+ <xsl:value-of select="link"/>
+ </xsl:attribute>
+ <h2>
+ <xsl:value-of select="title"/>
+ </h2>
+ </a>
+ <img width="200px" style="display:inline-block;vertical-align:top;margin:20px;">
+ <xsl:attribute name="src">
+ <xsl:value-of select="logo"/>
+ </xsl:attribute>
+ </img>
+ <p style="display:inline-block; width: calc(100% - 240px);">
+ <xsl:value-of select='intro'/>
+ </p>
+ </article>
+ </html>
+ </xsl:template>
+</xsl:stylesheet> \ No newline at end of file