fix: Correct template literals for aria-label/class/style attributes (#435)
Some checks failed
Code quality / quality (push) Failing after 4s
Build and Check / Astro Check for Node.js 22 (push) Failing after 4s
Build and Check / Astro Check for Node.js 23 (push) Failing after 4s
Build and Check / Astro Build for Node.js 22 (push) Failing after 5s
Build and Check / Astro Build for Node.js 23 (push) Failing after 4s

* fix: Correct template literals for aria-label attributes in PostMeta and Pagination components

* fix: Update template literals to use correct syntax in multiple components
This commit is contained in:
Katsuyuki Karasawa
2025-05-02 06:49:07 +09:00
committed by GitHub
parent 3b9574823a
commit 7f0c109b17
7 changed files with 9 additions and 9 deletions

View File

@@ -53,7 +53,7 @@ const className = Astro.props.class;
<Icon name="material-symbols:book-2-outline-rounded" class="text-xl"></Icon> <Icon name="material-symbols:book-2-outline-rounded" class="text-xl"></Icon>
</div> </div>
<div class="flex flex-row flex-nowrap items-center"> <div class="flex flex-row flex-nowrap items-center">
<a href={url(`/archive/category/${encodeURIComponent(category || 'uncategorized')}/`)} aria-label=`View all posts in the ${category} category` <a href={url(`/archive/category/${encodeURIComponent(category || 'uncategorized')}/`)} aria-label={`View all posts in the ${category} category`}
class="link-lg transition text-50 text-sm font-medium class="link-lg transition text-50 text-sm font-medium
hover:text-[var(--primary)] dark:hover:text-[var(--primary)] whitespace-nowrap"> hover:text-[var(--primary)] dark:hover:text-[var(--primary)] whitespace-nowrap">
{category || i18n(I18nKey.uncategorized)} {category || i18n(I18nKey.uncategorized)}
@@ -70,7 +70,7 @@ const className = Astro.props.class;
<div class="flex flex-row flex-nowrap items-center"> <div class="flex flex-row flex-nowrap items-center">
{(tags && tags.length > 0) && tags.map((tag, i) => ( {(tags && tags.length > 0) && tags.map((tag, i) => (
<div class:list={[{"hidden": i == 0}, "mx-1.5 text-[var(--meta-divider)] text-sm"]}>/</div> <div class:list={[{"hidden": i == 0}, "mx-1.5 text-[var(--meta-divider)] text-sm"]}>/</div>
<a href={url(`/archive/tag/${encodeURIComponent(tag)}/`)} aria-label=`View all posts with the ${tag} tag` <a href={url(`/archive/tag/${encodeURIComponent(tag)}/`)} aria-label={`View all posts with the ${tag} tag`}
class="link-lg transition text-50 text-sm font-medium class="link-lg transition text-50 text-sm font-medium
hover:text-[var(--primary)] dark:hover:text-[var(--primary)] whitespace-nowrap"> hover:text-[var(--primary)] dark:hover:text-[var(--primary)] whitespace-nowrap">
{tag} {tag}

View File

@@ -68,7 +68,7 @@ const getPageUrl = (p: number) => {
> >
{p} {p}
</div> </div>
return <a href={url(getPageUrl(p))} aria-label=`Page ${p}` return <a href={url(getPageUrl(p))} aria-label={`Page ${p}`}
class="btn-card w-11 h-11 rounded-lg overflow-hidden active:scale-[0.85]" class="btn-card w-11 h-11 rounded-lg overflow-hidden active:scale-[0.85]"
>{p}</a> >{p}</a>
})} })}

View File

@@ -18,7 +18,7 @@ const profileConf = profileConfig;
const licenseConf = licenseConfig; const licenseConf = licenseConfig;
const postUrl = decodeURIComponent(Astro.url.toString()); const postUrl = decodeURIComponent(Astro.url.toString());
--- ---
<div class=`relative transition overflow-hidden bg-[var(--license-block-bg)] py-5 px-6 ${className}`> <div class={`relative transition overflow-hidden bg-[var(--license-block-bg)] py-5 px-6 ${className}`}>
<div class="transition font-bold text-black/75 dark:text-white/75"> <div class="transition font-bold text-black/75 dark:text-white/75">
{title} {title}
</div> </div>

View File

@@ -7,7 +7,7 @@ interface Props {
} }
const className = Astro.props.class; const className = Astro.props.class;
--- ---
<div data-pagefind-body class=`prose dark:prose-invert prose-base !max-w-none custom-md ${className}`> <div data-pagefind-body class={`prose dark:prose-invert prose-base !max-w-none custom-md ${className}`}>
<!--<div class="prose dark:prose-invert max-w-none custom-md">--> <!--<div class="prose dark:prose-invert max-w-none custom-md">-->
<!--<div class="max-w-none custom-md">--> <!--<div class="max-w-none custom-md">-->
<slot/> <slot/>

View File

@@ -29,7 +29,7 @@ const style = Astro.props.style;
<ButtonLink <ButtonLink
url={getCategoryUrl(c.name)} url={getCategoryUrl(c.name)}
badge={String(c.count)} badge={String(c.count)}
label=`View all posts in the ${c.name} category` label={`View all posts in the ${c.name} category`}
> >
{c.name} {c.name}
</ButtonLink> </ButtonLink>

View File

@@ -52,7 +52,7 @@ const mainPanelTop = siteConfig.banner.enable
</div> </div>
<!-- Banner --> <!-- Banner -->
{siteConfig.banner.enable && <div id="banner-wrapper" class=`absolute z-10 w-full transition duration-700 overflow-hidden` style=`top: -${BANNER_HEIGHT_EXTEND}vh`> {siteConfig.banner.enable && <div id="banner-wrapper" class={`absolute z-10 w-full transition duration-700 overflow-hidden`} style={`top: -${BANNER_HEIGHT_EXTEND}vh`}>
<ImageWrapper id="banner" alt="Banner image of the blog" class:list={["object-cover h-full transition duration-700 opacity-0 scale-105"]} <ImageWrapper id="banner" alt="Banner image of the blog" class:list={["object-cover h-full transition duration-700 opacity-0 scale-105"]}
src={siteConfig.banner.src} position={siteConfig.banner.position} src={siteConfig.banner.src} position={siteConfig.banner.position}
> >
@@ -60,7 +60,7 @@ const mainPanelTop = siteConfig.banner.enable
</div>} </div>}
<!-- Main content --> <!-- Main content -->
<div class="absolute w-full z-30 pointer-events-none" style=`top: ${mainPanelTop}`> <div class="absolute w-full z-30 pointer-events-none" style={`top: ${mainPanelTop}`}>
<!-- The pointer-events-none here prevent blocking the click event of the TOC --> <!-- The pointer-events-none here prevent blocking the click event of the TOC -->
<div class="relative max-w-[var(--page-width)] mx-auto pointer-events-auto"> <div class="relative max-w-[var(--page-width)] mx-auto pointer-events-auto">
<div id="main-grid" class="transition duration-700 w-full left-0 right-0 grid grid-cols-[17.5rem_auto] grid-rows-[auto_1fr_auto] lg:grid-rows-[auto] <div id="main-grid" class="transition duration-700 w-full left-0 right-0 grid grid-cols-[17.5rem_auto] grid-rows-[auto_1fr_auto] lg:grid-rows-[auto]

View File

@@ -19,5 +19,5 @@ const len = page.data.length;
<MainGridLayout> <MainGridLayout>
<PostPage page={page}></PostPage> <PostPage page={page}></PostPage>
<Pagination class="mx-auto onload-animation" page={page} style=`animation-delay: calc(var(--content-delay) + ${(len)*50}ms)`></Pagination> <Pagination class="mx-auto onload-animation" page={page} style={`animation-delay: calc(var(--content-delay) + ${(len)*50}ms)`}></Pagination>
</MainGridLayout> </MainGridLayout>