aboutsummaryrefslogtreecommitdiff
path: root/static/templates.xsl
blob: 69a55649029c9974aeef675bee19df8eb0d55e99 (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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <xsl:param name="title" />
    <xsl:param name="icon" />

    <xsl:template name="icon-title">
        <xsl:if test="normalize-space($icon)">
            <img class="icon" src="/assets/feathericons/{$icon}.svg#{$icon}" /><xsl:text
            > </xsl:text>
        </xsl:if>
        <xsl:if test="normalize-space($title)">
            <xsl:value-of select="$title" />
        </xsl:if>
    </xsl:template>

    <xsl:template name="head">
        <head>
            <meta
                http-equiv="Content-Type"
                content="text/html; charset=UTF-8"
            />
            <meta
                name="viewport"
                content="width=device-width, initial-scale=1"
            />
            <title>
                <xsl:if test="normalize-space($title)">
                    <xsl:value-of select="$title" /> |<xsl:text> </xsl:text>
                </xsl:if>
                Alexander F. Kavon
            </title>
            <link
                rel="stylesheet"
                href="https://cdn.jsdelivr.net/npm/@picocss/pico@2/css/pico.min.css"
            />
        </head>
    </xsl:template>

    <xsl:template name="navigation">
        <aside>
            <nav id="navigation">
                <ul>
                    <li><a
                            href="/log"
                        >Log (thoughts, photos, videos, sturdy timber, et al.)</a></li>
                    <li><a href="/dm_slide"><img class="icon" src="/assets/feathericons/send.svg#send" /> Leave a Message</a></li>
                    <li><a href="/cv"><img
                                class="icon"
                                src="/assets/feathericons/paperclip.svg#paperclip"
                            /> CV</a></li>
                    <li><a href="/stand-up"> Stand-up Comedy</a></li>
                    <li><a target="_blank" href="//hivemindcomedy.com"><img
                                class="icon"
                                src="/assets/feathericons/youtube.svg#youtube"
                            /> Hive Mind Comedy (sketches)</a></li>
                    <li><a
                            target="_blank"
                            href="https://gitlab.com/alexkavon"
                        ><img
                                class="icon"
                                src="/assets/feathericons/gitlab.svg#gitlab"
                            /> Code</a></li>
                </ul>
            </nav>
        </aside>
        <nav id="external-navigation">
            <ul>
                <li><a
                        target="_blank"
                        href="https://instagram.com/afk_comedy"
                    ><img
                            class="icon"
                            src="/assets/feathericons/instagram.svg#instagram"
                        /></a></li>
                <li><a target="_blank" href="https://github.com/lgtmak"><img
                            class="icon"
                            src="/assets/feathericons/github.svg#github"
                        /></a></li>
            </ul>
        </nav>
    </xsl:template>

    <xsl:template name="page">
        <xsl:param name="content" />

        <html>
            <xsl:call-template name="head">
                <xsl:with-param name="title" select="$title" />
            </xsl:call-template>

            <body>
                <xsl:call-template name="navigation" />

                <xsl:if test="normalize-space($title)">
                    <h1><xsl:call-template name="icon-title" /></h1>
                    <hr />
                </xsl:if>
                <xsl:copy-of select="$content" />
            </body>
        </html>
    </xsl:template>
</xsl:stylesheet>