RConsortium / rconsortium_website

http://r-consortium.org/
1 stars 3 forks source link

URGENT: https://www.r-consortium.org/all-projects/call-for-proposals is broken #112

Closed HenrikBengtsson closed 2 months ago

HenrikBengtsson commented 2 months ago

The URL https://www.r-consortium.org/all-projects/call-for-proposals comes up first in search engines when searching for "R Consortium call for proposals". It is probably also used in recent Twitter, Mastodon, LinkedIn, ... announcements.

Since we have an on-going Call for Proposals, I think we should make this old URL work ASAP, e.g. have it redirect to the new https://r-consortium.org/all-projects/callforproposals.html URL.

HenrikBengtsson commented 2 months ago

Fixed by adding a YAML front matter with an aliases entry, cf. https://github.com/RConsortium/rconsortium_website/commit/02a0790fbc9234d0b007d2ad5dce8e6c99eca6a0;

---
aliases:
  - call-for-proposals
---
# The 2024 ISC Grant Program

...

This causes an "alias" page call-for-proposals/index.html to be created, a page whose URL is https://www.r-consortium.org/all-projects/call-for-proposals/index.html. The latter is also accessed via https://www.r-consortium.org/all-projects/call-for-proposals, which is our old URL for this page. The "alias" page, which is created by Quarto, is just a small HTML page with a JavaScript redirect;

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
  <title>Redirect</title>
  <script type="text/javascript">
    var redirects = {"":"../callforproposals.html"};
    var hash = window.location.hash.startsWith('#') ? window.location.hash.slice(1) : window.location.hash;
    var redirect = redirects[hash] || redirects[""] || "/";
    window.document.title = 'Redirect to  ' +  redirect;
    window.location.replace(redirect);
  </script>
</head>
<body>
</body>
</html>
jcasman commented 2 months ago

Confirmed this works from two different browsers and incognito window. Nice fix.