styling + rss

This commit is contained in:
Cory Dransfeldt 2023-03-11 19:32:11 -08:00
parent 2809018dc1
commit c9b06f3f17
No known key found for this signature in database
8 changed files with 77 additions and 4 deletions

View file

@ -29,7 +29,7 @@
}
</script>
</head>
<body class="dark:text-white dark:bg-black font-sans text-gray-800 dark:text-gray-50">
<body class="dark:text-white dark:bg-gray-900 font-sans text-gray-800 dark:text-gray-50">
{{ content }}
<script>
document.getElementById("toggleDarkMode").addEventListener("click", function() {

View file

@ -0,0 +1,3 @@
<a href="/feed.xml">
<svg class="inline w-6 h-6 fill-current text-gray-700 hover:text-purple-500 dark:text-gray-200 dark:hover:text-purple-400 h-6 w-6" role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><title>RSS</title><path d="M19.199 24C19.199 13.467 10.533 4.8 0 4.8V0c13.165 0 24 10.835 24 24h-4.801zM3.291 17.415c1.814 0 3.293 1.479 3.293 3.295 0 1.813-1.485 3.29-3.301 3.29C1.47 24 0 22.526 0 20.71s1.475-3.294 3.291-3.295zM15.909 24h-4.665c0-6.169-5.075-11.245-11.244-11.245V8.09c8.727 0 15.909 7.184 15.909 15.91z"/></svg>
</a>

View file

@ -7,6 +7,9 @@
<li class="mr-6">
{% include "icons/tags.liquid" %}
</li>
<li class="mr-6">
{% include "icons/rss.liquid" %}
</li>
<li class="mr-6">
{% include "icons/toggle-theme.liquid" %}
</li>

View file

@ -1,4 +1,4 @@
<nav class="flex justify-between mt-8">
<nav class="flex justify-between mt-8 items-center">
{% if pagination.href.previous %}
<a href="{{ pagination.href.previous }}">
<button class="py-2 pr-4 text-primary-400 hover:text-primary-500 dark:hover:text-primary-300">Previous</button>
@ -8,9 +8,9 @@
{% endif %}
{% for pageEntry in pagination.pages %}
{% if page.url == pagination.hrefs[forloop.index0] %}
{% if page.url == pagination.hrefs[forloop.index0] %}
<a href="{{ pagination.hrefs[forloop.index0] }}" aria-current="page">
<button class="py-2 px-4 text-primary-400 hover:text-primary-500 dark:hover:text-primary-300">
<button class="w-8 h-8 rounded-full text-white dark:text-gray-900 bg-primary-400 hover:bg-primary-500 dark:hover:bg-primary-300">
{{ forloop.index }}
</button>
</a>

27
src/feed.11ty.js Normal file
View file

@ -0,0 +1,27 @@
const createRssFeed = require('eleventy-rss-helper')
const permalink = '/feed.xml'
const baseUrl = 'https://coryd.dev'
module.exports = createRssFeed({
permalink,
feedOptions(data) {
return {
title: 'Cory Dransfeldt',
description: 'Latest posts from coryd.dev',
feed_url: `${baseUrl}${permalink}`,
site_url: baseUrl,
}
},
items(collections, data) {
return collections.posts.slice(-20).reverse()
},
itemOptions(item, data) {
return {
title: item.data.title,
description: item.data.post_excerpt,
url: `${baseUrl}${item.url}`,
date: item.date,
}
},
})