Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Bump jekyll-generator-single-source #1623

Merged
merged 29 commits into from
Nov 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
5209afe
Replace `page.version` with `page.release`
fabianrbz Jan 16, 2024
2738528
Simplify the way we boot the app
fabianrbz Jan 29, 2024
0da8180
Update docs with `page.release`
fabianrbz Jan 29, 2024
75ac216
Bump ruby version
fabianrbz Jan 29, 2024
c4e945e
Bump jekyll-generator-single-source
fabianrbz Jan 29, 2024
fdacee8
Fix site generation
fabianrbz Jan 29, 2024
1715272
Fix links after rebase
fabianrbz Jan 29, 2024
bdb63c6
bump jekyll-generator-single-source
fabianrbz Jan 31, 2024
aa8f4d7
Replace `page.version` with `page.release` in urls
fabianrbz Feb 1, 2024
4a05f56
Add 2.7.x nav file
fabianrbz Feb 1, 2024
cb3d5d4
Fix redirects
fabianrbz Feb 1, 2024
490d5c0
Make exe/build executable
fabianrbz Feb 1, 2024
d8392cd
Use page.release in links
fabianrbz Feb 22, 2024
6347224
Fix version alert
fabianrbz Feb 23, 2024
bca30a7
Fix link to latest version of a page
fabianrbz Feb 26, 2024
84a9bf6
Bump jekyll-generator-single-source
fabianrbz Nov 5, 2024
17dea10
Add missing release to nav files
fabianrbz Nov 5, 2024
a0bed31
Rename docs_nav_kuma_dev to docs_nav_kuma_2.10.x
fabianrbz Nov 5, 2024
d7df84b
Update versions.yml
fabianrbz Nov 5, 2024
5b69179
Replace page.version with page.release in links
fabianrbz Nov 5, 2024
bc0f381
Fix more links
fabianrbz Nov 5, 2024
4b054e8
Set the correct css classes if the page isn't the latest one
fabianrbz Nov 5, 2024
7087de8
Set the correct priorities to generators
fabianrbz Nov 5, 2024
fa3dde7
Rely on .ruby-version for setting up ruby in github actions
fabianrbz Nov 6, 2024
a20ef07
Fix specs
fabianrbz Nov 6, 2024
bdbbc2c
fix policy_yaml to support release and edition
lahabana Nov 7, 2024
a2f741c
more fixes to plugins
lahabana Nov 7, 2024
6947c11
Merge branch 'master' into refactor-version-is
lahabana Nov 7, 2024
6f2fbcc
ignore coreDNS for checklinks
lahabana Nov 7, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
3 changes: 2 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ jobs:
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
ruby-version: "3.1.2"
bundler-cache: true
- working-directory: jekyll-kuma-plugins
run: bundle install
Expand Down Expand Up @@ -58,6 +57,7 @@ jobs:
--exclude https://linux.die.net \
--exclude https://packages.konghq.com \
--exclude https://twitter.com \
--exclude https://coredns.io \
--max-connections-per-host=8 \
--max-response-body-size 100000000 \
--rate-limit 50 \
Expand All @@ -75,6 +75,7 @@ jobs:
--exclude https://linux.die.net \
--exclude https://packages.konghq.com \
--exclude https://twitter.com \
--exclude https://coredns.io \
--max-connections-per-host=8 \
--max-response-body-size 100000000 \
--rate-limit 50 \
Expand Down
2 changes: 1 addition & 1 deletion .ruby-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.1.2
3.2.2
17 changes: 6 additions & 11 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,15 @@ source 'https://rubygems.org'
gem 'jekyll', '~> 4.2'
gem 'liquid-c'
gem 'rouge', '3.30.0'
gem 'jekyll-generator-single-source'

group :jekyll_plugins do
gem 'jekyll-paginate-v2'
gem 'jekyll-last-modified-at'
gem 'jekyll-contentblocks'
gem 'jekyll-vite'
gem 'jekyll-generator-single-source'
gem 'jekyll-kuma-plugins', path: './jekyll-kuma-plugins'
end
gem 'jekyll-paginate-v2'
gem 'jekyll-last-modified-at'
gem 'jekyll-contentblocks'
gem 'jekyll-vite'
gem 'jekyll-kuma-plugins', path: './jekyll-kuma-plugins'

group :development do
# Webrick is no longer bundled with ruby 3
# https://github.com/jekyll/jekyll/issues/8523
gem "webrick", "~> 1.7"
gem 'byebug'
gem 'foreman'
end
Expand Down
4 changes: 2 additions & 2 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ GEM
webrick (~> 1.7)
jekyll-contentblocks (1.2.0)
jekyll
jekyll-generator-single-source (0.0.8)
jekyll-generator-single-source (0.0.15)
i18n (~> 1)
jekyll (>= 4.2, < 5.0)
jekyll-last-modified-at (1.3.0)
jekyll (>= 3.7, < 5.0)
Expand Down Expand Up @@ -132,7 +133,6 @@ DEPENDENCIES
liquid-c
rouge (= 3.30.0)
rspec
webrick (~> 1.7)

BUNDLED WITH
2.3.7
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@ install: ruby-version-check
bundle install

run: ruby-version-check
bundle exec foreman start
netlify dev

test:
bundle exec rspec

build: ruby-version-check
bundle exec jekyll build --config jekyll.yml --profile
exe/build

# Cleans up all temp files in the build.
# Run `make clean` locally whenever you're updating dependencies, or to help
Expand Down
4 changes: 2 additions & 2 deletions Procfile
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
netlify: npx netlify dev
jekyll: bundle exec jekyll serve --livereload --config jekyll-dev.yml
vite: bin/vite dev
jekyll: bin/jekyll-vite wait && bundle exec jekyll serve --livereload --config jekyll-dev.yml --profile
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
generate: true
assume_generated: true
release: 2.10.x
lahabana marked this conversation as resolved.
Show resolved Hide resolved
items:
- title: Introduction
group: true
Expand Down
1 change: 1 addition & 0 deletions app/_data/docs_nav_kuma_2.6.x.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
release: 2.6.x
generate: true
assume_generated: true
items:
Expand Down
1 change: 1 addition & 0 deletions app/_data/docs_nav_kuma_2.7.x.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
generate: true
assume_generated: true
release: 2.7.x
items:
- title: Introduction
group: true
Expand Down
1 change: 1 addition & 0 deletions app/_data/docs_nav_kuma_2.8.x.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
generate: true
assume_generated: true
release: 2.8.x
items:
- title: Introduction
group: true
Expand Down
1 change: 1 addition & 0 deletions app/_data/docs_nav_kuma_2.9.x.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
generate: true
assume_generated: true
release: 2.9.x
items:
- title: Introduction
group: true
Expand Down
5 changes: 3 additions & 2 deletions app/_data/versions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@
endOfLifeDate: "2025-10-22"
branch: release-2.9
- edition: kuma
version: preview
release: dev
version: 2.10.0
release: 2.10.x
label: dev
branch: master
2 changes: 1 addition & 1 deletion app/_includes/sidebar.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@
</div>
{%- endif %}

{% include sidebar_links.html nav_items=page.nav_items version=page.version depth=0 %}
{% include sidebar_links.html nav_items=page.nav_items release=page.release depth=0 %}
</aside>
2 changes: 1 addition & 1 deletion app/_includes/sidebar_group.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@
</button>

{% assign children_depth = depth | plus: 1 %}
{% include sidebar_links.html nav_items=item.items depth=children_depth cssClass='sidebar-group-items hidden' version=include.version %}
{% include sidebar_links.html nav_items=item.items depth=children_depth cssClass='sidebar-group-items hidden' release=include.release %}
</section>
4 changes: 2 additions & 2 deletions app/_includes/sidebar_link.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
{% assign current_page = page.url | remove: '.html' %}

{% if item.absolute_url %}{% assign url = item.url %}
{% else %}{% assign url = '/docs/' | append: include.version | append: item.url %}
{% else %}{% assign url = '/docs/' | append: include.release | append: item.url %}
{% endif %}
<a href="{{ url }}" class="sidebar-link {% if current_page == url %} active {% endif %}"{% if item.absolute_url %} target="_blank"{% endif %}>{{ item.text or item.title }}</a>

Expand All @@ -11,7 +11,7 @@
{% for sub_item in item.items %}
<li class="sidebar-sub-header">
{% if sub_item.absolute_url %}{% assign url = sub_item.url %}
{% else %}{% assign url = '/docs/' | append: include.version | append: sub_item.url %}
{% else %}{% assign url = '/docs/' | append: include.release | append: sub_item.url %}
{% endif %}

<a class="sidebar-link" href="{{ url }}"{% if sub_item.absolute_url %} target="_blank"{% endif %}>
Expand Down
4 changes: 2 additions & 2 deletions app/_includes/sidebar_links.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
{% for item in items %}
<li>
{% if item.group %}
{% include sidebar_group.html item=item depth=include.depth version=include.version %}
{% include sidebar_group.html item=item depth=include.depth release=include.release %}
{% else %}
{% include sidebar_link.html item=item version=include.version %}
{% include sidebar_link.html item=item release=include.release %}
{% endif %}
</li>
{% endfor %}
Expand Down
2 changes: 1 addition & 1 deletion app/_includes/snippets/install_kumactl.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ and extract the archive with `tar xvzf kuma-{{ page.latest_version }}.tar.gz`
{% endtab %}
{% endtabs %}

Once downloaded, you will find the contents of Kuma in the `kuma-{{ page.latest_version }}` folder. In this folder, you will find - among other files - the `bin` directory that stores the executables for Kuma, including the CLI client [`kumactl`](/docs/{{ page.version }}/explore/cli).
Once downloaded, you will find the contents of Kuma in the `kuma-{{ page.latest_version }}` folder. In this folder, you will find - among other files - the `bin` directory that stores the executables for Kuma, including the CLI client [`kumactl`](/docs/{{ page.release }}/explore/cli).

{% tip %}
**Note**: On Kubernetes - of all the Kuma binaries in the `bin` folder - we only need `kumactl`.
Expand Down
8 changes: 4 additions & 4 deletions app/_includes/snippets/install_os.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

You can start the control-plane with: `kuma-{{ page.latest_version }}/bin/kuma-cp run`

This example will run Kuma in `standalone` mode for a "flat" deployment, but there are more advanced {% if_version lte:2.1.x %}[deployment modes](/docs/{{ page.version }}/introduction/deployments){% endif_version %}{% if_version gte:2.2.x %}[deployment modes](/docs/{{ page.version }}/production/deployment/){% endif_version %} like "multi-zone".
This example will run Kuma in `standalone` mode for a "flat" deployment, but there are more advanced {% if_version lte:2.1.x %}[deployment modes](/docs/{{ page.release }}/introduction/deployments){% endif_version %}{% if_version gte:2.2.x %}[deployment modes](/docs/{{ page.release }}/production/deployment/){% endif_version %} like "multi-zone".

Check failure on line 31 in app/_includes/snippets/install_os.md

View workflow job for this annotation

GitHub Actions / Lint docs

[vale] reported by reviewdog 🐶 [Google.Quotes] Commas and periods go inside quotation marks. Raw Output: {"message": "[Google.Quotes] Commas and periods go inside quotation marks.", "location": {"path": "app/_includes/snippets/install_os.md", "range": {"start": {"line": 31, "column": 334}}}, "severity": "ERROR"}

We suggest adding the `kumactl` executable to your `PATH` so that it's always available in every working directory. Or - alternatively - you can also create link in `/usr/local/bin/` by executing:

Expand All @@ -37,7 +37,7 @@
```

{% tip %}
**Note**: By default this will run Kuma with a `memory` [store](/docs/{{ page.version }}/documentation/configuration), but for production you have to use a persistent storage like PostgreSQL by updating the `conf/kuma-cp.conf` file.
**Note**: By default this will run Kuma with a `memory` [store](/docs/{{ page.release }}/documentation/configuration), but for production you have to use a persistent storage like PostgreSQL by updating the `conf/kuma-cp.conf` file.
{% endtip %}

### Use Kuma
Expand Down Expand Up @@ -89,10 +89,10 @@
{% endtab %}
{% endtabs %}

You will notice that Kuma automatically creates a {% if_version lte:2.1.x %}[`Mesh`](/docs/{{ page.version }}/policies/mesh){% endif_version %}{% if_version gte:2.2.x %}[`Mesh`](/docs/{{ page.version }}/production/mesh/){% endif_version %} entity with name `default`.
You will notice that Kuma automatically creates a {% if_version lte:2.1.x %}[`Mesh`](/docs/{{ page.release }}/policies/mesh){% endif_version %}{% if_version gte:2.2.x %}[`Mesh`](/docs/{{ page.release }}/production/mesh/){% endif_version %} entity with name `default`.

### Quickstart

Congratulations! You have successfully installed Kuma 🚀.

In order to start using Kuma, it's time to check out the [quickstart guide for Universal](/docs/{{ page.version }}/quickstart/universal) deployments.
In order to start using Kuma, it's time to check out the [quickstart guide for Universal](/docs/{{ page.release }}/quickstart/universal) deployments.
2 changes: 1 addition & 1 deletion app/_includes/snippets/use_kuma_k8s.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,4 +78,4 @@ kumactl config control-planes add --name=XYZ --address=http://{address-to-kuma}:
{% endtab %}
{% endtabs %}

You will notice that Kuma automatically creates a {% if_version lte:2.1.x %}[`Mesh`](/docs/{{ page.version }}/policies/mesh){% endif_version %}{% if_version gte:2.2.x %}[`Mesh`](/docs/{{ page.version }}/production/mesh/){% endif_version %} entity with name `default`.
You will notice that Kuma automatically creates a {% if_version lte:2.1.x %}[`Mesh`](/docs/{{ page.release }}/policies/mesh){% endif_version %}{% if_version gte:2.2.x %}[`Mesh`](/docs/{{ page.release }}/production/mesh/){% endif_version %} entity with name `default`.
43 changes: 21 additions & 22 deletions app/_includes/version_alert.html
Original file line number Diff line number Diff line change
@@ -1,27 +1,26 @@
{% assign current_version = page.version %}
{% assign latest_version = site.data.latest_version.release %}
{% assign current_release = page.release %}
{% assign latest_release = site.data.latest_version.release %}
{% assign page_path = page.url | split: '/' | shift: 3 | join: '/' %}
{% assign latest_version_path = "docs/" | append: latest_version | append: '/' | append: page_path | append: '.md' %}
{% assign latest_page = site.pages | find: 'path', latest_version_path %}
{% assign latest_release_path = "/docs/" | append: latest_release | append: '/' | append: page_path %}
{% assign latest_page = site.pages | find: 'url', latest_release_path %}

{%- if current_version and current_version != site.data.latest_version.release -%}
<div class="version-alert">
<div class="custom-block warning">
<p class="custom-block-title">Careful!</p>
{% if current_version == 'dev' %}
<p>You are browsing documentation for the next version of {{ site.title }}. Use this version at your own risk.</p>
{% else %}
<p>You are browsing documentation for a version of {{ site.title }} that is not the latest release.</p>
{% endif %}
{% if current_release %}
{% unless current_release.latest? %}
<div class="version-alert">
<div class="custom-block warning">
<p class="custom-block-title">Careful!</p>
{% if current_release.label == 'dev' %}
<p>You are browsing documentation for the next version of {{ site.title }}. Use this version at your own risk.</p>
{% else %}
<p>You are browsing documentation for a version of {{ site.title }} that is not the latest release.</p>
{% endif %}

{% if latest_page != nil %}
<p>
<a href="/docs/latest/{{ page_path }}">Go here</a> to browse the documentation for the latest version.
</p>
{% endif %}
{% if current_version != 'dev' %}
<p>Looking for even older versions? <a href="{% post_url 2021-04-16-website-reorg %}">Learn more</a>.</p>
{% endif %}
{% if latest_page != nil %}
<p>
<a href="/docs/latest/{{ page_path }}">Go here</a> to browse the documentation for the latest version.
</p>
{% endif %}
</div>
</div>
</div>
{% endunless -%}
{% endif -%}
17 changes: 12 additions & 5 deletions app/_includes/version_selector.html
Original file line number Diff line number Diff line change
@@ -1,15 +1,22 @@
{% assign current_version = page.version %}
{% assign current_release = page.release %}

<select name="{{ include.name }}" class="version-selector" id="version-selector">
{% for version in site.data.versions %}
{% assign option_value = version.release %}
{% if version == site.data.latest_version %}
{% assign option_value = 'latest' %}
{% endif %}
<option value="{{ option_value }}" {% if version.release == current_version %} selected {% endif %}>
{{ version.release }}
{% if version == site.data.latest_version %}
(latest)
{% if version.label %}
{% assign option_value = version.label %}
{% endif %}
<option value="{{ option_value }}" {% if version.release == current_release.value %} selected {% endif %}>
{% if version.label %}
{{ version.label }}
{% else %}
{{ version.release }}
{% if version == site.data.latest_version %}
(latest)
{% endif %}
{% endif %}
</option>
{% endfor %}
Expand Down
6 changes: 3 additions & 3 deletions app/_layouts/default.html
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@
{% if page.doc %}
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/docsearch.js@2/dist/cdn/docsearch.min.css"/>
<meta name="docsearch:section" content="docs">
<meta name="docsearch:docsversion" content="{{ page.version }}">
<meta name="docsearch:docsversion" content="{{ page.release }}">

{% if page.version != site.data.latest_version.release %}
{% unless page.release.latest? %}
lahabana marked this conversation as resolved.
Show resolved Hide resolved
<meta name="robots" content="noindex,follow">
{% endif %}
{% endunless %}
{% endif %}

{% unless page.id == 'page-404' %}
Expand Down
10 changes: 5 additions & 5 deletions app/_layouts/install.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ <h1>Install {{ site.title }}</h1>
{% include version_selector.html name="version_selector "%}

<div class="version-selector__version-notifier">
<p class="page-sub-title">You are viewing installation instructions for <strong>{{ page.version }}</strong>.</p>
<p><a href="/docs/changelog">Changelog</a> • <a href="/docs/{{ page.version }}/production/upgrades-tuning/upgrade-notes">Upgrade Path</a> • <a href="/community">Community</a></p>
<p class="page-sub-title">You are viewing installation instructions for <strong>{{ page.release }}</strong>.</p>
<p><a href="/docs/changelog">Changelog</a> • <a href="/docs/{{ page.release }}/production/upgrades-tuning/upgrade-notes">Upgrade Path</a> • <a href="/community">Community</a></p>
</div>

{% if page.version != site.data.latest_version.release %}
{% unless page.release.latest? %}
<div class="version-alert">
<div class="warning custom-block">
<p class="custom-block-title">Careful!</p>
Expand All @@ -25,7 +25,7 @@ <h1>Install {{ site.title }}</h1>
<p>Looking for even older versions? <a href="{% post_url 2021-04-16-website-reorg %}">Learn more</a>.</p>
</div>
</div>
{% endif %}
{% endunless %}
</div>
</div>
</header>
Expand All @@ -36,7 +36,7 @@ <h1>Install {{ site.title }}</h1>
{% for item in page.cta %}
<li class="kuma-cta__item w-full sm:w-1/2 lg:w-1/3 px-4 mb-8">
<a
href='/docs/{{ page.version }}{{ item.slug }}/'
href='/docs/{{ page.release }}{{ item.slug }}/'
class="kuma-cta__item-link flex flex-wrap justify-center items-center"
>
<div class="kuma-cta__item-logo w-full sm:w-1/4 px-3">
Expand Down
6 changes: 3 additions & 3 deletions app/_layouts/page.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
{% capture classes -%}
theme-default-content
content__default
{% if page.version and page.version != site.data.latest_version.release %} with-alert{% endif %}
{% if page.release and page.release.latest? != true %} with-alert{% endif %}
{% if page.doc %} doc{% endif -%}
{%- endcapture %}

Expand Down Expand Up @@ -37,13 +37,13 @@ <h1 id="{{ page.title | downcase | replace: ' ', '-' }}">{{ page.title }}</h1>
{% if page.prev %}
<span class="prev">
<a class="prev" href="{% unless page.prev['absolute_url']%}/docs/{{ page.version }}{% endunless %}{{ page.prev['url'] }}">{{ page.prev['text'] }}</a>
<a class="prev" href="{% unless page.prev['absolute_url']%}/docs/{{ page.release }}{% endunless %}{{ page.prev['url'] }}">{{ page.prev['text'] }}</a>
</span>
{% endif %}

{% if page.next %}
<span class="next">
<a href="{% unless page.next['absolute_url']%}/docs/{{ page.version }}{% endunless %}{{ page.next['url'] }}">{{ page.next['text'] }}</a>
<a href="{% unless page.next['absolute_url']%}/docs/{{ page.release }}{% endunless %}{{ page.next['url'] }}">{{ page.next['text'] }}</a>
</span>
{% endif %}
Expand Down
6 changes: 3 additions & 3 deletions app/_plugins/generators/install_pages.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

module Jekyll
class InstallPages < Jekyll::Generator
priority :medium
priority :low

def generate(site)
latest_page = site.pages.detect { |p| p.relative_path == 'install/latest.md' }
latest_page.data['version'] = site.data['latest_version']['release']
latest_page.data['release'] = site.data['latest_version']['release']
latest_page.data['has_version'] = true

site.data['versions'].each do |version|
Expand All @@ -30,7 +30,7 @@ def initialize(site, version)
@data = SafeYAML.load(Regexp.last_match(1))
end

@data['version'] = version['release']
@data['release'] = version['release']
@data['has_version'] = true
end
end
Expand Down
Loading
Loading