From 22e6fbc3c4aa8d019b6b2ae08b594c9805950534 Mon Sep 17 00:00:00 2001 From: sloane Date: Tue, 28 Jan 2025 17:53:02 -0500 Subject: [PATCH] setup webmention.io --- Gemfile | 1 + Gemfile.lock | 83 +++++++++++++++++++++++++++ _config.yml | 8 +++ _layouts/default.html | 1 + _layouts/post.html | 6 +- _posts/2025-01-28-syndication-test.md | 5 +- js/JekyllWebmentionIO.js | 2 + 7 files changed, 101 insertions(+), 5 deletions(-) create mode 100644 js/JekyllWebmentionIO.js diff --git a/Gemfile b/Gemfile index 9f197f1..a9dfbca 100644 --- a/Gemfile +++ b/Gemfile @@ -7,4 +7,5 @@ gem 'webrick' group :jekyll_plugins do gem 'jekyll-compose' + gem 'jekyll-webmention_io' end diff --git a/Gemfile.lock b/Gemfile.lock index e534869..9f5ef33 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,17 +1,34 @@ GEM remote: https://rubygems.org/ specs: + activesupport (7.2.2.1) + base64 + benchmark (>= 0.3) + bigdecimal + concurrent-ruby (~> 1.0, >= 1.3.1) + connection_pool (>= 2.2.5) + drb + i18n (>= 1.6, < 2) + logger (>= 1.4.2) + minitest (>= 5.1) + securerandom (>= 0.3) + tzinfo (~> 2.0, >= 2.0.5) addressable (2.8.7) public_suffix (>= 2.0.2, < 7.0) base64 (0.2.0) + benchmark (0.4.0) bigdecimal (3.1.9) colorator (1.1.0) concurrent-ruby (1.3.5) + connection_pool (2.5.0) csv (3.3.2) + domain_name (0.6.20240107) + drb (2.2.1) em-websocket (0.5.3) eventmachine (>= 0.12.9) http_parser.rb (~> 0) eventmachine (1.2.7) + execjs (2.10.0) ffi (1.17.1) ffi (1.17.1-aarch64-linux-gnu) ffi (1.17.1-aarch64-linux-musl) @@ -23,6 +40,9 @@ GEM ffi (1.17.1-x86_64-darwin) ffi (1.17.1-x86_64-linux-gnu) ffi (1.17.1-x86_64-linux-musl) + ffi-compiler (1.3.2) + ffi (>= 1.15.5) + rake forwardable-extended (2.6.0) google-protobuf (4.29.3) bigdecimal @@ -42,9 +62,23 @@ GEM google-protobuf (4.29.3-x86_64-linux) bigdecimal rake (>= 13) + htmlbeautifier (1.4.3) + http (5.2.0) + addressable (~> 2.8) + base64 (~> 0.1) + http-cookie (~> 1.0) + http-form_data (~> 2.2) + llhttp-ffi (~> 0.5.0) + http-cookie (1.0.8) + domain_name (~> 0.5) + http-form_data (2.3.0) http_parser.rb (0.8.0) i18n (1.14.7) concurrent-ruby (~> 1.0) + indieweb-endpoints (8.0.0) + http (~> 5.0) + link-header-parser (~> 5.0) + nokogiri (>= 1.13) jekyll (4.4.0) addressable (~> 2.4) base64 (~> 0.2) @@ -70,20 +104,59 @@ GEM sass-embedded (~> 1.54) jekyll-watch (2.2.1) listen (~> 3.0) + jekyll-webmention_io (4.0.0) + activesupport (~> 7.0, >= 7.0.4.3) + htmlbeautifier (~> 1.1) + jekyll (>= 3.2.0, < 5.0) + json (~> 2.0) + jsonpath (~> 1.0.1) + openssl (>= 2.0, < 4.0) + uglifier (~> 4.1) + webmention (~> 7.0) json (2.9.1) + jsonpath (1.0.7) + multi_json kramdown (2.5.1) rexml (>= 3.3.9) kramdown-parser-gfm (1.1.0) kramdown (~> 2.0) + link-header-parser (5.1.1) liquid (4.0.4) listen (3.9.0) rb-fsevent (~> 0.10, >= 0.10.3) rb-inotify (~> 0.9, >= 0.9.10) + llhttp-ffi (0.5.0) + ffi-compiler (~> 1.0) + rake (~> 13.0) logger (1.6.5) mercenary (0.4.0) + mini_portile2 (2.8.8) + minitest (5.25.4) + multi_json (1.15.0) + nokogiri (1.18.2) + mini_portile2 (~> 2.8.2) + racc (~> 1.4) + nokogiri (1.18.2-aarch64-linux-gnu) + racc (~> 1.4) + nokogiri (1.18.2-aarch64-linux-musl) + racc (~> 1.4) + nokogiri (1.18.2-arm-linux-gnu) + racc (~> 1.4) + nokogiri (1.18.2-arm-linux-musl) + racc (~> 1.4) + nokogiri (1.18.2-arm64-darwin) + racc (~> 1.4) + nokogiri (1.18.2-x86_64-darwin) + racc (~> 1.4) + nokogiri (1.18.2-x86_64-linux-gnu) + racc (~> 1.4) + nokogiri (1.18.2-x86_64-linux-musl) + racc (~> 1.4) + openssl (3.3.0) pathutil (0.16.2) forwardable-extended (~> 2.6) public_suffix (6.0.1) + racc (1.8.1) rake (13.2.1) rb-fsevent (0.11.2) rb-inotify (0.11.1) @@ -126,9 +199,18 @@ GEM google-protobuf (~> 4.29) sass-embedded (1.83.4-x86_64-linux-musl) google-protobuf (~> 4.29) + securerandom (0.4.1) terminal-table (3.0.2) unicode-display_width (>= 1.1.1, < 3) + tzinfo (2.0.6) + concurrent-ruby (~> 1.0) + uglifier (4.2.1) + execjs (>= 0.3.0, < 3) unicode-display_width (2.6.0) + webmention (7.0.0) + http (~> 5.0) + indieweb-endpoints (~> 8.0) + nokogiri (>= 1.13) webrick (1.9.1) PLATFORMS @@ -160,6 +242,7 @@ PLATFORMS DEPENDENCIES jekyll jekyll-compose + jekyll-webmention_io logger webrick diff --git a/_config.yml b/_config.yml index 24baf41..ac2042a 100644 --- a/_config.yml +++ b/_config.yml @@ -4,7 +4,15 @@ title: "sloane.sh" # the name of your site, e.g. ACME Corp. permalink: /:categories/:year/:month/:day/:title/index:output_ext plugins: - jekyll-compose + - jekyll-webmention_io +webmentions: + username: sloane.sh + syndication: + mastodon: + endpoint: https://brid.gy/publish/mastodon + bluesky: + endpoint: https://brid.gy/publish/bluesky author: name: sloane diff --git a/_layouts/default.html b/_layouts/default.html index e5d7a3c..d3cae34 100644 --- a/_layouts/default.html +++ b/_layouts/default.html @@ -12,6 +12,7 @@ + {% webmentions_head %} {{ content }} diff --git a/_layouts/post.html b/_layouts/post.html index 963fed3..e4e5d96 100644 --- a/_layouts/post.html +++ b/_layouts/post.html @@ -39,8 +39,10 @@ layout: default - {% for service in page.syndicate %} - + {% webmentions page.url %} + {% for target in page.syndicate_to %} + {% endfor %} +{% webmentions_js %} diff --git a/_posts/2025-01-28-syndication-test.md b/_posts/2025-01-28-syndication-test.md index 60dcbb5..8b75666 100644 --- a/_posts/2025-01-28-syndication-test.md +++ b/_posts/2025-01-28-syndication-test.md @@ -2,8 +2,7 @@ layout: post title: syndication test date: 2025-01-28 17:08 -0500 -syndicate: -- mastodon -- bluesky +syndicate_to: [ mastodon, bluesky ] --- + This is a test! diff --git a/js/JekyllWebmentionIO.js b/js/JekyllWebmentionIO.js new file mode 100644 index 0000000..26a3a0c --- /dev/null +++ b/js/JekyllWebmentionIO.js @@ -0,0 +1,2 @@ +!function(t,e){function n(){for(var t,n=e.querySelectorAll("template[id^=webmention-]"),i=n.length;i--;)(t=n[i]).content.querySelector("ol")?f[t.id]=t.content.querySelector("ol"):f[t.id]=t.content;t=null}function i(){for(var t=e.querySelectorAll("[id^=webmention-]"),n=t.length;n--;)JekyllWebmentionIO.existing_webmentions.push(t[n].getAttribute("id").replace("webmention-",""));t=null}function r(){for(var t,n,i,r,s=e.querySelectorAll(".webmentions"),o=s.length;o--;){n="webmentions",(t=s[o]).className.indexOf("webmentions--")>-1&&(n=t.className.match(/webmentions\-\-(.*)/)[1]),t.type=n,f["webmention-"+n]&&(t.template=f["webmention-"+n]),r=(i="dataset"in t&&"webmentionTypes"in t.dataset?t.dataset.webmentionTypes.split(","):[n]).length;for(;r--;)(n=i[r])in d||(d[n]=[]),d[n].push(t)}t=null}function s(t){var e,n,i,r,s=0,a={},l=Object.keys(d),u=function(t){return JekyllWebmentionIO.types[t]===this.type};for(s=l.length;s--;)a[l[s]]=[];for(s=t.length;s--;)n=t[s],r=u.bind(n),i=Object.keys(JekyllWebmentionIO.types).filter(r)[0],l.indexOf(i)>-1&&a[i].push(n),a.webmentions&&a.webmentions.push(n);for(s=l.length;s--;)for(e=d[l[s]].length;e--;)a[l[s]].length>0&&o(a[l[s]],d[l[s]][e])}function o(e,n){if(e.length<1)console.warn("No webmentions to add, check your application code");else if(n.template)if("Liquid"in t){var i,r=n.querySelector(".webmentions__list"),s=n.template,o="append";r?s=Liquid.parse(s.innerHTML):(s=Liquid.parse(s.outerHTML),o="replace"),i=s.render({webmentions:e}),"append"==o?r.innerHTML+=i:n.innerHTML=i}else console.error("Liquid parsing engine is not available");else console.error("No template found for this webmention group",n)}function a(t){for(var e,n,i=t.length;i--;)e=t[i].id,(n=t[i].data.url||t[i].source)&&n.indexOf("twitter.com/")>-1&&n.indexOf("#favorited-by")<0&&(e=n.replace(/^.*?status\/(\d+)$/,"$1")),t[i].id=e+"";return t}function l(t){t.reverse();for(var e=[],n=t.length;n--;)JekyllWebmentionIO.existing_webmentions.indexOf(t[n].id)<0&&(e.push(t[n]),JekyllWebmentionIO.existing_webmentions.push(t[n].id));return e}function u(t){t.reverse();for(var e,n,i,r,s,o,a,l=t.length,u=function(t){t&&c(this.id,this.uri,t)};l--;)r=!1,(i=(e=t[l]).data.url||e.source).indexOf("twitter.com/")?r="twitter":i.indexOf("/googleplus/")>-1&&(r="googleplus"),!(s=e.data.published_ts)&&e.verified_date&&(s=e.verified_date),s&&(s=new Date(s).getTime()),n={id:e.id,url:i,source:r,pubdate:s,raw:t[l]},"author"in e.data&&(n.author=t[l].data.author),(o=t[l].activity.type)||(o="googleplus"==r?i.indexOf("/like/")>-1?"like":i.indexOf("/repost/")>-1?"repost":i.indexOf("/comment/")>-1?"reply":"link":"post"),n.type=o,!1,"post"==o&&h(i,u.bind({id:n.id,uri:i})),a=e.data.content,"bookmark"!=o&&"link"!=o&&"post"!=o&&"reply"!=o&&(a=e.activity.sentence_html),n.content=a,t[l]=n;return t}function c(t,n,i){var r,s,o,a=e.querySelector("#webmention-"+t),l=a.querySelector(".webmention__title"),u=e.createElement("html"),c="";u.innerHTML=i,s=u.querySelector("title"),o=u.querySelector("h1"),l.length<0&&(l=a.querySelector(".webmention__content")),l.length>0&&(c=s.length>0?s.innerText:o.length>0?o.innerHTML:"No title available")&&(c=c.replace(/<\/?[^>]+?>}/,""),(r=e.createElement("a")).href=n,r.appendChild(e.createTextNode(c)),l.innerHTML=r.outerHTML)}function h(e,n){if("XMLHttpRequest"in t){var i=new XMLHttpRequest;h=function(t,e){var n=!1;t="//whateverorigin.org/get?url="+encodeURIComponent(t),i.onreadystatechange=function(){4!=this.readyState||n||(n=!0,e(i.responseText))},i.onabort=function(){n||(n=!0,e(!1))},i.onerror=i.onabort,i.open("GET",t),i.send(null)}}else h=function(t,e){e(!1)};return h(e,n)}if("querySelectorAll"in e&&"filter"in[]&&"content"in e.createElement("template")){"JekyllWebmentionIO"in t||(t.JekyllWebmentionIO={}),JekyllWebmentionIO.existing_webmentions=[],JekyllWebmentionIO.processWebmentions=function(t){if(t&&!("error"in t)){var n=t.links.reverse();(n=l(n=a(n))).length&&(s(n=u(n)),this.counter_update_event&&e.dispatchEvent(this.counter_update_event))}};var d={},f={};n(),i(),r()}}(this,this.document),function(t){"use strict";t.location.origin||(t.location.origin=t.location.protocol+"//"+t.location.host),Object.keys||(Object.keys=function(t){if(t!==Object(t))throw new TypeError("Object.keys called on a non-object");var e,n=[];for(e in t)Object.prototype.hasOwnProperty.call(t,e)&&n.push(e);return n})}(this,this.document);var Liquid={author:"Matt McCray ",version:"1.3.2",readTemplateFile:function(){throw"This liquid context does not allow includes."},registerFilters:function(t){Liquid.Template.registerFilter(t)},parse:function(t){return Liquid.Template.parse(t)},extensions:{}};Liquid.extensions.object={},Liquid.extensions.object.update=function(t){for(var e in t)this[e]=t[e];return this},Liquid.extensions.object.hasKey=function(t){return!!this[t]},Liquid.extensions.object.hasValue=function(t){for(var e in this)if(this[e]==t)return!0;return!1},Liquid.extensions.object.isEmpty=function(t){if(!t||""===Liquid.extensions.stringTools.strip(t.toString()))return!0;if(t.length&&t.length>0)return!1;if("number"==typeof t)return!1;for(var e in t)if(t[e])return!1;return!0},Liquid.extensions.stringTools={},Liquid.extensions.stringTools.capitalize=function(t){return t.charAt(0).toUpperCase()+t.substring(1).toLowerCase()},Liquid.extensions.stringTools.strip=function(t){return t.replace(/^\s+/,"").replace(/\s+$/,"")},Liquid.extensions.arrayTools={},Liquid.extensions.arrayTools.last=function(t){return t[t.length-1]},Liquid.extensions.arrayTools.indexOf=function(t,e){for(var n=0;n=0},function(){var t=!1,e=/xyz/.test(function(){xyz})?/\b_super\b/:/.*/;this.Class=function(){},this.Class.extend=function(n){function i(){!t&&this.init&&this.init.apply(this,arguments)}var r=this.prototype;t=!0;var s=new this;for(var o in t=!1,n)s[o]="function"==typeof n[o]&&"function"==typeof r[o]&&e.test(n[o])?function(t,e){return function(){var n=this._super;this._super=r[t];var i=e.apply(this,arguments);return this._super=n,i}}(o,n[o]):n[o];return i.prototype=s,i.prototype.constructor=i,i.extend=arguments.callee,i}}.call(Liquid),Liquid.Tag=Liquid.Class.extend({init:function(t,e,n){this.tagName=t,this.markup=e,this.nodelist=this.nodelist||[],this.parse(n)},parse:function(){},render:function(){return""}}),Liquid.Block=Liquid.Tag.extend({init:function(t,e,n){this.blockName=t,this.blockDelimiter="end"+this.blockName,this._super(t,e,n)},parse:function(t){this.nodelist||(this.nodelist=[]),this.nodelist.length=0;var e=t.shift();for(t.push("");t.length;){if(/^\{\%/.test(e)){var n=e.match(/^\{\%\s*(\w+)\s*(.*)?\%\}$/);if(!n)throw"Tag '"+e+"' was not properly terminated with: %}";if(this.blockDelimiter==n[1])return void this.endTag();n[1]in Liquid.Template.tags?this.nodelist.push(new Liquid.Template.tags[n[1]](n[1],n[2],t)):this.unknownTag(n[1],n[2],t)}else/^\{\{/.test(e)?this.nodelist.push(this.createVariable(e)):this.nodelist.push(e);e=t.shift()}this.assertMissingDelimitation()},endTag:function(){},unknownTag:function(t){switch(t){case"else":throw this.blockName+" tag does not expect else tag";case"end":throw"'end' is not a valid delimiter for "+this.blockName+" tags. use "+this.blockDelimiter;default:throw"Unknown tag: "+t}},createVariable:function(t){var e=t.match(/^\{\{(.*)\}\}$/);if(e)return new Liquid.Variable(e[1]);throw"Variable '"+t+"' was not properly terminated with: }}"},render:function(t){return this.renderAll(this.nodelist,t)},renderAll:function(t,e){return Liquid.extensions.arrayTools.map(t||[],function(t){var n="";try{n=t.render?t.render(e):t}catch(i){n=e.handleError(i)}return n})},assertMissingDelimitation:function(){throw this.blockName+" tag was never closed"}}),Liquid.Document=Liquid.Block.extend({init:function(t){this.blockDelimiter=[],this.parse(t)},assertMissingDelimitation:function(){}}),Liquid.Strainer=Liquid.Class.extend({init:function(t){this.context=t},respondTo:function(t){return!(t=t.toString()).match(/^__/)&&(!Liquid.extensions.arrayTools.include(Liquid.Strainer.requiredMethods,t)&&t in this)}}),Liquid.Strainer.filters={},Liquid.Strainer.globalFilter=function(t){for(var e in t)Liquid.Strainer.filters[e]=t[e]},Liquid.Strainer.requiredMethods=["respondTo","context"],Liquid.Strainer.create=function(t){var e=new Liquid.Strainer(t);for(var n in Liquid.Strainer.filters)e[n]=Liquid.Strainer.filters[n];return e},Liquid.Context=Liquid.Class.extend({init:function(t,e,n){this.scopes=[t||{}],this.registers=e||{},this.errors=[],this.rethrowErrors=n,this.strainer=Liquid.Strainer.create(this)},get:function(t){return this.resolve(t)},set:function(t,e){this.scopes[0][t]=e},hasKey:function(t){return!!this.resolve(t)},push:function(){var t={};return this.scopes.unshift(t),t},merge:function(t){return Liquid.extensions.object.update.call(this.scopes[0],t)},pop:function(){if(1==this.scopes.length)throw"Context stack error";return this.scopes.shift()},stack:function(t,e){var n=null;this.push();try{n=t.apply(e||this.strainer)}finally{this.pop()}return n},invoke:function(t,e){return this.strainer.respondTo(t)?this.strainer[t].apply(this.strainer,e):0==e.length?null:e[0]},resolve:function(t){switch(t){case null:case"nil":case"null":case"":return null;case"true":return!0;case"false":return!1;case"blank":case"empty":return"";default:if(/^'(.*)'$/.test(t))return t.replace(/^'(.*)'$/,"$1");if(/^"(.*)"$/.test(t))return t.replace(/^"(.*)"$/,"$1");if(/^(\d+)$/.test(t))return parseInt(t.replace(/^(\d+)$/,"$1"));if(/^(\d[\d\.]+)$/.test(t))return parseFloat(t.replace(/^(\d[\d\.]+)$/,"$1"));if(/^\((\S+)\.\.(\S+)\)$/.test(t)){var e=t.match(/^\((\S+)\.\.(\S+)\)$/),n=parseInt(e[1]),i=parseInt(e[2]),r=[];if(isNaN(n)){let i=this.resolve(e[1]);if(n=parseInt(i),isNaN(n))throw new Error("Incorrect param for range: "+t)}if(isNaN(i)){let n=this.resolve(e[2]);if(i=parseInt(n),isNaN(i))throw new Error("Incorrect param for range: "+t)}for(var s=i-n+1,o=0;o"}}),Liquid.Condition.operators={"==":function(t,e){return t==e},"=":function(t,e){return t==e},"!=":function(t,e){return t!=e},"<>":function(t,e){return t!=e},"<":function(t,e){return t":function(t,e){return t>e},"<=":function(t,e){return t<=e},">=":function(t,e){return t>=e},contains:function(t,e){return"[object Array]"===Object.prototype.toString.call(t)?Liquid.extensions.arrayTools.indexOf(t,e)>=0:t.match(e)},hasKey:function(t,e){return Liquid.extensions.object.hasKey.call(t,e)},hasValue:function(t,e){return Liquid.extensions.object.hasValue.call(t,e)}},Liquid.ElseCondition=Liquid.Condition.extend({isElse:!0,evaluate:function(){return!0},toString:function(){return""}}),Liquid.Drop=Liquid.Class.extend({setContext:function(t){this.context=t},beforeMethod:function(){},invokeDrop:function(t){var e=this.beforeMethod();return!e&&t in this&&(e=this[t].apply(this)),e},hasKey:function(){return!0}});var split,hackObjectEach=function(t){if("function"!=typeof t)throw"Object.each requires first argument to be a function";var e=0,n=arguments[1];for(var i in this){var r=this[i],s=[i,r];s.key=i,s.value=r,t.call(n,s,e,this),e++}return null};Liquid.Template.registerTag("assign",Liquid.Tag.extend({tagSyntax:/((?:\(?[\w\-\.\[\]]\)?)+)\s*=\s*(.+)/,init:function(t,e,n){var i=e.match(this.tagSyntax);if(!i)throw"Syntax error in 'assign' - Valid syntax: assign [var] = [source]";this.to=i[1],this.from=i[2],this._super(t,e,n)},render:function(t){var e=new Liquid.Variable(this.from);return Liquid.extensions.arrayTools.last(t.scopes)[this.to.toString()]=e.render(t),""}})),Liquid.Template.registerTag("cache",Liquid.Block.extend({tagSyntax:/(\w+)/,init:function(t,e,n){var i=e.match(this.tagSyntax);if(!i)throw"Syntax error in 'cache' - Valid syntax: cache [var]";this.to=i[1],this._super(t,e,n)},render:function(t){var e=this._super(t);return Liquid.extensions.arrayTools.last(t.scopes)[this.to]=Liquid.extensions.arrayTools.flatten([e]).join(""),""}})),Liquid.Template.registerTag("capture",Liquid.Block.extend({tagSyntax:/(\w+)/,init:function(t,e,n){var i=e.match(this.tagSyntax);if(!i)throw"Syntax error in 'capture' - Valid syntax: capture [var]";this.to=i[1],this._super(t,e,n)},render:function(t){var e=this._super(t);return Liquid.extensions.arrayTools.last(t.scopes)[this.to.toString()]=Liquid.extensions.arrayTools.flatten([e]).join(""),""}})),Liquid.Template.registerTag("case",Liquid.Block.extend({tagSyntax:/("[^"]+"|'[^']+'|[^\s,|]+)/,tagWhenSyntax:/("[^"]+"|'[^']+'|[^\s,|]+)(?:(?:\s+or\s+|\s*\,\s*)("[^"]+"|'[^']+'|[^\s,|]+.*))?/,init:function(t,e,n){this.blocks=[],this.nodelist=[];var i=e.match(this.tagSyntax);if(!i)throw"Syntax error in 'case' - Valid syntax: case [condition]";this.left=i[1],this._super(t,e,n)},unknownTag:function(t,e,n){switch(t){case"when":this.recordWhenCondition(e);break;case"else":this.recordElseCondition(e);break;default:this._super(t,e,n)}},render:function(t){var e=this,n=[],i=!0;return t.stack(function(){for(var r=0;ra-z_]+)?\s*("[^"]+"|'[^']+'|[^\s,|]+)?/,init:function(t,e,n){this.nodelist=[],this.blocks=[],this.pushBlock("if",e),this._super(t,e,n)},unknownTag:function(t,e,n){Liquid.extensions.arrayTools.include(["elsif","else"],t)?this.pushBlock(t,e):this._super(t,e,n)},render:function(t){var e=this,n="";return t.stack(function(){for(var i=0;i0;){var s,o=i.shift();if(!(s=i.shift().match(this.tagSyntax)))throw"Syntax Error in tag '"+t+"' - Valid syntax: "+t+" [expression]";var a=new Liquid.Condition(s[1],s[2],s[3]);a[o](r),r=a}n=r}n.attach([]),this.blocks.push(n),this.nodelist=n.attachment}})),Liquid.Template.registerTag("ifchanged",Liquid.Block.extend({render:function(t){var e=this,n="";return t.stack(function(){var i=e.renderAll(e.nodelist,t).join("");i!=t.registers.ifchanged&&(n=i,t.registers.ifchanged=n)}),n}})),Liquid.Template.registerTag("include",Liquid.Tag.extend({tagSyntax:/((?:"[^"]+"|'[^']+'|[^\s,|]+)+)(\s+(?:with|for)\s+((?:"[^"]+"|'[^']+'|[^\s,|]+)+))?/,init:function(t,e,n){var i=(e||"").match(this.tagSyntax);if(!i)throw"Error in tag 'include' - Valid syntax: include '[template]' (with|for) [object|collection]";this.templateName=i[1],this.templateNameVar=this.templateName.substring(1,this.templateName.length-1),this.variableName=i[3],this.attributes={};var r=e.match(/(\w*?)\s*\:\s*("[^"]+"|'[^']+'|[^\s,|]+)/g);r&&Liquid.extensions.arrayTools.each(r,function(t){t=t.split(":"),this.attributes[Liquid.extensions.stringTools.strip(t[0])]=Liquid.extensions.stringTools.strip(t[1])},this),this._super(t,e,n)},render:function(t){var e=this,n=Liquid.readTemplateFile(t.get(this.templateName)),i=Liquid.parse(n),r=t.get(this.variableName||this.templateNameVar),s="";return t.stack(function(){e.attributes.each=hackObjectEach,e.attributes.each(function(e){t.set(e.key,t.get(e.value))}),r instanceof Array?s=Liquid.extensions.arrayTools.map(r,function(n){return t.set(e.templateNameVar,n),i.render(t)}):(t.set(e.templateNameVar,r),s=i.render(t))}),s=Liquid.extensions.arrayTools.flatten([s]).join("")}})),Liquid.Template.registerTag("unless",Liquid.Template.tags["if"].extend({render:function(t){var e=this,n="";return t.stack(function(){if((r=e.blocks[0]).evaluate(t))for(var i=1;i":">","<":"<",'"':""","'":"'"},size:function(t){return t.length?t.length:0},downcase:function(t){return t.toString().toLowerCase()},upcase:function(t){return t.toString().toUpperCase()},capitalize:function(t){return Liquid.extensions.stringTools.capitalize(t.toString())},escape:function(t){var e=this;return t.replace(/[&<>"']/g,function(t){return e._HTML_ESCAPE_MAP[t]})},h:function(t){var e=this;return t.replace(/[&<>"']/g,function(t){return e._HTML_ESCAPE_MAP[t]})},"default":function(t,e){return Liquid.extensions.object.isEmpty(t)?e:t},truncate:function(t,e,n){if(!t||""==t)return"";e=e||50,n=n||"...";t.slice(0,e);return t.length>e?t.slice(0,e)+n:t},truncatewords:function(t,e,n){if(!t||""==t)return"";e=parseInt(e||15),n=n||"...";var i=t.toString().split(" "),r=Math.max(e,0);return i.length>r?i.slice(0,r).join(" ")+n:t},truncate_words:function(t,e,n){if(!t||""==t)return"";e=parseInt(e||15),n=n||"...";var i=t.toString().split(" "),r=Math.max(e,0);return i.length>r?i.slice(0,r).join(" ")+n:t},strip_html:function(t){return t.toString().replace(/<.*?>/g,"")},strip_newlines:function(t){return t.toString().replace(/\n/g,"")},join:function(t,e){return e=e||" ",t.join(e)},split:function(t,e){return e=e||" ",t.split(e)},sort:function(t){return t.sort()},reverse:function(t){return t.reverse()},replace:function(t,e,n){return n=n||"",t.toString().replace(new RegExp(e,"g"),n)},replace_first:function(t,e,n){return n=n||"",t.toString().replace(new RegExp(e,""),n)},newline_to_br:function(t){return t.toString().replace(/\n/g,"
\n")},date:function(t,e){var n;return t instanceof Date&&(n=t),n instanceof Date||"now"!=t||(n=new Date),n instanceof Date||"number"!=typeof t||(n=new Date(1e3*t)),n instanceof Date||"string"!=typeof t||(n=new Date(Date.parse(t))),n instanceof Date?n.strftime(e):t},first:function(t){return t[0]},last:function(t){return(t=t)[t.length-1]},minus:function(t,e){return(Number(t)||0)-(Number(e)||0)},plus:function(t,e){return(Number(t)||0)+(Number(e)||0)},times:function(t,e){return(Number(t)||0)*(Number(e)||0)},divided_by:function(t,e){return(Number(t)||0)/(Number(e)||0)},modulo:function(t,e){return(Number(t)||0)%(Number(e)||0)},map:function(t,e){t=t||[];for(var n=[],i=0;i<']|&(?!([a-zA-Z]+|(#\d+));)/g,function(t){return e._HTML_ESCAPE_MAP[t]})},remove:function(t,e){return t.toString().replace(new RegExp(e,"g"),"")},remove_first:function(t,e){return t.toString().replace(e,"")},prepend:function(t,e){return""+(e||"").toString()+(t||"").toString()},append:function(t,e){return""+(t||"").toString()+(e||"").toString()}}),(new Date).strftime||(Date.ext={},Date.ext.util={},Date.ext.util.xPad=function(t,e,n){for(void 0===n&&(n=10);parseInt(t,10)1;n/=10)t=e.toString()+t;return t.toString()},Date.prototype.locale="en-GB",document.getElementsByTagName("html")&&document.getElementsByTagName("html")[0].lang&&(Date.prototype.locale=document.getElementsByTagName("html")[0].lang),Date.ext.locales={},Date.ext.locales.en={a:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],A:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],b:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],B:["January","February","March","April","May","June","July","August","September","October","November","December"],c:"%a %d %b %Y %T %Z",p:["AM","PM"],P:["am","pm"],x:"%d/%m/%y",X:"%T"},"undefined"!=typeof JSON?Date.ext.locales["en-US"]=JSON.parse(JSON.stringify(Date.ext.locales.en)):Date.ext.locales["en-US"]=Date.ext.locales.en,Date.ext.locales["en-US"].c="%a %d %b %Y %r %Z",Date.ext.locales["en-US"].x="%D",Date.ext.locales["en-US"].X="%r",Date.ext.locales["en-GB"]=Date.ext.locales.en,Date.ext.locales["en-AU"]=Date.ext.locales["en-GB"],Date.ext.formats={a:function(t){return Date.ext.locales[t.locale].a[t.getDay()]},A:function(t){return Date.ext.locales[t.locale].A[t.getDay()]},b:function(t){return Date.ext.locales[t.locale].b[t.getMonth()]},B:function(t){return Date.ext.locales[t.locale].B[t.getMonth()]},c:"toLocaleString",C:function(t){return Date.ext.util.xPad(parseInt(t.getFullYear()/100,10),0)},d:["getDate","0"],e:["getDate"," "],g:function(t){return Date.ext.util.xPad(parseInt(Date.ext.util.G(t)/100,10),0)},G:function(t){var e=t.getFullYear(),n=parseInt(Date.ext.formats.V(t),10),i=parseInt(Date.ext.formats.W(t),10);return i>n?e++:0===i&&n>=52&&e--,e},H:["getHours","0"],I:function(t){var e=t.getHours()%12;return Date.ext.util.xPad(0===e?12:e,0)},j:function(t){var e=t-new Date(t.getFullYear()+"/1/1 GMT");e+=6e4*t.getTimezoneOffset();var n=parseInt(e/6e4/60/24,10)+1;return Date.ext.util.xPad(n,0,100)},m:function(t){return Date.ext.util.xPad(t.getMonth()+1,0)},M:["getMinutes","0"],p:function(t){return Date.ext.locales[t.locale].p[t.getHours()>=12?1:0]},P:function(t){return Date.ext.locales[t.locale].P[t.getHours()>=12?1:0]},S:["getSeconds","0"],u:function(t){var e=t.getDay();return 0===e?7:e},U:function(t){var e=parseInt(Date.ext.formats.j(t),10),n=6-t.getDay(),i=parseInt((e+n)/7,10);return Date.ext.util.xPad(i,0)},V:function(t){var e=parseInt(Date.ext.formats.W(t),10),n=new Date(t.getFullYear()+"/1/1").getDay(),i=e+(n>4||n<=1?0:1);return 53==i&&new Date(t.getFullYear()+"/12/31").getDay()<4?i=1:0===i&&(i=Date.ext.formats.V(new Date(t.getFullYear()-1+"/12/31"))),Date.ext.util.xPad(i,0)},w:"getDay",W:function(t){var e=parseInt(Date.ext.formats.j(t),10),n=7-Date.ext.formats.u(t),i=parseInt((e+n)/7,10);return Date.ext.util.xPad(i,0,10)},y:function(t){return Date.ext.util.xPad(t.getFullYear()%100,0)},Y:"getFullYear",z:function(t){var e=t.getTimezoneOffset();return(e>0?"-":"+")+Date.ext.util.xPad(parseInt(Math.abs(e/60),10),0)+Date.ext.util.xPad(e%60,0)},Z:function(t){return t.toString().replace(/^.*\(([^)]+)\)$/,"$1")},"%":function(){return"%"}},Date.ext.aggregates={c:"locale",D:"%m/%d/%y",h:"%b",n:"\n",r:"%I:%M:%S %p",R:"%H:%M",t:"\t",T:"%H:%M:%S",x:"locale",X:"locale"},Date.ext.aggregates.z=Date.ext.formats.z(new Date),Date.ext.aggregates.Z=Date.ext.formats.Z(new Date),Date.ext.unsupported={},Date.prototype.strftime=function(t){this.locale in Date.ext.locales||(this.locale.replace(/-[a-zA-Z]+$/,"")in Date.ext.locales?this.locale=this.locale.replace(/-[a-zA-Z]+$/,""):this.locale="en-GB");for(var e=this;t.match(/%[cDhnrRtTxXzZ]/);)t=t.replace(/%([cDhnrRtTxXzZ])/g,function(t,n){var i=Date.ext.aggregates[n];return"locale"==i?Date.ext.locales[e.locale][n]:i});var n=t.replace(/%([aAbBCdegGHIjmMpPSuUVwWyY%])/g,function(t,n){var i=Date.ext.formats[n];return"string"==typeof i?e[i]():"function"==typeof i?i.call(e,e):"object"==typeof i&&"string"==typeof i[0]?Date.ext.util.xPad(e[i[0]](),i[1]):n});return e=null,n}), +split=split||function(t){var e,n=String.prototype.split,i=/()??/.exec("")[1]===t;return e=function(e,r,s){if("[object RegExp]"!==Object.prototype.toString.call(r))return n.call(e,r,s);var o,a,l,u,c=[],h=(r.ignoreCase?"i":"")+(r.multiline?"m":"")+(r.extended?"x":"")+(r.sticky?"y":""),d=0;r=new RegExp(r.source,h+"g");for(e+="",i||(o=new RegExp("^"+r.source+"$(?!\\s)",h)),s=s===t?-1>>>0:s>>>0;(a=r.exec(e))&&!((l=a.index+a[0].length)>d&&(c.push(e.slice(d,a.index)),!i&&a.length>1&&a[0].replace(o,function(){for(var e=1;e1&&a.index=s));)r.lastIndex===a.index&&r.lastIndex++;return d===e.length?!u&&r.test("")||c.push(""):c.push(e.slice(d)),c.length>s?c.slice(0,s):c},String.prototype.split=function(t,n){return e(this,t,n)},e}(),"undefined"!=typeof exports&&("undefined"!=typeof module&&module.exports&&(exports=module.exports=Liquid),exports.Liquid=Liquid),function(t,e,n){"use strict";function i(){for(var t,i,s,o,a,l=r.length;l--;)if("dataset"in(t=r[l])&&"webmentionTypes"in t.dataset){for(s=(i=t.dataset.webmentionTypes.split(",")).length,a=0;s--;)o=n.types[i[s]],a+=e.querySelectorAll(".webmention.webmention--"+o).length;t.innerText=a}else t.innerText=e.querySelectorAll(".webmention").length}if("querySelectorAll"in e){"JekyllWebmentionIO"in t||(t.JekyllWebmentionIO={});var r=e.querySelectorAll(".webmention-count"),s="JekyllWebmentionIO:update_counters";r.length&&(n.counter_update_event=new Event(s),e.addEventListener(s,i,!1))}}(this,this.document,this.JekyllWebmentionIO),function(t,e){if("querySelectorAll"in e){"JekyllWebmentionIO"in t||(t.JekyllWebmentionIO={});var n,i=[],r=e.querySelector('meta[property="webmention:redirected_from"]'),s=t.location.origin;i.push(s+t.location.pathname),r&&(r.getAttribute("content").split(",").forEach(function(t){i.push(t.indexOf("//")<0?s+t:t)}),!1),(n=e.createElement("script")).async=!0,n.src="https://webmention.io/api/mentions?jsonp=window.JekyllWebmentionIO.processWebmentions&target[]="+i.join("&target[]="),e.querySelector("head").appendChild(n)}}(this,this.document),function(t,e){"JekyllWebmentionIO"in t||(t.JekyllWebmentionIO={}),e.types={bookmarks:"bookmark",likes:"like",links:"link",posts:"post",replies:"reply",reposts:"repost",rsvps:"rsvp"}}(this,this.JekyllWebmentionIO); \ No newline at end of file