◊(Local Yarn Code "Diff")

Differences From Artifact [9e18f871]:

To Artifact [b8d08650]:


1
2
3
4
5
6
7

8
9
10
11
12
13
14
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15







+







#lang pollen/mode racket/base

; SPDX-License-Identifier: BlueOak-1.0.0
; This file is licensed under the Blue Oak Model License 1.0.0.

;; Provides functions for displaying content in HTML templates.
(require pollen/template
         pollen/core
         pollen/decode
         pollen/private/version
         racket/string
         racket/function
         racket/list
         txexpr
         "cache.rkt"
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
102
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
102
103
104
105



106
107
108
109
110
111
112
113
114
115







+
+
+
+
+
+
+
+
+
+








+






+












-
-
+
+




-
-
-
+
+
+



-
+





-
-
-
+
+
+







  (define body-class (if (non-empty-string? class) (format " class=\"~a\"" class) ""))
  ◊string-append{<body◊|body-class|><main>
 <a href="/index.html"><header>
 <img src="/web-extra/mark.svg" alt="The Local Yarn" height="103" class="logo">
 <h1>The Local Yarn</h1>
 </header></a>})

(define (html$-repo-links)
  (define here (path->string (here-source-path)))
  (cond
    [(checked-in?)
     ◊string-append{<div class="scm-links">
      <a title="source" href="/code/file/◊here">&sect;</a>
      <a title="changes" href="/code/finfo?name=◊here">¢</a>
      </div>}]
    [else (format "<!-- ~a -->" here) ]))

(define (html$-article-open pagenode title? title-tx published)
  (cond
    [title?
     ◊string-append{<article class="with-title hentry">
      ◊(->html `(h1 [[class "entry-title"]] ,@(get-elements title-tx)))
      <p class="time"><a href="/◊(symbol->string pagenode)" class="rel-bookmark">
      <time datetime="◊published" class="published">◊ymd->english[published]</time>
      </a></p>
      ◊(html$-repo-links)
      <section class="entry-content">}]
    [else
     ◊string-append{<article class="no-title hentry">
      <h1><a href="/◊(symbol->string pagenode)" class="rel-bookmark">
      <time datetime="◊published" class="entry-title">◊ymd->english[published]</time>
      </a></h1>
      ◊(html$-repo-links)
      <section class="entry-content">}]))

(define (html$-article-close footertext)
  (cond [(non-empty-string? footertext)
         ◊string-append{</section>
          <footer class="article-info"><span class="x">(</span>◊|footertext|<span class="x">)</span></footer>
          </article>}]
        [else "</section></article>"]))

(define (html$-article-listing-short pagenode pubdate title)
  ◊string-append{
 <article class="short-listing"><a href="/◊(symbol->string pagenode)">
  <time datetime="◊pubdate" class="caps">◊(ymd->english pubdate)</time>
  <h3>◊|title|</h3>
 <time datetime="◊pubdate" class="caps">◊(ymd->english pubdate)</time>
 <h3>◊|title|</h3>
 </a></article>})

(define (html$-article-excerpt pagenode excerpt-tx)
  ◊string-append{
   ◊(->html excerpt-tx #:splice? #t)
   <p class="further-reading"><a href="◊|web-root|◊symbol->string[pagenode]">Read more…</a></p>
})
 ◊(->html excerpt-tx #:splice? #t)
 <p class="further-reading"><a href="◊|web-root|◊symbol->string[pagenode]">Read more…</a></p>
 })

(define (html$-page-footer)
  ◊string-append{
<footer id="main">
 <footer id="main">
 <p class="title">
 <img src="◊|web-root|web-extra/images/small-rule.png" width="145" height="11" alt="* * *" />
 <br>
 The Local Yarn</p>
 <nav><a href="/index.html">Home</a> •
    <a href="/blog-pg1.html">Blog</a> •
    <a href="/keyword-index.html">Keyword Index</a> •
    <a href="/code"><i><code>◊"◊"(Source&nbsp;Code)</code></i></a>
 <a href="/blog-pg1.html">Blog</a> •
 <a href="/keyword-index.html">Keyword Index</a> •
 <a href="/code"><i><code>◊"◊"(Source&nbsp;Code)</code></i></a>
 </nav>
 ◊(html$-series-list)
 </footer>})

(define (html$-page-body-close)
  ◊string-append{
 </main>