From ce68d160b9f03052f80e2e063486a030305daee4 Mon Sep 17 00:00:00 2001 From: octospacc Date: Tue, 24 Jun 2025 18:17:54 +0200 Subject: [PATCH] Add some tomes & fully move loading to JavaScript with embed API --- _includes/header.html | 5 +- _includes/tome.json | 5 +- _layouts/index.html | 12 +++ _layouts/tome.html | 37 ++----- _tomes/en/smells-like-green-spirit/index.md | 9 ++ _tomes/en/smells-like-green-spirit/side-a.md | 6 ++ _tomes/en/smells-like-green-spirit/side-b.md | 6 ++ _tomes/en/the-promised-neverland/10.md | 13 +++ _tomes/en/the-promised-neverland/6.md | 13 +++ _tomes/en/the-promised-neverland/7.md | 13 +++ _tomes/en/the-promised-neverland/8.md | 13 +++ _tomes/en/the-promised-neverland/9.md | 13 +++ _tomes/en/welcome-to-the-nhk-manga/1.md | 12 +++ _tomes/en/welcome-to-the-nhk-manga/2.md | 12 +++ _tomes/en/welcome-to-the-nhk-manga/3.md | 12 +++ _tomes/en/welcome-to-the-nhk-manga/4.md | 12 +++ _tomes/en/welcome-to-the-nhk-manga/5.md | 12 +++ _tomes/en/welcome-to-the-nhk-manga/6.md | 12 +++ _tomes/en/welcome-to-the-nhk-manga/7.md | 12 +++ _tomes/en/welcome-to-the-nhk-manga/8.md | 12 +++ _tomes/en/welcome-to-the-nhk-manga/index.md | 11 +++ .../10-algebra-lineare.md | 2 +- ...regressione-analisi-statistica-dei-dati.md | 2 +- .../it/i-manga-delle-scienze/12-anatomia.md | 2 +- .../8-elettromagnetismo.md | 2 +- .../it/i-manga-delle-scienze/9-biochimica.md | 2 +- info.md | 13 +++ reader/autoload.js | 34 +++++++ reader/index.html | 96 +++++++++++-------- tomes.json | 4 +- 30 files changed, 333 insertions(+), 76 deletions(-) create mode 100644 _tomes/en/smells-like-green-spirit/index.md create mode 100644 _tomes/en/smells-like-green-spirit/side-a.md create mode 100644 _tomes/en/smells-like-green-spirit/side-b.md create mode 100644 _tomes/en/the-promised-neverland/10.md create mode 100644 _tomes/en/the-promised-neverland/6.md create mode 100644 _tomes/en/the-promised-neverland/7.md create mode 100644 _tomes/en/the-promised-neverland/8.md create mode 100644 _tomes/en/the-promised-neverland/9.md create mode 100644 _tomes/en/welcome-to-the-nhk-manga/1.md create mode 100644 _tomes/en/welcome-to-the-nhk-manga/2.md create mode 100644 _tomes/en/welcome-to-the-nhk-manga/3.md create mode 100644 _tomes/en/welcome-to-the-nhk-manga/4.md create mode 100644 _tomes/en/welcome-to-the-nhk-manga/5.md create mode 100644 _tomes/en/welcome-to-the-nhk-manga/6.md create mode 100644 _tomes/en/welcome-to-the-nhk-manga/7.md create mode 100644 _tomes/en/welcome-to-the-nhk-manga/8.md create mode 100644 _tomes/en/welcome-to-the-nhk-manga/index.md create mode 100644 info.md create mode 100644 reader/autoload.js diff --git a/_includes/header.html b/_includes/header.html index 03063e4..56f2bd2 100644 --- a/_includes/header.html +++ b/_includes/header.html @@ -1,7 +1,10 @@
\ No newline at end of file diff --git a/_includes/tome.json b/_includes/tome.json index 4f047a4..8b1ef8a 100644 --- a/_includes/tome.json +++ b/_includes/tome.json @@ -9,7 +9,10 @@ "folder": {{ tome-folder | jsonify }}, "file": {{ tome.file | jsonify }}, "chapters": {{ tome.chapters | jsonify }}, + "config": {{ site.extra | jsonify }}, {%- endif %} "locale": {{ tome-lang | jsonify }}, - "slug": {{ tome-id | jsonify }} + "slug": {{ tome-id | jsonify }}, + "isbn": {{ tome.isbn | jsonify }}, + "gbooks": {{ tome.gbooks | jsonify }} } \ No newline at end of file diff --git a/_layouts/index.html b/_layouts/index.html index 5516562..ca8b832 100644 --- a/_layouts/index.html +++ b/_layouts/index.html @@ -7,6 +7,10 @@ {%- include tome-id tome=page -%} {%- endcapture -%} {%- assign this-id = this-id | split: '/' | first | strip -%} + {%- capture is-page -%} + {%- assign tokens = page.path | split: '/' -%} + {%- if tokens.size == 1 and page.path != 'index.html' -%}true{%- else -%}false{%- endif -%} + {%- endcapture -%} {% if this-id == '' %} {{ site.name }} | {{ site.tagline }} @@ -24,6 +28,7 @@
+ {%- if is-page == 'false' -%} {% if this-id == '' %}

About site

{{ site.description }}

@@ -42,8 +47,14 @@ {% include tome-info.html %} {% endif %} + {% else %} +

{{ page.title }}

+
+ {{ page.content | markdownify }} + {% endif %}
+ {%- if is-page == 'false' -%}

Available tomes

@@ -81,6 +92,7 @@
+ {% endif %}
{% include footer.html %} diff --git a/_layouts/tome.html b/_layouts/tome.html index cfb99fa..6e68f73 100644 --- a/_layouts/tome.html +++ b/_layouts/tome.html @@ -1,9 +1,9 @@ - {%- capture id %}{% include tome-id tome=page %}{%- endcapture -%} + {%- capture this-id %}{% include tome-id tome=page %}{%- endcapture -%} + {%- capture parent -%}{%- include tome-parent tome=page key='title' -%}{%- endcapture -%} {%- capture title %}{% include tome-field tome=page field='title' %}{%- endcapture -%} - {%- capture folder %}{% include tome-field tome=page field='folder' %}{%- endcapture -%} {%- capture cover %}{% include tome-cover tome=page %}{%- endcapture -%} {{ title }} | {{ site.name }} @@ -11,12 +11,7 @@ {% include head.html %} - {% capture tome_json %}{% include tome.json tome=page full=true %}{% endcapture %} - {% capture embed %}{ - "page": {{ tome_json }}, - "extra": {{ site.extra | jsonify }} - }{% endcapture %} - + {% include header.html %} @@ -28,6 +23,11 @@

{{ title }}

{{ page.subtitle }}

+ {% if parent != '' %} + Part of + {{ parent }} + {% endif %} + Cover Cover @@ -51,11 +51,6 @@