Fix Broken Links and Extra Redirects.#99
Conversation
There was a problem hiding this comment.
Pull request overview
This pull request fixes broken links and eliminates unnecessary redirects across the Subsurface website templates. The changes remove redundant language prefixes from URLs and ensure consistent use of trailing slashes on internal links, while also correcting several broken external links.
Changes:
- Removed
get_env("lang")prefix from all internal links to eliminate extra redirects - Added trailing slashes to internal links for consistency
- Fixed broken external links (library homepages, license files)
- Corrected email address and internationalized domain name encoding
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/web/templates/thanks.html | Removed language prefix from sponsoring link, added trailing slashes to external vendor links, converted internationalized domain to punycode |
| src/web/templates/release-changes.html | Added trailing slash to current-release link |
| src/web/templates/latest-release.html | Removed language prefix and added trailing slash to current-release link |
| src/web/templates/home.html | Removed language prefixes from multiple current-release and documentation links |
| src/web/templates/faq.html | Extensive updates removing language prefixes from all internal anchor links, fixed anchor mismatch (#macversion to #macversions) |
| src/web/templates/documentation.html | Removed language prefixes from all documentation section links |
| src/web/templates/data-deletion.html | Fixed incomplete email address (added missing .org domain) |
| src/web/templates/current-release.html | Removed language prefixes from latest-release and user-forum links |
| src/web/templates/credits.html | Updated Qt, libgit2, and Kirigami URLs to current locations and license file paths |
| src/web/templates/contribute.html | Removed language prefix from user-forum link |
| src/web/templates/base.html | Removed language prefixes from all navigation menu links, added trailing slashes to preconnect URLs |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
src/web/templates/base.html
Outdated
| <link rel="preconnect" href="https://fonts.googleapis.com/"> | ||
| <link rel="preconnect" href="https://fonts.gstatic.com/" crossorigin> |
There was a problem hiding this comment.
Trailing slashes on preconnect URLs are unnecessary and non-standard. The rel="preconnect" attribute is used to establish early connections to origins (domains), not specific paths. The trailing slash suggests a path rather than an origin. According to the specification, preconnect should use origin URLs without path components. Consider reverting these URLs to their original form without trailing slashes: https://fonts.googleapis.com and https://fonts.gstatic.com.
| <link rel="preconnect" href="https://fonts.googleapis.com/"> | |
| <link rel="preconnect" href="https://fonts.gstatic.com/" crossorigin> | |
| <link rel="preconnect" href="https://fonts.googleapis.com"> | |
| <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin> |
Signed-off-by: Michael Keller <github@ike.ch>
7f8779a to
00e56eb
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 11 out of 11 changed files in this pull request and generated 5 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| </h1> | ||
| <p> | ||
| {{ _("A lot has happend in the 14 months between the 5.0.10 release of Subsurface and the end of 2023 - including the realization that our old approach to releasing the software wasn't working for us anymore. As a result we decided to attempt a different approach; instead of formal releases every few months with a cumbersome, manual process, we are switching to pointing our users at far more <a %(crelease)s>frequent and regular, automated builds</a> instead.", crelease="href=/current-release") }} | ||
| {{ _("A lot has happend in the 14 months between the 5.0.10 release of Subsurface and the end of 2023 - including the realization that our old approach to releasing the software wasn't working for us anymore. As a result we decided to attempt a different approach; instead of formal releases every few months with a cumbersome, manual process, we are switching to pointing our users at far more <a %(crelease)s>frequent and regular, automated builds</a> instead.", crelease="href=/current-release/") }} |
There was a problem hiding this comment.
The word "happend" is misspelled and should be "happened".
src/web/templates/faq.html
Outdated
| @@ -44,10 +44,10 @@ <h2 class="accordion-header" id="ossupport"> | |||
| {{ _("Subsurface runs on Windows 10 and newer, MacOS 10.15 and newer, and many flavors of Linux. Mobile versions of Subsurface are available for Android and iOS allow a portable platform for viewing your dive log and performing minor edits; depending on your OS/hardware comby, you may even be able to download dive data directly from your dive computer using Subsurface-mobile.") }} | |||
There was a problem hiding this comment.
The word "comby" appears to be a typo and should be "combination" or "combo".
src/web/templates/faq.html
Outdated
| <div class="accordion-body"> | ||
| <p> | ||
| {{ _("iOS users can simply install the Subsurface-mobile app that is available in iOS App Store. There is still an older version of Subsurface-mobile available in the Android Play Store, but because of the excessive bureaucracy and constantly changing rules and requirements associated with the Google Play store, we currently aren't able to update this package (and expect it to become unavailble at some point). To work around this, we have made an Android APK package available on our <a %(crelease)s>current release</a> page that can be side-loaded on most Android devices.", crelease="href="+get_env("lang")+"/current-release") }} | ||
| {{ _("iOS users can simply install the Subsurface-mobile app that is available in iOS App Store. There is still an older version of Subsurface-mobile available in the Android Play Store, but because of the excessive bureaucracy and constantly changing rules and requirements associated with the Google Play store, we currently aren't able to update this package (and expect it to become unavailble at some point). To work around this, we have made an Android APK package available on our <a %(crelease)s>current release</a> page that can be side-loaded on most Android devices.", crelease="href="+"/current-release/") }} |
There was a problem hiding this comment.
The word "unavailble" is misspelled and should be "unavailable".
| <button class="accordion-button collapsed" type="button" data-bs-toggle="collapse" | ||
| data-bs-target="#macversions_answer" aria-expanded="false" aria-controls="macversions_answer"> | ||
| <a href={{get_env("lang")+"/faq/#macversion"}}>{{ _("Supported Versions")}}</a> | ||
| <a href={{"/faq/#macversions"}}>{{ _("Supported Versions")}}</a> |
There was a problem hiding this comment.
The anchor fragment in the href appears to have an inconsistency. The href uses "#macversion" but the ID of the target element is "macversions" (with an 's'). This mismatch will cause the link to not work correctly.
src/web/templates/thanks.html
Outdated
| <li><a href="https://www.scuba.tech">Scuba.Tech</a></li> | ||
| <li><a href="http://www.heinrichsweikamp.com/">heinrichs weikamp</a></li> | ||
| <li><a href="http://www.shearwaterresearch.com/">Shearwater Research</a></li> | ||
| <li><a href="http://www.atomicaquatics.com/">Atomics Aquatics</a></li> |
There was a problem hiding this comment.
The text "Atomics Aquatics" appears to be misspelled. The company name is typically "Atomic Aquatics" (without the 's' in "Atomics").
| <li><a href="http://www.atomicaquatics.com/">Atomics Aquatics</a></li> | |
| <li><a href="http://www.atomicaquatics.com/">Atomic Aquatics</a></li> |
00e56eb to
181976e
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 11 out of 11 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
src/web/templates/home.html
Outdated
| <div class="col-md-6 col-12"> | ||
| <p> | ||
| {{ _("One of the major strengths of Subsurface is its support of a wide range of <strong>dive computers</strong> (see the <a %(link)s>list of supported dive computers</a>). Subsurface can also import existing dive logs from several sources including MacDive, Suunto DM3, DM4 & DM5, JDiveLog and divelogs.de.", link="href="+get_env("lang")+"/documentation/supported-dive-computers") }} | ||
| {{ _("One of the major strengths of Subsurface is its support of a wide range of <strong>dive computers</strong> (see the <a %(link)s>list of supported dive computers</a>). Subsurface can also import existing dive logs from several sources including MacDive, Suunto DM3, DM4 & DM5, JDiveLog and divelogs.de.", link="href="+"/documentation/supported-dive-computers/") }} |
There was a problem hiding this comment.
This link still points at "/documentation/supported-dive-computers/", which is handled by the redirector (strips the "/documentation" prefix). That adds an avoidable redirect and is inconsistent with the direct route "/supported-dive-computers/" used elsewhere (e.g., documentation.html). Update the href to point directly at "/supported-dive-computers/" to eliminate the extra hop.
src/web/templates/faq.html
Outdated
| <div class="accordion-body"> | ||
| <p> | ||
| {{ _("Support for the IrDA protocol has been removed from most major operating systems. Where it still exists it is limited to the use through additional drivers. Since Subsurface does not implement its own IrDA stack, this means that support for IrDA based dive computers in Subsurface is very limited. See <a %(usermanual)s>this section of the User Manual</a> for more details on possible workarounds.", usermanual="href="+get_env("lang")+"/subsurface-user-manual#S_ImportingIrDA") }} | ||
| {{ _("Support for the IrDA protocol has been removed from most major operating systems. Where it still exists it is limited to the use through additional drivers. Since Subsurface does not implement its own IrDA stack, this means that support for IrDA based dive computers in Subsurface is very limited. See <a %(usermanual)s>this section of the User Manual</a> for more details on possible workarounds.", usermanual="href="+"/subsurface-user-manual#S_ImportingIrDA") }} |
There was a problem hiding this comment.
This link uses "/subsurface-user-manual#S_ImportingIrDA" (missing the trailing slash). The app route is registered at "/subsurface-user-manual/", so this will incur an automatic redirect. Use "/subsurface-user-manual/#S_ImportingIrDA" to avoid the redirect and keep URLs consistent with the rest of the PR.
… slashes.
This commit addresses two related issues that were causing redirect chains:
1. Remove hardcoded language prefixes from all internal links
- Change get_env("lang")+"/page" to just "/page/"
- Language is now handled via cookies and request handlers, not URL paths
- Eliminates 302 redirects from the redirector() function
2. Add trailing slashes to all internal page links
- All Flask routes are defined with trailing slashes
- Links without trailing slashes caused Flask to issue redirects
- Now all links match Flask route definitions exactly
These changes eliminate 2-3 unnecessary HTTP redirects per page navigation,
significantly improving performance and user experience.
Signed-off-by: Michael Keller <github@ike.ch>
181976e to
46a25f9
Compare
Fix some problems with the website: