Add missing prefixes to filenames of downloadables #1650
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What This PR Changes
Add Mandatory Prefixes
The system that copies the standard downloadable files to the "resources" folders identifies them by a file suffix which starts with
-
(e.g.,*-schematics.pdf
):docs-content/.github/workflows/deploy-prd.yml
Lines 31 to 34 in afad791
The website infrastructure has a system for handling files not covered by the "resources" system. However, unlike the "resource" downloadables file copying system of the
arduino/docs-content
repository, the website generator's system doesn't include the-
in the file suffix patterns it uses to identify the resource files (seesrc/components/product/ProductResources.js:65-109
in that private repo). This means that if a downloadable file has a name matching the resource filename pattern, but without the-
, then it slips through a gap between the two systems and the download link on the website for these files will be broken.Some of the "resource" downloadable files were missing the standard
<sku>-
prefix and thus did not match the pattern and were not copied to the "resources" folders. This causes the "Schematics" links on those product pages to lead to a 404 page instead of downloading the schematics as expected:This is fixed by adding the standard prefix to the filenames of the resource downloadables.
Add Non-Mandatory Prefixes
Although a unique dash-separated prefix is mandatory for the "resource" downloadables, it is not mandatory for the non-"resource" downloadables. However, consistency with the established conventions is beneficial regardless so I also propose the addition of this prefix to the filenames of the non-"resource" downloadables that don't have any prefix.
Additional Context
Even though the mismatch between the resource downloadable file identification code in the two systems is a bug, a differentiating prefix on the filenames is also required to avoid collisions in the resources folder so this change is beneficial even after the bug in the infrastructure is fixed.
Contribution Guidelines