diff --git a/Gemfile b/Gemfile index 0537423..ad0af0c 100644 --- a/Gemfile +++ b/Gemfile @@ -16,7 +16,6 @@ group :jekyll_plugins do git: "https://github.com/danbee/jekyll-picture-tag.git", branch: "update-gemspec" gem "jekyll-video-tag" - gem "jekyll-json-feed" end gem "jekyll-staging" @@ -29,6 +28,6 @@ gem "facets" gem "pry" -gem "uglifier" -gem "sass" gem "bourbon" +gem "sass" +gem "uglifier" diff --git a/Gemfile.lock b/Gemfile.lock index 68ca526..9ae08ec 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -56,8 +56,6 @@ GEM pathutil (>= 0.8) rack (~> 1.6) sprockets (~> 3.3, < 3.8) - jekyll-json-feed (1.0.0) - jekyll (~> 3.3) jekyll-paginate (1.1.0) jekyll-sass-converter (1.5.2) sass (~> 3.4) @@ -126,7 +124,6 @@ DEPENDENCIES jekyll jekyll-archives jekyll-assets - jekyll-json-feed jekyll-paginate jekyll-picture-tag! jekyll-staging diff --git a/_config.yml b/_config.yml index f56f104..3692ed8 100644 --- a/_config.yml +++ b/_config.yml @@ -15,16 +15,12 @@ markdown: Kramdown description: Web designer and developer for thoughtbot in London. Drummer and all round musician. -subscribe_rss: "/atom.xml" -subscribe_json: "/feed.json" - plugins: - jekyll-paginate - jekyll-archives - jekyll-assets - jekyll-picture-tag - jekyll_video_tag - - jekyll-json-feed - bourbon simple_search: https://duckduckgo.com/ diff --git a/_includes/head.html b/_includes/head.html index 7e00fb4..f091054 100644 --- a/_includes/head.html +++ b/_includes/head.html @@ -10,9 +10,10 @@ - - - + + + + diff --git a/_redirects b/_redirects index 0875cdb..2eb46b8 100644 --- a/_redirects +++ b/_redirects @@ -1,3 +1,4 @@ /cv https://cv.danbarber.me 301 /invaders https://danbee.github.io/invaders 301 /canvas https://danbee.github.io/canvas 301 +/atom.xml /feed.xml 301 diff --git a/feed.json b/feed.json new file mode 100644 index 0000000..e7c682f --- /dev/null +++ b/feed.json @@ -0,0 +1,66 @@ +--- +layout: +--- + +{ + "version": "https://jsonfeed.org/version/1", + {% if site.title %} + "title": {{ site.title | smartify | jsonify }}, + {% elsif site.name %} + "title": {{ site.name | smartify | jsonify }}, + {% endif %} + {% if site.description %} + "description": {{ site.description | jsonify }}, + {% endif %} + "home_page_url": {{ '/' | absolute_url | jsonify }}, + "feed_url": {{ page.url | absolute_url | jsonify }}, + {% if site.author %} + "author": { + "name": {{ site.author.name | default: site.author | jsonify }} + {% if site.author.uri %} + , "url": {{ site.author.uri | jsonify }} + {% endif %} + {% if site.author.avatar %} + , "avatar": {{ site.author.avatar | jsonify }} + {% endif %} + }, + {% endif %} + "items": [ + {% assign posts = site.posts | where_exp: "post", "post.draft != true" %} + {% for post in posts limit: 20 %} + { + "id": {{ post.id | absolute_url | jsonify }}, + "url": {{ post.url | absolute_url | jsonify }}, + "title": {{ post.title | smartify | strip_html | normalize_whitespace | jsonify }}, + "content_html": {{ post.content | strip | jsonify }}, + {% if post.excerpt and post.excerpt != empty %} + "summary": {{ post.excerpt | strip_html | normalize_whitespace | jsonify }}, + {% endif %} + {% assign post_image = post.image.path | default: post.image %} + {% if post_image %} + {% unless post_image contains "://" %} + {% assign post_image = post_image | absolute_url | xml_escape %} + {% endunless %} + "image": {{ post_image | jsonify }}, + {% endif %} + {% assign post_banner_image = post.banner_image.path | default: post.banner_image %} + {% if post_banner_image %} + "banner_image": {{ post_banner_image | jsonify }}, + {% endif %} + "date_published": "{{ post.date | date_to_xmlschema }}", + "date_modified": "{{ post.last_modified_at | default: post.date | date_to_xmlschema }}", + {% assign post_author = post.author | default: post.authors[0] | default: site.author %} + {% assign post_author = site.data.authors[post_author] | default: post_author %} + {% assign post_author_uri = post_author.uri | default: nil %} + {% assign post_author_name = post_author.name | default: post_author %} + "author": { + "name": {{ post_author_name | default: "" | jsonify }} + {% if post_author_uri != nil %} + , "url": {{ post_author_uri | jsonify }} + {% endif %} + }, + "tags": {{ post.tags | jsonify }} + }{% unless forloop.last == true %},{% endunless %} + {% endfor %} + ] +} diff --git a/feed.photos.json b/feed.photos.json new file mode 100644 index 0000000..2a35b33 --- /dev/null +++ b/feed.photos.json @@ -0,0 +1,66 @@ +--- +layout: +--- + +{ + "version": "https://jsonfeed.org/version/1", + {% if site.title %} + "title": {{ site.title | smartify | jsonify }}, + {% elsif site.name %} + "title": {{ site.name | smartify | jsonify }}, + {% endif %} + {% if site.description %} + "description": {{ site.description | jsonify }}, + {% endif %} + "home_page_url": {{ '/' | absolute_url | jsonify }}, + "feed_url": {{ page.url | absolute_url | jsonify }}, + {% if site.author %} + "author": { + "name": {{ site.author.name | default: site.author | jsonify }} + {% if site.author.uri %} + , "url": {{ site.author.uri | jsonify }} + {% endif %} + {% if site.author.avatar %} + , "avatar": {{ site.author.avatar | jsonify }} + {% endif %} + }, + {% endif %} + "items": [ + {% assign posts = site.posts | where_exp: "post", "post.draft != true" %} + {% for post in site.categories.photos limit: 20 %} + { + "id": {{ post.id | absolute_url | jsonify }}, + "url": {{ post.url | absolute_url | jsonify }}, + "title": {{ post.title | smartify | strip_html | normalize_whitespace | jsonify }}, + "content_html": {{ post.content | strip | jsonify }}, + {% if post.excerpt and post.excerpt != empty %} + "summary": {{ post.excerpt | strip_html | normalize_whitespace | jsonify }}, + {% endif %} + {% assign post_image = post.image.path | default: post.image %} + {% if post_image %} + {% unless post_image contains "://" %} + {% assign post_image = post_image | absolute_url | xml_escape %} + {% endunless %} + "image": {{ post_image | jsonify }}, + {% endif %} + {% assign post_banner_image = post.banner_image.path | default: post.banner_image %} + {% if post_banner_image %} + "banner_image": {{ post_banner_image | jsonify }}, + {% endif %} + "date_published": "{{ post.date | date_to_xmlschema }}", + "date_modified": "{{ post.last_modified_at | default: post.date | date_to_xmlschema }}", + {% assign post_author = post.author | default: post.authors[0] | default: site.author %} + {% assign post_author = site.data.authors[post_author] | default: post_author %} + {% assign post_author_uri = post_author.uri | default: nil %} + {% assign post_author_name = post_author.name | default: post_author %} + "author": { + "name": {{ post_author_name | default: "" | jsonify }} + {% if post_author_uri != nil %} + , "url": {{ post_author_uri | jsonify }} + {% endif %} + }, + "tags": {{ post.tags | jsonify }} + }{% unless forloop.last == true %},{% endunless %} + {% endfor %} + ] +} diff --git a/feed.photos.xml b/feed.photos.xml new file mode 100644 index 0000000..cb78b00 --- /dev/null +++ b/feed.photos.xml @@ -0,0 +1,27 @@ +--- +layout: +--- + + + + <![CDATA[{{ site.title }}]]> + + + {{ site.time | date_to_xmlschema }} + {{ site.url }}/ + + + {% if site.email %}{% endif %} + + Octopress + + {% for post in site.categories.photos limit: 20 %} + + <![CDATA[{{ post.title | cdata_escape }}]]> + + {{ post.date | date_to_xmlschema }} + {{ site.url }}{{ post.id }} + + + {% endfor %} + diff --git a/atom.xml b/feed.xml similarity index 99% rename from atom.xml rename to feed.xml index 638e4bc..4c37c5b 100644 --- a/atom.xml +++ b/feed.xml @@ -4,7 +4,6 @@ layout: - <![CDATA[{{ site.title }}]]>