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

Overview
Comment:Add space between multiple notes in an article. Hide byline for notes by the site proprietor.
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 4fec67783d64ff7a09b4d99b5615750deeb4615635be9a61384318849077abc9
User & Date: joel on 2018-09-22 19:42:04
Other Links: manifest | tags
Context
2018-09-22
20:30
Fix for error when note contents are not a tagged X-expression (e.g. a single sentence) check-in: d4c38fce user: joel tags: trunk
19:42
Add space between multiple notes in an article. Hide byline for notes by the site proprietor. check-in: 4fec6778 user: joel tags: trunk
2018-09-21
21:54
Fix series info missing from footer check-in: 5b4bc26c user: joel tags: trunk
Changes

Modified crystalize.rkt from [cb0151f2] to [2ee97a67].

238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
  (define author (maybe-attr 'author attrs))
  (define note-id (build-note-id note-tx))
  (define title-html-flow (html$-note-title author pagenode parent-title-plain))
  (define author-url (maybe-attr 'author-url attrs))
  (define-values (disp-mark disp-verb) (disposition-values disposition-attr))
  (define content-html (html$-note-contents disp-mark (get-elements note-tx)))
  (define listing-full-html
    (html$-note-listing-full pagenode note-id title-html-flow note-date author author-url content-html))

  (define note-record
    (list pagenode
          note-id
          title-html-flow
          author
          author-url







|







238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
  (define author (maybe-attr 'author attrs))
  (define note-id (build-note-id note-tx))
  (define title-html-flow (html$-note-title author pagenode parent-title-plain))
  (define author-url (maybe-attr 'author-url attrs))
  (define-values (disp-mark disp-verb) (disposition-values disposition-attr))
  (define content-html (html$-note-contents disp-mark (get-elements note-tx)))
  (define listing-full-html
    (html$-note-listing-full pagenode note-id title-html-flow note-date content-html author author-url))

  (define note-record
    (list pagenode
          note-id
          title-html-flow
          author
          author-url
263
264
265
266
267
268
269
270
                           "VALUES ((SELECT `rowid` FROM `notes` WHERE `pagenode` = ?1"
                           " AND `note_id` = ?2), ~a)")
            (list->sql-fields table_notes-fields)
            (list->sql-parameters table_notes-fields)))
  (apply query! save-note-query note-record)
  
  ;; return html$ of note
  (html$-note-in-article note-id note-date author author-url content-html))







|
263
264
265
266
267
268
269
270
                           "VALUES ((SELECT `rowid` FROM `notes` WHERE `pagenode` = ?1"
                           " AND `note_id` = ?2), ~a)")
            (list->sql-fields table_notes-fields)
            (list->sql-parameters table_notes-fields)))
  (apply query! save-note-query note-record)
  
  ;; return html$ of note
  (html$-note-in-article note-id note-date content-html author author-url))

Modified template-html.rkt from [fdb84ec5] to [259532dd].

106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123



124
125
126
127
128
129
130
131
132
133
134
135
136
137



138
139
140
141
142
143
144
145
146
    (cond
      [(equal? 'p first-tag)
       (cons (txexpr 'p first-attrs (cons disposition first-elems)) (cdr elems))]
      [else
       (cons disposition elems)]))
  (string-append* (map ->html body-elems)))

(define (html$-note-listing-full pagenode note-id title-html-flow date author author-url contents)
  (define author-part
    (cond [(non-empty-string? author)
           ◊string-append{
            <div class="note-meta">
            &mdash;<a class="u-author h-card" href="◊|author-url|">◊|author|</a>
            </div>}]
          [else ◊string-append{
            <div class="note-meta">
            &mdash;<a class="u-author h-card" href="https://thelocalyarn.com">◊|default-authorname|</a>
            </div>}]))



  
  ◊string-append{
 <article class="with-title hentry">
 <h1 class="entry-title">◊|title-html-flow|</h1>
 <p class="time"><a href="◊|pagenode|◊note-id" class="rel-bookmark note-permlink">
 <time datetime="◊date">◊ymd->english[date]</time>
 </a></p>
 <section class="entry-content">
 <div class="p-content p-name">◊|contents|</div>
 ◊author-part
 </section>
 </article>})

(define (html$-note-in-article id date author author-url contents)



  ◊string-append{
 <div class="note u-comment" id="◊|id|">
 <h3><a href="#◊|id|"><time class="dt-published" datetime="◊date">◊ymd->english[date]</time>
 </a></h3>
 <div class="p-content p-name">
 ◊contents
 </div>
 <div class="note-meta">
 &mdash;<a class="u-author h-card" href="◊|author-url|">◊|author|</a>







|

|






|

>
>
>


|










|
>
>
>
|
|







106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
    (cond
      [(equal? 'p first-tag)
       (cons (txexpr 'p first-attrs (cons disposition first-elems)) (cdr elems))]
      [else
       (cons disposition elems)]))
  (string-append* (map ->html body-elems)))

(define (html$-note-listing-full pagenode note-id title-html-flow date contents [author default-authorname] [author-url ""])
  (define author-part
    (cond [(non-empty-string? author-url)
           ◊string-append{
            <div class="note-meta">
            &mdash;<a class="u-author h-card" href="◊|author-url|">◊|author|</a>
            </div>}]
          [else ◊string-append{
            <div class="note-meta">
            &mdash;<span class="h-card">◊|author|</span>
            </div>}]))
  (define maybe-author-class?
    (cond [(string=? author default-authorname) "by-proprietor"]
          [else ""]))
  
  ◊string-append{
 <article class="with-title ◊maybe-author-class? hentry">
 <h1 class="entry-title">◊|title-html-flow|</h1>
 <p class="time"><a href="◊|pagenode|◊note-id" class="rel-bookmark note-permlink">
 <time datetime="◊date">◊ymd->english[date]</time>
 </a></p>
 <section class="entry-content">
 <div class="p-content p-name">◊|contents|</div>
 ◊author-part
 </section>
 </article>})

(define (html$-note-in-article id date contents author author-url)
  (define maybe-author-class?
    (cond [(or (string=? author default-authorname) (string=? author "")) "by-proprietor"]
          [else ""]))

  ◊string-append{<div class="note ◊maybe-author-class? u-comment" id="◊|id|">
 <h3><a href="#◊|id|"><time class="dt-published" datetime="◊date">◊ymd->english[date]</time>
 </a></h3>
 <div class="p-content p-name">
 ◊contents
 </div>
 <div class="note-meta">
 &mdash;<a class="u-author h-card" href="◊|author-url|">◊|author|</a>

Modified web-extra/martin.css.pp from [2a8d5a40] to [f7b7564a].

472
473
474
475
476
477
478








479
480
481
482
483
484
485
    }

    div.note-meta {
        margin-top: ◊x-lineheight[1];
        font-feature-settings: "smcp" on;
        color: #888;
    }









    span.disposition-mark {
        color: ◊color-xrefmark;
        display: inline-block;
        width: 1em;
    }








>
>
>
>
>
>
>
>







472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
    }

    div.note-meta {
        margin-top: ◊x-lineheight[1];
        font-feature-settings: "smcp" on;
        color: #888;
    }

    .by-proprietor .note-meta {
        display: none;
    }

    div.note + div.note {
        margin-top: ◊x-lineheight[2];
    }

    span.disposition-mark {
        color: ◊color-xrefmark;
        display: inline-block;
        width: 1em;
    }