diff --git a/package.json b/package.json index 1f23e8ae..b60148d9 100644 --- a/package.json +++ b/package.json @@ -30,6 +30,7 @@ "dependencies": { "@tailwindcss/typography": "^0.5.1", "autoprefixer": "^10.4.2", + "eleventy-rss-helper": "^1.2.1", "markdown-it": "^12.3.2", "markdown-it-anchor": "^8.4.1", "tailwind-dracula": "^1.1.0", diff --git a/src/_includes/base.liquid b/src/_includes/base.liquid index a21bf412..ed6399a8 100644 --- a/src/_includes/base.liquid +++ b/src/_includes/base.liquid @@ -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() { diff --git a/src/_includes/icons/rss.liquid b/src/_includes/icons/rss.liquid new file mode 100644 index 00000000..769c6b94 --- /dev/null +++ b/src/_includes/icons/rss.liquid @@ -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> diff --git a/src/_includes/nav.liquid b/src/_includes/nav.liquid index fa0184f4..3445b40e 100644 --- a/src/_includes/nav.liquid +++ b/src/_includes/nav.liquid @@ -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> diff --git a/src/_includes/paginator.liquid b/src/_includes/paginator.liquid index 38c4bc41..4ac46f5c 100644 --- a/src/_includes/paginator.liquid +++ b/src/_includes/paginator.liquid @@ -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> diff --git a/src/feed.11ty.js b/src/feed.11ty.js new file mode 100644 index 00000000..89c3920e --- /dev/null +++ b/src/feed.11ty.js @@ -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, + } + }, +}) diff --git a/tailwind.config.js b/tailwind.config.js index 0af0b24f..c2319570 100644 --- a/tailwind.config.js +++ b/tailwind.config.js @@ -50,6 +50,7 @@ module.exports = { }, pre: { backgroundColor: theme('colors.gray.900'), + border: `1px solid ${theme('colors.gray.700')}`, }, code: { backgroundColor: theme('colors.gray.900'), diff --git a/yarn.lock b/yarn.lock index e40f5f9d..ecb30063 100644 --- a/yarn.lock +++ b/yarn.lock @@ -770,6 +770,14 @@ electron-to-chromium@^1.4.284: resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.328.tgz#b4565ffa502542b561cea16086d6d9b916c7095a" integrity sha512-DE9tTy2PNmy1v55AZAO542ui+MLC2cvINMK4P2LXGsJdput/ThVG9t+QGecPuAZZSgC8XoI+Jh9M1OG9IoNSCw== +eleventy-rss-helper@^1.2.1: + version "1.2.1" + resolved "https://registry.yarnpkg.com/eleventy-rss-helper/-/eleventy-rss-helper-1.2.1.tgz#c5a1e06bb94687f2df542adede67bbacb54f5daa" + integrity sha512-r6ZzpqDtYub39WMn+k9dzIUCUSPFw8gIMiQ1B67Dd1fn/YZ10cEuuiTCa+yuGOt5x1fm+TTdeD715TvsCzCQCg== + dependencies: + normalize-url "^4.3.0" + rss "^1.2.2" + encodeurl@~1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/encodeurl/-/encodeurl-1.0.2.tgz#ad3ff4c86ec2d029322f5a02c3a9a606c95b3f59" @@ -1631,6 +1639,18 @@ micromatch@^4.0.4, micromatch@^4.0.5: braces "^3.0.2" picomatch "^2.3.1" +mime-db@~1.25.0: + version "1.25.0" + resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.25.0.tgz#c18dbd7c73a5dbf6f44a024dc0d165a1e7b1c392" + integrity sha512-5k547tI4Cy+Lddr/hdjNbBEWBwSl8EBc5aSdKvedav8DReADgWJzcYiktaRIw3GtGC1jjwldXtTzvqJZmtvC7w== + +mime-types@2.1.13: + version "2.1.13" + resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.13.tgz#e07aaa9c6c6b9a7ca3012c69003ad25a39e92a88" + integrity sha512-ryBDp1Z/6X90UvjUK3RksH0IBPM137T7cmg4OgD5wQBojlAiUwuok0QeELkim/72EtcYuNlmbkrcGuxj3Kl0YQ== + dependencies: + mime-db "~1.25.0" + mime@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/mime/-/mime-3.0.0.tgz#b374550dca3a0c18443b0c950a6a58f1931cf7a7" @@ -1749,6 +1769,11 @@ normalize-range@^0.1.2: resolved "https://registry.yarnpkg.com/normalize-range/-/normalize-range-0.1.2.tgz#2d10c06bdfd312ea9777695a4d28439456b75942" integrity sha512-bdok/XvKII3nUpklnV6P2hxtMNrCboOjAcyBuQnWEhO665FwrSNRxU+AqpsyvO6LgGYPspN+lu5CLtw4jPRKNA== +normalize-url@^4.3.0: + version "4.5.1" + resolved "https://registry.yarnpkg.com/normalize-url/-/normalize-url-4.5.1.tgz#0dd90cf1288ee1d1313b87081c9a5932ee48518a" + integrity sha512-9UZCFRHQdNrfTpGg8+1INIg93B6zE0aXMVFkw1WFwvO4SlZywU6aLg5Of0Ap/PgcbSw4LNxvMWXMeugwMCX0AA== + nth-check@^2.0.1: version "2.1.1" resolved "https://registry.yarnpkg.com/nth-check/-/nth-check-2.1.1.tgz#c9eab428effce36cd6b92c924bdb000ef1f1ed1d" @@ -2236,6 +2261,14 @@ rimraf@^3.0.2: dependencies: glob "^7.1.3" +rss@^1.2.2: + version "1.2.2" + resolved "https://registry.yarnpkg.com/rss/-/rss-1.2.2.tgz#50a1698876138133a74f9a05d2bdc8db8d27a921" + integrity sha512-xUhRTgslHeCBeHAqaWSbOYTydN2f0tAzNXvzh3stjz7QDhQMzdgHf3pfgNIngeytQflrFPfy6axHilTETr6gDg== + dependencies: + mime-types "2.1.13" + xml "1.0.1" + run-parallel@^1.1.9: version "1.2.0" resolved "https://registry.yarnpkg.com/run-parallel/-/run-parallel-1.2.0.tgz#66d1368da7bdf921eb9d95bd1a9229e7f21a43ee" @@ -2557,6 +2590,11 @@ ws@^8.12.0: resolved "https://registry.yarnpkg.com/ws/-/ws-8.13.0.tgz#9a9fb92f93cf41512a0735c8f4dd09b8a1211cd0" integrity sha512-x9vcZYTrFPC7aSIbj7sRCYo7L/Xb8Iy+pW0ng0wt2vCJv7M9HOMy0UoN3rr+IFC7hb7vXoqS+P9ktyLLLhO+LA== +xml@1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/xml/-/xml-1.0.1.tgz#78ba72020029c5bc87b8a81a3cfcd74b4a2fc1e5" + integrity sha512-huCv9IH9Tcf95zuYCsQraZtWnJvBtLVE0QHMOs8bWyZAFZNDcYjsPq1nEx8jKA9y+Beo9v+7OBPRisQTjinQMw== + xtend@^4.0.2: version "4.0.2" resolved "https://registry.yarnpkg.com/xtend/-/xtend-4.0.2.tgz#bb72779f5fa465186b1f438f674fa347fdb5db54"