Generate components from SVGs in doc site #474
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.
Related issue
#437
Overview
Replaced the loading of inline SVGs with a build process which converts SVGs to React components to be added to the documentation.
Reason
There is a dependency on
gatsby-plugin-react-svg
which has upstream issues with outputting SVGs that contains elements with the same ID. This leads to the document being badly structure and therefore issues with presenting SVGs.There is the added benefit that this automates the manual task which is optimising SVGs.
Work carried out
gatsby-plugin-react-svg
dependencyScreenshot
Developer notes
Special attention should be given to the styles which have been moved to
masthead.scss
. This is because themasthead
is dependent onsite-logo.svg
which had embedded styles and SVGR could not convert it to a component without errors.