Skip to content

Commit

Permalink
upgrades
Browse files Browse the repository at this point in the history
  • Loading branch information
jdsteinbach committed Feb 14, 2023
2 parents c99e8de + 72d3c70 commit 2dd917c
Show file tree
Hide file tree
Showing 9 changed files with 41 additions and 32 deletions.
10 changes: 2 additions & 8 deletions .eleventy.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 => {
Expand Down Expand Up @@ -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')
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/eleventy_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
31 changes: 8 additions & 23 deletions src/_data/newsletter.js
Original file line number Diff line number Diff line change
@@ -1,28 +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', () => {
if(typeof data === 'string' && data.indexOf('<') === 0) throw new Error('ERROR: Newsletter API did not receive JSON.')
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()
2 changes: 2 additions & 0 deletions src/_includes/partials/_head.liquid
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,6 @@
<meta name="theme-color" content="#321f44" media="(prefers-color-scheme: dark)">
<meta name="theme-color" content="#492e63" media="(prefers-color-scheme: light)">
<meta name="theme-color" content="#492e63" />

<meta name="generator" content="{{ eleventy.generator }}" />
</head>
16 changes: 16 additions & 0 deletions src/_includes/sitemap.liquid
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
{%- for post in collections.all %}
<url>
<loc>{{ post.url | abs_url: site.url }}
</loc>
<lastmod>{{ post.date | rss_date }}
</lastmod>
{%- if post.data.changeFreq -%}
<changefreq>
{{ post.data.changefreq }}
</changefreq>
{%- endif -%}
</url>
{%- endfor -%}
</urlset>
1 change: 1 addition & 0 deletions src/pages/feed.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
---
permalink: feed.xml
layout: feed
eleventyExcludeFromCollections: true
---
5 changes: 5 additions & 0 deletions src/pages/sitemap.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
permalink: sitemap.xml
layout: sitemap
eleventyExcludeFromCollections: true
---
2 changes: 1 addition & 1 deletion src/pages/talks.md
Original file line number Diff line number Diff line change
Expand Up @@ -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/#/)
Expand Down
4 changes: 4 additions & 0 deletions src/robots.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Sitemap: https://jdsteinbach.com/sitemap.xml

User-agent: *
Disallow:

0 comments on commit 2dd917c

Please sign in to comment.