◊(Local Yarn Code "Check-in [a770b922]")

Overview
Comment:Add rough home page, finally close [3514e657bf79a443]
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: a770b9224b2a81cc7d20b2576409e1b080eb763f42ec6bc06a729e61732cc4c6
User & Date: joel on 2019-07-28 16:36:45
Other Links: manifest | tags
Context
2019-08-18
19:17
Makefile: SQLite file to replace zero-byte file in dependency tree. Also rename spritz → zap check-in: ec9ab7ab user: joel tags: trunk
2019-07-28
16:36
Add rough home page, finally close [3514e657bf79a443] check-in: a770b922 user: joel tags: trunk
16:22
Link to index.html explicitly in header check-in: 174a0398 user: joel tags: trunk
Changes

Added index.html.pp version [b1d87bbc].
































































































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
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
#lang pollen

◊(require pollen/template db/base racket/list racket/match)

◊(define (fetch-series)
  (define q "SELECT noun_plural, pagenode, title FROM series ORDER BY noun_plural DESC")
  (query-rows (sqltools:dbc) q))

◊(define (series-item->txpr s)
  (match-define (list n pagenode title) s)
  `(li (a [[href ,pagenode]] (i ,title))))

◊(define (series-grouped-list)
  ;; Produces '((("noun1" "p.html" "Title") ("noun1" "q.html" "Title")) (("noun2" ...) ...))
  (define init-group
    (group-by first (map vector->list (fetch-series)) string-ci=?))
  
  (define series-list-items
    (for/list ([group (in-list init-group)])
      `(div (h2 ,(first (first group))) (ul ,@(map series-item->txpr group)))))
  `(section [[class "series-list"] [style "margin-top: 1.3rem"]] ,@series-list-items))
            

<!DOCTYPE html>
<html lang="en">
◊html$-page-head["The Local Yarn" #f]
<style>
  header#front-page {
    text-align: center;
  }

  header#front-page > div {
    display: inline-block;
    width: auto;
    margin: 0 auto;
    overflow: hidden;
  }

  #front-page h1 {
    font-feature-settings: "smcp" on;
    text-transform: lowercase;
    font-weight: normal;
    font-size: 2.5em;
    /* 24fps slide-in from right edge of text, just like in GRAND BUDAPEST HOTEL */
    animation: slideFromRight 1s steps(24);
  }

  @keyframes slideFromRight {
    0%   { margin-right: -200%; }
    100% { margin-right: 0%; }
  }

  #front-page-logo {
    shape-outside: url(web-extra/mark.svg);
    filter: brightness(0) saturate(100%) invert(20%) sepia(16%) saturate(903%) hue-rotate(153deg) brightness(93%) contrast(90%);
    shape-margin: 1rem;
    float: left;
    margin-left: -20vw;
    margin-right: 1rem;
    z-index: -100;
  }

  main {
    background: transparent;
    font-size: 1.3em;
    line-height: 1.2em;
  }
</style>
</head>

<body style="overflow-x:hidden; hyphens: auto">
 <header id="front-page"><div>
 <h1 class="site-title">The Local Yarn</h1>
 </div></header>

 <img id="front-page-logo" src="/web-extra/mark.svg" style="max-width: 60vw; height: auto;">

◊(define front-page-body ◊root{

is the end of the ◊index{thread} that you can pick or pluck, the forked ribbon tracing into the bookshelf,
your own or someone else’s. ◊em{I’ve seen this before} says the voice on the other end. ¶ Everything
(almost) is ◊link[1]{arranged in time order, newest first}. There are also a few arranged into named
collections:

◊url[1]{/blog-pg1.html}

}) 
◊(crystalize-index-entries! '|index.html| front-page-body)

<main> 
  ◊(->html front-page-body #:splice? #t)
  ◊(->html (series-grouped-list))
</main> 
</body>
</html>

Modified makefile from [23ab73ad] to [557f6398].

16
17
18
19
20
21
22
23


24
25
26
27
28
29
30
16
17
18
19
20
21
22

23
24
25
26
27
28
29
30
31







-
+
+







series-sources  := $(wildcard series/*.poly.pm)
series-html     := $(patsubst %.poly.pm, %.html, $(series-sources))

# ~~~ Rules ~~
#

# The order of these dependencies is important. They will be processed left to right.
web: _article_htmls.mark $(articles-html) $(series-html) blog-pg1.html keyword-index.html web-extra/martin.css
web: _article_htmls.mark $(articles-html) $(series-html) 
web: index.html blog-pg1.html keyword-index.html web-extra/martin.css
web: ## Rebuild all web content (not PDFs)

# The file article_htmls.mark is a zero-byte file that serves only as a marker. If it is older than
# any of its dependencies (or missing) all of the articles will be rebuilt. Its dependencies are
# also on the Pollen cache watchlist (see pollen.rkt)
_article_htmls.mark: $(core-files) $(html-deps) template.html.p
	raco pollen setup -p articles/
44
45
46
47
48
49
50



51
52
53
54
55
56
57
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61







+
+
+







	# tidy -quiet -modify -indent --wrap 100 --wrap-attributes no --tidy-mark no $@ || true

# Note that if any article is part of a series, it will touch its series .poly.pm file during its
# render, triggering this rule for that series.
$(series-html): %.html: %.poly.pm
	raco pollen render $@
	# tidy -quiet -modify -indent --wrap 100 --wrap-attributes no --tidy-mark no $@ || true

index.html: $(core-files) $(html-deps) $(series-html) index.html.pp
	raco pollen render index.html

# This target will also rebuild pg2, pg3, etc. as needed
blog-pg1.html: $(core-files) $(html-deps) $(articles-html) blog.rkt
	rm -f blog*.html
	racket -tm blog.rkt
	# tidy -quiet -modify -indent --wrap 100 --wrap-attributes no --tidy-mark no blog*.html || true