Skip to content

Commit 99147ce

Browse files
committed
Update remote url
1 parent b11467b commit 99147ce

File tree

6 files changed

+34
-37
lines changed

6 files changed

+34
-37
lines changed

_includes/docs.css

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,13 @@ body{--bs-heading-color:var(--bs-gray-dark);color:#555}
99
aside{border-top:dotted 2px gray;padding-top:2rem;font-size:var(--aside-font-size)}
1010
h3,h4,h5{margin:0 0}
1111
h1 a{text-decoration-skip-ink:all}
12+
a.h5:hover,a.h6:hover{color:var(--bs-link-color)}
1213
.h2>a:hover,.h3>a:hover,.h4>a:hover,.h5>a:hover{font-style:oblique;transition:font-style .15s ease-in-out}
1314
q:after{content:""}
1415
q:before{content:""}
1516
a{color:var(--bs-success)}
1617
a:hover{color:#222}
18+
.breadcrumb{margin-bottom:0;font-family:var(--bs-font-monospace)!important;font-size:.85em}
1719
.bookmark q{white-space:pre-line;text-align:justify}
1820
.clamp{display:-webkit-box!important;-webkit-line-clamp:var(--clamp-lines,1);-webkit-box-orient:vertical;overflow:hidden;text-overflow:ellipsis}
1921
.gap{gap:var(--gap)}

_includes/postlist.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<h5>Other posts in <a class="fs-6 smaller letter-spacing-1" href="{{pagetag|relative_url}}">{{pagetag|upcase}}</a></h5>
55
<ul class="d-flex flex-column gap-2 my-3 lh-sm">
66
{%- for book in books %}
7-
<li class="text-muted">
7+
<li class="text-muted clamp">
88
{%- if book.slug == page.slug %}
99
<u class="h6 text-success">{{book.title}}</u>
1010
{%- else %}

_layouts/api.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,6 @@
88
"title": "{{info.title}}",
99
"author": "{{info.author}}",
1010
"genre": "{{info.tags}}",
11+
"url": "{{info.url}}",
1112
"activity": {{activity|jsonify}}
1213
}

_layouts/default.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ <h1 class="h1 site-title"><a href="{{ '/' | relative_url }}">{{site.title}}</a><
4747
</main>
4848
<footer class="d-flex flex-column gap-3 py-4">
4949
<hr>
50-
<div class="d-flex flex-wrap justify-content-between align-content-center align-items-center gap-3 smaller">
50+
<div class="d-flex flex-wrap justify-content-between align-content-center align-items-center gap-3 smaller px-3 py-1">
5151
<div>
5252
Created by <a href="https://github.com/{{site.repository}}">@{{site.github_username}}</a>.
5353
Copyright {{ site.time | date: '%Y' }}

scripts/annotations.jq

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ def create_activity_data:
3333
text: (.ZANNOTATIONSELECTEDTEXT|unsmart|remove_cites|format_quotes|join("\n")),
3434
created: .ZANNOTATIONCREATIONDATE,
3535
location: .ZANNOTATIONLOCATION,
36-
cfi: (.ZANNOTATIONLOCATION|[match("\\b[0-9]{1,4}\\b";"g").string|tonumber]|join(".")),
36+
cfi: (.ZANNOTATIONLOCATION|[match("\\b[0-9]{1,4}\\b";"g").string|tonumber|lpad(3)]|join(".")),
3737
chapter: (if ((.ZFUTUREPROOFING5|length)>0) then .ZFUTUREPROOFING5 else (.ZANNOTATIONLOCATION|format_location)? // .rangestart end),
3838
rangestart: .ZPLLOCATIONRANGESTART
3939
}) | sort_by(.id);
@@ -138,7 +138,7 @@ def stats_history_text:
138138
), ""
139139
]),
140140
# create link reference from _data/books.json
141-
($books[]|sort_by(.permalink)|map("[\(.assetid)]:\t\(.permalink)"))
141+
($books[]|sort_by(.url)|map("[\(.assetid)]:\t\(.url)"))
142142
]
143143
| flatten | join("\n") )
144144
else

scripts/build-data.sh

Lines changed: 27 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ SCRIPT="$(realpath "$0")"
66
DIR=${SCRIPT%/*/*}
77
_scriptdir=${SCRIPT%/*}
88

9-
DEFAULT_REMOTE_URL="https://raw.githubusercontent.com/nntrn/bookstand/assets/annotations.json"
9+
DEFAULT_REMOTE_URL="https://nntrn.github.io/store/annotations.json"
1010
DEFAULT_ANNOTATIONS_FILE=annotations.json
1111

1212
export OUTDIR=$DIR
@@ -64,44 +64,38 @@ done
6464

6565
export DATADIR=$OUTDIR/_data
6666

67-
_main() {
67+
if [[ ! -f $ANNOTATIONS_FILE ]] ||
68+
[[ ! -s $ANNOTATIONS_FILE ]] ||
69+
[[ $FETCH_REMOTE -eq 1 ]]; then
6870

69-
if [[ ! -f $ANNOTATIONS_FILE ]] ||
70-
[[ ! -s $ANNOTATIONS_FILE ]] ||
71-
[[ $FETCH_REMOTE -eq 1 ]]; then
71+
get_annotations &
72+
wait %1
73+
fi
7274

73-
get_annotations &
74-
wait %1
75-
fi
76-
77-
if [[ -n $RUN_ONLY ]]; then
78-
if [[ $RUN_ONLY == "stat_"* ]]; then
79-
jq_from_activity $RUN_ONLY
80-
else
81-
jq_from_annotations $RUN_ONLY
82-
fi
75+
if [[ -n $RUN_ONLY ]]; then
76+
if [[ $RUN_ONLY == "stat_"* ]]; then
77+
jq_from_activity $RUN_ONLY
8378
else
79+
jq_from_annotations $RUN_ONLY
80+
fi
81+
else
8482

85-
mkdir -p $OUTDIR/{_data/stats,_pages}
83+
mkdir -p $OUTDIR/{_data/stats,_pages}
8684

87-
jq_from_annotations create_book_data >$DATADIR/books.json &
88-
jq_from_annotations create_genre_data >$DATADIR/genres.json &
89-
jq_from_annotations create_activity_data >$DATADIR/activity.json &
90-
# jq_from_annotations create_word_data >$DATADIR/words.json &
91-
wait %3
85+
jq_from_annotations create_book_data >$DATADIR/books.json &
86+
jq_from_annotations create_genre_data >$DATADIR/genres.json &
87+
jq_from_annotations create_activity_data >$DATADIR/activity.json &
88+
# jq_from_annotations create_word_data >$DATADIR/words.json &
89+
wait %3
9290

93-
jq_from_activity stats_bookmarks_per_month >$DATADIR/stats/bookmarks_per_month.json &
94-
jq_from_activity stats_month >$DATADIR/stats/month.json &
95-
jq_from_activity stats_history >$DATADIR/history.json &
96-
wait %3
91+
jq_from_activity stats_bookmarks_per_month >$DATADIR/stats/bookmarks_per_month.json &
92+
jq_from_activity stats_month >$DATADIR/stats/month.json &
93+
jq_from_activity stats_history >$DATADIR/history.json &
94+
wait %3
9795

98-
_log "* Creating _pages/activity.txt"
99-
jq -r -L $_scriptdir \
100-
--slurpfile books $DATADIR/books.json \
101-
'include "annotations"; stats_history_text' $DATADIR/history.json 1>$OUTDIR/_includes/activity.txt &
102-
wait %1
96+
_log "* Creating _pages/activity.txt"
10397

104-
fi
105-
}
98+
jq -r -L $_scriptdir --slurpfile books $DATADIR/books.json 'include "annotations"; stats_history_text' \
99+
$DATADIR/history.json >$OUTDIR/_includes/activity.txt
106100

107-
_main
101+
fi

0 commit comments

Comments
 (0)