Move the heading anchor icon out of public/ and into src/assets/ - #3301
Merged
Conversation
Everything under public/ is copied verbatim into the deployed package, so link-on.svg shipped as a raw, permanently-cached asset at /docs/icons/. It is a component asset consumed only by the .bookmark-link mask in main.css, so it belongs in src/ alongside the stylesheet that references it. main.css is imported by HtmlHead.astro, which means Vite processes its url() declarations. A relative path lets it bundle the file: at 995 bytes the SVG falls under the 4KB inline limit, so it is emitted as a data URI inside components.*.css and costs no request at all. The favicons stay in public/docs/icons/ - they are referenced by absolute URL from the HTML head and have to be served verbatim. Also normalizes two combinator spacings prettier was already flagging on main, in rules untouched by this change. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
enf0rc3
force-pushed
the
wl/icon-assets-into-src
branch
from
August 5, 2026 06:22
b2d1300 to
4410d24
Compare
enf0rc3
commented
Aug 5, 2026
| -webkit-mask: url('/docs/icons/link-on.svg') center / contain no-repeat; | ||
| mask: url('/docs/icons/link-on.svg') center / contain no-repeat; | ||
| -webkit-mask: url('../assets/icons/link-on.svg') center / contain no-repeat; | ||
| mask: url('../assets/icons/link-on.svg') center / contain no-repeat; |
Contributor
Author
There was a problem hiding this comment.
|
Pull request environment is available at https://stoctodocspr3301.z22.web.core.windows.net. You can view the ephemeral environment status in Octopus Deploy. This environment will be automatically deprovisioned when the pull request is closed, or after 7 days of inactivity. |
borland
approved these changes
Aug 5, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Follows the
Move the inline-SVG icon components out of public/commit in #3280 —link-on.svgis a component asset whose only consumer is the.bookmark-linkmask inmain.css, so it belongs next to the stylesheet rather than inpublic/.public/docs/icons/link-on.svgsrc/assets/icons/link-on.svgmaskurlurl('/docs/icons/link-on.svg')url('../assets/icons/link-on.svg')main.cssis imported byHtmlHead.astro:24, so Vite processes itsurl()declarations and the relative path is what lets it bundle the file. At 995 bytes the SVG falls under the 4KB inline limit, so it ends up as a data URI insidecomponents.*.cssand costs no request at all.src/assets/matches the convention #3267 introduces withsrc/assets/octopus-logo-v2.svg.The favicons stay in
public/docs/icons/— they are requested by absolute URL from the HTML head, and #3280 deliberately keeps them too.Precursor to the CopyHeadingUrl work, which adds a second icon.
prettier --writealso normalized combinator spacing atmain.css:174and:324, in rules this change does not otherwise touch. Both were already failingprettier --checkonmain.Verification
pnpm buildexits 0, 2697 pages.maskindist/docs/_astro/components.*.cssresolves to the inlined data URI;dist/docs/icons/now holds only the six favicons.cspellon the changed files andprettier --check src/styles/main.css: both clean.🤖 Generated with Claude Code