Skip to content

Commit

Permalink
Merge pull request #1 from Alfedi/feat/plugin
Browse files Browse the repository at this point in the history
feat(webmentions): use jekyll-webmention_io plugin
  • Loading branch information
Alfedi authored Jan 25, 2024
2 parents 472d06e + a9bfc58 commit 7340820
Show file tree
Hide file tree
Showing 16 changed files with 115 additions and 67 deletions.
5 changes: 5 additions & 0 deletions .cache/webmention_io_bad_uris.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
contributors.scala-lang.org:
state: unsupported
attempts: 1
last_checked: '2023-12-12 15:43:15 +0100'
5 changes: 5 additions & 0 deletions .cache/webmention_io_lookups.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"/why-did-i-do-this/": 2024-01-24
"/testing-post/": 2024-01-24
"/testing-like/": 2024-01-24
"/testing-repost/": 2024-01-24
29 changes: 29 additions & 0 deletions .cache/webmention_io_outgoing.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
---
http://www.aferrero.boo/why-did-i-do-this/:
https://contributors.scala-lang.org/t/politics-safety-and-the-future-of-scala/5317: 1
https://indieweb.org/:
status: queued
summary: Webmention was queued for processing
location: https://webmention.io/indiewebcamp/webmention/viW817tGhUmxsmXhlbKu
source: http://www.aferrero.boo/why-did-i-do-this/
target: https://indieweb.org/
https://indieweb.org/POSSE:
status: queued
summary: Webmention was queued for processing
location: https://webmention.io/indiewebcamp/webmention/mR7gwJKBlph3vRdbWKAe
source: http://www.aferrero.boo/why-did-i-do-this/
target: https://indieweb.org/POSSE
http://www.aferrero.boo/testing-like/:
https://www.aferrero.boo/why-did-i-do-this/:
status: queued
summary: Webmention was queued for processing
location: https://webmention.io/www.aferrero.boo/webmention/hfiYtt8qOTaiZdU54Iz7
source: http://www.aferrero.boo/testing-like/
target: https://www.aferrero.boo/why-did-i-do-this/
http://www.aferrero.boo/testing-repost/:
https://www.aferrero.boo/why-did-i-do-this/:
status: queued
summary: Webmention was queued for processing
location: https://webmention.io/www.aferrero.boo/webmention/5UgkcCmW70UV1HE90KYw
source: http://www.aferrero.boo/testing-repost/
target: https://www.aferrero.boo/why-did-i-do-this/
5 changes: 5 additions & 0 deletions .cache/webmention_io_received.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"/why-did-i-do-this/": {}
"/testing-post/": {}
"/testing-like/": {}
"/testing-repost/": {}
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ gem "minima", "~> 2.5"
# If you have any plugins, put them here!
group :jekyll_plugins do
gem "jekyll-feed", "~> 0.12"
gem 'jekyll-webmention_io', "~> 4.0.0"
end

# Windows and JRuby does not include zoneinfo files, so bundle the tzinfo-data gem
Expand Down
43 changes: 43 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ GEM
connection_pool (2.4.1)
dnsruby (1.70.0)
simpleidn (~> 0.2.1)
domain_name (0.6.20231109)
drb (2.1.1)
ruby2_keywords
em-websocket (0.5.3)
Expand All @@ -40,6 +41,9 @@ GEM
ruby2_keywords (>= 0.0.4)
faraday-net_http (3.0.2)
ffi (1.16.3)
ffi-compiler (1.0.1)
ffi (>= 1.0.0)
rake
forwardable-extended (2.6.0)
gemoji (3.0.1)
github-pages (228)
Expand Down Expand Up @@ -96,9 +100,22 @@ GEM
html-pipeline (2.14.3)
activesupport (>= 2)
nokogiri (>= 1.4)
htmlbeautifier (1.4.2)
http (5.1.1)
addressable (~> 2.8)
http-cookie (~> 1.0)
http-form_data (~> 2.2)
llhttp-ffi (~> 0.4.0)
http-cookie (1.0.5)
domain_name (~> 0.5)
http-form_data (2.3.0)
http_parser.rb (0.8.0)
i18n (1.14.1)
concurrent-ruby (~> 1.0)
indieweb-endpoints (8.0.0)
http (~> 5.0)
link-header-parser (~> 5.0)
nokogiri (>= 1.13)
jekyll (3.9.3)
addressable (~> 2.4)
colorator (~> 1.0)
Expand Down Expand Up @@ -203,34 +220,53 @@ GEM
jekyll (>= 3.3, < 5.0)
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)
jemoji (0.12.0)
gemoji (~> 3.0)
html-pipeline (~> 2.2)
jekyll (>= 3.0, < 5.0)
json (2.7.1)
jsonpath (1.0.7)
multi_json
kramdown (2.3.2)
rexml
kramdown-parser-gfm (1.1.0)
kramdown (~> 2.0)
link-header-parser (5.1.0)
liquid (4.0.4)
listen (3.8.0)
rb-fsevent (~> 0.10, >= 0.10.3)
rb-inotify (~> 0.9, >= 0.9.10)
llhttp-ffi (0.4.0)
ffi-compiler (~> 1.0)
rake (~> 13.0)
mercenary (0.3.6)
minima (2.5.1)
jekyll (>= 3.5, < 5.0)
jekyll-feed (~> 0.9)
jekyll-seo-tag (~> 2.1)
minitest (5.20.0)
multi_json (1.15.0)
mutex_m (0.1.2)
nokogiri (1.15.4-x86_64-linux)
racc (~> 1.4)
octokit (4.25.1)
faraday (>= 1, < 3)
sawyer (~> 0.9)
openssl (3.2.0)
pathutil (0.16.2)
forwardable-extended (~> 2.6)
public_suffix (4.0.7)
racc (1.7.1)
rake (13.1.0)
rb-fsevent (0.11.2)
rb-inotify (0.10.1)
ffi (~> 1.0)
Expand All @@ -255,10 +291,16 @@ GEM
ethon (>= 0.9.0)
tzinfo (2.0.6)
concurrent-ruby (~> 1.0)
uglifier (4.2.0)
execjs (>= 0.3.0, < 3)
unf (0.1.4)
unf_ext
unf_ext (0.0.8.2)
unicode-display_width (1.8.0)
webmention (7.0.0)
http (~> 5.0)
indieweb-endpoints (~> 8.0)
nokogiri (>= 1.13)
webrick (1.8.1)

PLATFORMS
Expand All @@ -268,6 +310,7 @@ DEPENDENCIES
github-pages (~> 228)
http_parser.rb (~> 0.6.0)
jekyll-feed (~> 0.12)
jekyll-webmention_io (~> 4.0.0)
minima (~> 2.5)
tzinfo (>= 1, < 3)
tzinfo-data
Expand Down
5 changes: 5 additions & 0 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@ description: Don't take me seriously
# URL of your avatar or profile pic (you could use your GitHub profile pic)
avatar: /images/logo.png

webmentions:
username: www.aferrero.boo
cache_folder: .cache
cache_bad_uris_for: 5

#
# Flags below are optional
#
Expand Down
6 changes: 2 additions & 4 deletions _layouts/default.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@
<link rel="alternate" type="application/rss+xml" title="{{ site.name }} - {{ site.description }}" href="{{ site.baseurl }}/feed.xml" />
<link rel="canonical" href="{{ site.url }}{{ page.url }}" />

<link rel="webmention" href="https://webmention.io/www.aferrero.boo/webmention" />
<link rel="pingback" href="https://webmention.io/www.aferrero.boo/xmlrpc" />
<link rel="authorization_endpoint" href="https://indieauth.com/auth">
<link rel="token_endpoint" href="https://tokens.indieauth.com/token">

Expand All @@ -19,6 +17,7 @@
<meta name="theme-color" content="#000000">
<link rel="icon" type="image/png" sizes="32x32" href="{{ site.baseurl }}/images/favicon-32x32.png">
{% include analytics_head.html %}
{% webmentions_head %}
</head>

<body>
Expand Down Expand Up @@ -58,7 +57,6 @@ <h1 class="site-name"><a href="{{ site.baseurl }}/">{{ site.name }}</a></h1>
</div>
</div>
</div>

{% include analytics.html %}
{% webmentions_js %}
</body>
</html>
5 changes: 2 additions & 3 deletions _layouts/like.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,9 @@
<div class="post-tags">
<a href="{{site.baseurl}}/categories/#like" class="p-category">Like</a>
</div>

<div class="entry e-content">
<div class="h-cite">
❤️ <a class="u-url u-like-of" href="{{ page.liked }}">{{ page.liked }}</a>
<div class="h-cite like">
<a class="u-url u-like-of" href="{{ page.liked }}">{{ content }}</a>
</div>
</div>
</article>
58 changes: 3 additions & 55 deletions _layouts/post.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,61 +27,9 @@ <h1 class="p-name"><a href="{{ page.url }}" class="u-url">{{ page.title }}</a></
{{ content }}
</div>

<!-- <div> -->
<!-- <p><span class="share-box">Share:</span> <a href="http://twitter.com/share?text={{ page.title }}&url={{site.url}}{{page.url}}" target="_blank">Twitter</a></p> -->
<!-- </div> -->

<!--<div class="date">
Written on {{ page.date | date: "%B %e, %Y" }}
</div>-->

<!-- {% include disqus.html %} -->
<!-- Webmentions zone -->
{% capture filename %}{{ page.url | remove: "/"}}{% endcapture %}
{% assign webmentions = site.data.webmentions[filename] %}
<hr>



<div class="p-like h-cite likes">
<span class="vertical-likes">❤️</span>
{% for comment in webmentions %}
{% if comment["wm-property"] == "like-of" %}
<a class="u-url" href="{{ comment["wm-source"] }}">
<img class="p-author h-card u-photo likes-photo" src="{{ comment["author"]["photo"] }}" alt="{{ comment["author"]["url"] }}" width=48>
</a>
{% endif %}
{% endfor %}
</div>

<div class="p-like h-cite likes">
<span class="vertical-likes">🔁️</span>
{% for comment in webmentions %}
{% if comment["wm-property"] == "repost-of" %}
<a class="u-url" href="{{ comment["wm-source"] }}">
<img class="p-author h-card u-photo likes-photo" src="{{ comment["author"]["photo"] }}" alt="{{ comment["author"]["url"] }}" width=48>
</a>
{% endif %}
{% endfor %}
</div>

<ul>
{% for comment in webmentions %}
{% if comment["wm-property"] == "in-reply-to" %}
<li class="p-comment h-cite">
<div class="p-author h-card comment-author">
<img class="u-photo comment-author-image" src="{{ comment["author"]["photo"] }}" width=48 height=48>
<div class="comment">
<div class="comment-name-date">
<a class="p-name u-url comment-author-name" href="{{ comment["author"]["url"] }}"> {{ comment["author"]["name"] }} </a>
<a class="u-url comment-date" href="{{ comment["wm-source"] }}">
<time class="dt-published" datetime="{{ comment["published"] }}">{{ comment["published"] | date: "%a, %B %d %Y - %H:%M"}}</time>
</a>
</div>
<div class="p-content comment-text">{{ comment["content"]["html"] }}</div>
</div>
</li>
{% endif %}
{% endfor %}
</ul>
{% webmention_likes page.url %}
{% webmention_reposts page.url %}
{% webmention_replies page.url %}
</article>
4 changes: 2 additions & 2 deletions _layouts/repost.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
</div>

<div class="entry e-content">
<div class="h-cite">
🔁 <a class="u-url u-repost-of" href="{{ page.reposted }}">{{ page.reposted }}</a>
<div class="h-cite like">
<a class="u-url u-repost-of" href="{{ page.reposted }}">{{ content }}</a>
</div>
</div>
</article>
2 changes: 1 addition & 1 deletion _pages/categories.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ title: Categories
{% endfor %}
</div>
{% endfor %}
</div>
</div>
4 changes: 3 additions & 1 deletion _posts/2023-11-10-testing-like.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
---
layout: like
liked: https://www.aferrero.boo/why-did-i-do-this/
categories: like
title: ""
---
❤️ https://www.aferrero.boo/why-did-i-do-this/
4 changes: 3 additions & 1 deletion _posts/2023-11-10-testing-repost.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
---
layout: repost
reposted: https://www.aferrero.boo/why-did-i-do-this/
categories: repost
title: ""
---
🔁 https://www.aferrero.boo/why-did-i-do-this/
4 changes: 4 additions & 0 deletions assets/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -1139,6 +1139,10 @@ Modules - reusable parts of our design
}
}

.like {
text-align: center;
}

// Comments section

hr {
Expand Down
2 changes: 2 additions & 0 deletions js/JekyllWebmentionIO.js

Large diffs are not rendered by default.

0 comments on commit 7340820

Please sign in to comment.