Skip to content

Commit

Permalink
chore
Browse files Browse the repository at this point in the history
  • Loading branch information
nexmoe committed Apr 11, 2024
1 parent 01f612a commit ca09321
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 17 deletions.
14 changes: 7 additions & 7 deletions components/module/Image.vue
Original file line number Diff line number Diff line change
Expand Up @@ -16,23 +16,23 @@ const text = computed(() => extractTextFromHTML(props.module.content))
</script>

<template>
<div class="module shu-card p-5 space-y-3 flex flex-col justify-between">
<div class="module shu-card p-4 space-y-3 flex flex-col justify-between">
<div class="space-y-3 ">
<div v-if="props.module.image" class="rounded-xl relative overflow-hidden">
<div class="p-1">
{{ formatDateTime(module.date) }}
</div>
<div v-if="props.module.image" class="max-h-96 rounded-xl relative overflow-hidden">
<NuxtImg
class="w-full" format="webp" :src="props.module!.image" :alt="module.title"
referrerpolicy="no-referrer" loading="lazy" width="320px" height="200px"
/>
</div>
</div>
<div class="space-y-3 pb-1">
<div>
{{ formatDateTime(module.date) }}
</div>
<div class="space-y-3 p-1">
<h3 v-if="!flow.configNoTitle" class="font-bold text-2xl tracking-tight text-black">
{{ props.module.title }}
</h3>
<div v-if="!flow.configNoContent && text !== ' '">
<div class="line-clamp-3" v-if="!flow.configNoContent && text !== ' '">

Check warning on line 35 in components/module/Image.vue

View workflow job for this annotation

GitHub Actions / testCodebase

Attribute "v-if" should go before "class"
<div v-html="text" />
</div>
<div
Expand Down
1 change: 1 addition & 0 deletions nuxt.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ export default defineNuxtConfig({
site: {
url: 'https://i.nexmoe.com',
name: 'Nexmoe',
description: '充满热情的开发者和创造者,热衷于未来主义和赛博朋克,追求良好的用户体验和界面设计。分享技术见解、优化技巧和对生活的热爱,提供有价值的内容和工具,通过技术改善日常生活。',
},
sitemap: {
sitemaps: {
Expand Down
6 changes: 4 additions & 2 deletions server/api/__sitemap__/urls/categories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@ export default defineSitemapEventHandler(async (event) => {
const prisma = event.context.prisma

Check failure on line 2 in server/api/__sitemap__/urls/categories.ts

View workflow job for this annotation

GitHub Actions / testCodebase

Expected indentation of 1 tab but found 4 spaces

const flows = await prisma.flow.findMany({

Check failure on line 4 in server/api/__sitemap__/urls/categories.ts

View workflow job for this annotation

GitHub Actions / testCodebase

Expected indentation of 1 tab but found 4 spaces

orderBy: { index: 'asc' },
select: {

Check failure on line 5 in server/api/__sitemap__/urls/categories.ts

View workflow job for this annotation

GitHub Actions / testCodebase

Expected indentation of 2 tabs but found 8 spaces
id: true,

Check failure on line 6 in server/api/__sitemap__/urls/categories.ts

View workflow job for this annotation

GitHub Actions / testCodebase

Expected indentation of 3 tabs but found 12 spaces
updatedAt: true

Check failure on line 7 in server/api/__sitemap__/urls/categories.ts

View workflow job for this annotation

GitHub Actions / testCodebase

Expected indentation of 3 tabs but found 12 spaces

Check failure on line 7 in server/api/__sitemap__/urls/categories.ts

View workflow job for this annotation

GitHub Actions / testCodebase

Missing trailing comma
}
})

const posts = flows.map(p => ({
Expand Down
11 changes: 5 additions & 6 deletions server/flowing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -121,9 +121,8 @@ async function flowingByFlow(flow: Flow) {

const response = res.flatMap(r => (r.status === 'fulfilled' ? [r.value] : []))
const final = flow.api.length > 0 ? response.reduce(mergeArrays, []) : []

try {
for (const ele of final) {
for (const ele of final) {
try {
await prisma.module.create({
data: {
...ele,
Expand All @@ -132,9 +131,9 @@ async function flowingByFlow(flow: Flow) {
},
})
}
}
catch (error) {
consola.error(error)
catch (error) {
consola.error(error)
}
}
}

Expand Down
2 changes: 1 addition & 1 deletion utils/date.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import dayjs from 'dayjs'

export function formatDateTime(source: string | number) {
return dayjs(source).format('YYYY/MM/DD')
return dayjs(source).format('YYYY-MM-DD')
}
2 changes: 1 addition & 1 deletion utils/parse.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export function extractTextFromHTML(html) {
const text = html.replace(/<[^>]+>/g, '').replace(/\s+/g, ' ')

// 提取前 300 个字符
const extractedText = `${text.substring(0, 120)}...`
const extractedText = `${text.substring(0, 150)}`

return extractedText
}

0 comments on commit ca09321

Please sign in to comment.