Skip to content

Commit 7dd2d11

Browse files
committed
fix: Refine the nav titles and the footer project link
Suggested-by: Ihor Radchenko <yantar92@posteo.net>
1 parent 0c2a99c commit 7dd2d11

7 files changed

Lines changed: 22 additions & 22 deletions

File tree

README.org

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ exactly one of the three type keys:
192192
| =:archive-format-string= | no | URL template for message-ids (=%s= is replaced) |
193193
| =:base-url= | no | Base URL where this source's public directory is served |
194194
| =:website= | no | Project website, linked from page titles and footers |
195-
| =:contribute-url= | no | Contribution guide; drives the "Create new" button and a footer link |
195+
| =:contribute-url= | no | Contribution guide; drives the "Create new" button |
196196
| =:post-address= | no | Posting address shown on =docs.html= (mailbox sources fall back to =:to=) |
197197
| =:report-types= | no | Restrict detected and exported types, e.g. =#{:bug :patch}= |
198198
| =:export-formats= | no | Output formats (default: =["json" "org" "rss"]=) |

config.edn.example

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,9 @@
5858
;; Project links surfaced on the exported pages (all
5959
;; optional): :website links the source name in the page
6060
;; titles and the footer; :contribute-url drives the
61-
;; "Create new" button on the reports page and a footer
62-
;; link; :post-address is the address shown on docs.html
63-
;; for creating reports (mailbox sources fall back to :to).
61+
;; "Create new" button on the reports page; :post-address
62+
;; is the address shown on docs.html for creating reports
63+
;; (mailbox sources fall back to :to).
6464
;;
6565
;; :website "https://project.example.org"
6666
;; :contribute-url "https://project.example.org/contribute.html"

docs/bone-manual.org

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1050,7 +1050,7 @@ Emails that match no source are discarded at ingestion.
10501050
| | =Archived-At= header is absent |
10511051
| =:base-url= | Base URL where this source's public directory is served |
10521052
| =:website= | Project website: links the source name in page titles and the footer |
1053-
| =:contribute-url= | Contribution guide: "Create new" button on the reports page, plus a footer link |
1053+
| =:contribute-url= | Contribution guide: drives the "Create new" button on the reports page |
10541054
| =:post-address= | Posting address shown on =docs.html= (mailbox sources fall back to =:to=) |
10551055
| =:labels= | Per-source label overrides (see [[#customising-subject-labels][customising subject labels]]) |
10561056
| =:commands= | Per-source command overrides (see [[#customising-commands][customising commands]]) |

scripts/bone-docs.clj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,7 @@
307307
.meta { font-size: 0.78rem; color: var(--pico-muted-color); margin-bottom: 2rem; }
308308
" footer-css))
309309

310-
(defn docs-page [body-html {:keys [ical website contribute-url]}]
310+
(defn docs-page [body-html {:keys [ical website source]}]
311311
(let [title "BONE - Docs"
312312
generated-at (str (java.util.Date.))]
313313
(str
@@ -337,7 +337,7 @@
337337
[:script (h/raw (wrap-js theme-toggle-js))]]
338338
(bone-footer {:ical ical
339339
:website website
340-
:contribute-url contribute-url})]]))))
340+
:source source})]]))))
341341

342342
;; ---------------------------------------------------------------------------
343343
;; Filter feed links in "Getting the data" table
@@ -516,7 +516,7 @@
516516
"announcements.ics"))]
517517
(docs-page body-html {:ical has-ical?
518518
:website (:website source-cfg)
519-
:contribute-url (:contribute-url source-cfg)}))
519+
:source source-name}))
520520
(finally
521521
((resolve 'pod.huahaiy.datalevin/close) conn)))]
522522
(io/make-parents out-file)

scripts/bone-index.clj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,7 @@
309309
[:div#pagination]])
310310
(h/html (bone-footer {:ical has-ical?
311311
:website website
312-
:contribute-url contribute})))]
312+
:source source-name})))]
313313
(str
314314
"<!DOCTYPE html>\n"
315315
(h/html

scripts/bone-stats.clj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -582,7 +582,7 @@
582582
\"Available data\" table, and the scripts. Carries no report data --
583583
bone-stats.js fetches stats.json (via meta.json) and fills it in, so the
584584
file stays byte-stable across data-only changes."
585-
[out-dir source-name {:keys [website contribute-url]}]
585+
[out-dir source-name {:keys [website]}]
586586
(let [title (page-title "Data" source-name)
587587
has-ical? (.exists (io/file out-dir "events" "announcements.ics"))
588588
data-section (render-data-section out-dir)
@@ -605,7 +605,7 @@
605605
"</section>\n")
606606
tpl-footer (str (h/html (bone-footer {:ical has-ical?
607607
:website website
608-
:contribute-url contribute-url})))]
608+
:source source-name})))]
609609
(str
610610
"<!DOCTYPE html>\n"
611611
"<html lang=\"en\" data-theme=\"light\">\n"
@@ -671,7 +671,7 @@
671671
(let [src (some #(when (= source-name (:name %)) %)
672672
(:sources (load-config)))]
673673
(spit-html out-file (render-shell out-dir source-name
674-
(select-keys src [:website :contribute-url]))))
674+
(select-keys src [:website]))))
675675
(log/info "Wrote shell" out-file))
676676

677677
(defn -main [& args]

scripts/bone/html_bb.clj

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -178,12 +178,14 @@
178178
([title current] (nav-bar title current nil))
179179
([title current {:keys [source source-href]}]
180180
[:nav
181-
[:ul [:li [:a {:href "index.html" :style "text-decoration:none;color:inherit"}
181+
[:ul [:li [:a {:href "index.html" :title "Back to BONE homepage"
182+
:style "text-decoration:none;color:inherit"}
182183
[:strong title]]
183184
(when source
184185
(list " - "
185186
(if source-href
186187
[:a {:href source-href
188+
:title (str "Visit " source " website")
187189
:style "text-decoration:none;color:inherit"}
188190
[:strong source]]
189191
[:strong source])))]]
@@ -251,13 +253,13 @@
251253
(defn bone-footer
252254
"Footer with BONE repo + license link.
253255
Options:
254-
:feeds when true (default), appends per-source RSS/JSON/Org links.
255-
Set to false on the root index where those paths don't exist.
256-
:ical when true (default) and :feeds is on, appends an iCal link.
257-
:website / :contribute-url when set, append links to the tracked
258-
project's website and contribution page."
256+
:feeds when true (default), appends per-source RSS/JSON/Org links.
257+
Set to false on the root index where those paths don't exist.
258+
:ical when true (default) and :feeds is on, appends an iCal link.
259+
:website when set, appends a link to the tracked project's website,
260+
labeled with :source (the source name) when available."
259261
([] (bone-footer {}))
260-
([{:keys [ical feeds website contribute-url] :or {ical true feeds true}}]
262+
([{:keys [ical feeds website source] :or {ical true feeds true}}]
261263
[:footer.bone-footer
262264
[:a {:href bone-repo-url} "BONE"]
263265
" is "
@@ -273,9 +275,7 @@
273275
(when ical
274276
(list " -- " [:a {:href "events/announcements.ics"} "iCal"]))))
275277
(when website
276-
(list " -- " [:a {:href website} "Website"]))
277-
(when contribute-url
278-
(list " -- " [:a {:href contribute-url} "Contribute"]))]))
278+
(list " -- " [:a {:href website} (or source "Website")]))]))
279279

280280
;; ---------------------------------------------------------------------------
281281
;; Org-mode inline link conversion (shared by bone-docs, bone-stats)

0 commit comments

Comments
 (0)