diff --git a/components/app/windows/news.vue b/components/app/windows/news.vue index ff5b2c2..9ec080c 100644 --- a/components/app/windows/news.vue +++ b/components/app/windows/news.vue @@ -1,4 +1,5 @@ @@ -76,7 +93,7 @@ onMounted(async () => { > - {{ item.title }} + {{ item.title }} {{ item.publisher }} -- {{ @@ -90,7 +107,7 @@ onMounted(async () => { }) }} - {{ item.shortDescription }} + {{ item.shortDescription }} diff --git a/components/app/windows/newsView.vue b/components/app/windows/newsView.vue index c514617..b0c5c51 100644 --- a/components/app/windows/newsView.vue +++ b/components/app/windows/newsView.vue @@ -1,9 +1,33 @@ @@ -14,8 +38,8 @@ const activateAiSummary = ref(false); {{ item }} AI Summary: - Activate AI summary - {{}} + Activate AI summary + {{summaryText}} diff --git a/components/checks/checkKidUnfriendlyContent.ts b/components/checks/checkKidUnfriendlyContent.ts index bb7dc43..a37a756 100644 --- a/components/checks/checkKidUnfriendlyContent.ts +++ b/components/checks/checkKidUnfriendlyContent.ts @@ -6,11 +6,9 @@ async function checkUnsafeContent(title: string) { try { const req = await fetch("/api/contentcheck/kidunfriendlycontent"); const res = await req.json(); - console.log(res); const ac = new AhoCorasick(res.words); const kidfriendly = ac.hasKeywordInText(title); - console.log(kidfriendly); - return kidfriendly; + return kidfriendly; } catch (e) { console.log(e); } diff --git a/nuxt.config.ts b/nuxt.config.ts index 75c954f..3aa58b2 100644 --- a/nuxt.config.ts +++ b/nuxt.config.ts @@ -23,7 +23,7 @@ export default defineNuxtConfig({ "/api/home/lt": { swr: 3600 }, }, - css: ["~/styles/main.css"], + css: ["~/styles/main.css", "@fontsource-variable/noto-sans-tc"], modules: ["@nuxtjs/robots", "@nuxtjs/seo", "@nuxtjs/i18n", "@nuxtjs/tailwindcss", "shadcn-nuxt", "motion-v/nuxt", "@sentry/nuxt/module"], @@ -37,7 +37,6 @@ export default defineNuxtConfig({ }, site: { - url: "https://news.yuanhau.com/", title: "新聞盲點平台", description: "", }, diff --git a/server/api/ai/summarize/[slug].ts b/server/api/ai/summarize/[slug].ts index 747ef49..8f445a5 100644 --- a/server/api/ai/summarize/[slug].ts +++ b/server/api/ai/summarize/[slug].ts @@ -7,6 +7,8 @@ export default defineEventHandler(async (event) => { const host = getRequestHost(event); const protocol = getRequestProtocol(event); const slug = getRouterParam(event, "slug"); + const query = getQuery(event); + const locale = query.locale; const buildURL = protocol + "://" + host + "/api/news/get/lt/" + slug; const data = await fetch(buildURL); const fetchNewsArticle = await data.json(); @@ -18,7 +20,7 @@ export default defineEventHandler(async (event) => { }, { role: "system", - content: `You are a news summarizer. You will be given a news article and you will summarize it into a short paragraph.`, + content: `You are a news summarizer. You will be given a news article and you will summarize it into a short paragraph. The user's current locale is ${locale || "zh-tw"} please use the correct language as the response.`, }, ], model: "gemma2-9b-it", diff --git a/styles/main.css b/styles/main.css index 49169b5..5fab217 100644 --- a/styles/main.css +++ b/styles/main.css @@ -46,12 +46,3 @@ --chart-5: 340 75% 55%; } } - -@font-face { - font-family: "Noto Sans TC Variable"; - font-style: normal; - font-display: auto; - font-weight: 100 900; - src: url(@fontsource-variable/noto-sans-tc/files/noto-sans-tc-chinese-traditional-wght-normal.woff2) - format("woff2-variations"); -}
{{ item.publisher }} -- {{ @@ -90,7 +107,7 @@ onMounted(async () => { }) }}
{{ item.shortDescription }}