From 78ff04ea17d94a3f69a7ff6fa02e4108b4f4380b Mon Sep 17 00:00:00 2001 From: James Steinbach Date: Thu, 18 Aug 2022 10:12:48 -0600 Subject: [PATCH 1/5] add generator --- src/_includes/partials/_head.liquid | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/_includes/partials/_head.liquid b/src/_includes/partials/_head.liquid index db696a7e0..f81938a66 100644 --- a/src/_includes/partials/_head.liquid +++ b/src/_includes/partials/_head.liquid @@ -48,4 +48,6 @@ + + From 77754a3be66367a95983671b52069d30f7cd5aa3 Mon Sep 17 00:00:00 2001 From: James Steinbach Date: Tue, 11 Oct 2022 16:13:10 -0600 Subject: [PATCH 2/5] add sitemap & fix newsletter api --- .eleventy.js | 10 ++-------- src/_data/newsletter.js | 30 ++++++++---------------------- src/_includes/sitemap.liquid | 16 ++++++++++++++++ src/pages/feed.md | 1 + src/pages/sitemap.md | 5 +++++ src/robots.txt | 4 ++++ 6 files changed, 36 insertions(+), 30 deletions(-) create mode 100644 src/_includes/sitemap.liquid create mode 100644 src/pages/sitemap.md create mode 100644 src/robots.txt diff --git a/.eleventy.js b/.eleventy.js index d45c57cf0..7618b823f 100644 --- a/.eleventy.js +++ b/.eleventy.js @@ -73,14 +73,7 @@ module.exports = eleventyConfig => { eleventyConfig.addFilter('title_class', string => string.length > 30 ? ' is-long' : '') - eleventyConfig.addFilter('no_orphan', content => typogr(String(content)).chain().widont().value()) - - // eleventyConfig.addTransform('no_orphan', (content, outputPath) => { - // if( outputPath.endsWith(".html") ) { - // return typogr(content).chain().widont().value() - // } - // return content - // }) + eleventyConfig.addFilter('no_orphan', content => typogr(String(content)).chain().widont().value()) // Create Posts Collection eleventyConfig.addCollection('posts', collection => { @@ -157,6 +150,7 @@ module.exports = eleventyConfig => { eleventyConfig.addPassthroughCopy('src/A') eleventyConfig.addPassthroughCopy('src/CNAME') eleventyConfig.addPassthroughCopy('src/.nojekyll') + eleventyConfig.addPassthroughCopy('src/robots.txt') // More watched files eleventyConfig.addWatchTarget('./src/assets/js/**/*.js') diff --git a/src/_data/newsletter.js b/src/_data/newsletter.js index 436852c79..787c2b7e3 100644 --- a/src/_data/newsletter.js +++ b/src/_data/newsletter.js @@ -1,27 +1,13 @@ -const https = require('https') +const axios = require('axios') -const url = 'https://api.jdsteinbach.com/newsletter/' +const url = 'https://api.jdsteinbach.com/.netlify/functions/newsletter' -const getNewsletter = () => { - return new Promise((resolve, reject) => { - https.get( - url, - res => { - let data = '' - - res.on('data', d => { - data += d - }) - - res.on('end', () => { - resolve(JSON.parse(data)) - }) - } - ).on('error', error => { - console.error(error) - reject(error) - }) +const getNewsletter = () => axios.get(url) + .then(({ data }) => { + return data + }) + .catch(error => { + console.error(error) }) -} module.exports = getNewsletter() diff --git a/src/_includes/sitemap.liquid b/src/_includes/sitemap.liquid new file mode 100644 index 000000000..d2821dc94 --- /dev/null +++ b/src/_includes/sitemap.liquid @@ -0,0 +1,16 @@ + + + {%- for post in collections.all %} + + {{ post.url | abs_url: site.url }} + + {{ post.date | rss_date }} + + {%- if post.data.changeFreq -%} + + {{ post.data.changefreq }} + + {%- endif -%} + + {%- endfor -%} + diff --git a/src/pages/feed.md b/src/pages/feed.md index 913fad65d..0189e3115 100644 --- a/src/pages/feed.md +++ b/src/pages/feed.md @@ -1,4 +1,5 @@ --- permalink: feed.xml layout: feed +eleventyExcludeFromCollections: true --- diff --git a/src/pages/sitemap.md b/src/pages/sitemap.md new file mode 100644 index 000000000..efbd175ee --- /dev/null +++ b/src/pages/sitemap.md @@ -0,0 +1,5 @@ +--- +permalink: sitemap.xml +layout: sitemap +eleventyExcludeFromCollections: true +--- diff --git a/src/robots.txt b/src/robots.txt new file mode 100644 index 000000000..2708a1a9c --- /dev/null +++ b/src/robots.txt @@ -0,0 +1,4 @@ +Sitemap: https://jdsteinbach.com/sitemap.xml + +User-agent: * +Disallow: From e5a643855e731e699118018433d535940b7161c9 Mon Sep 17 00:00:00 2001 From: James Steinbach Date: Tue, 11 Oct 2022 16:24:12 -0600 Subject: [PATCH 3/5] cron job on deploy --- .github/workflows/eleventy_build.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/eleventy_build.yml b/.github/workflows/eleventy_build.yml index 42280df52..dece97a69 100644 --- a/.github/workflows/eleventy_build.yml +++ b/.github/workflows/eleventy_build.yml @@ -7,6 +7,8 @@ name: Build Eleventy on: push: branches: [ blog ] + schedule: + - cron: "00 20 * * 2" # A workflow run is made up of one or more jobs that can run sequentially or in parallel jobs: From 9aee96c0241c7cdf0f6df8dfd5548ddc804817ed Mon Sep 17 00:00:00 2001 From: James Steinbach Date: Wed, 12 Oct 2022 08:48:50 -0600 Subject: [PATCH 4/5] add talk video --- src/pages/talks.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/talks.md b/src/pages/talks.md index 384503e2c..bbe4f6c04 100644 --- a/src/pages/talks.md +++ b/src/pages/talks.md @@ -18,7 +18,7 @@ I enjoy writing here on the blog, but I really love speaking with real audiences * [Modal Windows for Everyone](https://jdsteinbach.com/a11y-modal-slides/#/) (Longer Version) / [Video](https://www.youtube.com/watch?v=kHqLKi1MwT4) * CascadiaJS 2020: [Modal Windows for Everyone](https://jdsteinbach.com/a11y-modal-slides/#/) / [Video](https://www.youtube.com/watch?v=UoIV6IWuJCY) * [A Practical Introduction to CSS Grid](https://jdsteinbach.com/intro-css-grid/#/) -* EmberConf 2020: [An Ember Dev's Guide to CSS Grid](https://jdsteinbach.com/emberconf-grid/#/) +* EmberConf 2020: [An Ember Dev's Guide to CSS Grid](https://jdsteinbach.com/emberconf-grid/#/) / [Video](https://www.youtube.com/watch?v=qAkRdaokkgI) * [Intro to Web Components](https://jdsteinbach.com/intro-web-components/#/) * EmberCamp 2019: [Content Choreography](https://jdsteinbach.com/ember-anim/#/) * Activate 2019: [A Practical Introduction to CSS Grid](https://jdsteinbach.com/intro-css-grid/#/) From 3b7f72742d608f9121f11deacadfb289803f0233 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 22 Nov 2022 05:48:01 +0000 Subject: [PATCH 5/5] Bump engine.io from 6.2.0 to 6.2.1 Bumps [engine.io](https://github.com/socketio/engine.io) from 6.2.0 to 6.2.1. - [Release notes](https://github.com/socketio/engine.io/releases) - [Changelog](https://github.com/socketio/engine.io/blob/main/CHANGELOG.md) - [Commits](https://github.com/socketio/engine.io/compare/6.2.0...6.2.1) --- updated-dependencies: - dependency-name: engine.io dependency-type: indirect ... Signed-off-by: dependabot[bot] --- package-lock.json | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/package-lock.json b/package-lock.json index 10b1677cc..daf3b8115 100644 --- a/package-lock.json +++ b/package-lock.json @@ -3562,9 +3562,9 @@ } }, "node_modules/engine.io": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/engine.io/-/engine.io-6.2.0.tgz", - "integrity": "sha512-4KzwW3F3bk+KlzSOY57fj/Jx6LyRQ1nbcyIadehl+AnXjKT7gDO0ORdRi/84ixvMKTym6ZKuxvbzN62HDDU1Lg==", + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/engine.io/-/engine.io-6.2.1.tgz", + "integrity": "sha512-ECceEFcAaNRybd3lsGQKas3ZlMVjN3cyWwMP25D2i0zWfyiytVbTpRPa34qrr+FHddtpBVOmq4H/DCv1O0lZRA==", "dev": true, "dependencies": { "@types/cookie": "^0.4.1", @@ -13443,9 +13443,9 @@ "dev": true }, "engine.io": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/engine.io/-/engine.io-6.2.0.tgz", - "integrity": "sha512-4KzwW3F3bk+KlzSOY57fj/Jx6LyRQ1nbcyIadehl+AnXjKT7gDO0ORdRi/84ixvMKTym6ZKuxvbzN62HDDU1Lg==", + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/engine.io/-/engine.io-6.2.1.tgz", + "integrity": "sha512-ECceEFcAaNRybd3lsGQKas3ZlMVjN3cyWwMP25D2i0zWfyiytVbTpRPa34qrr+FHddtpBVOmq4H/DCv1O0lZRA==", "dev": true, "requires": { "@types/cookie": "^0.4.1",