summaryrefslogtreecommitdiff
path: root/layout/post.ejs
blob: 4b160089363fe73d2725fca97b15d551284a4401 (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
<div class="columns">
    <div class="column is-8 is-offset-2">
        <div class="card">
            <% if (page.thumbnail) { %>
                <div class="card-iamge">
                    <figure class="image is-16by9">
                        <% if (theme.lazyload === true) { %>
                            <img class="lazy" data-src="<%= page.thumbnail %>" />
                        <% } else { %>
                            <img src="<%= page.thumbnail %>" />
                        <% } %>
                    </figure>
                </div>
            <% } %>
            <div class="card-content post-card">
                <h2 class="title has-text-centered">
                    <%= page.title %>
                </h2>
                <% if (page.podcast) { %>
                    <div class="post-podcast-player"></div>
                    <script>
                        window.addEventListener("load", () => {
                            const player = new Shikwasa({
                                container: () => document.querySelector('.post-podcast-player'),
                                audio: {
                                    title: "<%= page.title %>",
                                    artist: "<%= page.podcast.author %>",
                                    cover: "<%= page.podcast.cover %>",
                                    src: "<%= page.podcast.media %>"
                                },
                                fixed: {
                                    type: "auto",
                                    position: "bottom"
                                },
                                themeColor: "red"
                            });
                        }, false);
                    </script>
                <% } %>
                <section class="content post-content is-size-6">
                    <%- page.content %>
                </section>
                <div class="level">
                    <div class="level-left">
                        <div class="level-item">
                            <% if (page.tags) { %>
                                <div class="tags">
                                    <% (page.tags).forEach(function(item) { %>
                                        <span class="tag"># <%= item.name %></span>
                                        <% }); %>
                                </div>
                            <% } %>
                        </div>
                    </div>
                </div>                
            </div>
        </div>
    </div>
</div>