Skip to content

Commit 2e5e359

Browse files
committed
fix categories and tags index pages
1 parent 7a7899d commit 2e5e359

File tree

4 files changed

+19
-41
lines changed

4 files changed

+19
-41
lines changed

docs/working-notes/todo3.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -389,8 +389,8 @@ mdx format adds new lines and paddings to paragraphs
389389
pagination align bottom, mobile problem...
390390
subfolders in components, working notes in docs folder
391391
fix title text in metadata, dot separator
392-
style share, add text
393-
restyle scroll to top, must be moved from solid to astro - cactus
392+
style share, add text
393+
restyle scroll to top, must be moved from solid to astro - cactus
394394

395395
satori can define og image with html, astro-canvas limited
396396
satori understands only react jsx, not solid-js
@@ -401,7 +401,7 @@ solid-js style prop dash case 'border-radius': '3px'
401401
add random hero images for mdx and list pages, and maybe random gradient, handle longer domain in new row
402402
fix folders in assets/images
403403
pages/design, sve .mdx index stranice, fix in metadata, endsWith('/') // fixed in getPages()
404-
replace solid with react and jsx config
404+
replace solid with react and jsx config
405405
giscus, share add text, transitions, shorter commit info footer
406406
write content for home and about
407407
write readme and credits
@@ -420,5 +420,6 @@ alert component style
420420
improve lighthouse, accessibility, aria attrs
421421
2 prerendered paginations, 3 and 5 items
422422
must export_ vars in .mdx or acor error, ask?
423+
define color themes
423424
```
424425

src/components/CategoryCard.astro

Lines changed: 0 additions & 29 deletions
This file was deleted.

src/pages/blog/categories/index.astro

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
---
2-
import { getCategoryLinks } from '@/modules/post/category';
2+
import { Icon } from 'astro-icon/components';
3+
4+
import { getCategoryLinks, getCategoryProps } from '@/modules/post/category';
35
import { getAllPosts } from '@/modules/post/common';
46
import List from '@/layouts/List.astro';
5-
import CategoryCard from '@/components/CategoryCard.astro';
7+
import Button from '@/components/Button.astro';
68
import FilterList from '@/components/FilterList.astro';
79
import { getPageMetadata } from '@/utils/metadata';
810
@@ -18,11 +20,16 @@ const metadata = getPageMetadata('lists/blog/categories');
1820
<section>
1921
<FilterList class="mb-4" itemLinks={categoryLinks}>
2022
{
21-
({ href, text, textWithCount }: FilterLink) => (
22-
<CategoryCard href={href} category={text}>
23-
{textWithCount}
24-
</CategoryCard>
25-
)
23+
({ href, text, textWithCount }: FilterLink) => {
24+
const { icon } = getCategoryProps(text);
25+
26+
return (
27+
<Button href={href} size="md">
28+
<Icon name={icon} slot="before-icon" />
29+
{textWithCount}
30+
</Button>
31+
);
32+
}
2633
}
2734
</FilterList>
2835
</section>

src/pages/blog/tags/index.astro

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import List from '@/layouts/List.astro';
55
import FilterList from '@/components/FilterList.astro';
66
import Tag from '@/components/Tag.astro';
77
import { getPageMetadata } from '@/utils/metadata';
8-
import { cn } from '@/utils/styles';
98
109
import type { FilterLink } from '@/types/post';
1110
@@ -21,7 +20,7 @@ const metadata = getPageMetadata('lists/blog/tags');
2120
<FilterList class="mb-4" itemLinks={tagLinks}>
2221
{
2322
({ href, textWithCount, isActive }: FilterLink) => (
24-
<Tag href={href} size="md" class={cn({ 'underline font-bold text-accent': isActive })}>
23+
<Tag href={href} size="md" colors={isActive ? 'primary' : 'default'}>
2524
{textWithCount}
2625
</Tag>
2726
)

0 commit comments

Comments
 (0)