Fixed footer image path to use aliases
Fixed carousel - added to an init script and re runs on astro page change
This commit is contained in:
parent
435ae4fa05
commit
3b5a4a13d5
|
|
@ -14,8 +14,7 @@ pnpm-debug.log*
|
||||||
|
|
||||||
|
|
||||||
# environment variables
|
# environment variables
|
||||||
.env
|
.env.keys
|
||||||
.env.production
|
|
||||||
|
|
||||||
# macOS-specific files
|
# macOS-specific files
|
||||||
.DS_Store
|
.DS_Store
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
---
|
---
|
||||||
import { Image } from "astro:assets"
|
import { Image } from "astro:assets";
|
||||||
import "swiper/css";
|
import "swiper/css";
|
||||||
import "swiper/css/navigation";
|
import "swiper/css/navigation";
|
||||||
import "swiper/css/pagination";
|
import "swiper/css/pagination";
|
||||||
|
|
@ -20,7 +20,11 @@ const { images, class: className } = Astro.props;
|
||||||
{image.text}
|
{image.text}
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
<img class="w-full h-full object-cover object-center" src={image.image} alt={image.text} />
|
<img
|
||||||
|
class="w-full h-full object-cover object-center"
|
||||||
|
src={image.image}
|
||||||
|
alt={image.text}
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
))
|
))
|
||||||
|
|
@ -43,7 +47,12 @@ const { images, class: className } = Astro.props;
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import Swiper from "swiper";
|
import Swiper from "swiper";
|
||||||
import { Navigation, Pagination, Scrollbar } from 'swiper/modules';
|
import { Navigation, Pagination, Scrollbar } from "swiper/modules";
|
||||||
|
|
||||||
|
// Re-initialize after every page swap via View Transitions
|
||||||
|
document.addEventListener("astro:after-swap", init);
|
||||||
|
|
||||||
|
function init() {
|
||||||
const swiper = new Swiper(".swiper", {
|
const swiper = new Swiper(".swiper", {
|
||||||
// Optional parameters
|
// Optional parameters
|
||||||
modules: [Navigation, Pagination, Scrollbar],
|
modules: [Navigation, Pagination, Scrollbar],
|
||||||
|
|
@ -65,4 +74,8 @@ const { images, class: className } = Astro.props;
|
||||||
el: ".swiper-scrollbar",
|
el: ".swiper-scrollbar",
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// Initialize on the first page load
|
||||||
|
init();
|
||||||
</script>
|
</script>
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
---
|
---
|
||||||
import { Icon } from "astro-icon/components";
|
import { Icon } from "astro-icon/components";
|
||||||
import { Image } from "astro:assets";
|
import { Image } from "astro:assets";
|
||||||
import jbp from "../../assets/DRJBP-1.webp";
|
import jbp from "@assets/DRJBP-1.webp";
|
||||||
|
|
||||||
import { createTranslator, t } from '../../i18n';
|
import { createTranslator, t } from '../../i18n';
|
||||||
const tl = createTranslator(Astro.currentLocale);
|
const tl = createTranslator(Astro.currentLocale);
|
||||||
|
|
|
||||||
|
|
@ -4,18 +4,19 @@ import { z } from 'astro/zod';
|
||||||
|
|
||||||
const news = defineCollection({
|
const news = defineCollection({
|
||||||
loader: glob({ pattern: "**/*.md", base: "./src/content/news" }),
|
loader: glob({ pattern: "**/*.md", base: "./src/content/news" }),
|
||||||
schema: z.object({
|
schema: ({ image }) => z.object({
|
||||||
locale: z.string(),
|
locale: z.string().describe("News main language"),
|
||||||
title: z.string(),
|
title: z.string(),
|
||||||
date: z.date(),
|
date: z.date(),
|
||||||
|
draft: z.boolean().optional(),
|
||||||
place: z.string().optional(),
|
place: z.string().optional(),
|
||||||
city: z.string().optional(),
|
city: z.string().optional(),
|
||||||
state: z.string().optional(),
|
state: z.string().optional(),
|
||||||
country: z.string().optional(),
|
country: z.string().optional(),
|
||||||
thumbnail: z.string().optional(),
|
thumbnail: image().optional().describe("Main news thumbnail image"),
|
||||||
youtube: z.string().optional(),
|
youtube: z.string().optional(),
|
||||||
gallery: z.array(z.object({
|
gallery: z.array(z.object({
|
||||||
image: z.string().optional(),
|
image: image().optional(),
|
||||||
text: z.string().optional()
|
text: z.string().optional()
|
||||||
})).optional().nullable()
|
})).optional().nullable()
|
||||||
}),
|
}),
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,14 @@
|
||||||
{
|
{
|
||||||
"extends": "astro/tsconfigs/strict",
|
"extends": "astro/tsconfigs/strict",
|
||||||
"include": [".astro/types.d.ts", "**/*"],
|
"include": [".astro/types.d.ts", "**/*"],
|
||||||
"exclude": ["dist"]
|
"exclude": ["dist"],
|
||||||
|
"compilerOptions": {
|
||||||
|
"baseUrl": ".",
|
||||||
|
"paths": {
|
||||||
|
"@/*": ["src/*"],
|
||||||
|
"@assets/*": ["src/assets/*"],
|
||||||
|
"@components/*": ["src/components/*"],
|
||||||
|
"@layouts/*": ["src/layouts/*"]
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue