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

Add individual pages for changelog versions #7117

Merged
merged 7 commits into from
Mar 8, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
23 changes: 23 additions & 0 deletions content/_ext/changelog_releases.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
require 'awestruct/page'

class ChangelogReleases

def initialize(release_line, changelog_path, limit_version_key)
@release_line = release_line
@changelog_path = changelog_path
@limit_version_key = limit_version_key # to compare versions, what's the latest released
end

def execute(site)
changelog_entries = site.changelogs[@release_line]

entry_template = Pathname.new(::Awestruct::Engine.instance.site.config.dir).join('_layouts/changelog_entry.html.haml')

changelog_entries.each do |changelog_entry|
page = site.engine.load_page(entry_template)
page.output_path = "/#{@changelog_path}/#{changelog_entry.version}/index.html"
page.release = changelog_entry
site.pages << page
end
end
end
3 changes: 3 additions & 0 deletions content/_ext/pipeline.rb
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@
extension Awestruct::IBeams::HandbookExtension.new(:devbook,
File.expand_path(File.dirname(__FILE__) + '/../doc/developer'))

extension ChangelogReleases.new('lts', 'changelog-stable', 'stable')
extension ChangelogReleases.new('weekly', 'changelog', 'latest')

transformer VersionSwitcher.new

extension Validator.new
Expand Down
20 changes: 20 additions & 0 deletions content/_layouts/changelog_entry.html.haml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
layout: changelog
show_ratings: true
has_rss: false
---

= partial('release-header.html.haml', :release => page.release)
-if page.release.changes and page.release.lts_changes and page.release.lts_baseline
%div
%strong
-# TODO figure out how to get rid of this
= "Changes since #{page.release.lts_baseline}:"
%ul.image
= partial('changelog-changes.html.haml', :changes => page.release.changes)
-if page.release.changes and page.release.lts_changes
%div
%strong
= "Notable changes since #{page.release.lts_predecessor}:"
%ul.image
= partial('changelog-changes.html.haml', :changes => page.release.lts_changes)