summaryrefslogtreecommitdiffstats
path: root/templates_html/page.html
blob: 2d60db31c55a452bf95782498aaa9be8650ff4f4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
{% extends "base.html" %}
{% import "macros.html" as macros %}
{% block content %}

{{ macros::page_content(page=page) }}

<div id="webmentions"></div>
<script>
fetch(`https://webmention.io/api/mentions.jf2?target={{ page.permalink | safe }}`)
  .then(res => res.json())
  .then(data => {
    const container = document.getElementById('webmentions');
    (data.children || []).forEach(entry => {
      const author = entry.author || {};
      const el = document.createElement('div');
      el.className = 'webmention webmention-' + (entry['wm-property'] || 'mention');
      el.innerHTML = `
        ${author.photo ? `<img src="${author.photo}" alt="" width="32" height="32">` : ''}
        <a href="${author.url || entry.url}">${author.name || 'Someone'}</a>
        ${entry.content ? `<p>${entry.content.text || ''}</p>` : ''}
      `;
      container.appendChild(el);
    });
  })
  .catch(err => console.error('Webmentions failed to load:', err));
</script>

<nav class="post-nav" aria-label="Post navigation">
    {% if page.higher %}
    <div class="post-nav-left">
        <a class="post-nav-link" href="{{ page.higher.permalink }}"
            >← {{ page.higher.title }}</a
        >
    </div>
    {% endif %} {% if page.lower %}
    <div class="post-nav-right">
        <a class="post-nav-link" href="{{ page.lower.permalink }}"
            >{{ page.lower.title }} →</a
        >
    </div>
    {% endif %}
</nav>

<div style="display: none" class="h-entry">
    <div class="p-name">{{ page.title }}</div>
    <span class="p-author h-card">
        <img
            class="u-photo"
            src="https://jan.systems/files/Jan_Tuomi_headshot.jpg"
            loading="lazy"
        />
        <a class="p-name u-url" href="https://jan.systems">Jan Sydänviita (né Tuomi)</a>
    </span>
    <a class="u-url" href="{{ page.permalink }}">
        Published <time class="dt-published">{{ page.date }}</time>
    </a>
    <p class="e-content">Testing, don't mind me</p>
    <a class="u-in-reply-to" href="https://aaronparecki.com/2018/06/30/11/your-first-webmention">@aaronpk</a>
</div>
{% endblock %}