mirror of
https://github.com/reonokiy/blog.nokiy.net.git
synced 2025-06-18 20:18:36 +02:00
refactor: clean up configuration and components, optimize implementation details
- Remove unused navigation bar and social link configurations - Update Footer component, simplify code - Refactor PostList and PostTime components, improve code readability - Adjust Waline comment component styles - Streamline content config and reading time plugin - Update theme guide document titles and tags
This commit is contained in:
parent
8ac9b865f5
commit
c23a54ae83
10 changed files with 33 additions and 126 deletions
|
@ -12,8 +12,7 @@ const { date, updatedDate, minutes } = Astro.props
|
|||
const format = themeConfig.global.dateFormat
|
||||
const currentPath = Astro.url.pathname
|
||||
const isPost = isPostPage(currentPath)
|
||||
const updatedTimeMarginClass = isPost ? 'ml-1.75' : 'ml-1.5'
|
||||
const readingTimeMarginClass = isPost ? 'ml-1.75' : 'ml-1.5'
|
||||
const timeSpacingClass = isPost ? 'ml-1.75' : 'ml-1.5'
|
||||
|
||||
function formatDate(date: Date, format: 'YYYY-MM-DD' | 'MM-DD-YYYY' | 'DD-MM-YYYY' | 'MONTH DAY YYYY' | 'DAY MONTH YYYY') {
|
||||
const options: Intl.DateTimeFormatOptions = {
|
||||
|
@ -65,14 +64,14 @@ function formatDate(date: Date, format: 'YYYY-MM-DD' | 'MM-DD-YYYY' | 'DD-MM-YYY
|
|||
|
||||
<!-- updated time -->
|
||||
{updatedDate && (
|
||||
<time datetime={updatedDate.toISOString().split('T')[0]} class={updatedTimeMarginClass}>
|
||||
<time datetime={updatedDate.toISOString().split('T')[0]} class={timeSpacingClass}>
|
||||
updated {formatDate(updatedDate, format)}
|
||||
</time>
|
||||
)}
|
||||
|
||||
<!-- reading time -->
|
||||
{minutes !== undefined && (
|
||||
<span class={readingTimeMarginClass}>
|
||||
<span class={timeSpacingClass}>
|
||||
{minutes} min
|
||||
</span>
|
||||
)}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue