mirror of
https://github.com/d0zingcat/BroadcastChannel.git
synced 2026-05-13 23:16:46 +00:00
feat: improve back-to-top icon integration
Refactor back-to-top icon import for better performance and maintainability.
This commit is contained in:
@@ -4,6 +4,7 @@ import '../assets/style.css'
|
|||||||
import '../assets/global.css'
|
import '../assets/global.css'
|
||||||
import { SEO } from 'astro-seo'
|
import { SEO } from 'astro-seo'
|
||||||
import { getEnv } from '../lib/env'
|
import { getEnv } from '../lib/env'
|
||||||
|
import backToTopIcon from '../assets/back-to-top.svg'
|
||||||
|
|
||||||
const { SITE_URL } = Astro.locals
|
const { SITE_URL } = Astro.locals
|
||||||
const { channel } = Astro.props
|
const { channel } = Astro.props
|
||||||
@@ -42,8 +43,6 @@ const seoParams = {
|
|||||||
|
|
||||||
const HEADER_INJECT = getEnv(import.meta.env, Astro, 'HEADER_INJECT')
|
const HEADER_INJECT = getEnv(import.meta.env, Astro, 'HEADER_INJECT')
|
||||||
const FOOTER_INJECT = getEnv(import.meta.env, Astro, 'FOOTER_INJECT')
|
const FOOTER_INJECT = getEnv(import.meta.env, Astro, 'FOOTER_INJECT')
|
||||||
|
|
||||||
const backToTopIcon = 'src/assets/back-to-top.svg'
|
|
||||||
---
|
---
|
||||||
|
|
||||||
<!doctype html>
|
<!doctype html>
|
||||||
@@ -127,7 +126,7 @@ const backToTopIcon = 'src/assets/back-to-top.svg'
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<a href="#wrapper" id="back-to-top" aria-label="Back to top">
|
<a href="#wrapper" id="back-to-top" aria-label="Back to top">
|
||||||
<img src={backToTopIcon} alt="Back to Top" />
|
<img {...backToTopIcon} alt="Back to Top" />
|
||||||
</a>
|
</a>
|
||||||
<Fragment set:html={FOOTER_INJECT} />
|
<Fragment set:html={FOOTER_INJECT} />
|
||||||
</body>
|
</body>
|
||||||
|
|||||||
Reference in New Issue
Block a user