From 2d89379f69c981542ecc128ca3246b9d672a5fce Mon Sep 17 00:00:00 2001 From: madrilene Date: Thu, 3 Nov 2022 17:05:13 +0100 Subject: [PATCH] more examples, better structure, changed favicons --- .eleventy.js | 10 ++---- config/shortcodes/aside/index.js | 12 ------- config/shortcodes/index.js | 4 --- config/shortcodes/insertion/index.js | 30 ---------------- src/_data/navigation.js | 8 ++--- src/_includes/partials/blog-card.njk | 7 ++++ src/_includes/partials/footer.njk | 2 +- src/_includes/partials/header.njk | 4 ++- src/_layouts/blog.njk | 22 ++++++++++++ src/_layouts/home.njk | 13 ++----- src/_layouts/post.njk | 2 +- src/assets/css/blocks/signoff.css | 14 -------- src/assets/css/blocks/site-foot.css | 4 ++- src/assets/css/blocks/textgradient.css | 33 +++++++++--------- src/assets/css/global/variables.css | 2 +- src/assets/design-tokens/text-sizes.json | 2 +- .../images/favicon/android-chrome-192x192.png | Bin 7477 -> 8808 bytes .../images/favicon/android-chrome-512x512.png | Bin 16669 -> 17632 bytes .../images/favicon/apple-touch-icon.png | Bin 6787 -> 8274 bytes src/assets/images/favicon/favicon-16x16.png | Bin 871 -> 900 bytes src/assets/images/favicon/favicon-32x32.png | Bin 1420 -> 1572 bytes src/assets/images/favicon/favicon.ico | Bin 15086 -> 15086 bytes src/assets/images/favicon/favicon.png | Bin 22387 -> 25414 bytes src/assets/images/favicon/favicon.svg | 2 +- src/assets/images/favicon/maskable.png | Bin 24692 -> 31442 bytes src/assets/images/favicon/mstile-150x150.png | Bin 0 -> 6482 bytes src/pages/about.md | 21 +++++++++++ src/pages/blog.md | 6 ++++ src/pages/github.njk | 18 ---------- src/pages/index.md | 14 +++----- src/pages/legal.md | 2 +- src/pages/privacy.md | 4 +-- src/posts/2022-08-17-post-with-fetched..md | 20 +++++++++++ .../2022-08-28-post-with301-redirects.md | 4 +-- .../2022-11-02-markdown.md} | 11 +++--- 35 files changed, 126 insertions(+), 145 deletions(-) delete mode 100644 config/shortcodes/aside/index.js delete mode 100644 config/shortcodes/insertion/index.js create mode 100644 src/_includes/partials/blog-card.njk create mode 100644 src/_layouts/blog.njk delete mode 100644 src/assets/css/blocks/signoff.css create mode 100644 src/assets/images/favicon/mstile-150x150.png create mode 100644 src/pages/about.md create mode 100644 src/pages/blog.md delete mode 100644 src/pages/github.njk create mode 100644 src/posts/2022-08-17-post-with-fetched..md rename src/{pages/markdown.md => posts/2022-11-02-markdown.md} (82%) diff --git a/.eleventy.js b/.eleventy.js index 55b293d..dac55b2 100644 --- a/.eleventy.js +++ b/.eleventy.js @@ -22,12 +22,7 @@ const { } = require('./config/filters/index.js'); // module import shortcodes -const { - asideShortcode, - insertionShortcode, - imageShortcodePlaceholder, - liteYoutube -} = require('./config/shortcodes/index.js'); +const {imageShortcodePlaceholder, liteYoutube} = require('./config/shortcodes/index.js'); // module import collections const {getAllPosts} = require('./config/collections/index.js'); @@ -53,6 +48,7 @@ module.exports = eleventyConfig => { eleventyConfig.addLayoutAlias('base', 'base.njk'); eleventyConfig.addLayoutAlias('page', 'page.njk'); eleventyConfig.addLayoutAlias('home', 'home.njk'); + eleventyConfig.addLayoutAlias('blog', 'blog.njk'); eleventyConfig.addLayoutAlias('post', 'post.njk'); // --------------------- Custom filters ----------------------- @@ -74,8 +70,6 @@ module.exports = eleventyConfig => { eleventyConfig.addFilter('entries', Object.entries); // --------------------- Custom shortcodes --------------------- - eleventyConfig.addPairedShortcode('aside', asideShortcode); - eleventyConfig.addPairedShortcode('insertion', insertionShortcode); eleventyConfig.addNunjucksAsyncShortcode('imagePlaceholder', imageShortcodePlaceholder); eleventyConfig.addShortcode('youtube', liteYoutube); eleventyConfig.addShortcode('year', () => `${new Date().getFullYear()}`); // current year, stephanie eckles diff --git a/config/shortcodes/aside/index.js b/config/shortcodes/aside/index.js deleted file mode 100644 index ef00125..0000000 --- a/config/shortcodes/aside/index.js +++ /dev/null @@ -1,12 +0,0 @@ -const markdownLib = require('../../plugins/markdown'); -const outdent = require('outdent'); - -const aside = children => { - if (!children) { - throw new Error('You must provide a non-empty string for an aside.'); - } - const content = markdownLib.renderInline(children); - return ``; -}; - -module.exports = aside; diff --git a/config/shortcodes/index.js b/config/shortcodes/index.js index 31cebe6..91ba060 100644 --- a/config/shortcodes/index.js +++ b/config/shortcodes/index.js @@ -1,10 +1,6 @@ const imageShortcodePlaceholder = require('./imagePlaceholder'); -const insertionShortcode = require('./insertion'); -const asideShortcode = require('./aside'); const liteYoutube = require('./youtube-lite'); module.exports = { imageShortcodePlaceholder, - insertionShortcode, - asideShortcode, liteYoutube }; diff --git a/config/shortcodes/insertion/index.js b/config/shortcodes/insertion/index.js deleted file mode 100644 index d634164..0000000 --- a/config/shortcodes/insertion/index.js +++ /dev/null @@ -1,30 +0,0 @@ -const {outdent} = require('outdent'); -const markdownLib = require('../../plugins/markdown'); - -// this is not working yet - -const insertion = (img, figcaption, alt, children) => { - if (!img) { - throw new Error(`Must have an image-path.`); - } - if (!alt) { - throw new Error('Images must have an alt text.'); - } - if (!figcaption) { - throw new Error('Must have a figcaption'); - } - if (!children) { - throw new Error('add a content.'); - } - const content = markdownLib.render(children.trim()); - return outdent`
- {% imagePlaceholder "./src/assets/images/${img}", "bg-transparent pt-size-0", " - h-full", "object-cover w-full h-max rounded-tr-2xl", "${figcaption}", "${alt}", " - (max-width: 463px) 400px, (max-width: 718px) 700px, (max-width: 912px) 400px, 700px" %} -
- ${content} -
-
`; -}; - -module.exports = insertion; diff --git a/src/_data/navigation.js b/src/_data/navigation.js index e08454a..8690f60 100644 --- a/src/_data/navigation.js +++ b/src/_data/navigation.js @@ -1,12 +1,12 @@ module.exports = { top: [ { - text: 'Markdown', - url: '/markdown/' + text: 'About', + url: '/about/' }, { - text: 'Github Fetch', - url: '/github/' + text: 'Blog', + url: '/blog/' } ], bottom: [ diff --git a/src/_includes/partials/blog-card.njk b/src/_includes/partials/blog-card.njk new file mode 100644 index 0000000..1693983 --- /dev/null +++ b/src/_includes/partials/blog-card.njk @@ -0,0 +1,7 @@ +
  • +

    + {{ post.data.title }} +

    + {% set definedDate = post.date %} {% include "partials/date.njk" %} +

    {{ post.data.description }}

    +
  • diff --git a/src/_includes/partials/footer.njk b/src/_includes/partials/footer.njk index ba14add..523dae4 100644 --- a/src/_includes/partials/footer.njk +++ b/src/_includes/partials/footer.njk @@ -2,7 +2,7 @@