Skip to content

Move the heading anchor icon out of public/ and into src/assets/ - #3301

Merged
enf0rc3 merged 1 commit into
mainfrom
wl/icon-assets-into-src
Aug 5, 2026
Merged

Move the heading anchor icon out of public/ and into src/assets/#3301
enf0rc3 merged 1 commit into
mainfrom
wl/icon-assets-into-src

Conversation

@enf0rc3

@enf0rc3 enf0rc3 commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Follows the Move the inline-SVG icon components out of public/ commit in #3280link-on.svg is a component asset whose only consumer is the .bookmark-link mask in main.css, so it belongs next to the stylesheet rather than in public/.

Before After
file public/docs/icons/link-on.svg src/assets/icons/link-on.svg
mask url url('/docs/icons/link-on.svg') url('../assets/icons/link-on.svg')

main.css is imported by HtmlHead.astro:24, so Vite processes its url() 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 inside components.*.css and costs no request at all.

src/assets/ matches the convention #3267 introduces with src/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 --write also normalized combinator spacing at main.css:174 and :324, in rules this change does not otherwise touch. Both were already failing prettier --check on main.

Verification

  • pnpm build exits 0, 2697 pages.
  • The mask in dist/docs/_astro/components.*.css resolves to the inlined data URI; dist/docs/icons/ now holds only the six favicons.
  • cspell on the changed files and prettier --check src/styles/main.css: both clean.

🤖 Generated with Claude Code

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
enf0rc3 force-pushed the wl/icon-assets-into-src branch from b2d1300 to 4410d24 Compare August 5, 2026 06:22
Comment thread src/styles/main.css
-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;

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@team-marketing-branch-protections

Copy link
Copy Markdown

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.

@enf0rc3
enf0rc3 merged commit c036447 into main Aug 5, 2026
7 checks passed
@enf0rc3
enf0rc3 deleted the wl/icon-assets-into-src branch August 5, 2026 20:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants