Skip to content

Commit

Permalink
feat(feed): basic PubSubHubbub support
Browse files Browse the repository at this point in the history
  • Loading branch information
sparanoid committed Oct 17, 2015
1 parent 190a5fe commit 0d72326
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 2 deletions.
9 changes: 9 additions & 0 deletions Gruntfile.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ module.exports = (grunt) ->
gitreset: "grunt-git"
replace: "grunt-text-replace"
usebanner: "grunt-banner"
pubsubhubbub_publish: "grunt-pubsubhubbub_publish"

# Track tasks load time
require("time-grunt") grunt
Expand Down Expand Up @@ -563,6 +564,13 @@ module.exports = (grunt) ->
tagMessage: "chore: create tag %VERSION%"
push: false

pubsubhubbub_publish:
dist:
options:
hub: "<%= config.cfg.pshh %>"

hubUrl: "<%= config.cfg.url %><%= config.cfg.feed %>"

grunt.registerTask "theme-upgrade", "Upgrade specific theme from AMSF cache to app", [
"shell:amsf__theme__to_app"
]
Expand Down Expand Up @@ -678,6 +686,7 @@ module.exports = (grunt) ->
if grunt.option("deploy")
grunt.task.run [
"shell:sync_commit"
"pubsubhubbub_publish"
]

grunt.registerTask "default", "Default task aka. build task", [
Expand Down
5 changes: 3 additions & 2 deletions _app/feed-atom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,12 @@ permalink: /feed.xml
<title>{{ site.name }}</title>
<subtitle>{{ site.description }}</subtitle>
<updated>{{ site.time | date_to_xmlschema }}</updated>
{% assign site_domain = site.url | replace:'http://', '' | replace:'https://', '' %}
<id>{{ site.feed | prepend: amsf_site_base | xml_escape }}</id>
<rights>Copyright © {{ site.time | date: "%Y" }}, {{ site.data.authors.default.name }}</rights>

<link rel="alternate" type="text/html" hreflang="en" href="{{ amsf_site_base }}/" />
<link rel="self" type="application/atom+xml" href="{{ site.feed | prepend: amsf_site_base }}" />
<rights>Copyright © {{ site.time | date: "%Y" }}, {{ site.data.authors.default.name }}</rights>
<link rel="hub" href="{{ site.pshh }}" />

<author>
<name>{{ site.data.authors.default.name }}</name>
Expand Down
4 changes: 4 additions & 0 deletions _config.init.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,10 @@ assets: /assets
# Default: /feed.xml
feed: /feed.xml

# PubSubHubbub Hub
# Default: https://pubsubhubbub.appspot.com/
pshh: https://pubsubhubbub.appspot.com/

# Used in atom feed, sitemap, Twitter Cards, and etc. I should use absolute full URLs for these fields
url: http://sparanoid.com

Expand Down
4 changes: 4 additions & 0 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,10 @@ assets: /assets
# Default: /feed.xml
feed: /feed.xml

# PubSubHubbub Hub
# Default: https://pubsubhubbub.appspot.com/
pshh: https://pubsubhubbub.appspot.com/

# Used in atom feed, sitemap, Twitter Cards, and etc. I should use absolute full URLs for these fields
url: http://sparanoid.com

Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
"grunt-minjson": "^0.3.0",
"grunt-newer": "^1.1.1",
"grunt-postcss": "^0.6.0",
"grunt-pubsubhubbub_publish": "^0.2.1",
"grunt-rev": "^0.1.0",
"grunt-shell": "^1.1.2",
"grunt-text-replace": "^0.4.0",
Expand Down

0 comments on commit 0d72326

Please sign in to comment.