Browse Source

likes: First shot at implementing likes

master
Chimo 3 years ago
parent
commit
199523e4b0
4 changed files with 77 additions and 11 deletions
  1. 13
    11
      _layouts/like.html
  2. 1
    0
      _sass/_layout.scss
  3. 48
    0
      likes.xml
  4. 15
    0
      likes/index.md

+ 13
- 11
_layouts/like.html View File

@@ -1,36 +1,38 @@
1 1
 {% include head.html %}
2 2
 
3 3
 {% include navigation.html %}
4
-{% include masthead.html %}
5 4
 
6 5
 <div id="main" role="main">
7 6
   <article class="hentry h-entry">
8 7
     <div class="entry-wrapper">
9 8
       <header class="entry-header">
10 9
         {% include tags.html %}
11
-        <h1 class="entry-title p-name">
12
-          <a class="u-url" href="{{ page.url }}">
10
+        <h1 class="sr-only entry-title p-name">
13 11
             Chimo liked {{ page.target.type }} by {{ page.target.by }}
14
-            <span class="link-arrow fa fa-link"></span>
15
-          </a>
16 12
         </h1>
17 13
       </header>
18 14
 
19
-      {% include meta.html %}
20
-
21 15
       <div class="content">
22 16
         <div class="entry-content e-content">
23 17
           <figure class="chr-card">
24
-            <figcaption>
18
+            <figcaption class="chr-card__title">
25 19
               Chimo liked {{ page.target.type }} by {{ page.target.by }}
26 20
             </figcaption>
27 21
 
28
-            <blockquote>
29
-              {{ content }}
22
+            {{ content }}
23
+
24
+            <blockquote cite="{{ page.target.url }}">
25
+              <a class="u-like-of" href="{{ page.target.url }}">{{ page.target.title }}</a>
30 26
             </blockquote>
31 27
 
32 28
             <footer class="chr-card__meta">
33
-              via <a class="u-like-of" href="{{ page.target.url }}"><img src="{{ page.target.icon }}"></a>
29
+              <a class="u-url" href="{{ page.url }}">
30
+                <time class="timeago" datetime="{{ page.date | date_to_xmlschema }}">
31
+                  {{ page.date | date: "%Y-%m-%d %T (%Z)" }}
32
+                </time>
33
+              </a>
34
+              via
35
+              <img src="/images/homepage/webmention.png" title="webmention">
34 36
             </footer>
35 37
           </figure>
36 38
 

+ 1
- 0
_sass/_layout.scss View File

@@ -311,6 +311,7 @@ span + .entry-title {
311 311
 // Page layout
312 312
 #home,
313 313
 .update,
314
+.like,
314 315
 .page {
315 316
 	.entry-wrapper {
316 317
 		max-width: em(760);

+ 48
- 0
likes.xml View File

@@ -0,0 +1,48 @@
1
+---
2
+sitemap: false
3
+---
4
+<?xml version="1.0" encoding="utf-8"?>
5
+<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
6
+<title type="text">{{ site.title }}</title>
7
+<generator uri="https://github.com/jekyll/jekyll">Jekyll</generator>
8
+<link rel="self" type="application/atom+xml" href="https:{{ site.url }}/feed.xml" />
9
+<link rel="hub" href="https://push.chromic.org" />
10
+<link rel="alternate" type="text/html" href="https:{{ site.url }}" />
11
+<updated>{{ site.time | date_to_xmlschema }}</updated>
12
+<id>https:{{ site.url }}/</id>
13
+<author>
14
+  <name>{{ site.owner.name }}</name>
15
+  <uri>https:{{ site.url }}/</uri>
16
+  {% if site.owner.email %}<email>{{ site.owner.email }}</email>{% endif %}
17
+</author>
18
+{% for post in site.categories.likes limit:20 %}
19
+{% if post.author %}
20
+  {% assign author = site.data.authors[post.author] %}
21
+{% else %}
22
+  {% assign author = site.owner %}
23
+{% endif %}
24
+<entry>
25
+  <title type="html"><![CDATA[{{ post.title | cdata_escape }}]]></title>
26
+  <link rel="alternate" type="text/html" href="https:{{ site.url }}{{ post.url }}" />
27
+  <id>https:{{ site.url }}{{ post.id }}</id>
28
+  {% if post.modified %}<updated>{{ post.modified | to_xmlschema }}T00:00:00-00:00</updated>
29
+  <published>{{ post.date | date_to_xmlschema }}</published>
30
+  {% else %}<published>{{ post.date | date_to_xmlschema }}</published>
31
+  <updated>{{ post.date | date_to_xmlschema }}</updated>{% endif %}
32
+  <author>
33
+    <name>{{ author.name }}</name>
34
+    <uri>https:{{ site.url }}</uri>
35
+    {% if author.email %}<email>{{ author.email }}</email>{% endif %}
36
+  </author>
37
+  <content type="html">
38
+    &lt;div class=&quot;entry-content e-content chr-card__content&quot;&gt;
39
+      {{ post.content | xml_escape }}
40
+
41
+      &lt;blockquote cite=&quot;{{ post.target.url }}&quot;&gt;
42
+        &lt;a class=&quot;u-like-of&quot; href=&quot;{{ post.target.url }}&quot;&gt;{{ post.target.title }}&lt;/a&gt;
43
+      &lt;/blockquote&gt;
44
+    &lt;/div&gt;
45
+  </content>
46
+</entry>
47
+{% endfor %}
48
+</feed>

+ 15
- 0
likes/index.md View File

@@ -0,0 +1,15 @@
1
+---
2
+layout: page
3
+title: Items 'liked'
4
+excerpt: "An archive of liked items sorted by date."
5
+search_omit: true
6
+---
7
+
8
+<ul class="post-list">
9
+{% for post in site.categories.likes %} 
10
+  <li><article><a href="{{ site.url }}{{ post.url }}">{{ post.title }} <span class="entry-date"><time datetime="{{ post.date | date_to_xmlschema }}">{{ post.date | date: "%B %d, %Y" }}</time></span></a></article></li>
11
+{% endfor %}
12
+</ul>
13
+
14
+<p style="text-align: center;"><a href="//chromic.org/likes.xml" title="Atom/RSS feed"><i class="fa fa-rss-square fa-2x"></i></a></p>
15
+

Loading…
Cancel
Save