Migrate to Astro V5 (#22)

* fix video url

* update deploy script for using rsync

* remove delete from script

* translate resources page

* fix images dimensions and favicon

* add css optimization plugin and improve images

* update project dependencies

* refactor lang

* post translated to spanish

* fix metadata

* update dependencies

* update dependencies

* update dependencies

* update to Astro 5.x

* format index.astro

* Migrate content layer to Astro V5
This commit is contained in:
Juan Manzanero
2025-02-01 17:33:00 -06:00
committed by GitHub
parent 9363bf7a20
commit 4f0e80b988
46 changed files with 2265 additions and 2034 deletions

View File

@ -1,30 +1,30 @@
const months = [
"January",
"February",
"March",
"April",
"May",
"June",
"July",
"August",
"September",
"October",
"November",
"December",
'January',
'February',
'March',
'April',
'May',
'June',
'July',
'August',
'September',
'October',
'November',
'December',
];
const meses = [
"Enero",
"Febrero",
"Marzo",
"Abril",
"Mayo",
"Junio",
"Julio",
"Agosto",
"Septiembre",
"Octubre",
"Noviembre",
"Diciembre",
'Enero',
'Febrero',
'Marzo',
'Abril',
'Mayo',
'Junio',
'Julio',
'Agosto',
'Septiembre',
'Octubre',
'Noviembre',
'Diciembre',
];
export default function formatDate(date: Date | string, lang: string) {
@ -34,7 +34,7 @@ export default function formatDate(date: Date | string, lang: string) {
const day = newDate.getDate();
const year = newDate.getFullYear();
return lang !== "es"
return lang !== 'es'
? `${month} ${day}, ${year}`
: `${day} de ${mes} del ${year}`;
}

View File

@ -1,10 +1,10 @@
import PocketBase from "pocketbase";
import type { RecordService } from "pocketbase";
import PocketBase from 'pocketbase';
import type { RecordService } from 'pocketbase';
export enum Collections {
Microblogs = "microblogs",
Tags = "tags",
Users = "users",
Microblogs = 'microblogs',
Tags = 'tags',
Users = 'users',
}
export type IsoDateString = string;
@ -62,19 +62,19 @@ export type CollectionResponses = {
};
export type TypedPocketBase = PocketBase & {
collection(idOrName: "microblogs"): RecordService<MicroblogsResponse>;
collection(idOrName: "tags"): RecordService<TagsResponse>;
collection(idOrName: "users"): RecordService<UsersResponse>;
collection(idOrName: 'microblogs'): RecordService<MicroblogsResponse>;
collection(idOrName: 'tags'): RecordService<TagsResponse>;
collection(idOrName: 'users'): RecordService<UsersResponse>;
};
export function createServerClient(url: string) {
if (!url) {
throw new Error("Pocketbase API url not defined !");
throw new Error('Pocketbase API url not defined !');
}
if (typeof window !== "undefined") {
if (typeof window !== 'undefined') {
throw new Error(
"This method is only supposed to call from the Server environment",
'This method is only supposed to call from the Server environment'
);
}

View File

@ -1,6 +1,6 @@
export function sortContentByDate(array: any[]) {
array.sort(
(a: any, b: any) =>
Date.parse(b.data.date.toString()) - Date.parse(a.data.date.toString()),
Date.parse(b.data.date.toString()) - Date.parse(a.data.date.toString())
);
}