mirror of
https://github.com/ArthurDanjou/artsite.git
synced 2026-01-14 20:59:57 +01:00
Linted code
This commit is contained in:
6
.github/workflows/nuxthub.yml
vendored
6
.github/workflows/nuxthub.yml
vendored
@@ -3,7 +3,7 @@ on: push
|
||||
|
||||
jobs:
|
||||
deploy:
|
||||
name: "Deploy to NuxtHub"
|
||||
name: Deploy to NuxtHub
|
||||
runs-on: ubuntu-latest
|
||||
environment:
|
||||
name: ${{ github.ref == 'refs/heads/main' && 'production' || 'preview' }}
|
||||
@@ -22,7 +22,7 @@ jobs:
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 22
|
||||
cache: 'pnpm'
|
||||
cache: pnpm
|
||||
|
||||
- name: Install dependencies
|
||||
run: pnpm install
|
||||
@@ -32,4 +32,4 @@ jobs:
|
||||
|
||||
- name: Deploy to NuxtHub
|
||||
uses: nuxt-hub/action@v1
|
||||
id: deploy
|
||||
id: deploy
|
||||
|
||||
@@ -1,12 +1,14 @@
|
||||
<script lang="ts" setup>
|
||||
import { navColors, type NavColor } from '~~/types'
|
||||
import type { NavColor } from '~~/types'
|
||||
import { navColors } from '~~/types'
|
||||
|
||||
const route = useRoute()
|
||||
const colorMode = useColorMode()
|
||||
|
||||
const colors = computed((): NavColor[] => {
|
||||
const navColor = navColors.find(nav => route.name === nav.name)
|
||||
if (navColor?.colors) return navColor.colors
|
||||
if (navColor?.colors)
|
||||
return navColor.colors
|
||||
|
||||
const fallbackColor = colorMode.value === 'dark' ? '#000000' : '#ffffff'
|
||||
const fallbackGradient = { color: fallbackColor, x: 0, y: 0, radius: 0 }
|
||||
@@ -15,14 +17,14 @@ const colors = computed((): NavColor[] => {
|
||||
|
||||
const backgroundStyle = computed(() => {
|
||||
const gradients = colors.value
|
||||
.map(({ color, radius, x, y }) =>
|
||||
`radial-gradient(circle ${radius}px at ${x}% ${y}%, ${color}4D, transparent)`
|
||||
.map(({ color, radius, x, y }) =>
|
||||
`radial-gradient(circle ${radius}px at ${x}% ${y}%, ${color}4D, transparent)`,
|
||||
)
|
||||
.join(', ')
|
||||
|
||||
|
||||
return {
|
||||
backgroundImage: gradients,
|
||||
backgroundSize: Array(colors.value.length).fill('100% 100%').join(', ')
|
||||
backgroundSize: Array.from({ length: colors.value.length }).fill('100% 100%').join(', '),
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<script lang="ts" setup>
|
||||
defineProps({
|
||||
title: {
|
||||
type: Object as PropType<{ en: string; fr: string; es: string }>,
|
||||
type: Object as PropType<{ en: string, fr: string, es: string }>,
|
||||
required: true,
|
||||
},
|
||||
})
|
||||
|
||||
@@ -93,9 +93,9 @@ const { copy, copied } = useClipboard({
|
||||
/>
|
||||
<ClientOnly>
|
||||
<ContentRenderer
|
||||
:value="project"
|
||||
class="!max-w-none prose dark:prose-invert"
|
||||
/>
|
||||
:value="project"
|
||||
class="!max-w-none prose dark:prose-invert"
|
||||
/>
|
||||
</ClientOnly>
|
||||
<div class="space-y-4 mt-8">
|
||||
<PostFooter />
|
||||
|
||||
@@ -159,9 +159,9 @@ function scrollToSection(id: string) {
|
||||
<article class="mt-8">
|
||||
<ClientOnly>
|
||||
<ContentRenderer
|
||||
:value="post"
|
||||
class="!max-w-none prose dark:prose-invert"
|
||||
/>
|
||||
:value="post"
|
||||
class="!max-w-none prose dark:prose-invert"
|
||||
/>
|
||||
</ClientOnly>
|
||||
<div class="space-y-4 mt-8">
|
||||
<PostFooter />
|
||||
|
||||
@@ -6,4 +6,4 @@
|
||||
"es": "Utilizo mi Beelink como primer servidor de mi homelab, con Proxmox, para alojar servicios autogestionados, ejecutar contenedores Docker y probar herramientas de código abierto."
|
||||
},
|
||||
"category": "homelab"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,4 +6,4 @@
|
||||
"es": "Utilizo mi switch TP-Link de 5 puertos para conectar mis distintos dispositivos de red a mi servidor principal y garantizar una comunicación local rápida y estable."
|
||||
},
|
||||
"category": "homelab"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,4 +6,4 @@
|
||||
"es": "Uptime Kuma, Beszel, Traefik, Cloudflare, MySpeed, AdGuard Home, Portainer, Home Assistant, Minio, Immich, Vaultwarden, Tailscale, Palmr y Cap.so"
|
||||
},
|
||||
"category": "homelab"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,4 +6,4 @@
|
||||
"es": "Diseñado para la flexibilidad y el rendimiento, Visual Studio Code es mi entorno de desarrollo principal. Ligero pero potente, admite Python, JavaScript, TypeScript, SQL y mucho más. Aprovecho sus extensiones e integraciones con IA para programar más rápido, mejor y con un control total de mi entorno."
|
||||
},
|
||||
"category": "ide"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,20 +1,4 @@
|
||||
import { H3Event } from 'h3'
|
||||
|
||||
export default defineEventHandler(async (event) => {
|
||||
const [coding, editors, os, languages] = await Promise.all([
|
||||
cachedWakatimeCoding(event),
|
||||
cachedWakatimeEditors(event),
|
||||
cachedWakatimeOs(event),
|
||||
cachedWakatimeLanguages(event)
|
||||
])
|
||||
|
||||
return {
|
||||
coding,
|
||||
editors,
|
||||
os,
|
||||
languages
|
||||
}
|
||||
})
|
||||
import type { H3Event } from 'h3'
|
||||
|
||||
const cachedWakatimeCoding = defineCachedFunction(async (event: H3Event) => {
|
||||
const config = useRuntimeConfig(event)
|
||||
@@ -23,7 +7,7 @@ const cachedWakatimeCoding = defineCachedFunction(async (event: H3Event) => {
|
||||
}, {
|
||||
maxAge: 24 * 60 * 60,
|
||||
name: 'wakatime',
|
||||
getKey: () => 'coding'
|
||||
getKey: () => 'coding',
|
||||
})
|
||||
|
||||
const cachedWakatimeEditors = defineCachedFunction(async (event: H3Event) => {
|
||||
@@ -33,7 +17,7 @@ const cachedWakatimeEditors = defineCachedFunction(async (event: H3Event) => {
|
||||
}, {
|
||||
maxAge: 24 * 60 * 60,
|
||||
name: 'wakatime',
|
||||
getKey: () => 'editors'
|
||||
getKey: () => 'editors',
|
||||
})
|
||||
|
||||
const cachedWakatimeOs = defineCachedFunction(async (event: H3Event) => {
|
||||
@@ -43,7 +27,7 @@ const cachedWakatimeOs = defineCachedFunction(async (event: H3Event) => {
|
||||
}, {
|
||||
maxAge: 24 * 60 * 60,
|
||||
name: 'wakatime',
|
||||
getKey: () => 'os'
|
||||
getKey: () => 'os',
|
||||
})
|
||||
|
||||
const cachedWakatimeLanguages = defineCachedFunction(async (event: H3Event) => {
|
||||
@@ -53,5 +37,21 @@ const cachedWakatimeLanguages = defineCachedFunction(async (event: H3Event) => {
|
||||
}, {
|
||||
maxAge: 24 * 60 * 60,
|
||||
name: 'wakatime',
|
||||
getKey: () => 'languages'
|
||||
})
|
||||
getKey: () => 'languages',
|
||||
})
|
||||
|
||||
export default defineEventHandler(async (event) => {
|
||||
const [coding, editors, os, languages] = await Promise.all([
|
||||
cachedWakatimeCoding(event),
|
||||
cachedWakatimeEditors(event),
|
||||
cachedWakatimeOs(event),
|
||||
cachedWakatimeLanguages(event),
|
||||
])
|
||||
|
||||
return {
|
||||
coding,
|
||||
editors,
|
||||
os,
|
||||
languages,
|
||||
}
|
||||
})
|
||||
|
||||
@@ -68,16 +68,18 @@ interface ActivityMessages {
|
||||
invalid: string
|
||||
}
|
||||
|
||||
const createTimeUnit = (singular: string, plural: string, pastSingular?: string, futureSingular?: string): TimeUnit =>
|
||||
(n: number, past = true) => {
|
||||
function createTimeUnit(singular: string, plural: string, pastSingular?: string, futureSingular?: string): TimeUnit {
|
||||
return (n: number, past = true) => {
|
||||
if (n === 1) {
|
||||
return past ? (pastSingular || `last ${singular}`) : (futureSingular || `next ${singular}`)
|
||||
}
|
||||
return `${n} ${plural}`
|
||||
}
|
||||
}
|
||||
|
||||
const createSimpleTimeUnit = (unit: string): TimeUnit =>
|
||||
(n: number) => `${n} ${unit}${n > 1 ? 's' : ''}`
|
||||
function createSimpleTimeUnit(unit: string): TimeUnit {
|
||||
return (n: number) => `${n} ${unit}${n > 1 ? 's' : ''}`
|
||||
}
|
||||
|
||||
export const activityMessages: Record<'en' | 'fr' | 'es', ActivityMessages> = {
|
||||
en: {
|
||||
@@ -94,11 +96,11 @@ export const activityMessages: Record<'en' | 'fr' | 'es', ActivityMessages> = {
|
||||
invalid: '',
|
||||
},
|
||||
fr: {
|
||||
justNow: "à l'instant",
|
||||
justNow: 'à l\'instant',
|
||||
past: (n: string) => n.match(/\d/) ? `il y a ${n}` : n,
|
||||
future: (n: string) => n.match(/\d/) ? `dans ${n}` : n,
|
||||
month: (n: number, past = true) => n === 1 ? (past ? 'le mois dernier' : 'le mois prochain') : `${n} mois`,
|
||||
year: (n: number, past = true) => n === 1 ? (past ? "l'année dernière" : "l'année prochaine") : `${n} ans`,
|
||||
year: (n: number, past = true) => n === 1 ? (past ? 'l\'année dernière' : 'l\'année prochaine') : `${n} ans`,
|
||||
day: (n: number, past = true) => n === 1 ? (past ? 'hier' : 'demain') : `${n} jours`,
|
||||
week: (n: number, past = true) => n === 1 ? (past ? 'la semaine dernière' : 'la semaine prochaine') : `${n} semaines`,
|
||||
hour: createSimpleTimeUnit('heure'),
|
||||
@@ -169,11 +171,11 @@ export const navs: readonly Nav[] = [
|
||||
{ label: { en: 'uses', fr: 'usages', es: 'usos' }, to: '/uses', icon: 'backpack-duotone' },
|
||||
{ label: { en: 'writings', fr: 'écrits', es: 'escritos' }, to: '/writings', icon: 'books-duotone' },
|
||||
{ label: { en: 'projects', fr: 'projets', es: 'proyectos' }, to: '/projects', icon: 'code-duotone' },
|
||||
{
|
||||
label: { en: 'resume', fr: 'cv', es: 'currículum' },
|
||||
icon: 'address-book-duotone',
|
||||
to: 'https://files.arthurdanjou.fr/s/resume',
|
||||
target: '_blank'
|
||||
{
|
||||
label: { en: 'resume', fr: 'cv', es: 'currículum' },
|
||||
icon: 'address-book-duotone',
|
||||
to: 'https://files.arthurdanjou.fr/s/resume',
|
||||
target: '_blank',
|
||||
},
|
||||
] as const
|
||||
|
||||
|
||||
Reference in New Issue
Block a user