Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

just-the-docs を 0.7.0 までアップデートする #1399

Merged
merged 5 commits into from
Jan 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
*.jekyll-metadata
.sass-cache
_site
Gemfile.lock
node_modules
.DS_Store
/vendor
10 changes: 8 additions & 2 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
source "https://rubygems.org"
gemspec

gem "jekyll-github-metadata", ">= 2.15"
gem "kramdown-parser-gfm"
gem "webrick", "~> 1.7"
gem "liquid-c", ">= 4.0.1"

gem "jekyll-github-metadata", ">= 2.15"

gem "jekyll-include-cache", group: :jekyll_plugins

gem "webrick", "~> 1.7"

gem "html-proofer", "~> 5.0", :group => :development
106 changes: 106 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
PATH
remote: .
specs:
just-the-docs (0.5.0)
jekyll (>= 3.8.5)
jekyll-seo-tag (>= 2.0)
rake (>= 12.3.1)

GEM
remote: https://rubygems.org/
specs:
addressable (2.8.4)
public_suffix (>= 2.0.2, < 6.0)
colorator (1.1.0)
concurrent-ruby (1.2.2)
em-websocket (0.5.3)
eventmachine (>= 0.12.9)
http_parser.rb (~> 0)
eventmachine (1.2.7)
faraday (2.7.4)
faraday-net_http (>= 2.0, < 3.1)
ruby2_keywords (>= 0.0.4)
faraday-net_http (3.0.2)
ffi (1.15.5)
forwardable-extended (2.6.0)
google-protobuf (3.22.3-arm64-darwin)
google-protobuf (3.22.3-x86_64-linux)
http_parser.rb (0.8.0)
i18n (1.12.0)
concurrent-ruby (~> 1.0)
jekyll (4.3.2)
addressable (~> 2.4)
colorator (~> 1.0)
em-websocket (~> 0.5)
i18n (~> 1.0)
jekyll-sass-converter (>= 2.0, < 4.0)
jekyll-watch (~> 2.0)
kramdown (~> 2.3, >= 2.3.1)
kramdown-parser-gfm (~> 1.0)
liquid (~> 4.0)
mercenary (>= 0.3.6, < 0.5)
pathutil (~> 0.9)
rouge (>= 3.0, < 5.0)
safe_yaml (~> 1.0)
terminal-table (>= 1.8, < 4.0)
webrick (~> 1.7)
jekyll-github-metadata (2.16.0)
jekyll (>= 3.4, < 5.0)
octokit (>= 4, < 7, != 4.4.0)
jekyll-sass-converter (3.0.0)
sass-embedded (~> 1.54)
jekyll-seo-tag (2.8.0)
jekyll (>= 3.8, < 5.0)
jekyll-watch (2.2.1)
listen (~> 3.0)
kramdown (2.4.0)
rexml
kramdown-parser-gfm (1.1.0)
kramdown (~> 2.0)
liquid (4.0.4)
liquid-c (4.0.1)
liquid (>= 3.0.0)
listen (3.8.0)
rb-fsevent (~> 0.10, >= 0.10.3)
rb-inotify (~> 0.9, >= 0.9.10)
mercenary (0.4.0)
octokit (6.1.1)
faraday (>= 1, < 3)
sawyer (~> 0.9)
pathutil (0.16.2)
forwardable-extended (~> 2.6)
public_suffix (5.0.1)
rake (13.0.6)
rb-fsevent (0.11.2)
rb-inotify (0.10.1)
ffi (~> 1.0)
rexml (3.2.5)
rouge (4.1.0)
ruby2_keywords (0.0.5)
safe_yaml (1.0.5)
sass-embedded (1.62.0-arm64-darwin)
google-protobuf (~> 3.21)
sass-embedded (1.62.0-x86_64-linux-gnu)
google-protobuf (~> 3.21)
sawyer (0.9.2)
addressable (>= 2.3.5)
faraday (>= 0.17.3, < 3)
terminal-table (3.0.2)
unicode-display_width (>= 1.1.1, < 3)
unicode-display_width (2.4.2)
webrick (1.8.1)

PLATFORMS
arm64-darwin-22
x86_64-linux

DEPENDENCIES
bundler (~> 2.4.6)
jekyll-github-metadata (>= 2.15)
just-the-docs!
kramdown-parser-gfm
liquid-c
webrick (~> 1.7)

BUNDLED WITH
2.4.6
38 changes: 26 additions & 12 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,24 +7,28 @@ source: _posts

permalink: pretty
exclude:
- "node_modules/"
# from https://github.com/jekyll/jekyll/blob/master/lib/site_template/_config.yml:
- .sass-cache/
- .jekyll-cache/
- Gemfile
- Gemfile.lock
- node_modules/
- vendor/
# specific to the theme website:
- bin/
- lib/
- "*.gemspec"
- "*.gem"
- "Gemfile"
- "Gemfile.lock"
- "package.json"
- "package-lock.json"
- LICENSE.txt
- package.json
- package-lock.json
- Rakefile
- README.md
- "script/"
- "LICENSE.txt"
- "lib/"
- "bin/"
- "README.md"
- "Rakefile"
- "docs/tests/"
- "*.tags"
- ".jekyll-cache"
- "post/.jekyll-cache"
- "vendor"
- Dockerfile

theme: just-the-docs

Expand Down Expand Up @@ -58,6 +62,9 @@ search:
# Supports true or false (default)
button: false

# For copy button on code
enable_copy_code_button: true

# To disable support for mermaid diagrams (https://mermaid-js.github.io/mermaid/),
# comment out the `mermaid` and `version` keys below
# By default, consuming the theme as a gem leaves mermaid disabled; it is opt-in
Expand All @@ -67,6 +74,12 @@ mermaid:
version: "9.1.6"
# Put any additional configuration, such as setting the theme, in _includes/mermaid_config.js
# See also docs/ui-components/code
# To load mermaid from a local library, also use the `path` key to specify the location of the library; e.g.
# for (v10+):
# path: "/assets/js/mermaid.esm.min.mjs"
# for (<v10):
# path: "/assets/js/mermaid.min.js"
# Note: copy both `mermaid.esm.min.mjs` (v10+) or `mermaid.min.js` (<v10) and the associated `.map` file from the specified version of `mermaid/dist` to `/assets/js/`.

# Enable or disable heading anchors
heading_anchors: true
Expand Down Expand Up @@ -138,6 +151,7 @@ ga_tracking_anonymize_ip: true # Use GDPR compliant Google Analytics settings (t

plugins:
- jekyll-seo-tag
- jekyll-include-cache

kramdown:
syntax_highlighter_opts:
Expand Down
48 changes: 28 additions & 20 deletions _includes/components/breadcrumbs.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,30 +3,38 @@
Depends on: page, site.
Results in: HTML for the breadcrumbs component.
Overwrites:
pages_list, parent_page, grandparent_page.
node, pages_list, parent_page, grandparent_page.
{%- endcomment -%}

{%- if page.url != "/" and page.parent -%}

{%- assign pages_list = site[page.collection]
| default: site.html_pages
| where_exp: "item", "item.title != nil"
| where_exp: "item", "item.has_children != nil" -%}

{%- if page.grand_parent -%}
{%- assign parent_page = pages_list
| where: "title", page.parent
| where: "parent", page.grand_parent
| first -%}
{%- assign grandparent_page = pages_list
| where: "title", page.grand_parent
| first -%}
{%- else -%}
{%- assign parent_page = pages_list
| where: "title", page.parent
| where_exp: "item", "item.parent == nil"
| first -%}
{%- endif -%}
{%- assign pages_list = site[page.collection] | default: site.html_pages -%}

{%- assign parent_page = nil -%}
{%- assign grandparent_page = nil -%}

{%- for node in pages_list -%}

{%- if node.has_children and page.grand_parent -%}

{%- if node.title == page.parent and node.parent == page.grand_parent -%}
{%- assign parent_page = node -%}
{%- endif -%}
{%- if node.title == page.grand_parent -%}
{%- assign grandparent_page = node -%}
{%- endif -%}
{%- if parent_page and grandparent_page -%}
{%- break -%}
{%- endif -%}

{%- elsif node.has_children and node.title == page.parent and node.parent == nil -%}

{%- assign parent_page = node -%}
{%- break -%}

{%- endif -%}

{%- endfor -%}

<nav aria-label="Breadcrumb" class="breadcrumb-nav">
<ol class="breadcrumb-nav-list">
Expand Down
75 changes: 75 additions & 0 deletions _includes/components/nav.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
{%- comment -%}
Include as: {%- include components/nav.html pages=pages -%}
Depends on: include.pages.
Results in: HTML for the navigation panel.
Includes:
sorted_pages.html
Overwrites:
nav_pages, first_level_pages, second_level_pages, third_level_pages,
node, children_list, child, grand_children_list, grand_child.
{%- endcomment -%}

{%- assign nav_pages = include.pages
| where_exp: "item", "item.title != nil"
| where_exp: "item", "item.nav_exclude != true" -%}

{%- include sorted_pages.html pages = nav_pages -%}

{%- comment -%}
It might be more efficient to sort the pages at each level separately.
{%- endcomment -%}

{%- assign first_level_pages = sorted_pages
| where_exp: "item", "item.parent == nil" -%}
{%- assign second_level_pages = sorted_pages
| where_exp: "item", "item.parent != nil"
| where_exp: "item", "item.grand_parent == nil" -%}
{%- assign third_level_pages = sorted_pages
| where_exp: "item", "item.grand_parent != nil" -%}

<ul class="nav-list">
{%- for node in first_level_pages -%}
<li class="nav-list-item">
{%- if node.has_children -%}
<button class="nav-list-expander btn-reset" aria-label="toggle items in {{ node.title }} category" aria-pressed="false">
<svg viewBox="0 0 24 24" aria-hidden="true"><use xlink:href="#svg-arrow-right"></use></svg>
</button>
{%- endif -%}
<a href="{{ node.url | relative_url }}" class="nav-list-link">{{ node.title }}</a>
{%- if node.has_children -%}
{%- assign children_list = second_level_pages
| where: "parent", node.title -%}
{%- if node.child_nav_order == 'desc' or node.child_nav_order == 'reversed' -%}
{%- assign children_list = children_list | reverse -%}
{%- endif -%}
<ul class="nav-list">
{%- for child in children_list -%}
<li class="nav-list-item">
{%- if child.has_children -%}
<button class="nav-list-expander btn-reset" aria-label="toggle items in {{ child.title }} category" aria-pressed="false">
<svg viewBox="0 0 24 24" aria-hidden="true"><use xlink:href="#svg-arrow-right"></use></svg>
</button>
{%- endif -%}
<a href="{{ child.url | relative_url }}" class="nav-list-link">{{ child.title }}</a>
{%- if child.has_children -%}
{%- assign grand_children_list = third_level_pages
| where: "parent", child.title
| where: "grand_parent", node.title -%}
{%- if child.child_nav_order == 'desc' or child.child_nav_order == 'reversed' -%}
{%- assign grand_children_list = grand_children_list | reverse -%}
{%- endif -%}
<ul class="nav-list">
{%- for grand_child in grand_children_list -%}
<li class="nav-list-item">
<a href="{{ grand_child.url | relative_url }}" class="nav-list-link">{{ grand_child.title }}</a>
</li>
{%- endfor -%}
</ul>
{%- endif -%}
</li>
{%- endfor -%}
</ul>
{%- endif -%}
</li>
{%- endfor -%}
</ul>
Loading