Skip to content

Commit

Permalink
fix: have changelog be global to the website (#1420)
Browse files Browse the repository at this point in the history
Signed-off-by: Charly Molter <charly.molter@konghq.com>
  • Loading branch information
lahabana authored Jul 18, 2023
1 parent 77bcdc0 commit 4c2db25
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 5 deletions.
4 changes: 3 additions & 1 deletion app/_data/docs_nav_kuma_2.1.x.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@ items:
- text: Enterprise
url: /introduction/enterprise/
- text: Release notes
url: /introduction/changelog/
url: /docs/changelog/
absolute_url: true
generate: false
- title: Install
group: true
items:
Expand Down
4 changes: 3 additions & 1 deletion app/_data/docs_nav_kuma_2.2.x.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@ items:
- text: Kuma requirements
url: /introduction/kuma-requirements/
- text: Release notes
url: /introduction/changelog/
url: /docs/changelog/
absolute_url: true
generate: false
- title: Kuma in Production
group: true
items:
Expand Down
4 changes: 3 additions & 1 deletion app/_data/docs_nav_kuma_2.3.x.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@ items:
- text: Kuma requirements
url: /introduction/kuma-requirements/
- text: Release notes
url: /introduction/changelog/
url: /docs/changelog/
absolute_url: true
generate: false
- title: Kuma in Production
group: true
items:
Expand Down
4 changes: 3 additions & 1 deletion app/_data/docs_nav_kuma_dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@ items:
- text: Kuma requirements
url: /introduction/kuma-requirements/
- text: Release notes
url: /introduction/changelog/
url: /docs/changelog/
absolute_url: true
generate: true
- title: Kuma in Production
group: true
items:
Expand Down
2 changes: 1 addition & 1 deletion app/_includes/version_alert.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
{% assign latest_version_path = "docs/" | append: latest_version | append: '/' | append: page_path | append: '.md' %}
{% assign latest_page = site.pages | find: 'path', latest_version_path %}

{% if current_version != site.data.latest_version.release %}
{% if current_version && current_version != site.data.latest_version.release %}
<div>
<div class="version-alert">
<div class="warning custom-block">
Expand Down
1 change: 1 addition & 0 deletions app/_plugins/generators/navigation_links.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ def generate(site)
site.pages.each_with_index do |page, index|
next unless page.relative_path.start_with? 'docs'
next if page.path == 'docs/index.md'
next unless page.data.key? 'nav_items'
# remove docs/<version>/ prefix and `.md` and the end
page_url = page.path.gsub(/docs\/[^\/]+\//, '/').gsub('.md', '/')

Expand Down
2 changes: 2 additions & 0 deletions app/_plugins/generators/versions.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ def generate(site)
site.pages.each do |page|
next unless page.url.start_with?('/docs/')
version_data = version_from_page_url(page.url, site.data['versions'])
page.data['nav_items'] = {}
next unless version_data
page.data['doc'] = true
page.data['has_version'] = true
page.data['version'] = version_data['release']
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
title: Release notes
no_version: true
---

{% embed raw/CHANGELOG.md %}

0 comments on commit 4c2db25

Please sign in to comment.