Skip to content

Commit

Permalink
Merge branch 'main' into multi-level
Browse files Browse the repository at this point in the history
  • Loading branch information
mattxwang committed Apr 22, 2024
2 parents c744937 + a251382 commit 61a97d0
Show file tree
Hide file tree
Showing 14 changed files with 117 additions and 121 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
matrix:
jekyll-version: [3.9, 4.3]
os: [ ubuntu-latest, macos-latest, windows-latest ]
ruby-version: ["3.0", "3.1", "3.2"]
ruby-version: ["3.1", "3.2", "3.3"]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: "3.2"
ruby-version: "3.3"
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
cache-version: 0 # Increment this number if you need to re-download cached gems
- name: Setup Pages
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/publish-gem.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ jobs:

steps:
- uses: actions/checkout@v4
- name: Setup Ruby 3.2
- name: Setup Ruby 3.3
uses: ruby/setup-ruby@v1
with:
ruby-version: "3.2"
ruby-version: "3.3"

- name: Publish to GPR
run: |
Expand Down
14 changes: 12 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,21 @@ This website is built from the `HEAD` of the `main` branch of the theme reposito

Code changes to `main` that are *not* in the latest release:

- N/A
- Added: `nav_enabled` site, layout, and page-level variable to selectively show or hide the side/mobile menu by [@kevinlin1] in [#1441]. The minimal layout was reimplemented using this feature, and now has support for the site-wide search bar and auxiliary links.

Docs changes made since the latest release:

- N/A
- Docs: Explained the `nav_enabled` variables as an alternative to using the minimal layout [@kevinlin1] in [#1441].

## Release v0.8.2

Hi everyone! This patch release fixes a bug where a default layout with unrestricted `scope` (`path: ""`) breaks JavaScript functionality. Users who do not use a default layout with unrestricted `scope` should not be affected. This should be a straightforward upgrade for all users. Thank you to [@pdmosses] for triaging and fixing the bug!

### Bugfixes

- Fixed: Protect theme JS file from front matter default for layout by [@pdmosses] in [#1447]

[#1447]: https://github.com/just-the-docs/just-the-docs/pull/1447

## Release v0.8.1

Expand Down
32 changes: 16 additions & 16 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PATH
remote: .
specs:
just-the-docs (0.8.1)
just-the-docs (0.8.2)
jekyll (>= 3.8.5)
jekyll-include-cache
jekyll-seo-tag (>= 2.0)
Expand All @@ -14,15 +14,15 @@ GEM
addressable (2.8.6)
public_suffix (>= 2.0.2, < 6.0)
afm (0.2.2)
async (2.9.0)
async (2.10.2)
console (~> 1.10)
fiber-annotation
io-event (~> 1.5, >= 1.5.1)
timers (~> 4.1)
bigdecimal (3.1.7)
colorator (1.1.0)
concurrent-ruby (1.2.3)
console (1.23.5)
console (1.23.6)
fiber-annotation
fiber-local
json
Expand All @@ -40,9 +40,9 @@ GEM
fiber-annotation (0.2.0)
fiber-local (1.0.0)
forwardable-extended (2.6.0)
google-protobuf (4.26.0-arm64-darwin)
google-protobuf (4.26.1-arm64-darwin)
rake (>= 13)
google-protobuf (4.26.0-x86_64-linux)
google-protobuf (4.26.1-x86_64-linux)
rake (>= 13)
hashery (2.1.2)
html-proofer (5.0.8)
Expand Down Expand Up @@ -85,7 +85,7 @@ GEM
jekyll (>= 3.8, < 5.0)
jekyll-watch (2.2.1)
listen (~> 3.0)
json (2.7.1)
json (2.7.2)
kramdown (2.4.0)
rexml
kramdown-parser-gfm (1.1.0)
Expand All @@ -97,9 +97,9 @@ GEM
mercenary (0.4.0)
net-http (0.4.1)
uri
nokogiri (1.16.3-arm64-darwin)
nokogiri (1.16.4-arm64-darwin)
racc (~> 1.4)
nokogiri (1.16.3-x86_64-linux)
nokogiri (1.16.4-x86_64-linux)
racc (~> 1.4)
octokit (6.1.1)
faraday (>= 1, < 3)
Expand All @@ -112,20 +112,20 @@ GEM
hashery (~> 2.0)
ruby-rc4
ttfunk
public_suffix (5.0.4)
public_suffix (5.0.5)
racc (1.7.3)
rainbow (3.1.1)
rake (13.1.0)
rake (13.2.1)
rb-fsevent (0.11.2)
rb-inotify (0.10.1)
ffi (~> 1.0)
rexml (3.2.6)
rouge (4.2.0)
rouge (4.2.1)
ruby-rc4 (0.1.5)
safe_yaml (1.0.5)
sass-embedded (1.72.0-arm64-darwin)
sass-embedded (1.75.0-arm64-darwin)
google-protobuf (>= 3.25, < 5.0)
sass-embedded (1.72.0-x86_64-linux-gnu)
sass-embedded (1.75.0-x86_64-linux-gnu)
google-protobuf (>= 3.25, < 5.0)
sawyer (0.9.2)
addressable (>= 2.3.5)
Expand All @@ -144,8 +144,8 @@ GEM
zeitwerk (2.6.13)

PLATFORMS
arm64-darwin-22
x86_64-linux
arm64-darwin
x86_64-linux-gnu

DEPENDENCIES
bundler (>= 2.3.5)
Expand All @@ -155,4 +155,4 @@ DEPENDENCIES
just-the-docs!

BUNDLED WITH
2.4.19
2.5.9
6 changes: 5 additions & 1 deletion _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,10 @@ aux_links:
# Makes Aux links open in a new tab. Default is false
aux_links_new_tab: false

# Enable or disable the side/mobile menu globally
# Nav menu can also be selectively enabled or disabled using page variables or the minimal layout
nav_enabled: true

# Sort order for navigation links
# nav_sort: case_insensitive # default, equivalent to nil
nav_sort: case_sensitive # Capital letters sorted before lowercase
Expand All @@ -124,7 +128,7 @@ nav_error_report: true # default is false/nil.
liquid:
error_mode: strict
strict_filters: true

# Footer content
# appears at the bottom of every page's main content

Expand Down
8 changes: 7 additions & 1 deletion _layouts/default.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,13 @@
<body>
<a class="skip-to-main" href="#main-content">Skip to main content</a>
{% include icons/icons.html %}
{% include components/sidebar.html %}
{% if page.nav_enabled == true %}
{% include components/sidebar.html %}
{% elsif layout.nav_enabled == true and page.nav_enabled == nil %}
{% include components/sidebar.html %}
{% elsif site.nav_enabled != false and layout.nav_enabled == nil and page.nav_enabled == nil %}
{% include components/sidebar.html %}
{% endif %}
<div class="main" id="top">
{% include components/header.html %}
<div class="main-content-wrap">
Expand Down
34 changes: 3 additions & 31 deletions _layouts/minimal.html
Original file line number Diff line number Diff line change
@@ -1,34 +1,6 @@
---
layout: table_wrappers
layout: default
nav_enabled: false
---

<!DOCTYPE html>

<html lang="{{ site.lang | default: 'en-US' }}">
{% include head.html %}
<body>
<a class="skip-to-main" href="#main-content">Skip to main content</a>
{% include icons/icons.html %}
<div class="main-content-wrap" id="top">
{% include components/breadcrumbs.html %}
<div id="main-content" class="main-content" role="main">
{% if site.heading_anchors != false %}
{% include vendor/anchor_headings.html html=content beforeHeading="true" anchorBody="<svg viewBox=\"0 0 16 16\" aria-hidden=\"true\"><use xlink:href=\"#svg-link\"></use></svg>" anchorClass="anchor-heading" anchorAttrs="aria-labelledby=\"%html_id%\"" %}
{% else %}
{{ content }}
{% endif %}

{% if page.has_children == true and page.has_toc != false %}
{% include components/children_nav.html %}
{% endif %}

{% include components/footer.html %}

</div>
</div>

{% if site.mermaid %}
{% include components/mermaid.html %}
{% endif %}
</body>
</html>
{{ content }}
60 changes: 37 additions & 23 deletions _sass/layout.scss
Original file line number Diff line number Diff line change
Expand Up @@ -19,23 +19,48 @@
width: calc((100% - #{$nav-width + $content-width}) / 2 + #{$nav-width});
min-width: $nav-width;
}

& + .main {
@include mq(md) {
margin-left: $nav-width-md;
}

@include mq(lg) {
// stylelint-disable function-name-case
// disable for Max(), we want to use the CSS max() function
margin-left: Max(
#{$nav-width},
calc((100% - #{$nav-width + $content-width}) / 2 + #{$nav-width})
);
// stylelint-enable function-name-case
}

.main-header {
display: none;
background-color: $sidebar-color;

@include mq(md) {
display: flex;
background-color: $body-background-color;
}

&.nav-open {
display: block;

@include mq(md) {
display: flex;
}
}
}
}
}

.main {
margin: auto;

@include mq(md) {
position: relative;
max-width: $content-width;
margin-left: $nav-width-md;
}

@include mq(lg) {
// stylelint-disable function-name-case
// disable for Max(), we want to use the CSS max() function
margin-left: Max(
#{$nav-width},
calc((100% - #{$nav-width + $content-width}) / 2 + #{$nav-width})
);
// stylelint-enable function-name-case
}
}

Expand All @@ -53,23 +78,12 @@

.main-header {
z-index: 0;
display: none;
background-color: $sidebar-color;
border-bottom: $border $border-color;

@include mq(md) {
display: flex;
justify-content: space-between;
height: $header-height;
background-color: $body-background-color;
border-bottom: $border $border-color;
}

&.nav-open {
display: block;

@include mq(md) {
display: flex;
}
}
}

Expand Down
9 changes: 6 additions & 3 deletions assets/js/just-the-docs.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
---
layout: null
---
(function (jtd, undefined) {

Expand Down Expand Up @@ -555,12 +556,14 @@ function activateNav() {
// Document ready

jtd.onReady(function(){
initNav();
if (document.getElementById('site-nav')) {
initNav();
activateNav();
scrollNav();
}
{%- if site.search_enabled != false %}
initSearch();
{%- endif %}
activateNav();
scrollNav();
});

// Copy button on code
Expand Down
8 changes: 8 additions & 0 deletions docs/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,14 @@ aux_links:
aux_links_new_tab: false
```

## Navigation sidebar

```yaml
# Enable or disable the side/mobile menu globally
# Nav menu can also be selectively enabled or disabled using page variables or the minimal layout
nav_enabled: true
```

## Heading anchor links

```yaml
Expand Down
Loading

0 comments on commit 61a97d0

Please sign in to comment.