-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathtemplate.html.p
56 lines (55 loc) · 2.78 KB
/
template.html.p
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8"/>
<title>◊(hash-ref metas 'title)</title>
◊; Because I deploy this site in a sub-directory (rather than a domain root) I
◊; have to use relative paths instead of absolute ones. Defining path-prefix
◊; is just my way of coping with this.
◊(define path-prefix (if (string-contains (symbol->string here) "/") "../" ""))
◊(define source-file (select-from-metas 'here-path metas))
◊(define pollen-source-listing
(regexp-replace #px"(.*)\\/(.+).html" (symbol->string here) "\\2.pollen.html"))
<link rel="stylesheet" href="◊|path-prefix|css/tufte.css"/>
<link rel="stylesheet" href="◊|path-prefix|css/joel.css"/>
<link rel="alternate" type="application/atom+xml" title="Atom feed" href="◊|path-prefix|feed.xml" />
<meta name="viewport" content="width=device-width, initial-scale=1">
<style type="text/css">
img { mix-blend-mode: multiply; }
</style>
</head>
<body><article>
<h1>◊(hash-ref metas 'title)</h1>
◊when/splice[(select-from-metas 'author metas)]{
<h2>◊(hash-ref metas 'author)</h2>
}
<nav><ul>
◊when/splice[(and (previous here) (not (eq? (parent here) (previous here))))]{
<li><a href="◊|path-prefix|◊|(previous here)|">← Previous</a></li>
}
◊when/splice[(not (eq? here 'index.html))]{
<li><a href="◊|path-prefix|index.html">↑ Home</a></li>
}
◊when/splice[(and (next here) (member (next here) (siblings here)))]{
<li><a href="◊|path-prefix|◊|(next here)|">Next →</a></li>
}
◊when/splice[(pdfable? source-file)]{
<li><a href="◊pdfname[source-file]">
<img src="◊|path-prefix|css/pdficon.png" width="15" height="15" alt="Download PDF" />
<span class="caps" style="font-style: normal">PDF</span></a></li>
}
◊when/splice[(string-contains path-prefix "/")]{
<li style="width: auto;">
<a href="◊|pollen-source-listing|" title="View the Pollen source for this file"
class=" sourcelink code">◊ Pollen Source</a></li>
}
</ul></nav>
◊(map ->html (select-from-doc 'body here))
</article>
◊when/splice[(equal? "Joel Dueck" (select-from-metas 'author here))]{
<footer><hr>
<p>My name is <a href="https://keybase.io/joeld">Joel Dueck</a>. I’ve been <a href="https://thelocalyarn.com/blog">writing online</a> since 1998. You can contact me on the Twitters <a href="https://twitter.com/joeld">@joeld</a> or by email at <a href="mailto:[email protected]">[email protected]</a>, or see my <a href="https://github.com/otherjoel">Github profile</a>. <a href="◊|path-prefix|colophon.html">Read about this site</a>.</p>
</footer>
}
</body>
</html>