Skip to content

Commit 6625f23

Browse files
authored
Digital Bookshelf V2 (#2866)
Since I was annoyed at not being able to use [jekyll-archives](https://github.com/jekyll/jekyll-archives) to create an archive for the books, I decided to implement myself the [jekyll-archives-v2](https://github.com/george-gca/jekyll-archives-v2) that doesn't have this limitation. Closes #923. --------- Signed-off-by: George Araújo <[email protected]>
1 parent 14aaf47 commit 6625f23

21 files changed

+537
-155
lines changed

.github/workflows/broken-links.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,4 +49,4 @@ jobs:
4949
with:
5050
fail: true
5151
# removed md files that include liquid tags
52-
args: --user-agent 'curl/7.54' --exclude-path README.md --exclude-path _pages/404.md --exclude-path _pages/blog.md --exclude-path _posts/2018-12-22-distill.md --exclude-path _posts/2023-04-24-videos.md --verbose --no-progress './**/*.md' './**/*.html'
52+
args: --user-agent 'curl/7.54' --exclude-path README.md --exclude-path _pages/404.md --exclude-path _pages/blog.md --exclude-path _posts/2018-12-22-distill.md --exclude-path _posts/2023-04-24-videos.md --exclude-path _books/the_godfather.md --verbose --no-progress './**/*.md' './**/*.html'

CUSTOMIZE.md

+10-6
Original file line numberDiff line numberDiff line change
@@ -59,10 +59,12 @@ You can create new pages by adding new Markdown files in the [\_pages](_pages/)
5959

6060
## Creating new blog posts
6161

62-
To create a new blog post, you can add a new Markdown file in the [\_posts](_posts/) directory. The [name of the file must follow](https://jekyllrb.com/docs/posts/#creating-posts) the format `YYYY-MM-DD-title.md`. The easiest way to do this is to copy an existing blog post and modify it. Note that some blog posts have optional fields in the [frontmatter](https://jekyllrb.com/docs/front-matter/) that are used to enable specific behaviors or functions.
62+
To create a new blog post, you can add a new Markdown file in the [\_posts](_posts/) directory, which is the [default location for posts in Jekyll](https://jekyllrb.com/docs/posts/). The [name of the file must follow](https://jekyllrb.com/docs/posts/#creating-posts) the format `YYYY-MM-DD-title.md`. The easiest way to do this is to copy an existing blog post and modify it. Note that some blog posts have optional fields in the [frontmatter](https://jekyllrb.com/docs/front-matter/) that are used to enable specific behaviors or functions.
6363

6464
If you want to create blog posts that are not ready to be published, but you want to track it with git, you can create a [\_drafts](https://jekyllrb.com/docs/posts/#drafts) directory and store them there.
6565

66+
Note that `posts` is also a collection, but it is a default collection created automatically by Jekyll. To access the posts, you can use the `site.posts` variable in your templates.
67+
6668
## Creating new projects
6769

6870
You can create new projects by adding new Markdown files in the [\_projects](_projects/) directory. The easiest way to do this is to copy an existing project and modify it.
@@ -73,10 +75,14 @@ You can add news in the about page by adding new Markdown files in the [\_news](
7375

7476
## Adding Collections
7577

76-
This Jekyll theme implements `collections` to let you break up your work into categories. The theme comes with two default collections: `news` and `projects`. Items from the `news` collection are automatically displayed on the home page. Items from the `projects` collection are displayed on a responsive grid on projects page.
78+
This Jekyll theme implements [collections](https://jekyllrb.com/docs/collections/) to let you break up your work into categories. The theme comes with three default collections: `news`, `projects`, and `books`. Items from the `news` collection are automatically displayed on the home page, while items from the `projects` collection are displayed on a responsive grid on projects page and items from the `books` collection are displayed on its own `bookshelf` page inside `submenus`.
7779

7880
You can easily create your own collections, apps, short stories, courses, or whatever your creative work is. To do this, edit the collections in the [\_config.yml](_config.yml) file, create a corresponding folder, and create a landing page for your collection, similar to [\_pages/projects.md](_pages/projects.md).
7981

82+
If you wish to create a collection with support for categories and tags, like the blog posts, you just need to add this collection to the `jekyll-archives` section of your [\_config.yml](_config.yml) file. You can check how this is done with the `books` collection. For more information about customizing the archives section or creating your own archives page, check the [jekyll-archives-v2 documentation](https://george-gca.github.io/jekyll-archives-v2/).
83+
84+
To access the collections, you can use the `site.COLLECTION_NAME` variable in your templates.
85+
8086
## Adding a new publication
8187

8288
To add publications create a new entry in the [\_bibliography/papers.bib](_bibliography/papers.bib) file. You can find the BibTeX entry of a publication in Google Scholar by clicking on the quotation marks below the publication title, then clicking on "BibTeX", or also in the conference page itself. By default, the publications will be sorted by year and the most recent will be displayed first. You can change this behavior and more in the `Jekyll Scholar` section in [\_config.yml](_config.yml) file.
@@ -183,11 +189,9 @@ You can also:
183189

184190
- delete [\_includes/latest_posts.liquid](_includes/latest_posts.liquid)
185191
- delete [\_includes/related_posts.liquid](_includes/related_posts.liquid)
186-
- delete [\_layouts/archive-category.liquid](_layouts/archive-category.liquid)
187-
- delete [\_layouts/archive-tag.liquid](_layouts/archive-tag.liquid)
188-
- delete [\_layouts/archive-year.liquid](_layouts/archive-year.liquid)
192+
- delete [\_layouts/archive.liquid](_layouts/archive.liquid) (unless you have a custom collection that uses it)
189193
- delete [\_plugins/external-posts.rb](_plugins/external-posts.rb)
190-
- remove the `jekyll-archives` gem from the [Gemfile](Gemfile) and the `plugins` section in [\_config.yml](_config.yml)
194+
- remove the `jekyll-archives-v2` gem from the [Gemfile](Gemfile) and the `plugins` section in [\_config.yml](_config.yml) (unless you have a custom collection that uses it)
191195
- remove the `classifier-reborn` gem from the [Gemfile](Gemfile)
192196

193197
### Removing the news section

Gemfile

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ gem 'jekyll'
44

55
# Core plugins that directly affect site building
66
group :jekyll_plugins do
7-
gem 'jekyll-archives'
7+
gem 'jekyll-archives-v2'
88
gem 'jekyll-email-protect'
99
gem 'jekyll-feed'
1010
gem 'jekyll-get-json'
@@ -32,7 +32,7 @@ group :other_plugins do
3232
gem 'httparty'
3333
gem 'observer' # used by jekyll-scholar
3434
gem 'ostruct' # used by jekyll-twitter-plugin
35-
gem 'terser' # used by jekyll-terser
35+
# gem 'terser' # used by jekyll-terser
3636
# gem 'unicode_utils' -- should be already installed by jekyll
3737
# gem 'webrick' -- should be already installed by jekyll
3838
end

Gemfile.lock

+42-25
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
GIT
22
remote: https://github.com/RobertoJBeltran/jekyll-terser.git
3-
revision: 2f737004fe4732b92021c84e4de71e6a8585ff01
3+
revision: 1085bf66d692799af09fe39f8162a1e6e42a3cc4
44
specs:
5-
jekyll-terser (0.2.2)
5+
jekyll-terser (0.2.3)
66
jekyll (>= 0.10.0)
77
terser (>= 1.0.0)
88

@@ -30,8 +30,13 @@ GEM
3030
latex-decode (~> 0.0)
3131
racc (~> 1.7)
3232
bigdecimal (3.1.9)
33-
citeproc (1.0.10)
33+
citeproc (1.1.0)
34+
date
35+
forwardable
36+
json
3437
namae (~> 1.0)
38+
observer (< 1.0)
39+
open-uri (< 1.0)
3540
citeproc-ruby (1.1.14)
3641
citeproc (~> 1.0, >= 1.0.9)
3742
csl (~> 1.6)
@@ -51,6 +56,7 @@ GEM
5156
addressable
5257
cssminify2 (2.0.1)
5358
csv (3.3.2)
59+
date (3.4.1)
5460
deep_merge (1.2.2)
5561
drb (2.2.1)
5662
em-websocket (0.5.3)
@@ -70,6 +76,7 @@ GEM
7076
ffi (1.17.1-x86_64-darwin)
7177
ffi (1.17.1-x86_64-linux-gnu)
7278
ffi (1.17.1-x86_64-linux-musl)
79+
forwardable (1.3.3)
7380
forwardable-extended (2.6.0)
7481
gemoji (4.1.0)
7582
google-protobuf (4.29.3)
@@ -96,25 +103,29 @@ GEM
96103
csv
97104
mini_mime (>= 1.0.0)
98105
multi_xml (>= 0.5.2)
99-
i18n (1.14.6)
106+
i18n (1.14.7)
100107
concurrent-ruby (~> 1.0)
101-
jekyll (4.3.4)
108+
jekyll (4.4.1)
102109
addressable (~> 2.4)
110+
base64 (~> 0.2)
103111
colorator (~> 1.0)
112+
csv (~> 3.0)
104113
em-websocket (~> 0.5)
105114
i18n (~> 1.0)
106115
jekyll-sass-converter (>= 2.0, < 4.0)
107116
jekyll-watch (~> 2.0)
117+
json (~> 2.6)
108118
kramdown (~> 2.3, >= 2.3.1)
109119
kramdown-parser-gfm (~> 1.0)
110120
liquid (~> 4.0)
111-
mercenary (>= 0.3.6, < 0.5)
121+
mercenary (~> 0.3, >= 0.3.6)
112122
pathutil (~> 0.9)
113123
rouge (>= 3.0, < 5.0)
114124
safe_yaml (~> 1.0)
115125
terminal-table (>= 1.8, < 4.0)
116126
webrick (~> 1.7)
117-
jekyll-archives (2.3.0)
127+
jekyll-archives-v2 (0.0.6)
128+
activesupport
118129
jekyll (>= 3.6, < 5.0)
119130
jekyll-email-protect (1.1.0)
120131
jekyll-feed (0.17.0)
@@ -136,8 +147,8 @@ GEM
136147
jekyll-paginate-v2 (3.0.0)
137148
jekyll (>= 3.0, < 5.0)
138149
jekyll-regex-replace (1.1.0)
139-
jekyll-sass-converter (3.0.0)
140-
sass-embedded (~> 1.54)
150+
jekyll-sass-converter (3.1.0)
151+
sass-embedded (~> 1.75)
141152
jekyll-scholar (7.1.3)
142153
bibtex-ruby (~> 6.0)
143154
citeproc-ruby (~> 1.0)
@@ -157,7 +168,7 @@ GEM
157168
gemoji (>= 3, < 5)
158169
html-pipeline (~> 2.2)
159170
jekyll (>= 3.0, < 5.0)
160-
json (2.9.1)
171+
json (2.10.1)
161172
json-minify (0.0.3)
162173
json (> 0)
163174
kramdown (2.5.1)
@@ -169,7 +180,7 @@ GEM
169180
listen (3.9.0)
170181
rb-fsevent (~> 0.10, >= 0.10.3)
171182
rb-inotify (~> 0.9, >= 0.9.10)
172-
logger (1.6.5)
183+
logger (1.6.6)
173184
loofah (2.24.0)
174185
crass (~> 1.0.2)
175186
nokogiri (>= 1.12.0)
@@ -198,6 +209,10 @@ GEM
198209
nokogiri (1.18.3-x86_64-linux-musl)
199210
racc (~> 1.4)
200211
observer (0.1.2)
212+
open-uri (0.5.0)
213+
stringio
214+
time
215+
uri
201216
ostruct (0.6.1)
202217
pathutil (0.16.2)
203218
forwardable-extended (~> 2.6)
@@ -207,37 +222,40 @@ GEM
207222
rb-fsevent (0.11.2)
208223
rb-inotify (0.11.1)
209224
ffi (~> 1.0)
210-
rexml (3.4.0)
225+
rexml (3.4.1)
211226
rouge (4.5.1)
212227
safe_yaml (1.0.5)
213-
sass-embedded (1.83.4-aarch64-linux-gnu)
228+
sass-embedded (1.85.1-aarch64-linux-gnu)
214229
google-protobuf (~> 4.29)
215-
sass-embedded (1.83.4-aarch64-linux-musl)
230+
sass-embedded (1.85.1-aarch64-linux-musl)
216231
google-protobuf (~> 4.29)
217-
sass-embedded (1.83.4-arm-linux-gnueabihf)
232+
sass-embedded (1.85.1-arm-linux-gnueabihf)
218233
google-protobuf (~> 4.29)
219-
sass-embedded (1.83.4-arm-linux-musleabihf)
234+
sass-embedded (1.85.1-arm-linux-musleabihf)
220235
google-protobuf (~> 4.29)
221-
sass-embedded (1.83.4-arm64-darwin)
236+
sass-embedded (1.85.1-arm64-darwin)
222237
google-protobuf (~> 4.29)
223-
sass-embedded (1.83.4-x86_64-darwin)
238+
sass-embedded (1.85.1-x86_64-darwin)
224239
google-protobuf (~> 4.29)
225-
sass-embedded (1.83.4-x86_64-linux-gnu)
240+
sass-embedded (1.85.1-x86_64-linux-gnu)
226241
google-protobuf (~> 4.29)
227-
sass-embedded (1.83.4-x86_64-linux-musl)
242+
sass-embedded (1.85.1-x86_64-linux-musl)
228243
google-protobuf (~> 4.29)
229244
sax-machine (1.3.2)
230245
securerandom (0.4.1)
246+
stringio (3.1.5)
231247
terminal-table (3.0.2)
232248
unicode-display_width (>= 1.1.1, < 3)
233-
terser (1.2.4)
249+
terser (1.2.5)
234250
execjs (>= 0.3.0, < 3)
251+
time (0.4.1)
252+
date
235253
tzinfo (2.0.6)
236254
concurrent-ruby (~> 1.0)
237255
uglifier (4.2.1)
238256
execjs (>= 0.3.0, < 3)
239257
unicode-display_width (2.6.0)
240-
uri (1.0.2)
258+
uri (1.0.3)
241259
webrick (1.9.1)
242260

243261
PLATFORMS
@@ -260,7 +278,7 @@ DEPENDENCIES
260278
feedjira
261279
httparty
262280
jekyll
263-
jekyll-archives
281+
jekyll-archives-v2
264282
jekyll-email-protect
265283
jekyll-feed
266284
jekyll-get-json
@@ -279,7 +297,6 @@ DEPENDENCIES
279297
jemoji
280298
observer
281299
ostruct
282-
terser
283300

284301
BUNDLED WITH
285-
2.6.2
302+
2.6.5

INSTALL.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ If you installed **al-folio** as described above, you can manually update your c
210210
# Assuming the current directory is <your-repo-name>
211211
$ git remote add upstream https://github.com/alshedivat/al-folio.git
212212
$ git fetch upstream
213-
$ git rebase v0.13.4
213+
$ git rebase v0.14.0
214214
```
215215

216216
If you have extensively customized a previous version, it might be trickier to upgrade.

_books/the_godfather.md

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
---
2+
layout: book-review
3+
title: The Godfather
4+
author: Mario Puzo
5+
cover: assets/img/book_covers/the_godfather.jpg
6+
olid: OL43499941M # use Open Library ID to fetch cover (if no `cover` is provided)
7+
isbn: 7539967447 # use ISBN to fetch cover (if no `olid` is provided, dashes are optional)
8+
categories: classics crime historical-fiction mystery novels thriller
9+
tags: top-100
10+
buy_link: https://www.amazon.com/Godfather-Deluxe-Mario-Puzo/dp/0593542592
11+
started: 2024-08-23
12+
finished: 2024-09-07
13+
released: 1969
14+
stars: 5
15+
goodreads_review: 6318556633
16+
status: Finished
17+
---
18+
19+
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Cras sollicitudin eros sit amet ante aliquet, sit amet vulputate lectus mattis. Aenean ullamcorper pretium nunc, sed egestas lorem elementum id. Nulla id mi id neque ultrices egestas ut in urna. Sed ac ultricies nunc. Nam convallis placerat urna id egestas. Nulla porta, est interdum vestibulum venenatis, lorem odio laoreet sapien, in pulvinar tellus eros a dolor. Vivamus sapien justo, ullamcorper a mi eget, scelerisque euismod nunc. In augue augue, ultrices a ornare non, tincidunt quis justo. Donec sit amet consectetur eros. Nullam neque leo, tincidunt id ipsum ac, volutpat lobortis mi. Phasellus consequat ultricies arcu, eu semper ligula ultrices eget. Ut in fringilla elit, ac tincidunt nisi.
20+
21+
Nunc commodo elit nec turpis feugiat consectetur. Nullam in nisi egestas, fermentum ligula hendrerit, euismod enim. Nulla eu hendrerit eros. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Proin et velit ante. Vestibulum pretium vitae quam et sagittis. Proin eu nunc vel velit accumsan eleifend. Nulla facilisis, diam tempus imperdiet ultrices, massa ipsum consequat orci, sed efficitur eros mi a felis. Cras lobortis turpis sem, sed lobortis nunc ullamcorper tristique. Nam vehicula rhoncus ante, in faucibus sapien scelerisque et. Donec semper libero et tincidunt mattis. In vestibulum, nulla pretium dictum commodo, risus nulla vestibulum felis, at tincidunt massa mi in odio. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.
22+
23+
Donec efficitur ultrices purus sit amet imperdiet. Nam consequat metus in erat sodales faucibus. Aliquam maximus fermentum nulla id finibus. Aliquam iaculis sed odio vel rutrum. Curabitur sed odio est. Praesent nec sollicitudin tortor. Praesent pharetra, turpis quis porttitor rhoncus, ante massa fringilla lacus, nec porttitor magna turpis vitae felis. Nullam tristique massa id odio imperdiet, nec sodales massa egestas. Proin nisi metus, euismod sed accumsan vitae, facilisis vel risus. Morbi suscipit auctor erat, nec viverra elit fringilla eu. Mauris congue, purus id tristique facilisis, felis nisi efficitur magna, eu consectetur augue sem vitae lacus. Aliquam erat volutpat. Cras at nibh ultricies, volutpat arcu vitae, dictum est. In ac dolor sagittis, egestas lectus et, semper nisl. Etiam consectetur purus vitae sapien porttitor auctor.
24+
25+
Nulla sit amet venenatis odio. Suspendisse ac lacus quis augue mollis tempus vel in lorem. Donec augue turpis, eleifend nec nibh eu, elementum dictum metus. Proin ut est ligula. Etiam vehicula facilisis metus, sit amet consectetur risus ullamcorper porttitor. In congue nibh quis sollicitudin iaculis. Donec a mollis lorem, non mollis lacus. Nulla et leo ex. Aliquam erat volutpat. Nam sit amet tincidunt mauris. Vivamus vitae est sit amet nisi semper egestas. Donec in diam pharetra, commodo diam vitae, imperdiet ligula. Cras iaculis ac diam eget vehicula. Proin suscipit ante enim, quis vehicula mi porta bibendum. Aliquam a diam porttitor, sollicitudin justo vitae, tempor odio.
26+
27+
Cras fermentum dignissim pretium. Donec quis turpis eu neque lacinia facilisis in sit amet nibh. Nulla non tortor ultricies, euismod est in, blandit nibh. Ut a neque metus. Sed convallis condimentum nibh quis finibus. Praesent aliquam sem iaculis eros maximus accumsan. Nulla venenatis mauris id aliquet maximus. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Proin at enim vitae ex porttitor vestibulum sed eget nibh. Suspendisse accumsan feugiat quam eget ultricies.

_config.yml

+11-12
Original file line numberDiff line numberDiff line change
@@ -144,14 +144,14 @@ newsletter:
144144
# -----------------------------------------------------------------------------
145145

146146
collections:
147+
books:
148+
output: true
147149
news:
148150
defaults:
149151
layout: post
150152
output: true
151-
permalink: /:collection/:title/
152153
projects:
153154
output: true
154-
permalink: /:collection/:title/
155155

156156
# -----------------------------------------------------------------------------
157157
# Jekyll settings
@@ -198,7 +198,7 @@ keep_files:
198198

199199
# Plug-ins
200200
plugins:
201-
- jekyll-archives
201+
- jekyll-archives-v2
202202
- jekyll-email-protect
203203
- jekyll-feed
204204
- jekyll-get-json
@@ -247,15 +247,14 @@ terser:
247247
# -----------------------------------------------------------------------------
248248

249249
jekyll-archives:
250-
enabled: [year, tags, categories] # enables year, tag and category archives (remove if you need to disable one of them).
251-
layouts:
252-
year: archive-year
253-
tag: archive-tag
254-
category: archive-category
255-
permalinks:
256-
year: "/blog/:year/"
257-
tag: "/blog/tag/:name/"
258-
category: "/blog/category/:name/"
250+
posts:
251+
enabled: [year, tags, categories] # enables year, tag and category archives (remove if you need to disable one of them).
252+
permalinks:
253+
year: "/blog/:year/"
254+
tags: "/blog/:type/:name/"
255+
categories: "/blog/:type/:name/"
256+
books:
257+
enabled: [year, tags, categories] # enables year, tag and category archives (remove if you need to disable one of them).
259258

260259
display_tags: ["formatting", "images", "links", "math", "code", "blockquotes"] # these tags will be displayed on the front page of your blog
261260
display_categories: ["external-services"] # these categories will be displayed on the front page of your blog

_layouts/archive-category.liquid

-30
This file was deleted.

0 commit comments

Comments
 (0)