Skip to content
This repository was archived by the owner on Feb 15, 2022. It is now read-only.
This repository was archived by the owner on Feb 15, 2022. It is now read-only.

Model route and url types properly #216

@ghost

Description

To the extent that it is practical, let's use shared constants, types, and validation logic to ensure that all URL data is a validly formed URL. For URLs to refer to pages within this site, let's also ensure that the URLs always point to valid pages. For URLs referring to external sites, consider ways to validate that the external site exists at site build time.

Some possible tasks:

  • Define global constant values for each internal URL. Whenever a page links to an internal URL, make use of these constant values. (Done in Define and use constants for internal urls #327)
  • Use a javascript library to validate that a string is a valid URL and make use of this validation when receiving URL values (e.g. when converting markdown to html or when parsing data from yaml files). Alternatively, we can assume all URL values are valid and that ood has already performed this validation.
  • At site build time, whenever we receive an external URL value, we could perform a live fetch of the url to check the http response code.
  • We could validate any internal URLs mentioned in markdown files against a set of valid internal URLs when converting the markdown to html. I don't expect links between tutorials. The tutorial navigation will steer users between tutorials.
  • We could use some form of code generation or more complex use of types to ensure only valid internal URLs are used.

Time box: 6 hours

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions