Update template

This commit is contained in:
Andros Fenollosa 2021-06-28 22:49:25 +02:00
parent 341fa1d958
commit cb92ffb693
2 changed files with 111 additions and 22 deletions

View File

@ -2,14 +2,14 @@
<html lang="en"> <html lang="en">
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<title>Inicio</title> <title>{{ title }}</title>
<link rel="icon" type="image/png" href="favicon.png"> <link rel="icon" type="image/png" href="favicon.png">
<meta name="theme-color" content="#3c790a"> <meta name="theme-color" content="#3c790a">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, shrink-to-fit=no"> <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, shrink-to-fit=no">
<meta name="author" content="Tu nombre"> <meta name="author" content="Tu nombre">
<meta name="generator" content="Clojure"> <meta name="generator" content="RSSpaper">
<meta name="keywords" content="html, css, javascript"> <meta name="keywords" content="html, css, javascript">
<meta name="description" content="my description..."> <meta name="description" content="My news">
<meta property="og:image" content="img/screenshot.png"> <meta property="og:image" content="img/screenshot.png">
<meta property="og:title" content="The Rock"> <meta property="og:title" content="The Rock">
<meta property="og:type" content="website"> <meta property="og:type" content="website">
@ -22,38 +22,124 @@
<meta property="og:image:width" content="400"> <meta property="og:image:width" content="400">
<meta property="og:image:height" content="300"> <meta property="og:image:height" content="300">
<meta property="og:image:alt" content=""> <meta property="og:image:alt" content="">
<!-- Normalize -->
<link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/normalize/8.0.1/normalize.min.css"> <link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/normalize/8.0.1/normalize.min.css">
<!-- End Normalize -->
<!-- Fonts -->
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Newsreader:ital,wght@0,400;0,700;1,400&display=swap" rel="stylesheet">
<!-- End Fonts -->
<!-- CSS --> <!-- CSS -->
<link rel="stylesheet" type="text/css" href="css/main.css"> <style>
/* Global */
:root {
--color-black: black;
}
body {
margin: 0;
padding: 0;
font-family: 'Newsreader', serif;
color: var(--color-black);
}
img, video, iframe {
width: 100%;
}
a {
color: var(--color-black);
text-decoration: none;
}
pre {
overflow-x: auto;
}
.container {
max-width: 62rem;
margin: 0 auto;
padding: 1rem;
}
.title {
text-align: center;
font-size: 4rem;
font-weight: normal;
margin-bottom: 0;
margin-top: 1rem;
}
.subtitle {
display: flex;
justify-content: center;
align-items: center;
margin-top: -1rem;
font-weight: normal;
font-size: 1.5rem;
}
.subtitle__separator {
font-size: 3rem;
font-weight: bold;
}
.separator {
border: 0;
background: var(--color-black);
height: 1px;
}
.footer__text {
text-align: center;
padding: 1rem 0;
}
.footer__link {
font-weight: bold;
}
.footer__heard {
display: inline-block;
margin-left: .3rem;
}
.article__title, .article__feed {
font-weight: normal;
}
</style>
<style media="all and (max-width: 600px)"> <style media="all and (max-width: 600px)">
/* Mobile */
body { body {
background: red; background: red;
} }
</style> </style>
<style media="all and (min-width: 601px)"> <style media="all and (min-width: 601px)">
/* Desktop */
body { body {
} }
</style> </style>
<!-- End CSS --> <!-- End CSS -->
</head> </head>
<body> <body>
<main> <div class="container">
<h1>RSSPaper</h1> <header class="header">
{% for item in data %} <h1 class="title">{{ title }}</h1>
<h2>{{ item.feed.title }}</h2> <h2 class="subtitle"><span class="subtitle__separator">~</span> <span class="subtitle__text">My static generate newspaper</span> <span class="subtitle__separator">~</span></h2>
<section> <hr class="separator">
{% for article in item.feed.entries %} </header>
<article> <main class="main">
<header> {% for item in data %}
<h3>{{ article.title }}</h3> <section class="feed">
</header> {% for article in item.feed.entries %}
<main> <article class="feed__article article">
{{ article.description.value|safe }} <header class="article__header">
</main> <h1 class="article__title">{{ article.title }}</h1>
</article> <h2 class="article__feed">{{ item.feed.title }}</h2>
</header>
<main class="article__main">
{{ article.description.value|safe }}
</main>
</article>
{% endfor %}
</section>
{% endfor %} {% endfor %}
</section> </main>
{% endfor %} </div>
</main> <footer class="footer">
<hr class="separator">
<p class="footer__text">
Generated with <a class="footer__link" href="https://github.com/tanrax/RSSpaper">RSSpaper</a> and a lot of <span class="footer__heard">❤️</span>
</p>
</footer>
</body> </body>
</html> </html>

View File

@ -15,4 +15,7 @@
(.mkdir (java.io.File. dir)) (.mkdir (java.io.File. dir))
;; Make dist/index.html ;; Make dist/index.html
(with-open [wrtr (io/writer path)] (with-open [wrtr (io/writer path)]
(.write wrtr (s/render-file (str "themes/" (:theme config) ".html") {:data data}))))) (.write wrtr (s/render-file (str "themes/" (:theme config) ".html") {
:title (:title config)
:data data
})))))