-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
49 changed files
with
262 additions
and
122 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
--- | ||
import { TagCategoryMapping, type TagCategory } from '@/content/config' | ||
export type TagNavCategory = 'all' | TagCategory | ||
interface Props { | ||
category: TagNavCategory | ||
} | ||
const { category } = Astro.props | ||
const tagCategoryEntries = [['all', '全般'], ...TagCategoryMapping] as const | ||
--- | ||
|
||
<nav | ||
class="flex w-full whitespace-nowrap pb-6 pt-2 text-center font-sans text-lg font-medium" | ||
> | ||
{ | ||
tagCategoryEntries.map(([c, text], i) => ( | ||
<a | ||
href={c === 'all' ? '/blog/tags/' : `/blog/tags/${c}/`} | ||
class:list={[ | ||
'block basis-28 border-y border-r border-slate-300 py-1 max-sm:basis-1/4', | ||
{ | ||
'bg-slate-100': c === category, | ||
'bg-white transition-colors hover:bg-slate-100': c !== category, | ||
'rounded-l-xl border-l': i === 0, | ||
'rounded-r-xl': i === tagCategoryEntries.length - 1, | ||
}, | ||
]} | ||
> | ||
{text} | ||
</a> | ||
)) | ||
} | ||
</nav> |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
--- | ||
import BlogLayout from '@/layouts/BlogLayout.astro' | ||
import { getCollection } from 'astro:content' | ||
import { getTagStatistics } from '@/content/_blog-statistics' | ||
import TagListSection from '@/components/blog/tag/TagListSection.astro' | ||
import type { TagNavCategory } from './TagCategoryNav.astro' | ||
import TagCategoryNav from './TagCategoryNav.astro' | ||
interface Props { | ||
category: TagNavCategory | ||
} | ||
const { category } = Astro.props | ||
const [tagEntries, statistics] = await Promise.all([ | ||
getCollection('tags'), | ||
getTagStatistics(), | ||
] as const) | ||
const tags = tagEntries | ||
.filter((tag) => category === 'all' || category === tag.data.category) | ||
.map((tag) => ({ | ||
...tag, | ||
articleCount: statistics[tag.id].length, | ||
lastPostedTime: statistics[tag.id][0]?.time ?? 0, | ||
})) | ||
tags.sort((tag1, tag2) => | ||
tag2.articleCount !== tag1.articleCount | ||
? tag2.articleCount - tag1.articleCount | ||
: tag2.lastPostedTime - tag1.lastPostedTime, | ||
) | ||
--- | ||
|
||
<BlogLayout title="タグ一覧" description="ブログのタグ一覧です。"> | ||
<!-- 右側のスクロールバーを常時表示させるために min-h-[80vh] --> | ||
<main class="flex min-h-[80vh] flex-col"> | ||
<TagListSection title="タグ一覧" tags={tags}> | ||
<Fragment slot="nav"> | ||
<TagCategoryNav category={category} /> | ||
</Fragment> | ||
</TagListSection> | ||
</main> | ||
</BlogLayout> |
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,72 +1,89 @@ | ||
{ | ||
"$schema": "http://json-schema.org/draft-07/schema#", | ||
"definitions": { | ||
"AuthorSchema": { | ||
"title": "AuthorSchema", | ||
"type": "object", | ||
"properties": { | ||
"name": { | ||
"type": "string", | ||
"title": "name" | ||
}, | ||
"description": { | ||
"type": "string", | ||
"title": "description" | ||
}, | ||
"github": { | ||
"type": "string", | ||
"title": "github" | ||
}, | ||
"image": { | ||
"type": "string", | ||
"title": "image" | ||
} | ||
}, | ||
"additionalProperties": false, | ||
"required": ["name"] | ||
}, | ||
"TagSchema": { | ||
"title": "TagSchema", | ||
"type": "object", | ||
"properties": { | ||
"name": { | ||
"type": "string", | ||
"title": "name" | ||
}, | ||
"description": { | ||
"type": "string", | ||
"title": "description" | ||
}, | ||
"image": { | ||
"type": "string", | ||
"title": "image" | ||
}, | ||
"fullSizeImage": { | ||
"type": "boolean", | ||
"title": "fullSizeImage" | ||
"$schema": "http://json-schema.org/draft-07/schema#", | ||
"definitions": { | ||
"AuthorSchema": { | ||
"title": "AuthorSchema", | ||
"type": "object", | ||
"properties": { | ||
"name": { | ||
"type": "string", | ||
"title": "name" | ||
}, | ||
"description": { | ||
"type": "string", | ||
"title": "description" | ||
}, | ||
"github": { | ||
"type": "string", | ||
"title": "github" | ||
}, | ||
"image": { | ||
"type": "string", | ||
"title": "image" | ||
} | ||
}, | ||
"additionalProperties": false, | ||
"required": [ | ||
"name" | ||
] | ||
}, | ||
"links": { | ||
"type": "array", | ||
"items": { | ||
"TagSchema": { | ||
"title": "TagSchema", | ||
"type": "object", | ||
"properties": { | ||
"url": { | ||
"type": "string", | ||
"title": "url" | ||
}, | ||
"text": { | ||
"type": "string", | ||
"title": "text" | ||
} | ||
"name": { | ||
"type": "string", | ||
"title": "name" | ||
}, | ||
"description": { | ||
"type": "string", | ||
"title": "description" | ||
}, | ||
"category": { | ||
"enum": [ | ||
"circle", | ||
"other", | ||
"tech" | ||
], | ||
"type": "string", | ||
"title": "category" | ||
}, | ||
"image": { | ||
"type": "string", | ||
"title": "image" | ||
}, | ||
"fullSizeImage": { | ||
"type": "boolean", | ||
"title": "fullSizeImage" | ||
}, | ||
"links": { | ||
"type": "array", | ||
"items": { | ||
"type": "object", | ||
"properties": { | ||
"url": { | ||
"type": "string", | ||
"title": "url" | ||
}, | ||
"text": { | ||
"type": "string", | ||
"title": "text" | ||
} | ||
}, | ||
"additionalProperties": false, | ||
"required": [ | ||
"text", | ||
"url" | ||
] | ||
}, | ||
"title": "links" | ||
} | ||
}, | ||
"additionalProperties": false, | ||
"required": ["text", "url"] | ||
}, | ||
"title": "links" | ||
"required": [ | ||
"category", | ||
"name" | ||
] | ||
} | ||
}, | ||
"additionalProperties": false, | ||
"required": ["name"] | ||
} | ||
} | ||
} |
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
{ | ||
"name": "Advent Calendar" | ||
"name": "Advent Calendar", | ||
"category": "circle" | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
{ | ||
"name": "Arduino", | ||
"category": "tech", | ||
"image": "./arduino.svg" | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
{ | ||
"name": "ASP.NET Core", | ||
"category": "tech", | ||
"image": "./dotnet.svg", | ||
"fullSizeImage": true, | ||
"links": [ | ||
|
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
{ | ||
"name": "Astro", | ||
"category": "tech", | ||
"image": "./astro.svg" | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
{ | ||
"name": "自動化" | ||
"name": "自動化", | ||
"category": "tech" | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
{ | ||
"name": "Blender" | ||
"name": "Blender", | ||
"category": "tech" | ||
} |
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
{ | ||
"name": "Discord Bot", | ||
"category": "tech", | ||
"image": "./discord-bot.svg" | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
{ | ||
"name": "Docker", | ||
"category": "tech", | ||
"image": "./docker.svg" | ||
} |
Oops, something went wrong.