diff --git a/Dockerfile b/Dockerfile index 5225ebb..19dbadd 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM node:18-alpine AS build +FROM node:22-alpine AS build WORKDIR /app @@ -10,7 +10,7 @@ COPY . /app RUN npm run build -FROM node:18-alpine AS prod +FROM node:22-alpine AS prod WORKDIR /app diff --git a/app.vue b/app.vue index f4b9fe0..c8080a2 100644 --- a/app.vue +++ b/app.vue @@ -3,19 +3,13 @@ diff --git a/assets/app.css b/assets/app.css index bd36a30..36e56ca 100644 --- a/assets/app.css +++ b/assets/app.css @@ -1,6 +1,10 @@ -@tailwind base; -@tailwind components; -@tailwind utilities; +@import "tailwindcss"; + +@theme { + --color-primary: #b22222; + --color-darkgray: #2b292a; + --color-lightgray: #e3dfdf; +} * { font-family: "ConthraxSemiBold"; diff --git a/components/Footer.vue b/components/Footer.vue index b92195f..967da90 100644 --- a/components/Footer.vue +++ b/components/Footer.vue @@ -29,7 +29,6 @@ diff --git a/components/Header.vue b/components/Header.vue index 9deea5d..22cf62c 100644 --- a/components/Header.vue +++ b/components/Header.vue @@ -54,7 +54,7 @@ v-for="sublink in navbar_sub_items" :key="sublink.id" :to="`/${params?.[0]}/${sublink.URL}`" - :class="sublink.URL == params?.[1] && !params[2] ? 'active' : ''" + :class="sublink.URL == params?.[1] ? 'active' : ''" class="w-fit" > {{ sublink.name }} @@ -64,8 +64,6 @@ diff --git a/components/base/ListImageItem.vue b/components/base/ListImageItem.vue index 4a40a1d..432d2e5 100644 --- a/components/base/ListImageItem.vue +++ b/components/base/ListImageItem.vue @@ -4,27 +4,27 @@ :class="allowNavigation ? '' : 'pointer-events-none'" :to="`${urlOverwrite ?? $route.path}/${data?.slug}`" > -
+

{{ itemIndex }}.

-
+

{{ data?.title }}

-

+

{{ itemDate }}

@@ -42,7 +42,7 @@ import type Lookup from "../../types/collection/lookup"; const runtimeConfig = useRuntimeConfig(); const baseUrl = runtimeConfig.public.strapi.url; -const { logo } = await provideGlobal(); +const { logo } = useGlobal(); const props = defineProps({ data: Object as PropType, diff --git a/components/base/ListItem.vue b/components/base/ListItem.vue index 2be7a84..3746e9e 100644 --- a/components/base/ListItem.vue +++ b/components/base/ListItem.vue @@ -4,7 +4,7 @@ :class="allowNavigation ? '' : 'pointer-events-none'" :to="`${urlOverwrite ?? $route.path}/${data?.slug}`" > -

+

{{ itemIndex }}.

diff --git a/components/shared/EmphasiseArticle.vue b/components/shared/EmphasiseArticle.vue index ade964f..8d99d1e 100644 --- a/components/shared/EmphasiseArticle.vue +++ b/components/shared/EmphasiseArticle.vue @@ -25,7 +25,7 @@ import type SharedEmphasiseArticle from "../../types/component/shared/emphasiseA import type Lookup from "../../types/collection/lookup"; const { find } = useStrapi(); -const { data: lookup } = await useAsyncData("lookup", () => +const { data: lookup } = await useAsyncData(() => find("collection-lookups", { filters: { collection: "articles", diff --git a/components/shared/List.vue b/components/shared/List.vue index 40b2348..b04ce21 100644 --- a/components/shared/List.vue +++ b/components/shared/List.vue @@ -113,13 +113,13 @@ const pagination = ref({ page: 0, pageSize: 0, pageCount: 0, total: 0 }); const activeYear = ref(0); if (props.data?.lookup.list_with_date != "none") { - const { data: year } = await useAsyncData>("distinct-years", () => + const { data: year } = await useAsyncData>(() => $fetch(`${baseUrl}/api/custom/${props.data?.lookup.collection}/distinct-years`) ); years.value = year.value ?? []; activeYear.value = years.value[0] ?? 0; } -const { data: collections } = await useAsyncData("collection", () => +const { data: collections } = await useAsyncData(() => find(props.data?.lookup.collection ?? "", { ...(props.data?.lookup?.list_with_date != "none" ? { @@ -235,7 +235,7 @@ async function changeTimedData(year: number) { withCount: true, }, }); - console.log(data); + collection.value = data?.data; pagination.value = (data?.meta.pagination as unknown as { page: number; diff --git a/composables/calculateTitle.ts b/composables/calculateTitle.ts deleted file mode 100644 index 2b9ab75..0000000 --- a/composables/calculateTitle.ts +++ /dev/null @@ -1,11 +0,0 @@ -import provideGlobal from "./provideGlobal"; - -export default async function () { - const runtimeConfig = useRuntimeConfig(); - const appTitle = runtimeConfig.public.app.title; - - const { SEO } = await provideGlobal(); - const { metaTitle } = SEO ?? {}; - - return metaTitle ?? appTitle; -} diff --git a/composables/provideGlobal.ts b/composables/provideGlobal.ts deleted file mode 100644 index 61beaf8..0000000 --- a/composables/provideGlobal.ts +++ /dev/null @@ -1,9 +0,0 @@ -import type Global from "../types/single/global"; - -export default async function () { - const { findOne } = useStrapi(); - const { data: global } = await useAsyncData("global", () => findOne("global")); - const { logo, navbar, footer, SEO } = global.value?.data ?? {}; - - return { logo, navbar, footer, SEO }; -} diff --git a/composables/useGlobal.ts b/composables/useGlobal.ts new file mode 100644 index 0000000..922c1f5 --- /dev/null +++ b/composables/useGlobal.ts @@ -0,0 +1,26 @@ +import type BaseFile from "../types/component/baseFile"; +import type Footer from "../types/component/global/footer"; +import type Navbar from "../types/component/global/navbar"; +import type SEO from "../types/component/global/seo"; +import type Global from "../types/single/global"; + +export const useGlobal = () => { + const global = useState("global"); + const runtimeConfig = useRuntimeConfig(); + const appTitle = runtimeConfig.public.app.title; + + const logo = computed(() => global.value?.logo ?? null); + const navbar = computed(() => global.value?.navbar ?? null); + const footer = computed