jekyll-webmention_io 2.0.2 → 2.0.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c4382f474833e2206b0e3d6016a0308b9aafc71f
4
- data.tar.gz: b8e5d8b894e2fd35b57d82005583c7b7fca9dc17
3
+ metadata.gz: 78b32f9c7aed21bc49a703a1fa010f53bef88e9b
4
+ data.tar.gz: 2b4587543f067474e883aa755d795e8ff3e25386
5
5
  SHA512:
6
- metadata.gz: d9ee082689c82401ccb06acba124e6729e1e7da07ba8820f897c3792b2fcad38948cb544b586d9a4391404d7a62ed26fa4d04c8e6b6e27a415001601c3a5fdc6
7
- data.tar.gz: 21d9be47dab80508be40b69792af0996261b62b1621a1f277cd28f2181cafb338830b45e01eeedbe9c9068d10ab7e588dedc54578a642ba0b01c379878e0fa76
6
+ metadata.gz: c3aa1b06bf34a4b9beb98b8e06b15a852c99a10320f1955b7269cd5db8e7a2a0886f6378e5c83ec4bf4d595cd14537bc2abea5da99c4defd8ffd6f9455e4add7
7
+ data.tar.gz: 9941ed468a34f98862698f7ccdb7d5a1a8371025387c56242086cea3b661241551ce67f8755d6f10766fe1eff9c4a5062c67380074718a3042a3115e75a1b307
data/Gemfile ADDED
@@ -0,0 +1,3 @@
1
+ source 'https://rubygems.org'
2
+
3
+ gemspec
data/LICENSE ADDED
@@ -0,0 +1,22 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2014 Aaron Gustafson
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
22
+
data/README.md ADDED
@@ -0,0 +1,109 @@
1
+ # Liquid Webmention Tag for Jekyll and Octopress
2
+
3
+ This plugin makes it possible to load [webmentions](http://indiewebcamp.com/webmention) from [Webmention.io](http://webmention.io) into your Jekyll and Octopress projects. It currently supports the following:
4
+
5
+ ## Webmention Count
6
+
7
+ Get a count of webmentions for a page or post using the following liquid tag:
8
+
9
+ {% webmention_count YOUR_URL %}
10
+
11
+ The output will simply be a number.
12
+
13
+ ## Webmention List
14
+
15
+ You can get a complete list of webmentions for a page or post using the following liquid tag:
16
+
17
+ {% webmentions YOUR_URL %}
18
+
19
+ If webmentions are found, this is the format they will come out in:
20
+
21
+ <div class="webmentions">
22
+ <ol class="webmentions__list">
23
+ <!-- if it has a Name/Title, this is the generated code -->
24
+ <li class="webmentions__item">
25
+ <article class="webmention webmention--title-only">
26
+ <!-- if Author this block appears -->
27
+ <div class="webmention__author vcard">
28
+ <!-- if Author Link the name is wrapped in a link -->
29
+ <a class="fn url" href="https://kylewm.com">
30
+ <!-- if Author Photo -->
31
+ <img class="webmention__author__photo photo" src="/static/img/users/kyle.jpg" alt="">
32
+ Kyle Mahan
33
+ </a>
34
+ </div>
35
+ <div class="webmention__title">
36
+ <a href="https://kylewm.com/2014/03/renaming-my-blog-engine-groomsman-to-red-wind">renaming my blog engine Groomsman to Red Wind</a>
37
+ </div>
38
+ <div class="webmention__meta">
39
+ <time class="webmention__pubdate" datetime="2014-03-13T20:33:42+00:00">13 March 2014</time>
40
+ </div>
41
+ </article>
42
+ </li>
43
+ <!-- if it has Content, but no Name, this is the generated code -->
44
+ <li class="webmentions__item">
45
+ <article class="webmention webmention--content-only">
46
+ <div class="webmention__meta">
47
+ <time class="webmention__pubdate" datetime="2014-11-11T15:30:18+00:00">11 November 2014</time>
48
+ |
49
+ <a class="webmention__source" href="http://aaronparecki.com/replies/2014/11/11/4/drupal">Permalink</a>
50
+ </div>
51
+ <div class="webmention__content">
52
+ <!-- This is run through Markdown -->
53
+ <p>@noneck @indiewebcamp Well the good news is there&rsquo;s lots of PHP libraries which should be easy to use in #drupal! <a href="http://indiewebcamp.com/PHP#Libraries">http://indiewebcamp.com/PHP#Libraries</a></p>
54
+ </div>
55
+ </article>
56
+ </li>
57
+ </ol>
58
+ </div>
59
+
60
+ If no webmentions are found, the plugin spits out this:
61
+
62
+ <div class="webmentions">
63
+ <p class="webmentions__not-found">No webmentions were found</p>
64
+ </div>
65
+
66
+ To summarize the classes, here’s what you have to work with:
67
+
68
+ * `webmentions` - overall container (`div`)
69
+ * `webmentions__list` - the list of webmentions (`ol`)
70
+ * `webmentions__item` - the webmention container (`li`)
71
+ * `webmention` - the webmention itself (`article`)
72
+ * `webmention--title-only` - title-only variant
73
+ * `webmention--content-only` - content-only variant
74
+ * `webmention--author-starts` - variant for when the author’s name starts the title or content
75
+ * `webmention__author` - Author of the webmention (`div`)
76
+ * `webmention__author__photo` - Author’s photo (`img`)
77
+ * `webmention__title` - The webmention’s title (`div`)
78
+ * `webmention__content` - The webmention’s content (`div`)
79
+ * `webmention__meta` - The webmention’s meta information container (`div`)
80
+ * `webmention__pubdate` - The publication date (`time`)
81
+ * `webmention__source` - The webmention permalink (`a`)
82
+ * `webmentions__not-found` - The "no results" message (`p`)
83
+
84
+ Note: Webmentions are cached to the `.cache` directory in a file named `webmentions_received.yml`. If you are unhappy with how a webmention is displayed, you can alter the HTML in this file, but be careful, the file must remain valid YAML. But if you botch things, you can always delete the file and the webmentions will be re-cached.
85
+
86
+ ## JavaScript (optional)
87
+
88
+ I have also included a JavaScript file that will keep your webmentions up to date even when you don’t publish frequently. It will also update your page’s webmentions in realtime.
89
+
90
+ To inform the JavaScript of additional URLs to check (e.g. when the current page receives redirects from old URLs), use the following `meta` element:
91
+
92
+ <meta property="webmention:redirected_from" content="URL_1,URL_2">
93
+
94
+ The `content` attribute should contain a single URL or multiple URLs separated by commas.
95
+
96
+ ## Publishing Webmentions
97
+
98
+ Included in this repo is a [Rake](https://github.com/ruby/rake) task for publishing webmentions (webmention.Rakefile). You can add this task to your global Rakefile or reference it. Just be sure to update the path for your `.cache` folder
99
+
100
+ The workflow is as follows:
101
+
102
+ 1. `rake generate` to generate your site and collect a list of mentioned URLs in your posts
103
+ 2. `rake webmention` to cycle through those URLs and post to any that offer webmention endpoints.
104
+
105
+ Notes:
106
+
107
+ * If an endpoint is not offered, the URL will be skipped and can be processed later.
108
+ * In order to streamline the process, a webmention connection will only be processed once (and cached so it can be skipped).
109
+ * You may want to add `.cache` to your `.gitignore` file.
data/Rakefile ADDED
@@ -0,0 +1,6 @@
1
+ require 'bundler/gem_tasks'
2
+ #require 'rspec/core/rake_task'
3
+
4
+ #RSpec::Core::RakeTask.new(:spec)
5
+
6
+ task :default => :spec
@@ -212,7 +212,7 @@ module Jekyll
212
212
  # cleanup
213
213
  title = title.gsub(%r{</?[^>]+?>}, '')
214
214
  end # if no title
215
- webmention['title'] = markdownify( title )
215
+ webmention['title'] = markdownify( title ) if title
216
216
 
217
217
  # Everything else
218
218
  content = link['data']['content']
@@ -1,3 +1,3 @@
1
1
  module WebmentionIO
2
- VERSION = "2.0.2"
2
+ VERSION = "2.0.5"
3
3
  end
data/templates/likes.html CHANGED
@@ -2,7 +2,7 @@
2
2
  {% if webmentions.size > 0 %}
3
3
  <ol class="webmentions__list">
4
4
  {% for webmention in webmentions %}
5
- <li id="webmention-{{ webmention.id }}" class="webmentions__item webmentions__item--{{ webmention.type }}">
5
+ <li id="webmention-{{ webmention.id }}" class="webmentions__item webmention webmention--{{ webmention.type }}">
6
6
  <div class="webmention__author p-author h-card">
7
7
  <a class="u-url" href="{{ webmention.author.url }}">
8
8
  <img class="webmention__author__photo u-photo" src="{{ webmention.author.photo }}" alt="" title="{{ webmention.author.name }}">
data/templates/links.html CHANGED
@@ -2,7 +2,7 @@
2
2
  {% if webmentions.size > 0 %}
3
3
  <ol class="webmentions__list">
4
4
  {% for webmention in webmentions %}
5
- <li id="webmention-{{ webmention.id }}" class="webmentions__item webmentions__item--{{ webmention.type }}">
5
+ <li id="webmention-{{ webmention.id }}" class="webmentions__item webmention webmention--{{ webmention.type }}">
6
6
  {{ webmention.content }}
7
7
  <div class="webmention__meta">
8
8
  {% if webmention.author %}
data/templates/posts.html CHANGED
@@ -2,7 +2,7 @@
2
2
  {% if webmentions.size > 0 %}
3
3
  <ol class="webmentions__list">
4
4
  {% for webmention in webmentions %}
5
- <li id="webmention-{{ webmention.id }}" class="webmentions__item webmentions__item--{{ webmention.type }}">
5
+ <li id="webmention-{{ webmention.id }}" class="webmentions__item webmention webmention--{{ webmention.type }}">
6
6
  <a class="webmention__title webmention__source u-url" href="{{ webmention.url }}">{{ webmention.title }}</a>
7
7
  <div class="webmention__meta">
8
8
  {% if webmention.pubdate %}
@@ -1,8 +1,8 @@
1
- <div class="webmentions">
1
+ <div class="webmentions webmentions--replies">
2
2
  {% if webmentions.size > 0 %}
3
3
  <ol class="webmentions__list">
4
4
  {% for webmention in webmentions %}
5
- <li id="webmention-{{ webmention.id }}" class="webmentions__item webmentions__item--{{ webmention.type }}">
5
+ <li id="webmention-{{ webmention.id }}" class="webmentions__item webmention webmention--{{ webmention.type }}">
6
6
  {{ webmention.content }}
7
7
  <div class="webmention__meta">
8
8
  {% if webmention.author %}
@@ -2,7 +2,7 @@
2
2
  {% if webmentions.size > 0 %}
3
3
  <ol class="webmentions__list">
4
4
  {% for webmention in webmentions %}
5
- <li id="webmention-{{ webmention.id }}" class="webmentions__item webmentions__item--{{ webmention.type }}">
5
+ <li id="webmention-{{ webmention.id }}" class="webmentions__item webmention webmention--{{ webmention.type }}">
6
6
  <div class="webmention__author p-author h-card">
7
7
  <a class="u-url" href="{{ webmention.author.url }}">
8
8
  <img class="webmention__author__photo u-photo" src="{{ webmention.author.photo }}" alt="" title="{{ webmention.author.name }}">
@@ -2,9 +2,8 @@
2
2
  {% if webmentions.size > 0 %}
3
3
  <ol class="webmentions__list">
4
4
  {% for webmention in webmentions %}
5
- <li id="webmention-{{ webmention.id }}" class="webmentions__item webmentions__item--{{ webmention.type }}">
6
- <article class="h-cite
7
- {{ webmention.classes }}
5
+ <li id="webmention-{{ webmention.id }}" class="webmentions__item">
6
+ <article class="h-cite webmention webmention--{{ webmention.type }}
8
7
  {% unless webmention.author %}webmention--no-author{% endunless %}
9
8
  {% unless webmention.author.photo %}webmention--no-photo{% endunless %}
10
9
  {% if webmention.is_tweet == true %}webmention--author-starts{% endif %}
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jekyll-webmention_io
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.2
4
+ version: 2.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Aaron Gustafson
@@ -145,6 +145,10 @@ executables: []
145
145
  extensions: []
146
146
  extra_rdoc_files: []
147
147
  files:
148
+ - Gemfile
149
+ - LICENSE
150
+ - README.md
151
+ - Rakefile
148
152
  - assets/webmention_io.js
149
153
  - lib/jekyll-webmention_io.rb
150
154
  - lib/jekyll/commands/webmention.rb