mirror of
https://github.com/ArthurDanjou/artchat.git
synced 2026-01-21 18:23:17 +01:00
Compare commits
4 Commits
22c93c509d
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
| 4ed7228b60 | |||
| d88fd80aee | |||
| 8856e77ae1 | |||
| 48e6043205 |
2
.gitignore
vendored
2
.gitignore
vendored
@@ -24,3 +24,5 @@ logs
|
||||
.env
|
||||
.env.*
|
||||
!.env.example
|
||||
|
||||
.wrangler
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
{"configPath":"../../.output/server/wrangler.json"}
|
||||
@@ -15,7 +15,7 @@ const searchTerm = ref('')
|
||||
const openMessageModal = ref(false)
|
||||
const openClearModal = ref(false)
|
||||
|
||||
const { t, locale } = useI18n()
|
||||
const { t, locale } = useI18n({ useScope: 'global' })
|
||||
const { messages, submitMessage } = useChat()
|
||||
const { clearMessages, messages: storeMessages } = useChatStore()
|
||||
|
||||
@@ -72,7 +72,7 @@ const toolTipContent = {
|
||||
align: 'center',
|
||||
side: 'top',
|
||||
sideOffset: 0,
|
||||
}
|
||||
} as any
|
||||
|
||||
const router = useRouter()
|
||||
function goHome() {
|
||||
@@ -134,7 +134,7 @@ function isRoute(name: string): boolean {
|
||||
<div class="absolute inset-0 -m-1" />
|
||||
<div class="flex items-center gap-2.5">
|
||||
<UIcon :name="item.icon!" size="20" />
|
||||
<span>{{ t(item.label) }}</span>
|
||||
<span>{{ t(item.label || '') }}</span>
|
||||
</div>
|
||||
<div class="text-dimmed text-xs font-medium text-start">
|
||||
{{ t(item.prompt) }}
|
||||
|
||||
@@ -5,7 +5,7 @@ import { ChatState } from '~~/types'
|
||||
const props = defineProps<{ messageId: number, fetchStates: ChatFetchState[] }>()
|
||||
const currentState = ref<ChatFetchState | undefined>(props.fetchStates[0] ?? undefined)
|
||||
const { setLoadingState } = useChatStore()
|
||||
const { t } = useI18n()
|
||||
const { t } = useI18n({ useScope: 'global' })
|
||||
|
||||
onMounted(() => {
|
||||
let index = 0
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<script setup lang="ts">
|
||||
const { t } = useI18n()
|
||||
const { t } = useI18n({ useScope: 'global' })
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
||||
@@ -8,7 +8,7 @@ const props = defineProps<{
|
||||
|
||||
const isArthur = computed(() => props.message.sender === ChatSender.ARTHUR)
|
||||
|
||||
const { t, locale } = useI18n()
|
||||
const { t, locale } = useI18n({ useScope: 'global' })
|
||||
const formatDate = computed(() => useDateFormat(props.message.createdAt, 'D MMMM YYYY, HH:mm', { locales: locale.value ?? 'en' }).value)
|
||||
</script>
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@ const props = defineProps<{
|
||||
message: ChatMessage
|
||||
}>()
|
||||
|
||||
const { locale, t } = useI18n()
|
||||
const { locale, t } = useI18n({ useScope: 'global' })
|
||||
const formatDate = computed(() => useDateFormat(props.message.createdAt, 'D MMMM YYYY, HH:mm', { locales: locale.value ?? 'en' }).value)
|
||||
|
||||
const componentMap: Record<ChatType, Component | undefined> = {
|
||||
@@ -66,9 +66,19 @@ const dynamicComponent = computed(() => componentMap[props.message.type])
|
||||
</UCard>
|
||||
<UCard
|
||||
v-else
|
||||
v-motion
|
||||
variant="soft"
|
||||
class="mt-1 w-full max-w-none bg-transparent"
|
||||
:ui="{ body: 'p-0 sm:p-0', header: 'p-0 sm:p-0', footer: 'p-0 sm:p-0' }"
|
||||
:initial="{
|
||||
opacity: 0,
|
||||
y: 20,
|
||||
}"
|
||||
:enter="{
|
||||
opacity: 1,
|
||||
y: 0,
|
||||
transition: { ease: 'easeInOut', duration: 300, delay: 500 },
|
||||
}"
|
||||
>
|
||||
<component
|
||||
:is="dynamicComponent"
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<script setup lang="ts">
|
||||
const { t, locale } = useI18n()
|
||||
const { t, locale } = useI18n({ useScope: 'global' })
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<script lang="ts" setup>
|
||||
const { t } = useI18n()
|
||||
const { t } = useI18n({ useScope: 'global' })
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
||||
@@ -3,7 +3,7 @@ import type { UseTimeAgoMessages } from '@vueuse/core'
|
||||
import type { Activity } from '~~/types'
|
||||
import { activityMessages, IDEs } from '~~/types'
|
||||
|
||||
const { locale, t } = useI18n()
|
||||
const { locale, t } = useI18n({ useScope: 'global' })
|
||||
const { data: activity, refresh } = await useAsyncData<Activity>('activity', () => $fetch<Activity>('/api/activity'))
|
||||
|
||||
useIntervalFn(async () => await refresh(), 5000)
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<script lang="ts" setup>
|
||||
import { socials } from '~~/types'
|
||||
|
||||
const { t } = useI18n()
|
||||
const { t } = useI18n({ useScope: 'global' })
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<script lang="ts" setup>
|
||||
const { t } = useI18n()
|
||||
const { t } = useI18n({ useScope: 'global' })
|
||||
|
||||
const year = ref(useNow().value.getFullYear())
|
||||
</script>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<script lang="ts" setup>
|
||||
const { t } = useI18n()
|
||||
const { t } = useI18n({ useScope: 'global' })
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<script lang="ts" setup>
|
||||
const { data: experiences } = await useAsyncData('experiences', async () => await queryCollection('experiences').all())
|
||||
|
||||
const { t, locale } = useI18n()
|
||||
const { t, locale } = useI18n({ useScope: 'global' })
|
||||
const formatDate = (date: string) => useDateFormat(new Date(date), 'MMM YYYY', { locales: locale.value ?? 'en' }).value
|
||||
function getLanguageForText(text: { en: string, es: string, fr: string }) {
|
||||
return locale.value === 'en' ? text.en : locale.value === 'es' ? text.es : text.fr
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<script lang="ts" setup>
|
||||
const { t } = useI18n()
|
||||
const { t } = useI18n({ useScope: 'global' })
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<script lang="ts" setup>
|
||||
import { en, es, fr } from '@nuxt/ui/locale'
|
||||
|
||||
const { locale, t } = useI18n()
|
||||
const { locale, t } = useI18n({ useScope: 'global' })
|
||||
const { changeLocale } = useLanguage()
|
||||
</script>
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<script lang="ts" setup>
|
||||
const { locale, t } = useI18n()
|
||||
const { locale, t } = useI18n({ useScope: 'global' })
|
||||
|
||||
const { data: projects } = await useAsyncData('projects-index', async () => await queryCollection('projects').where('favorite', '=', true).select('title', 'description', 'id', 'publishedAt', 'tags', 'slug').all())
|
||||
const date = (date: string) => useDateFormat(new Date(date), 'DD MMMM YYYY', { locales: locale.value ?? 'en' })
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<script lang="ts" setup>
|
||||
const { t } = useI18n()
|
||||
const { t } = useI18n({ useScope: 'global' })
|
||||
|
||||
interface ResumeFile {
|
||||
name: string
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<script lang="ts" setup>
|
||||
const { data: skills } = await useAsyncData('skills', async () => await queryCollection('skills').first())
|
||||
|
||||
const { t, locale } = useI18n()
|
||||
const { t, locale } = useI18n({ useScope: 'global' })
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
||||
@@ -3,7 +3,7 @@ import type { Stats } from '~~/types'
|
||||
|
||||
const { data: stats } = await useAsyncData<Stats>('stats', () => $fetch('/api/stats'))
|
||||
|
||||
const { locale, t } = useI18n()
|
||||
const { locale, t } = useI18n({ useScope: 'global' })
|
||||
|
||||
const time = useTimeAgo(new Date(stats.value!.coding.data.range.start) ?? new Date()).value.split(' ')[0]
|
||||
const date = useDateFormat(new Date(stats.value!.coding.data.range.start ?? new Date()), 'DD MMMM YYYY', { locales: locale.value ?? 'en' })
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<script lang="ts" setup>
|
||||
const { t } = useI18n()
|
||||
const { t } = useI18n({ useScope: 'global' })
|
||||
const { dark, toggleDark } = useTheme()
|
||||
</script>
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ const props = defineProps({
|
||||
},
|
||||
})
|
||||
|
||||
const { locale } = useI18n()
|
||||
const { locale } = useI18n({ useScope: 'global' })
|
||||
|
||||
const { data: items } = await useAsyncData(`uses-${props.category}`, async () => await queryCollection('uses').where('category', '=', props.category).all())
|
||||
const { data: categoryData } = await useAsyncData(`category-${props.category}`, async () => await queryCollection('usesCategories').where('slug', '=', props.category).first())
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<script setup lang="ts">
|
||||
import type { Weather } from '~~/types'
|
||||
|
||||
const { t } = useI18n()
|
||||
const { t } = useI18n({ useScope: 'global' })
|
||||
const { data: weather } = await useAsyncData<Weather>('weather', () =>
|
||||
$fetch('/api/weather'))
|
||||
</script>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<script lang="ts" setup>
|
||||
const { locale, t } = useI18n()
|
||||
const { locale, t } = useI18n({ useScope: 'global' })
|
||||
|
||||
const { data: writings } = await useAsyncData('writings-index', async () => await queryCollection('writings').order('publishedAt', 'DESC').select('title', 'description', 'id', 'publishedAt', 'tags', 'slug').limit(2).all())
|
||||
const formatDate = (date: string) => useDateFormat(new Date(date), 'DD MMMM YYYY', { locales: locale.value ?? 'en' })
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
export function useLanguage() {
|
||||
const { setLocale } = useI18n()
|
||||
const { setLocale } = useI18n({ useScope: 'global' })
|
||||
|
||||
async function changeLocale(newLocale: string) {
|
||||
await setLocale(newLocale as 'en' | 'fr' | 'es')
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<script setup lang="ts">
|
||||
const { t } = useI18n()
|
||||
const { t } = useI18n({ useScope: 'global' })
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
||||
@@ -10,7 +10,7 @@ const { messages } = useChatStore()
|
||||
const parents = useTemplateRef('parents')
|
||||
const { height } = useElementBounding(parents)
|
||||
|
||||
const { locale } = useI18n()
|
||||
const { locale } = useI18n({ useScope: 'global' })
|
||||
const lastLang = ref(locale.value)
|
||||
watch(
|
||||
height,
|
||||
|
||||
@@ -18,7 +18,7 @@ useSeoMeta({
|
||||
author: 'Arthur Danjou',
|
||||
})
|
||||
|
||||
const { t } = useI18n()
|
||||
const { t } = useI18n({ useScope: 'global' })
|
||||
|
||||
useSeoMeta(project.value.seo || {})
|
||||
</script>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<script lang="ts" setup>
|
||||
const { t } = useI18n()
|
||||
const { t } = useI18n({ useScope: 'global' })
|
||||
useSeoMeta({
|
||||
title: 'My Projects',
|
||||
description: t('projects.description'),
|
||||
|
||||
@@ -12,7 +12,7 @@ if (!writing.value) {
|
||||
})
|
||||
}
|
||||
|
||||
const { t } = useI18n()
|
||||
const { t } = useI18n({ useScope: 'global' })
|
||||
|
||||
useSeoMeta(writing.value.seo || {})
|
||||
</script>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<script lang="ts" setup>
|
||||
const { t } = useI18n()
|
||||
const { t } = useI18n({ useScope: 'global' })
|
||||
useSeoMeta({
|
||||
title: 'My Shelf - Arthur DANJOU',
|
||||
description: t('writings.description'),
|
||||
|
||||
@@ -19,17 +19,7 @@ export default defineNuxtConfig({
|
||||
css: ['~/assets/css/main.css'],
|
||||
|
||||
// Nuxt Modules
|
||||
modules: [
|
||||
'@nuxt/ui',
|
||||
'@nuxtjs/seo',
|
||||
'@nuxt/content',
|
||||
'@vueuse/nuxt',
|
||||
'@nuxtjs/google-fonts',
|
||||
'@nuxt/image',
|
||||
'@vueuse/motion/nuxt',
|
||||
'@pinia/nuxt',
|
||||
'@nuxtjs/i18n',
|
||||
],
|
||||
modules: ['@nuxt/ui', '@nuxtjs/seo', '@nuxt/content', '@vueuse/nuxt', '@nuxtjs/google-fonts', '@nuxt/image', '@vueuse/motion/nuxt', '@pinia/nuxt', '@nuxtjs/i18n', 'nuxt-studio'],
|
||||
|
||||
ogImage: {
|
||||
enabled: false,
|
||||
@@ -68,9 +58,6 @@ export default defineNuxtConfig({
|
||||
|
||||
// Nuxt Content
|
||||
content: {
|
||||
preview: {
|
||||
api: 'https://api.nuxt.studio',
|
||||
},
|
||||
build: {
|
||||
markdown: {
|
||||
highlight: {
|
||||
@@ -107,6 +94,17 @@ export default defineNuxtConfig({
|
||||
timeline: { enabled: true },
|
||||
},
|
||||
|
||||
// Nuxt Studio
|
||||
studio: {
|
||||
// GitHub repository configuration (owner and repo are required)
|
||||
repository: {
|
||||
provider: 'github', // only GitHub is currently supported
|
||||
owner: 'arthurdanjou', // your GitHub username or organization
|
||||
repo: 'artchat', // your repository name
|
||||
branch: 'main', // the branch to commit to (default: main)
|
||||
},
|
||||
},
|
||||
|
||||
// Nuxt I18N
|
||||
i18n: {
|
||||
strategy: 'no_prefix',
|
||||
@@ -159,6 +157,10 @@ export default defineNuxtConfig({
|
||||
deployConfig: true,
|
||||
nodeCompat: true,
|
||||
},
|
||||
prerender: {
|
||||
routes: ['/'],
|
||||
crawlLinks: true,
|
||||
},
|
||||
},
|
||||
|
||||
// Nuxt Env
|
||||
|
||||
22
package.json
22
package.json
@@ -13,12 +13,12 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@antfu/eslint-config": "^5.4.1",
|
||||
"@iconify-json/devicon": "^1.2.45",
|
||||
"@iconify-json/logos": "^1.2.9",
|
||||
"@iconify-json/devicon": "^1.2.46",
|
||||
"@iconify-json/logos": "^1.2.10",
|
||||
"@iconify-json/ph": "^1.2.2",
|
||||
"@iconify-json/simple-icons": "^1.2.53",
|
||||
"@iconify-json/simple-icons": "^1.2.57",
|
||||
"@iconify-json/twemoji": "^1.2.4",
|
||||
"@iconify-json/vscode-icons": "^1.2.30",
|
||||
"@iconify-json/vscode-icons": "^1.2.33",
|
||||
"@nuxt/content": "3.7.1",
|
||||
"@nuxt/eslint": "1.9.0",
|
||||
"@nuxt/image": "^1.11.0",
|
||||
@@ -26,24 +26,30 @@
|
||||
"@nuxtjs/google-fonts": "^3.2.0",
|
||||
"@nuxtjs/i18n": "10.1.0",
|
||||
"@nuxtjs/seo": "^3.2.2",
|
||||
"@pinia/nuxt": "^0.11.2",
|
||||
"@pinia/nuxt": "^0.11.3",
|
||||
"@tailwindcss/typography": "^0.5.19",
|
||||
"@vueuse/math": "13.9.0",
|
||||
"@vueuse/motion": "^3.0.3",
|
||||
"better-sqlite3": "^12.4.1",
|
||||
"eslint": "9.36.0",
|
||||
"nuxt": "4.1.2",
|
||||
"nuxt-studio": "1.0.0-alpha.1",
|
||||
"rehype-katex": "^7.0.1",
|
||||
"remark-math": "^6.0.0",
|
||||
"remark-parse": "^11.0.0",
|
||||
"remark-rehype": "^11.1.2",
|
||||
"typescript": "5.9.3",
|
||||
"vue": "^3.5.22",
|
||||
"vue-router": "^4.5.1"
|
||||
"vue-router": "^4.6.3",
|
||||
"wrangler": "^4.45.4"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "24.6.2",
|
||||
"@vueuse/nuxt": "^13.9.0",
|
||||
"vue-tsc": "^3.1.0"
|
||||
}
|
||||
"vue-tsc": "^3.1.3"
|
||||
},
|
||||
"trustedDependencies": [
|
||||
"@parcel/watcher",
|
||||
"unrs-resolver"
|
||||
]
|
||||
}
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 1.4 MiB After Width: | Height: | Size: 155 KiB |
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user