Skip to content

Redirect stale /downloads to /download/#35

Open
Copilot wants to merge 5 commits intomasterfrom
copilot/fix-downloads-folder-link
Open

Redirect stale /downloads to /download/#35
Copilot wants to merge 5 commits intomasterfrom
copilot/fix-downloads-folder-link

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 8, 2026

The downloads/README.md was being rendered by Jekyll as a page at /downloads, surfacing stale leftover content to users arriving via search engines. The canonical downloads page lives at /download/.

Changes

  • layout: nulldownloads/README.md is now a complete, self-contained HTML document. The <meta http-equiv="refresh"> and JS redirect both fire from <head> before any layout CSS/JS assets are requested.
  • Trailing slash — all redirect targets (JS replace, meta refresh, fallback link) point to /download/ to avoid an extra 301 hop on GitHub Pages.
  • Canonical link<link rel="canonical" href="/download/"> added in <head>.
  • Developer notes preserved — original folder documentation kept in an HTML comment at the bottom of the file, visible in the raw file and GitHub file view.
  • PDF files in downloads/ remain accessible at their existing paths.

Copilot AI linked an issue May 8, 2026 that may be closed by this pull request
Copilot AI changed the title [WIP] Fix stale downloads folder link Redirect stale /downloads to /download May 8, 2026
Copilot AI requested a review from butlerpd May 8, 2026 02:08
Copy link
Copy Markdown
Member

@butlerpd butlerpd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking at this directory, it does not in fact seem to be a legacy folder. In fact, it is the folder that contains all the artifacts that can be retrieved directly from the webpages. Thus it has a different purpose than the downloads page. The readme file is clearly meant to give developers information about the purpose of the folder and probably best not to remove that information.

What is not clear to me is why sasview.org/downloads renders as an actual page while attempts to access other directories, for example sasview.org/img thows a 404 error?

Somehow that readme information should be kept in a way that is obvious to developers navigating to the directory while throwing a 404 error for anyone attempting to navigate from the web to sasview.org/downloads though redirecting that to the links and download page works too. Not sure how one does that but...

Copy link
Copy Markdown
Contributor Author

Copilot AI commented May 8, 2026

Looking at this directory, it does not in fact seem to be a legacy folder. In fact, it is the folder that contains all the artifacts that can be retrieved directly from the webpages. Thus it has a dif...

Good point — I've restored the original developer notes back into the file (commit 1d8d5fc). The redirect (JS + meta refresh) fires immediately for web visitors so they land on /download, while developers browsing the repo on GitHub still see the full Markdown explanation of the folder's purpose.

As for why /downloads renders a page while /img gives a 404: Jekyll picks up README.md (and index.md) files inside a directory and renders them as the index page for that URL path. The img/ directory has no such file, so there's no page to serve and GitHub Pages returns 404. Now that downloads/README.md has a front matter block with a redirect, the behaviour is the same as before (a page is served), but visitors are immediately sent to the right place.

Copilot AI requested a review from butlerpd May 8, 2026 14:43
@butlerpd butlerpd marked this pull request as ready for review May 8, 2026 14:46
Copilot AI review requested due to automatic review settings May 8, 2026 14:46
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR addresses an unintended/stale /downloads page generated by Jekyll from downloads/README.md by turning that README into an immediate client-side redirect to the canonical /download downloads page.

Changes:

  • Added Jekyll front matter to downloads/README.md so it is rendered as a page.
  • Added an immediate redirect to /download (JS) with a meta refresh + clickable link fallback.
  • Preserved the original developer notes below the redirect content.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread downloads/README.md Outdated
Comment on lines +1 to +8
---
layout: page
title: Redirecting...
---

<script>window.location.replace("/download");</script>
<meta http-equiv="refresh" content="0; url=/download">
<p>This page has moved. Please <a href="/download">click here</a> if you are not redirected automatically.</p>
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot apply changes based on this feedback

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in ed27373. Switched to layout: null so the page is now a complete minimal HTML document — the <meta http-equiv="refresh"> and <script> redirect both fire from <head> before any layout assets are requested. The URL also now uses the trailing slash /download/ throughout to avoid the extra 301 hop. Developer notes are preserved in an HTML comment at the end of the file.

Comment thread downloads/README.md Outdated
butlerpd and others added 2 commits May 8, 2026 11:08
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Copy link
Copy Markdown
Member

@butlerpd butlerpd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this now looks good to me. Should be ready to merge

Copilot AI changed the title Redirect stale /downloads to /download Redirect stale /downloads to /download/ May 8, 2026
Copilot AI requested a review from butlerpd May 8, 2026 15:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

downloads folder stale

3 participants