cwa-website: Inconsistent use of absolute and relative paths to https://www.coronawarn.app

Where to find the issue

All of the website https://www.coronawarn.app.

Describe the issue

Website repository sources inconsistently use absolute and relative paths to refer to locations on https://www.coronawarn.app.

For instance in faq.json #who_can_help https://github.com/corona-warn-app/cwa-website/blob/44cf83c5d945f3c9a87b2846880b9f37e9b5af47/src/data/faq.json#L30

"The various feedback channels of the <a href='https://www.coronawarn.app/en/community/'>Corona-Warn-App-Community<a/> will help you with your questions about the open source project of the Corona-Warn-App."

uses the absolute path https://www.coronawarn.app/en/community/, whereas in a following article #how_to_contribute instead a relative path /en/community/ is used instead:

https://github.com/corona-warn-app/cwa-website/blob/44cf83c5d945f3c9a87b2846880b9f37e9b5af47/src/data/faq.json#L1674

"Collaboration within the community follows a defined code of conduct. You can find all the guidelines for participation <a href='/en/community/'>here</a>."

Consequence of using absolute paths

Using absolute paths to the https://www.coronawarn.app/ web in hyperlinks prevents portability. It means, for instance, that a local test (running npm start) on http://localhost:8000 or a cypress test (running npm run test) is not cleanly testing the cloned or checked out branch. It is testing a hybrid of a local test web and the production instance of the web on https://www.coronawarn.app.

Suggested change

Firstly it should be decided by the Open Source Team if there is a preference to use relative links inside https://www.coronawarn.app.

If yes, then update contribution best practice documentation accordingly.

After that, existing web content could be refactored to conform the convention of preferring relative links. New content should conform to any new recommendations.


Internal Tracking ID: EXPOSUREAPP-10069

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 16 (16 by maintainers)

Most upvoted comments

Now closing, as the original issue: “Website repository sources inconsistently use absolute and relative paths to refer to locations on https://www.coronawarn.app.” has been resolved and the suggestion to “update contribution best practice documentation accordingly.” has been implemented in WRITE_BLOG_POSTS.md#link-to-other-locations for blog posts.

Perhaps it would be good to create a best practice document WRITE_FAQ_ARTICLES as well? The recommendations in WRITE_BLOG_POSTS.md#link-to-other-locations for the blog *.md source files don’t directly apply to the faq.json / faq_de.json source files. The general recommendation from the Open Source Team to avoid absolute paths is documented in the short statement in https://github.com/corona-warn-app/cwa-website/issues/1819#issuecomment-934432503 “We should use relative paths.”.

Good morning @MikeMcC399! Thanks for all this ‘clean-up’ work!

Continuing the conversion:

All blog posts have now been converted to use relative paths.

I have proposed a documentation update “Additional linking hints for WRITE_BLOG_POSTS” in PR #1870 to assist setting a standard for using relative links in blog posts. This follows on from my previous comment in https://github.com/corona-warn-app/cwa-website/issues/1819#issuecomment-941243215.

In the meantime the blogs

have been updated. The rest are planned to follow.

@dsarkar

We might also as well go through the older blog articles at some point.

OK! I will take a look at these and do them over time so we don’t get too much to check all at once.

@MikeMcC399 Thanks for the feedback. We will keep an eye on this for the future science and blog articles. We might also as well go through the older blog articles at some point.

The pages:

from Science Blog 2 are now converted to use relative paths due to the merger of PR #1846.

@dsarkar

We should use relative paths.

Many thanks for your confirmation! That is my view too!

I will submit a PR to change absolute links to relative links for the FAQs only. There are not so many of them in the FAQs. Now we have the link check tool it will be possible to verify the changes automatically.

Edit: I will hold back on the PR until after the 2.11 release to avoid any conflicts.