This is an automated email from the ASF dual-hosted git repository.

lukaszlenart pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/struts-site.git


The following commit(s) were added to refs/heads/main by this push:
     new 329586567 fix: point /announce.html at the newest announce-YYYY page 
(#317)
329586567 is described below

commit 329586567f016413eea2301f366b2fea5dbbeb96
Author: Lukasz Lenart <[email protected]>
AuthorDate: Sat Jul 25 09:28:12 2026 +0200

    fix: point /announce.html at the newest announce-YYYY page (#317)
    
    The redirect was hardcoded to /announce-2024.html, so it kept sending
    visitors to the 2024 announcements even though 2025 and 2026 pages exist.
    
    Add empty front matter to source/.htaccess so Jekyll renders Liquid in it,
    and resolve the target from the newest announce-* page at build time. No
    manual update is needed when a new year file is added; CLAUDE.md and the
    announcing-struts-release skill are updated to drop that step.
    
    Co-authored-by: Claude Opus 5 <[email protected]>
---
 .claude/skills/announcing-struts-release/SKILL.md | 5 +++--
 CLAUDE.md                                         | 4 ++--
 source/.htaccess                                  | 7 ++++++-
 3 files changed, 11 insertions(+), 5 deletions(-)

diff --git a/.claude/skills/announcing-struts-release/SKILL.md 
b/.claude/skills/announcing-struts-release/SKILL.md
index bda7f8f44..0060be0d7 100644
--- a/.claude/skills/announcing-struts-release/SKILL.md
+++ b/.claude/skills/announcing-struts-release/SKILL.md
@@ -42,8 +42,9 @@ Model PRs: #292 (6.9.0 GA), this skill was derived from the 
6.10.0 release.
    line and compare its `announce-YYYY` to the year of your new entry.** If 
they differ
    (the announcement crossed into a new year file), update the `announce-YYYY` 
part to the
    new year — the anchor itself is variable-driven. If they already match, no 
edit.
-   Note: a brand-new year file is the "New announcement year" task in 
CLAUDE.md — also
-   create `source/announce-YYYY.md` and update the `.htaccess` redirect.
+   Note: a brand-new year file is the "New announcement year" task in 
CLAUDE.md — just
+   create `source/announce-YYYY.md`; the `.htaccess` `/announce.html` redirect 
picks up
+   the newest year automatically.
 4. **`source/releases.md`** — move the now-superseded version of the **same 
line** into
    the **Prior Releases** table, newest first. Match the column widths and the
    vulnerability-cell style of the row above it (empty if no published 
bulletin).
diff --git a/CLAUDE.md b/CLAUDE.md
index 751afacd3..f90be1b05 100644
--- a/CLAUDE.md
+++ b/CLAUDE.md
@@ -28,7 +28,7 @@ bundle exec jekyll serve -w --trace --host 0.0.0.0
   - `_layouts/` - Page templates: `default`, `main-page`, `core-developers`, 
`maven-archetypes`
   - `_includes/` - Shared partials: `header.html`, `footer.html`
   - `_plugins/` - Custom Liquid tags (see below)
-  - `.htaccess` - Apache redirect rules (update when adding yearly 
announcement pages)
+  - `.htaccess` - Apache redirect rules (Liquid-processed, has empty front 
matter)
 - `_config.yml` - Jekyll config and site-wide version/release variables
 - `.asf.yaml` - ASF infrastructure config (deployment, notifications, branch 
protection)
 
@@ -87,6 +87,6 @@ Kramdown attribute syntax for Bootstrap classes:
 
 **New release**: Update version variables in `_config.yml`, add announcement 
entry to the current year's `announce-YYYY.md`, and move the now-superseded 
version into the **Prior Releases** table in `source/releases.md`.
 
-**New announcement year**: Create `source/announce-YYYY.md`, update the 
redirect in `source/.htaccess` (`RedirectMatch \/announce.html` line) to point 
to the new year.
+**New announcement year**: Create `source/announce-YYYY.md`. The 
`/announce.html` redirect in `source/.htaccess` resolves to the newest 
`announce-YYYY` page at build time, so it needs no manual update.
 
 **New security bulletin**: Add to `source/security/` directory.
\ No newline at end of file
diff --git a/source/.htaccess b/source/.htaccess
index 80cf212d2..41562793b 100644
--- a/source/.htaccess
+++ b/source/.htaccess
@@ -1,3 +1,6 @@
+---
+# Empty front matter, required so Jekyll renders the Liquid tags below
+---
 # This file is maintained at 
https://gitbox.apache.org/repos/asf?p=struts-site.git
 DirectoryIndex index.html
 
@@ -25,6 +28,8 @@ RedirectMatch \/2.*\/(.*)?                          
http://struts.apache.org/$1
 # page downloads.html was renamed to releases.html
 RedirectMatch \/downloads /releases
 
-RedirectMatch \/announce.html(#a[0-9]+)? /announce-2024.html$1
+# always points to the most recent announce-YYYY page, no manual update needed
+{% assign announcements = site.pages | where_exp: "page", "page.path contains 
'announce-'" | sort: "path" -%}
+RedirectMatch \/announce.html(#a[0-9]+)? {{ announcements.last.url }}$1
 
 ErrorDocument 404 /404

Reply via email to