aboutsummaryrefslogtreecommitdiff
path: root/lume/src/_includes/talk.njk
blob: f76e3f5222647a531dd4df8ac0014edc7422f8e3 (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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
---
layout: base.njk
---

{% if commit.hash != "development" %}
    {{ comp.ads() | safe }}
{% endif %}

<article class="prose dark:prose-invert max-w-none lg:prose-p:max-w-[80ch] lg:prose-p:mx-auto lg:prose-headings:mx-20 lg:prose-blockquote:max-w-[70ch] lg:prose-blockquote:mx-auto lg:prose-li:max-w-[78ch] lg:prose-li:mx-auto lg:prose-pre:max-w-[85ch] lg:prose-pre:mx-auto lg:prose-table:max-w-[100ch] lg:prose-table:mx-auto">
    <style>
        .prose :where(li):not(:where([class~="not-prose"], [class~="not-prose"] *)) {
            margin-left: auto;
            margin-right: auto;
            max-width: 78ch;
        }
    </style>
    <h1>{{title}}</h1>
    <p class="text-sm text-fg-3 dark:text-fgDark-3">
        Published on <time datetime={{date | date("DATE")}}>{{date | date("DATE_US")}}</time>, {{ readingInfo.words }} words, {{ readingInfo.minutes }} minutes to read
    </p>

    {% if hero %}
        <meta property="og:image" content={`https://files.xeiaso.net/hero/${hero.file}.jpg`}/>
        {{ comp.XeblogHero(hero) | safe }}
    {% endif %}

    {{content | safe}}

    <hr/>

    <button id="shareButton" type="button" class="rounded-md bg-white px-3.5 py-2.5 text-sm font-semibold text-gray-900 shadow-sm ring-1 ring-inset ring-gray-300 hover:bg-gray-50"> Share <svg
        xmlns="http://www.w3.org/2000/svg"
        class="icon icon-tabler icon-tabler-share-2 h-8 w-8"
        width=24
        height=24
        viewBox="0 0 24 24"
        stroke-width=2
        stroke="currentColor"
        fill="none"
        stroke-linecap="round"
        stroke-linejoin="round"
      >
            <path stroke="none" d="M0 0h24v24H0z" fill="none"/>
            <path d="M8 9h-1a2 2 0 0 0 -2 2v8a2 2 0 0 0 2 2h10a2 2 0 0 0 2 -2v-8a2 2 0 0 0 -2 -2h-1"/>
            <path d="M12 14v-11"/>
            <path d="M9 6l3 -3l3 3"/>
        </svg>
    </button>

    <script>
        const shareButton = document.getElementById("shareButton");
        function doShareButton() {
            console.log("got here");
            const shareData = {
                title: document.title,
                url: window.location.href
            };
            if (!navigator.canShare(shareData)) {
                console.log("can't share");
                return;
            }
            navigator
                .share({title: document.title, url: window.location.href})
                .then(() => {
                    console.log('Thanks for sharing!');
                })
                .catch(console.error);
        }
        shareButton.addEventListener("click", doShareButton);
    </script>

    <p class="mb-4">Facts and circumstances may have changed since publication. Please contact me before jumping to conclusions if something seems wrong or unclear.</p>

    <p class="mb-4">Tags: {{tags.join(", ")}}</p>

    {% if slides_link %}
        <a href="{{slides_link}}">View slides</a>
    {% endif %}
</article>