Skip to content

Commit 15b57b7

Browse files
george-gcaOmidSa75
authored andcommitted
Digital Bookshelf V2 (alshedivat#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 alshedivat#923. --------- Signed-off-by: George Araújo <[email protected]>
1 parent 0ed788f commit 15b57b7

21 files changed

+537
-154
lines changed

.github/workflows/broken-links.yml

Lines changed: 1 addition & 1 deletion
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

Lines changed: 10 additions & 6 deletions
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

Lines changed: 2 additions & 2 deletions
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

Lines changed: 42 additions & 25 deletions
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)
@@ -172,7 +183,7 @@ GEM
172183
listen (3.9.0)
173184
rb-fsevent (~> 0.10, >= 0.10.3)
174185
rb-inotify (~> 0.9, >= 0.9.10)
175-
logger (1.6.5)
186+
logger (1.6.6)
176187
loofah (2.24.0)
177188
crass (~> 1.0.2)
178189
nokogiri (>= 1.12.0)
@@ -201,6 +212,10 @@ GEM
201212
nokogiri (1.18.3-x86_64-linux-musl)
202213
racc (~> 1.4)
203214
observer (0.1.2)
215+
open-uri (0.5.0)
216+
stringio
217+
time
218+
uri
204219
ostruct (0.6.1)
205220
pathutil (0.16.2)
206221
forwardable-extended (~> 2.6)
@@ -210,38 +225,41 @@ GEM
210225
rb-fsevent (0.11.2)
211226
rb-inotify (0.11.1)
212227
ffi (~> 1.0)
213-
rexml (3.4.0)
228+
rexml (3.4.1)
214229
rouge (4.5.1)
215230
rouge (4.5.1)
216231
safe_yaml (1.0.5)
217-
sass-embedded (1.83.4-aarch64-linux-gnu)
232+
sass-embedded (1.85.1-aarch64-linux-gnu)
218233
google-protobuf (~> 4.29)
219-
sass-embedded (1.83.4-aarch64-linux-musl)
234+
sass-embedded (1.85.1-aarch64-linux-musl)
220235
google-protobuf (~> 4.29)
221-
sass-embedded (1.83.4-arm-linux-gnueabihf)
236+
sass-embedded (1.85.1-arm-linux-gnueabihf)
222237
google-protobuf (~> 4.29)
223-
sass-embedded (1.83.4-arm-linux-musleabihf)
238+
sass-embedded (1.85.1-arm-linux-musleabihf)
224239
google-protobuf (~> 4.29)
225-
sass-embedded (1.83.4-arm64-darwin)
240+
sass-embedded (1.85.1-arm64-darwin)
226241
google-protobuf (~> 4.29)
227-
sass-embedded (1.83.4-x86_64-darwin)
242+
sass-embedded (1.85.1-x86_64-darwin)
228243
google-protobuf (~> 4.29)
229-
sass-embedded (1.83.4-x86_64-linux-gnu)
244+
sass-embedded (1.85.1-x86_64-linux-gnu)
230245
google-protobuf (~> 4.29)
231-
sass-embedded (1.83.4-x86_64-linux-musl)
246+
sass-embedded (1.85.1-x86_64-linux-musl)
232247
google-protobuf (~> 4.29)
233248
sax-machine (1.3.2)
234249
securerandom (0.4.1)
250+
stringio (3.1.5)
235251
terminal-table (3.0.2)
236252
unicode-display_width (>= 1.1.1, < 3)
237-
terser (1.2.4)
253+
terser (1.2.5)
238254
execjs (>= 0.3.0, < 3)
255+
time (0.4.1)
256+
date
239257
tzinfo (2.0.6)
240258
concurrent-ruby (~> 1.0)
241259
uglifier (4.2.1)
242260
execjs (>= 0.3.0, < 3)
243261
unicode-display_width (2.6.0)
244-
uri (1.0.2)
262+
uri (1.0.3)
245263
webrick (1.9.1)
246264

247265
PLATFORMS
@@ -263,7 +281,7 @@ DEPENDENCIES
263281
feedjira
264282
httparty
265283
jekyll
266-
jekyll-archives
284+
jekyll-archives-v2
267285
jekyll-email-protect
268286
jekyll-feed
269287
jekyll-get-json
@@ -282,7 +300,6 @@ DEPENDENCIES
282300
jemoji
283301
observer
284302
ostruct
285-
terser
286303

287304
BUNDLED WITH
288-
2.6.2
305+
2.6.5

INSTALL.md

Lines changed: 1 addition & 1 deletion
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

Lines changed: 27 additions & 0 deletions
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

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -188,11 +188,12 @@ newsletter:
188188
# -----------------------------------------------------------------------------
189189

190190
collections:
191+
books:
192+
output: true
191193
news:
192194
defaults:
193195
layout: post
194196
output: true
195-
permalink: /:collection/:title/
196197
projects:
197198
output: true
198199
permalink: /projects/:path/
@@ -245,7 +246,7 @@ keep_files:
245246

246247
# Plug-ins
247248
plugins:
248-
- jekyll-archives
249+
- jekyll-archives-v2
249250
- jekyll-email-protect
250251
- jekyll-feed
251252
- jekyll-get-json
@@ -294,15 +295,14 @@ terser:
294295
# -----------------------------------------------------------------------------
295296

296297
jekyll-archives:
297-
enabled: [year, tags, categories] # enables year, tag and category archives (remove if you need to disable one of them).
298-
layouts:
299-
year: archive-year
300-
tag: archive-tag
301-
category: archive-category
302-
permalinks:
303-
year: "/blog/:year/"
304-
tag: "/blog/tag/:name/"
305-
category: "/blog/category/:name/"
298+
posts:
299+
enabled: [year, tags, categories] # enables year, tag and category archives (remove if you need to disable one of them).
300+
permalinks:
301+
year: "/blog/:year/"
302+
tags: "/blog/:type/:name/"
303+
categories: "/blog/:type/:name/"
304+
books:
305+
enabled: [year, tags, categories] # enables year, tag and category archives (remove if you need to disable one of them).
306306

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

_layouts/archive-category.liquid

Lines changed: 0 additions & 30 deletions
This file was deleted.

0 commit comments

Comments
 (0)