Overview
Comment: | The footer is here. Closes [87f985fb5b] and [751a7ebc2a] |
---|---|
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA3-256: |
2c0b202bc28e5fb6a13926db074edcda |
User & Date: | joel on 2020-02-08 17:56:34 |
Other Links: | manifest | tags |
Context
2020-02-10
| ||
17:28 | Improved footer check-in: 75502f96 user: joel tags: trunk | |
2020-02-08
| ||
17:56 | The footer is here. Closes [87f985fb5b] and [751a7ebc2a] check-in: 2c0b202b user: joel tags: trunk | |
2020-02-02
| ||
04:53 | Include bold type check-in: 4fecf9d9 user: joel tags: trunk | |
Changes
Modified cache.rkt from [7fc7c05e] to [42c939a6].
5 5 6 6 (require deta 7 7 db/base 8 8 db/sqlite3 9 9 threading 10 10 pollen/setup 11 11 racket/match 12 + (rename-in racket/list 13 + (group-by group-list-by)) 12 14 "dust.rkt" 13 15 (except-in pollen/core select)) 14 16 15 17 (provide init-cache-db! 16 18 cache-conn ; The most eligible bachelor in Neo Yokyo 17 19 (schema-out cache:article) 18 20 (schema-out cache:note) ................................................................................ 23 25 current-plain-title 24 26 articles 25 27 articles+notes 26 28 listing-htmls 27 29 <listing-full> 28 30 <listing-excerpt> 29 31 <listing-short> 30 - unfence) 32 + unfence 33 + series-grouped-list) 31 34 32 35 ;; Cache DB and Schemas 33 36 34 37 (define DBFILE (build-path (current-project-root) "vitreous.sqlite")) 35 38 (define cache-conn (sqlite3-connect #:database DBFILE #:mode 'create)) 36 39 37 40 (define current-plain-title (make-parameter "void")) ................................................................................ 197 200 ,@(listing-htmls (query-func 'short #:series s #:limit lim #:order ord)) 198 201 "</ul>")) ;; ^^^^^^ 199 202 200 203 ;; Remove "<style>" and "</style>" introduced by using ->html on docs containing output from 201 204 ;; listing functions 202 205 (define (unfence html-str) 203 206 (regexp-replace* #px"<[\\/]{0,1}style>" html-str "")) 207 + 208 +;; 209 +;; ~~~ Fetching series ~~~ 210 +;; 211 +(define (series-grouped-list) 212 + (~> (for/list ([row (in-entities cache-conn (from cache:series #:as s))]) row) 213 + (group-list-by cache:series-noun-plural _ string-ci=?)))
Modified index.html.pp from [eb78d203] to [511f6fe5].
1 1 #lang pollen 2 2 3 3 ◊; SPDX-License-Identifier: BlueOak-1.0.0 4 4 ◊; This file is licensed under the Blue Oak Model License 1.0.0. 5 5 6 -◊(require pollen/template db/base racket/list racket/match) 7 - 8 -◊(define (fetch-series) 9 - (define q "SELECT noun_plural, page, title FROM series ORDER BY noun_plural DESC") 10 - (query-rows cache-conn q)) 11 - 12 -◊(define (series-item->txpr s) 13 - (match-define (list n pagenode title) s) 14 - `(li (a [[href ,pagenode]] (i ,title)))) 15 - 16 -◊(define (series-grouped-list) 17 - ;; Produces '((("noun1" "p.html" "Title") ("noun1" "q.html" "Title")) (("noun2" ...) ...)) 18 - (define init-group 19 - (group-by first (map vector->list (fetch-series)) string-ci=?)) 20 - 21 - (define series-list-items 22 - (for/list ([group (in-list init-group)]) 23 - `(div (h2 ,(first (first group))) (ul ,@(map series-item->txpr group))))) 24 - `(section [[class "series-list"] [style "margin-top: 1.3rem"]] ,@series-list-items)) 6 +◊(require pollen/template racket/file) 25 7 26 - 27 8 <!DOCTYPE html> 28 9 <html lang="en"> 29 10 ◊html$-page-head["The Local Yarn" #f] 30 11 <style> 31 12 header#front-page { 32 13 text-align: center; 33 14 } ................................................................................ 85 66 (almost) is ◊link[1]{arranged in time order, newest first}. There are also a few arranged into named 86 67 collections: 87 68 88 69 ◊url[1]{/blog-pg1.html} 89 70 90 71 }) 91 72 ◊; stop for now: (crystalize-index-entries! '|index.html| front-page-body) 73 +◊(display-to-file (html$-page-footer) "scribbled/site-footer.html" #:exists 'replace) 92 74 93 75 <main> 94 76 ◊(->html front-page-body #:splice? #t) 95 - ◊(->html (series-grouped-list)) 77 + ◊(html$-series-list) 96 78 </main> 97 79 </body> 98 80 </html>
Modified makefile from [223b34de] to [9872e7c1].
47 47 # render, triggering this rule for that series. 48 48 $(series-html): %.html: %.poly.pm 49 49 raco pollen render $@ 50 50 tidy -quiet -modify -indent --wrap 100 --wrap-attributes no --tidy-mark no $@ || true 51 51 52 52 index.html: $(core-files) $(html-deps) $(series-html) index.html.pp 53 53 raco pollen render index.html 54 + fossil uv add scribbled/site-footer.html 54 55 55 56 # This target will also rebuild pg2, pg3, etc. as needed 56 57 blog-pg1.html: $(core-files) $(html-deps) $(articles-html) blog.rkt 57 58 rm -f blog*.html 58 59 racket -tm blog.rkt 59 60 tidy -quiet -modify -indent --wrap 100 --wrap-attributes no --tidy-mark no blog*.html || true 60 61 ................................................................................ 90 91 --exclude=.fslckout \ 91 92 --exclude='*.ltx' \ 92 93 --exclude='*.swp' \ 93 94 --exclude=.DS_Store \ 94 95 --exclude='template*.*' \ 95 96 --exclude=makefile 96 97 rm -rf ~/Desktop/publish 98 + fossil uv sync 97 99 98 100 scribble: ## Rebuild code documentation and update Fossil repo 99 101 scribble --htmls +m --redirect https://docs.racket-lang.org/local-redirect/ code-docs/main.scrbl 100 102 fossil uv rm scribbled/* 101 103 rm -rf scribbled/* 102 104 mv main/* scribbled/ 103 105 cp code-docs/scribble-iframe.html scribbled/scribble.html
Modified snippets-html.rkt from [9386bc7c] to [56f8da66].
9 9 pollen/decode 10 10 pollen/private/version 11 11 racket/string 12 12 racket/function 13 13 racket/list 14 14 txexpr 15 15 openssl/sha1 16 + "cache.rkt" 16 17 "dust.rkt") 17 18 18 19 (provide html$-page-head 19 20 html$-page-body-open 21 + html$-series-list 20 22 html$-article-open 21 23 html$-article-close 22 24 html$-article-listing-short 25 + html$-page-footer 23 26 html$-page-body-close 24 27 html$-note-contents 25 28 html$-note-listing-full 26 29 html$-note-in-article 27 30 html$-notes-section 28 31 html$-paginate-navlinks) 29 32 ................................................................................ 69 72 70 73 (define (html$-article-listing-short pagenode pubdate title) 71 74 ◊string-append{ 72 75 <li><a href="/◊(symbol->string pagenode)"> 73 76 <div class="article-list-date caps">◊(ymd->english pubdate)</div> 74 77 <div class="article-list-title">◊|title|</div> 75 78 </a></li>}) 79 + 80 +(define (html$-page-footer) 81 + ◊string-append{ 82 +<footer id="main"> 83 + <h1>The Local Yarn</h1> 84 + <p><a href="/">Home</a> • 85 + <a href="/blog-pg1.html">Blog</a> • 86 + <a href="/keyword-index.html">Keyword Index</a> • 87 + <a href="/code"><i><code>(Source Code)</code></i></a> 88 + </p> 89 + ◊(html$-series-list) 90 + </footer>}) 76 91 77 92 (define (html$-page-body-close) 78 - ◊string-append{<footer>By Joel Dueck</footer> 79 - </main></body>}) 93 + ◊string-append{ 94 + </main> 95 + ◊(html$-page-footer) 96 + </body>}) 80 97 81 98 ;; Notes 82 99 ;; 83 100 (define (html$-note-contents disposition-mark disposition-verb elems) 84 101 (define disposition 85 102 (cond [(non-empty-string? disposition-mark) 86 103 `(abbr [[class "disposition-mark-in-note"] ................................................................................ 194 211 195 212 (define next-link 196 213 (if (eq? pagecount pagenum) 197 214 "<li class=\"nav-text inactive-link\">Older→</li>" 198 215 (page-func (+ pagenum 1) "Older →" "nav-text"))) 199 216 200 217 (string-join `(,prev-link ,@page-group ,next-link))) 218 + 219 +(define (series->txpr s) 220 + `(li (a [[href ,(symbol->string (cache:series-page s))]] 221 + (i ,(cache:series-title s))))) 222 + 223 +(define (html$-series-list) 224 + (define series-list-items 225 + (for/list ([group (in-list (series-grouped-list))]) 226 + `(div (h2 ,(cache:series-noun-plural (first group))) (ul ,@(map series->txpr group))))) 227 + (->html `(section [[class "column-list"] [style "margin-top: 1.3rem"]] ,@series-list-items)))
Modified web-extra/martin.css.pp from [7cbcbc97] to [f7b75dc6].
630 630 div.article-list-title { 631 631 font-size: 1.2rem; 632 632 } 633 633 634 634 /* ******* (Mobile first) Columnar series list styling ******* 635 635 */ 636 636 637 -.series-list { 638 - display: grid; 639 - grid-template-columns: repeat(auto-fill,8em); 640 - place-content: center; 637 +.column-list { 638 + display: flex; 639 + flex-wrap: wrap; 640 + justify-content: space-evenly; 641 +} 642 + 643 +.column-list div { 644 + padding-left: 0.25em; /* Keeps some italic descenders inside the box */ 645 + margin: 0 0.5rem; 646 + text-align: left; 647 + width: 8rem; 641 648 } 642 649 643 -.series-list div { 644 - padding-left: 0.25em; /* Keeps some italic descenders inside the box */ 645 -} 646 - 647 -.series-list h2 { 650 +.column-list h2 { 648 651 font-feature-settings: "smcp" on; 649 652 text-transform: lowercase; 650 653 font-weight: normal; 651 654 font-size: 1em; 652 655 margin: 0; 653 656 } 654 657 655 -.series-list ul { 658 +.column-list ul { 656 659 margin-top: 0; 657 660 list-style-type: none; 658 661 padding: 0; 659 662 } 660 663 661 664 /* ******* (Mobile first) Keyword Index styling ******* 662 665 */ ................................................................................ 682 685 padding: 0; 683 686 } 684 687 685 688 #keywordindex ul ul { 686 689 margin-left: 0.5em; 687 690 font-size: smaller; 688 691 } 692 + 693 +/* Footer ***** */ 694 + 695 +footer#main { 696 + text-align: center; 697 + margin-top: ◊x-lineheight[1]; 698 + padding-top: ◊x-lineheight[1]; 699 + background: #dedede; 700 + border-top: dotted ◊color-bodytext 2px; 701 +} 689 702 690 703 /* End of mobile-first typography and layout */ 691 704 692 705 693 706 /* Here’s where we start getting funky for any viewport wider than mobile portrait. 694 707 An iPhone 6 is 667px wide in landscape mode, so that’s our breakpoint. */ 695 708