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

Overview
Comment:First attempt at hiding redundant series info on series pages
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 8ab2075d1984fd35523f07f2b4d62132a85c31b56b6e3b30ad78617d2fb1f4df
User & Date: joel on 2019-04-12 02:33:04
Other Links: manifest | tags
Context
2019-04-12
03:00
Process footnote blocks in the same way as the rest of the document. Fixes [d836105a] check-in: e780afcd user: joel tags: trunk
02:33
First attempt at hiding redundant series info on series pages check-in: 8ab2075d user: joel tags: trunk
2019-04-11
22:39
Fix for layout bug preventing some permlinks from being unclickable check-in: 4d2683da user: joel tags: trunk
Changes

Modified code-docs/snippets-html.scrbl from [35495a0f] to [8b5eb568].

54
55
56
57
58
59
60
61
62
63
64



65
66
67
68
69
70
71

@section{HTML Snippet functions}

@defproc[(html$-page-head [title (or/c string? #f) #f]) non-empty-string?]

Returns the @tt{<head>} section of an HTML document.

@defproc[(html$-page-body-open) non-empty-string?]

Returns the opening @tt{<body>} and @tt{<main>} tags and elements that immediately follow, such as
site header, logo and navigation.




@defproc[(html$-article-open [pagenode pagenode?] 
                             [title-specified-in-doc? boolean?] 
                             [title txexpr?] 
                             [pubdate string?])
          non-empty-string?]








|



>
>
>







54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74

@section{HTML Snippet functions}

@defproc[(html$-page-head [title (or/c string? #f) #f]) non-empty-string?]

Returns the @tt{<head>} section of an HTML document.

@defproc[(html$-page-body-open [body-class string? ""]) non-empty-string?]

Returns the opening @tt{<body>} and @tt{<main>} tags and elements that immediately follow, such as
site header, logo and navigation.

If @racket[_body-class] is a non-empty string, its contents will be included in the @tt{class}
attribute of the @tt{<body>} tag.

@defproc[(html$-article-open [pagenode pagenode?] 
                             [title-specified-in-doc? boolean?] 
                             [title txexpr?] 
                             [pubdate string?])
          non-empty-string?]

Modified crystalize.rkt from [b9c0d03d] to [b88a4287].

233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
...
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
  
;; Convert a bunch of information about an article into some nice English and links.
(define (make-article-footertext pagenode series disposition disp-note-id note-count)
  (define s-title (series-title))
  (define s-noun (series-noun))
  (define series-part
    (cond [(non-empty-string? s-title)
           (format "This is ~a, part of <a href=\"/~a\">‘~a’</a>."
                   s-noun
                   series
                   s-title)]
          [else ""]))
  (define disp-part
    (cond [(non-empty-string? disposition)
           (define-values (mark verb) (disposition-values disposition))
................................................................................
                   note-count)]
          [(and (note-count . > . 0) (string=? disposition ""))
           (format "There is <a href=\"/~a#furthernotes\">a note</a> appended."
                   pagenode)]
          [else ""]))
  
  (cond [(ormap non-empty-string? (list series-part disp-part notes-part))
         (format "~a ~a ~a" series-part disp-part notes-part)]
        [else ""]))
    

;; ~~~ Notes ~~~

;; Save a collection of ◊note tags to the DB, and return the HTML of the complete
;; “Further Notes” section at the end







|







 







|







233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
...
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
  
;; Convert a bunch of information about an article into some nice English and links.
(define (make-article-footertext pagenode series disposition disp-note-id note-count)
  (define s-title (series-title))
  (define s-noun (series-noun))
  (define series-part
    (cond [(non-empty-string? s-title)
           (format "<span class=\"series-part\">This is ~a, part of <a href=\"/~a\">‘~a’</a>.</span>"
                   s-noun
                   series
                   s-title)]
          [else ""]))
  (define disp-part
    (cond [(non-empty-string? disposition)
           (define-values (mark verb) (disposition-values disposition))
................................................................................
                   note-count)]
          [(and (note-count . > . 0) (string=? disposition ""))
           (format "There is <a href=\"/~a#furthernotes\">a note</a> appended."
                   pagenode)]
          [else ""]))
  
  (cond [(ormap non-empty-string? (list series-part disp-part notes-part))
         (string-join (list series-part disp-part notes-part))]
        [else ""]))
    

;; ~~~ Notes ~~~

;; Save a collection of ◊note tags to the DB, and return the HTML of the complete
;; “Further Notes” section at the end

Modified series/template.html.p from [5863c80f] to [2bb23760].

1
2
3
4
5
6
7
8
9
10
11
12
13
14
<!DOCTYPE html>
<html lang="en">

◊html$-page-head[(select-from-metas 'title metas)]

◊html$-page-body-open[]

◊(unfence (->html doc #:splice? #t))

◊html$-page-body-close[]

</html>







|








1
2
3
4
5
6
7
8
9
10
11
12
13
14
<!DOCTYPE html>
<html lang="en">

◊html$-page-head[(select-from-metas 'title metas)]

◊html$-page-body-open["series-page"]

◊(unfence (->html doc #:splice? #t))

◊html$-page-body-close[]

</html>


Modified snippets-html.rkt from [b2f8e39c] to [f7e3f3ed].

46
47
48
49
50
51
52
53

54
55
56
57
58
59
60
61
  ◊string-append{<head>
 <title>◊if[title title ""] </title>
 <meta charset="utf-8" />
 <meta name="viewport" content="width=device-width, initial-scale=1">
 <link rel="stylesheet" type="text/css" href="/web-extra/martin.css">
 </head>})

(define (html$-page-body-open)

  ◊string-append{<body><main>
 <a href="/"><header>
 <img src="/web-extra/mark.svg" height="103" class="logo">
 <h1>The Local Yarn</h1>
 </header></a>})

(define (html$-article-open pagenode title? title-tx published)
  (cond







|
>
|







46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
  ◊string-append{<head>
 <title>◊if[title title ""] </title>
 <meta charset="utf-8" />
 <meta name="viewport" content="width=device-width, initial-scale=1">
 <link rel="stylesheet" type="text/css" href="/web-extra/martin.css">
 </head>})

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

(define (html$-article-open pagenode title? title-tx published)
  (cond

Modified web-extra/martin.css.pp from [116a0622] to [dfbb1609].

303
304
305
306
307
308
309





310
311
312
313
314
315
316
        font-feature-settings: "smcp" on, "liga" on, "clig" on, "dlig" on, "kern" on, "onum" on, "pnum" on;
        color: #888;
    }

    footer.article-info::before {
        content: "☞\00a0";
    }






    p.time::before {
        content: none;
    }

    p.time {
        font-size: ◊x-lineheight[0.75];







>
>
>
>
>







303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
        font-feature-settings: "smcp" on, "liga" on, "clig" on, "dlig" on, "kern" on, "onum" on, "pnum" on;
        color: #888;
    }

    footer.article-info::before {
        content: "☞\00a0";
    }
    
    /* Within article info, don’t display series info when on a series page (redundant) */
    body.series-page .series-part {
        display: none;
    }

    p.time::before {
        content: none;
    }

    p.time {
        font-size: ◊x-lineheight[0.75];