jekyll-theme-modootoday 1.3.0 → 1.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +21 -1
- data/README.ko.md +3 -3
- data/README.md +3 -3
- data/_includes/modootoday/docs-extra/packages.html +6 -5
- data/_includes/modootoday/markdown/packages.html +22 -0
- data/_includes/modootoday/markdown/raw-body.html +10 -2
- data/_layouts/llms-full.html +2 -2
- data/_layouts/reference.html +11 -3
- data/_layouts/twin.html +5 -2
- data/_sass/modootoday/docs-extra/_page.scss +4 -3
- data/lib/modootoday/check/layouts/docs_extra.rb +3 -2
- data/lib/modootoday/check/twins.rb +14 -2
- metadata +2 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: ba068af52c4217d7469bbaf5d086362b4704281f9a3ce7b9a96ca826e66c6f11
|
|
4
|
+
data.tar.gz: ea56a35d36bbb798fabe491a206314227f6253f0228370f62330a3bb0f4aa040
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 9cb0516b1496e14dc54c91c99f08b490eb3b314f62e1946e647a02d9377f7f19331d3ac979ab483285a97b4322eedd28168b1cc7483ea798596d61578a1c2b2a
|
|
7
|
+
data.tar.gz: 33f345936a60b53e2097eb4a6177bf6490f43711143584fd361ad6caa2ac8a93497efa5ee8f9de85f44441195154ceefefd4f1048f0545c5dda8bc451f09f80d
|
data/CHANGELOG.md
CHANGED
|
@@ -6,6 +6,24 @@ The content rules have their own version header (`md-components v1`) in [RULES.m
|
|
|
6
6
|
|
|
7
7
|
## [Unreleased]
|
|
8
8
|
|
|
9
|
+
## [1.4.1] - 2026-10-31
|
|
10
|
+
|
|
11
|
+
### Fixed
|
|
12
|
+
|
|
13
|
+
- Markdown twins and `llms-full.txt` now include a `reference` page's `packages:` table as a Markdown table (with `packages_title`, before or after the body as `packages_position` sets, without the text when `packages_compact: true`); pipes in cells are escaped. `modootoday-check --twins` accepts that table around the byte-identical body. Pages without `packages:` are unchanged.
|
|
14
|
+
|
|
15
|
+
## [1.4.0] - 2026-10-31
|
|
16
|
+
|
|
17
|
+
### Added
|
|
18
|
+
|
|
19
|
+
- `reference` layout: `packages_compact: true` leaves out the `text` under each package name, for pages whose body already describes the packages, and `packages_position: after` puts the package table below the body (default `before`). The include takes `compact=true` as well.
|
|
20
|
+
|
|
21
|
+
### Fixed
|
|
22
|
+
|
|
23
|
+
- `reference` layout: GitHub alerts (`> [!TIP]` and the rest), badges, `kbd:` and figures in the body are converted as in the `doc` layout; before, they stayed as plain quotes and `modootoday-check` reported unconverted alert markers.
|
|
24
|
+
- Package table: the caption now sits inside the table border on wide screens (the border moved to a wrapper `div.mt-dx-pkgs`).
|
|
25
|
+
- Docs: the package table include is for your own layouts and HTML pages; Markdown pages set `packages:` in front matter, since `modootoday-check` rejects Liquid in page bodies.
|
|
26
|
+
|
|
9
27
|
## [1.3.0] - 2026-10-31
|
|
10
28
|
|
|
11
29
|
### Added
|
|
@@ -275,7 +293,9 @@ Internal development milestones, never released. They are all part of 1.0.0.
|
|
|
275
293
|
- Example: `sass.silence_deprecations: [import]` for Dart Sass; `llms.txt` per language generated instead of hand-written.
|
|
276
294
|
- Raw `<name>.md` copies in `_site` on GitHub Pages: caused by content files without front matter (rendered by `jekyll-optional-front-matter` and also copied). Front matter is now required and checked.
|
|
277
295
|
|
|
278
|
-
[Unreleased]: https://github.com/modootoday/jekyll-theme-modootoday/compare/v1.
|
|
296
|
+
[Unreleased]: https://github.com/modootoday/jekyll-theme-modootoday/compare/v1.4.1...HEAD
|
|
297
|
+
[1.4.1]: https://github.com/modootoday/jekyll-theme-modootoday/releases/tag/v1.4.1
|
|
298
|
+
[1.4.0]: https://github.com/modootoday/jekyll-theme-modootoday/releases/tag/v1.4.0
|
|
279
299
|
[1.3.0]: https://github.com/modootoday/jekyll-theme-modootoday/releases/tag/v1.3.0
|
|
280
300
|
[1.2.3]: https://github.com/modootoday/jekyll-theme-modootoday/releases/tag/v1.2.3
|
|
281
301
|
[1.2.2]: https://github.com/modootoday/jekyll-theme-modootoday/releases/tag/v1.2.2
|
data/README.ko.md
CHANGED
|
@@ -30,7 +30,7 @@ gem 방식(`theme:`):
|
|
|
30
30
|
|
|
31
31
|
```ruby
|
|
32
32
|
# Gemfile
|
|
33
|
-
gem "jekyll-theme-modootoday", "~> 1.
|
|
33
|
+
gem "jekyll-theme-modootoday", "~> 1.4"
|
|
34
34
|
```
|
|
35
35
|
|
|
36
36
|
```yaml
|
|
@@ -42,7 +42,7 @@ Gemfile 없이 GitHub Pages에서(`remote_theme:`):
|
|
|
42
42
|
|
|
43
43
|
```yaml
|
|
44
44
|
# _config.yml
|
|
45
|
-
remote_theme: modootoday/jekyll-theme-modootoday@v1.
|
|
45
|
+
remote_theme: modootoday/jekyll-theme-modootoday@v1.4.1
|
|
46
46
|
plugins:
|
|
47
47
|
- jekyll-remote-theme
|
|
48
48
|
```
|
|
@@ -53,7 +53,7 @@ plugins:
|
|
|
53
53
|
|
|
54
54
|
```sh
|
|
55
55
|
mkdir my-docs && cd my-docs
|
|
56
|
-
printf 'source "https://rubygems.org"\ngem "jekyll", "~> 4.4"\ngem "jekyll-theme-modootoday", "~> 1.
|
|
56
|
+
printf 'source "https://rubygems.org"\ngem "jekyll", "~> 4.4"\ngem "jekyll-theme-modootoday", "~> 1.4"\n' > Gemfile
|
|
57
57
|
printf 'theme: jekyll-theme-modootoday\nmarkdown: kramdown\nkramdown: {input: GFM}\nsass: {style: compressed, silence_deprecations: [import, global-builtin]}\n' > _config.yml
|
|
58
58
|
printf -- '---\nlayout: doc\ntitle: Home\n---\n# Hello\n\n> [!TIP]\n> Plain Markdown, styled.\n' > index.md
|
|
59
59
|
bundle install && bundle exec jekyll build
|
data/README.md
CHANGED
|
@@ -27,7 +27,7 @@ As a gem (`theme:`):
|
|
|
27
27
|
|
|
28
28
|
```ruby
|
|
29
29
|
# Gemfile
|
|
30
|
-
gem "jekyll-theme-modootoday", "~> 1.
|
|
30
|
+
gem "jekyll-theme-modootoday", "~> 1.4"
|
|
31
31
|
```
|
|
32
32
|
|
|
33
33
|
```yaml
|
|
@@ -39,7 +39,7 @@ On GitHub Pages without a Gemfile (`remote_theme:`):
|
|
|
39
39
|
|
|
40
40
|
```yaml
|
|
41
41
|
# _config.yml
|
|
42
|
-
remote_theme: modootoday/jekyll-theme-modootoday@v1.
|
|
42
|
+
remote_theme: modootoday/jekyll-theme-modootoday@v1.4.1
|
|
43
43
|
plugins:
|
|
44
44
|
- jekyll-remote-theme
|
|
45
45
|
```
|
|
@@ -50,7 +50,7 @@ Pin a tag or a commit. More options: [Install guide](https://modootoday.github.i
|
|
|
50
50
|
|
|
51
51
|
```sh
|
|
52
52
|
mkdir my-docs && cd my-docs
|
|
53
|
-
printf 'source "https://rubygems.org"\ngem "jekyll", "~> 4.4"\ngem "jekyll-theme-modootoday", "~> 1.
|
|
53
|
+
printf 'source "https://rubygems.org"\ngem "jekyll", "~> 4.4"\ngem "jekyll-theme-modootoday", "~> 1.4"\n' > Gemfile
|
|
54
54
|
printf 'theme: jekyll-theme-modootoday\nmarkdown: kramdown\nkramdown: {input: GFM}\nsass: {style: compressed, silence_deprecations: [import, global-builtin]}\n' > _config.yml
|
|
55
55
|
printf -- '---\nlayout: doc\ntitle: Home\n---\n# Hello\n\n> [!TIP]\n> Plain Markdown, styled.\n' > index.md
|
|
56
56
|
bundle install && bundle exec jekyll build
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
{%- include modootoday/i18n.html -%}
|
|
2
|
-
{%- comment -%}Package table: include.items is [{name, version, text, url, links: [{label, url}]}]; include.caption is optional
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
{%- comment -%}Package table: include.items is [{name, version, text, url, links: [{label, url}]}]; include.caption is optional;
|
|
3
|
+
compact=true leaves out each package's text (for pages whose body already describes the packages).
|
|
4
|
+
One row per package (the name is the row header, the text under it); rows stack into cards on narrow screens. CSS in docs-extra; the wrapper draws the border so the caption sits inside it.{%- endcomment -%}
|
|
5
|
+
<div class="mt-dx-pkgs"><table>
|
|
5
6
|
{%- if include.caption %}<caption>{{ include.caption }}</caption>{% endif %}
|
|
6
7
|
<thead><tr><th scope="col">{{ mt_t_layouts_name }}</th><th scope="col">{{ mt_t_layouts_version }}</th><th scope="col">{{ mt_t_layouts_links }}</th></tr></thead>
|
|
7
8
|
<tbody>
|
|
8
9
|
{%- for p in include.items %}
|
|
9
|
-
<tr id="{{ p.id | default: p.name | slugify }}"><th scope="row"><code>{% if p.url %}<a href="{% include modootoday/link.html url=p.url %}">{{ p.name }}</a>{% else %}{{ p.name }}{% endif %}</code>{% if p.text %}<span>{{ p.text | markdownify | remove: "<p>" | remove: "</p>" | strip }}</span>{% endif %}</th>
|
|
10
|
+
<tr id="{{ p.id | default: p.name | slugify }}"><th scope="row"><code>{% if p.url %}<a href="{% include modootoday/link.html url=p.url %}">{{ p.name }}</a>{% else %}{{ p.name }}{% endif %}</code>{% if p.text and include.compact != true %}<span>{{ p.text | markdownify | remove: "<p>" | remove: "</p>" | strip }}</span>{% endif %}</th>
|
|
10
11
|
<td data-label="{{ mt_t_layouts_version }}">{% if p.version %}<code>{{ p.version }}</code>{% endif %}</td>
|
|
11
12
|
<td data-label="{{ mt_t_layouts_links }}">{% if p.links.size > 0 %}<ul>{% for l in p.links %}<li><a href="{% include modootoday/link.html url=l.url %}"{% include modootoday/links/attrs.html on=l.new_window target=l.target url=l.url %}>{{ l.label }}</a></li>{% endfor %}</ul>{% endif %}</td></tr>
|
|
12
13
|
{%- endfor %}
|
|
13
14
|
</tbody>
|
|
14
|
-
</table>
|
|
15
|
+
</table></div>
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
{%- comment -%}md-components v1: the package table of include.page (reference layout, packages:) as Markdown, for the twin and
|
|
2
|
+
llms-full layouts. Optional bold packages_title line, then | Name | Version | Links |; the name links to url, its text follows
|
|
3
|
+
after ": " unless packages_compact; pipes are escaped and newlines become spaces. Ends with a newline. Empty without packages.{%- endcomment -%}
|
|
4
|
+
{%- assign _pp = include.page -%}
|
|
5
|
+
{%- if _pp.layout == "reference" and _pp.packages.size > 0 -%}
|
|
6
|
+
{%- include modootoday/i18n.html -%}
|
|
7
|
+
{%- assign _nl = "
|
|
8
|
+
" -%}
|
|
9
|
+
{%- if _pp.packages_title %}**{{ _pp.packages_title | replace: _nl, " " | replace: "|", "\|" }}**
|
|
10
|
+
|
|
11
|
+
{% endif -%}
|
|
12
|
+
| {{ mt_t_layouts_name }} | {{ mt_t_layouts_version }} | {{ mt_t_layouts_links }} |
|
|
13
|
+
| --- | --- | --- |
|
|
14
|
+
{% for p in _pp.packages -%}
|
|
15
|
+
{%- capture _n %}`{{ p.name }}`{% endcapture -%}
|
|
16
|
+
{%- if p.url %}{% capture _u %}{% include modootoday/link.html url=p.url %}{% endcapture %}{% assign _n = "[" | append: _n | append: "](" | append: _u | append: ")" %}{% endif -%}
|
|
17
|
+
{%- if p.text and _pp.packages_compact != true %}{% assign _n = _n | append: ": " | append: p.text %}{% endif -%}
|
|
18
|
+
{%- capture _ls %}{% for l in p.links %}{% unless forloop.first %}, {% endunless %}[{{ l.label }}]({% include modootoday/link.html url=l.url %}){% endfor %}{% endcapture -%}
|
|
19
|
+
{%- capture _v %}{% if p.version %}`{{ p.version }}`{% endif %}{% endcapture -%}
|
|
20
|
+
| {{ _n | replace: _nl, " " | replace: "|", "\|" }} | {{ _v | replace: "|", "\|" }} | {{ _ls | replace: _nl, " " | replace: "|", "\|" }} |
|
|
21
|
+
{% endfor -%}
|
|
22
|
+
{%- endif -%}
|
|
@@ -1,6 +1,14 @@
|
|
|
1
|
-
{%- comment -%}md-components v1: the source body of include.file (path relative to the current page), front matter removed. Used by the twin and llms-full layouts.
|
|
1
|
+
{%- comment -%}md-components v1: the source body of include.file (path relative to the current page), front matter removed. Used by the twin and llms-full layouts.
|
|
2
|
+
With include.page (the source page), a reference page's packages: table is added before the body, or after it with packages_position: after.{%- endcomment -%}
|
|
2
3
|
{%- capture _raw -%}{% include_relative {{ include.file }} %}{%- endcapture -%}
|
|
3
4
|
{%- assign _fm = _raw | split: "---" -%}
|
|
4
5
|
{%- assign _front = "---" | append: _fm[1] | append: "---
|
|
5
6
|
" -%}
|
|
6
|
-
{
|
|
7
|
+
{%- assign _body = _raw | remove_first: _front -%}
|
|
8
|
+
{%- capture _pkmd %}{% if include.page %}{% include modootoday/markdown/packages.html page=include.page %}{% endif %}{% endcapture -%}
|
|
9
|
+
{%- if _pkmd == "" -%}{{- _body -}}
|
|
10
|
+
{%- elsif include.page.packages_position == "after" -%}{{- _body }}
|
|
11
|
+
{{ _pkmd -}}
|
|
12
|
+
{%- else -%}{{- _pkmd }}
|
|
13
|
+
{{ _body -}}
|
|
14
|
+
{%- endif -%}
|
data/_layouts/llms-full.html
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
{%- comment -%}md-components v1 llms-full.txt: the source body of every page of this language under this directory, byte-for-byte, separated by a blank line. Use from a stub: front matter `layout: llms-full` only.{%- endcomment -%}
|
|
1
|
+
{%- comment -%}md-components v1 llms-full.txt: the source body of every page of this language under this directory, byte-for-byte (plus a reference page's packages: table as Markdown), separated by a blank line. Use from a stub: front matter `layout: llms-full` only.{%- endcomment -%}
|
|
2
2
|
{%- include modootoday/markdown/llms-pages.html -%}
|
|
3
3
|
{%- for _p in _llms_pages -%}
|
|
4
4
|
{%- assign _rel = _p.path | remove_first: _llms_dir -%}
|
|
5
5
|
{%- unless forloop.first %}
|
|
6
6
|
{% endunless -%}
|
|
7
|
-
{%- include modootoday/markdown/raw-body.html file=_rel -%}
|
|
7
|
+
{%- include modootoday/markdown/raw-body.html file=_rel page=_p -%}
|
|
8
8
|
{%- endfor -%}
|
data/_layouts/reference.html
CHANGED
|
@@ -6,7 +6,14 @@ mt_main: mt-dx mt-dx-reference
|
|
|
6
6
|
{%- comment -%}reference: an API or option reference. members: [{name, signature, text, since, deprecated, id, group}] become a contents
|
|
7
7
|
list and one section each (h2 with the name in code, the signature, the text, since / deprecated notes); the body comes first.
|
|
8
8
|
Opt-in: sidebar: true puts the contents in a sticky side column (members grouped by group, in order of first use; CSS only, a plain
|
|
9
|
-
list on narrow screens). packages: [{name, version, text, url, links: [{label, url}]}] adds a package table (packages.html) before the body
|
|
9
|
+
list on narrow screens). packages: [{name, version, text, url, links: [{label, url}]}] adds a package table (packages.html) before the body;
|
|
10
|
+
packages_position: after puts it after the body, packages_compact: true leaves out each package's text. The body converts GitHub alerts,
|
|
11
|
+
badges, kbd and figures like the doc layout (modootoday/markdown/components.html).{%- endcomment -%}
|
|
12
|
+
{%- include modootoday/config.html -%}
|
|
13
|
+
{%- assign _badges = mt_badges -%}{%- if page.badges == false -%}{%- assign _badges = false -%}{%- endif -%}{%- unless mt_components contains "badge" -%}{%- assign _badges = false -%}{%- endunless -%}
|
|
14
|
+
{%- assign _fig = false -%}{%- if mt_components contains "figure" -%}{%- assign _fig = true -%}{%- endif -%}
|
|
15
|
+
{%- assign _kbd = false -%}{%- if mt_components contains "kbd" -%}{%- assign _kbd = true -%}{%- endif -%}
|
|
16
|
+
{%- capture _pkgs %}{% if page.packages %}{% include modootoday/docs-extra/packages.html items=page.packages caption=page.packages_title compact=page.packages_compact %}{% endif %}{% endcapture -%}
|
|
10
17
|
<article aria-labelledby="mt-dx-title"{% if page.sidebar %} class="mt-dx-api"{% endif %}>
|
|
11
18
|
{%- include modootoday/docs-extra/head.html %}
|
|
12
19
|
{%- if page.sidebar and page.members.size > 0 %}
|
|
@@ -18,10 +25,11 @@ list on narrow screens). packages: [{name, version, text, url, links: [{label, u
|
|
|
18
25
|
{%- elsif page.members.size > 1 %}
|
|
19
26
|
<nav class="mt-dx-toc" aria-label="{{ mt_t_layouts_contents }}"><ul>{% for m in page.members %}<li><a href="#{{ m.id | default: m.name | slugify }}"><code>{{ m.name }}</code></a></li>{% endfor %}</ul></nav>
|
|
20
27
|
{%- endif %}
|
|
21
|
-
{%-
|
|
28
|
+
{%- unless page.packages_position == "after" %}{{ _pkgs }}{% endunless %}
|
|
22
29
|
<div class="mt-dx-body">
|
|
23
|
-
{
|
|
30
|
+
{% include modootoday/markdown/components.html content=content lang=page.lang badges=_badges figure=_fig kbd=_kbd %}
|
|
24
31
|
</div>
|
|
32
|
+
{%- if page.packages_position == "after" %}{{ _pkgs }}{% endif %}
|
|
25
33
|
{%- for m in page.members %}{% assign _id = m.id | default: m.name | slugify %}
|
|
26
34
|
<section class="mt-dx-member" id="{{ _id }}" aria-labelledby="{{ _id }}-h">
|
|
27
35
|
<h2 id="{{ _id }}-h"><code>{{ m.name }}</code></h2>
|
data/_layouts/twin.html
CHANGED
|
@@ -1,2 +1,5 @@
|
|
|
1
|
-
{%- comment -%}md-components v1 twin: outputs the source body of page.twin_of byte-for-byte.{%- endcomment -%}
|
|
2
|
-
{%-
|
|
1
|
+
{%- comment -%}md-components v1 twin: outputs the source body of page.twin_of byte-for-byte (a reference page's packages: table is added as Markdown).{%- endcomment -%}
|
|
2
|
+
{%- assign _tdir = page.path | split: "/" | pop | join: "/" -%}{%- if _tdir != "" -%}{%- assign _tdir = _tdir | append: "/" -%}{%- endif -%}
|
|
3
|
+
{%- assign _tpath = _tdir | append: page.twin_of -%}
|
|
4
|
+
{%- assign _tpage = site.pages | where: "path", _tpath | first -%}
|
|
5
|
+
{%- include modootoday/markdown/raw-body.html file=page.twin_of page=_tpage -%}
|
|
@@ -48,8 +48,9 @@
|
|
|
48
48
|
.mt-dx-api > .mt-dx-side { grid-column: 1; grid-row: 1 / span 999; align-self: start; position: sticky; top: 4.5rem; max-height: calc(100vh - 6rem); overflow-y: auto; padding-inline-end: .5rem; border-inline-end: 1px solid mt(border); }
|
|
49
49
|
.mt-dx-api > .mt-dx-side ul { margin-bottom: 0; }
|
|
50
50
|
}
|
|
51
|
-
.mt-dx-pkgs {
|
|
52
|
-
.mt-dx-pkgs
|
|
51
|
+
.mt-dx-pkgs { overflow-x: auto; margin-bottom: 2rem; border: 1px solid mt(border); border-radius: mt(radius-lg); }
|
|
52
|
+
.mt-dx-pkgs table { display: table; width: 100%; margin: 0; border: 0; border-radius: 0; }
|
|
53
|
+
.mt-dx-pkgs caption { padding: .75rem .9rem .5rem; font-weight: 600; text-align: start; }
|
|
53
54
|
.mt-dx-pkgs thead th { color: mt(muted-foreground); }
|
|
54
55
|
.mt-dx-pkgs tbody th { white-space: normal; background: none; font-size: inherit; font-weight: 400; }
|
|
55
56
|
.mt-dx-pkgs tr:last-child > th { border-bottom: 0; }
|
|
@@ -58,7 +59,7 @@
|
|
|
58
59
|
.mt-dx-pkgs ul { display: flex; flex-wrap: wrap; gap: .25rem .75rem; margin: 0; padding: 0; list-style: none; }
|
|
59
60
|
.mt-dx-pkgs li { margin: 0; }
|
|
60
61
|
@media (max-width: 39.99rem) {
|
|
61
|
-
.mt-dx-pkgs, .mt-dx-pkgs caption, .mt-dx-pkgs tbody, .mt-dx-pkgs tr, .mt-dx-pkgs th, .mt-dx-pkgs td { display: block; }
|
|
62
|
+
.mt-dx-pkgs table, .mt-dx-pkgs caption, .mt-dx-pkgs tbody, .mt-dx-pkgs tr, .mt-dx-pkgs th, .mt-dx-pkgs td { display: block; }
|
|
62
63
|
.mt-dx-pkgs thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
|
|
63
64
|
.mt-dx-pkgs tr { padding: .5rem .9rem; border-bottom: 1px solid mt(border); }
|
|
64
65
|
.mt-dx-pkgs tr:last-child { border-bottom: 0; }
|
|
@@ -17,10 +17,11 @@ module Modootoday
|
|
|
17
17
|
send(fm["layout"], errs, w, fm)
|
|
18
18
|
end
|
|
19
19
|
|
|
20
|
-
# members is required unless the page lists packages; sidebar:
|
|
20
|
+
# members is required unless the page lists packages; sidebar: and packages_compact: are true or false, packages_position: before or after; packages need a name, links a label and url.
|
|
21
21
|
def reference(errs, w, fm)
|
|
22
22
|
Shape.list(errs, w, "members", fm["members"], any: %w[name], optional: fm.key?("packages"))
|
|
23
|
-
errs << "#{w}:
|
|
23
|
+
%w[sidebar packages_compact].each { |k| errs << "#{w}: #{k} must be true or false" unless [nil, true, false].include?(fm[k]) }
|
|
24
|
+
Shape.one_of(errs, w, "packages_position", fm["packages_position"], %w[before after]) if fm.key?("packages_position")
|
|
24
25
|
Shape.list(errs, w, "packages", fm["packages"], any: %w[name]) do |p, i|
|
|
25
26
|
Shape.list(errs, w, "packages[#{i}].links", p["links"], any: %w[label]) do |l, j|
|
|
26
27
|
errs << "#{w}: packages[#{i}].links[#{j}].url is required" unless Shape.url?(l["url"])
|
|
@@ -6,6 +6,8 @@ module Modootoday
|
|
|
6
6
|
# (/index.md for index.md), byte-identical to its source body. It comes from a stub <name>.md.txt
|
|
7
7
|
# (layout: twin; works on GitHub Pages) or from the opt-in plugin (plugins: [jekyll-theme-modootoday]).
|
|
8
8
|
# With modootoday.twins: source, a page without front matter is its own twin at /<path>.md.
|
|
9
|
+
# A reference page's packages: table is added to its twin as Markdown, before the body (or after it with
|
|
10
|
+
# packages_position: after); the body itself must still be there byte-for-byte.
|
|
9
11
|
# llms.txt / llms-full.txt exist at / and at each /<lang>/; llms-full.txt contains every page body.
|
|
10
12
|
module Twins
|
|
11
13
|
HINT = "add a stub %s (front matter `layout: twin`, `twin_of`, `permalink`) or enable `plugins: [jekyll-theme-modootoday]` (not on classic GitHub Pages)"
|
|
@@ -43,10 +45,20 @@ module Modootoday
|
|
|
43
45
|
return
|
|
44
46
|
end
|
|
45
47
|
out = File.basename(r) == "index" ? "#{site}/#{r}.md" : "#{site}/#{r}/index.md"
|
|
46
|
-
|
|
48
|
+
src = File.read(f)
|
|
49
|
+
b = Markdown.body(src)
|
|
47
50
|
bodies[ctx.lang_of(r).to_s] << [rf, b]
|
|
48
51
|
return errs << "#{rf}: twin missing at #{out}: #{format(HINT, "#{rf}.txt")}" unless File.exist?(out)
|
|
49
|
-
|
|
52
|
+
tw = File.binread(out)
|
|
53
|
+
fm = (Markdown.fm(src) rescue {})
|
|
54
|
+
pk = fm["layout"] == "reference" && fm["packages"].is_a?(Array) && !fm["packages"].empty? ? fm["packages"] : nil
|
|
55
|
+
return errs << "#{out}: twin is not byte-identical to the body of #{rf}" unless pk || tw == b.b
|
|
56
|
+
return unless pk
|
|
57
|
+
after = fm["packages_position"] == "after"
|
|
58
|
+
ok = after ? tw.start_with?(b.b) : tw.end_with?(b.b)
|
|
59
|
+
names = pk.map { |x| x.is_a?(Hash) ? x["name"].to_s : "" }
|
|
60
|
+
ok &&= names.all? { |n| tw.include?("`#{n}`".b) }
|
|
61
|
+
errs << "#{out}: twin must be the body of #{rf} with its packages: table #{after ? 'after' : 'before'} it" unless ok
|
|
50
62
|
end
|
|
51
63
|
|
|
52
64
|
def llms(ctx, bodies)
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: jekyll-theme-modootoday
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.
|
|
4
|
+
version: 1.4.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- modootoday
|
|
@@ -134,6 +134,7 @@ files:
|
|
|
134
134
|
- _includes/modootoday/markdown/inline.html
|
|
135
135
|
- _includes/modootoday/markdown/lists.html
|
|
136
136
|
- _includes/modootoday/markdown/llms-pages.html
|
|
137
|
+
- _includes/modootoday/markdown/packages.html
|
|
137
138
|
- _includes/modootoday/markdown/raw-body.html
|
|
138
139
|
- _includes/modootoday/markdown/sections.html
|
|
139
140
|
- _includes/modootoday/markdown/split.html
|