diff --git a/astro.config.mjs b/astro.config.mjs index 6ae911c..04c3c82 100644 --- a/astro.config.mjs +++ b/astro.config.mjs @@ -19,7 +19,7 @@ export default defineConfig({ }, image: { - domains: ['placehold.co'], + domains: ['placehold.co','ik.imagekit.io'], service: imageService(), }, }); \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 7207665..0605b4a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -8,10 +8,12 @@ "version": "0.0.1", "dependencies": { "@astrojs/markdoc": "^0.15.10", + "@iconify-json/ph": "^1.2.2", "@tailwindcss/vite": "^4.1.18", "@unpic/astro": "^1.0.2", "astro": "^5.17.1", "astro-icon": "^1.1.5", + "dayjs": "^1.11.19", "tailwindcss": "^4.1.18" }, "devDependencies": { @@ -616,6 +618,15 @@ "node": ">=18" } }, + "node_modules/@iconify-json/ph": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/@iconify-json/ph/-/ph-1.2.2.tgz", + "integrity": "sha512-PgkEZNtqa8hBGjHXQa4pMwZa93hmfu8FUSjs/nv4oUU6yLsgv+gh9nu28Kqi8Fz9CCVu4hj1MZs9/60J57IzFw==", + "license": "MIT", + "dependencies": { + "@iconify/types": "*" + } + }, "node_modules/@iconify/tools": { "version": "4.2.0", "resolved": "https://registry.npmjs.org/@iconify/tools/-/tools-4.2.0.tgz", @@ -2730,6 +2741,12 @@ "integrity": "sha512-aylIc7Z9y4yzHYAJNuESG3hfhC+0Ibp/MAMiaOZgNv4pmEdFyfZhhhny4MNiAfWdBQ1RQ2mfDWmM1x8SvGyp8g==", "license": "CC0-1.0" }, + "node_modules/dayjs": { + "version": "1.11.19", + "resolved": "https://registry.npmjs.org/dayjs/-/dayjs-1.11.19.tgz", + "integrity": "sha512-t5EcLVS6QPBNqM2z8fakk/NKel+Xzshgt8FFKAn+qwlD1pzZWxh0nVCrvFK7ZDb6XucZeF9z8C7CBWTRIVApAw==", + "license": "MIT" + }, "node_modules/debug": { "version": "4.4.3", "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz", diff --git a/package.json b/package.json index 011cf39..ba7ccd2 100644 --- a/package.json +++ b/package.json @@ -10,10 +10,12 @@ }, "dependencies": { "@astrojs/markdoc": "^0.15.10", + "@iconify-json/ph": "^1.2.2", "@tailwindcss/vite": "^4.1.18", "@unpic/astro": "^1.0.2", "astro": "^5.17.1", "astro-icon": "^1.1.5", + "dayjs": "^1.11.19", "tailwindcss": "^4.1.18" }, "devDependencies": { diff --git a/src/components/NewsCard.astro b/src/components/NewsCard.astro new file mode 100644 index 0000000..17b1c78 --- /dev/null +++ b/src/components/NewsCard.astro @@ -0,0 +1,19 @@ +--- +import Image from "astro/components/Image.astro"; +import { Icon } from 'astro-icon/components' +import dayjs from "dayjs"; + +const { data } = Astro.props; +const nicedate = dayjs(data.date).format('D MMMM YYYY') +--- +
+ +

{data.city}, {data.country}
({nicedate}):

+

{data.title}

+ + + +
+ {data.title} +
+
\ No newline at end of file diff --git a/src/components/NewsSection.astro b/src/components/NewsSection.astro new file mode 100644 index 0000000..6b89bba --- /dev/null +++ b/src/components/NewsSection.astro @@ -0,0 +1,18 @@ +--- +import Image from "astro/components/Image.astro"; +import { getCollection, getEntry } from "astro:content"; +import NewsCard from "./NewsCard.astro"; +const newsItems = await getCollection("news"); +--- +
+

Noticias

+

Actualidad institucional y proyección internacional

+ +
+ { + newsItems.map((item) => ( + + )) + } +
+
\ No newline at end of file diff --git a/src/pages/index.astro b/src/pages/index.astro index 7b6a54f..aac1cbf 100644 --- a/src/pages/index.astro +++ b/src/pages/index.astro @@ -1,19 +1,12 @@ --- import "../styles/global.css"; -import { getCollection, getEntry } from "astro:content"; + import MainLayout from "../layouts/MainLayout.astro"; import HeroHome from "../components/HeroHome.astro"; - -const newsItems = await getCollection("news"); +import NewsSection from "../components/NewsSection.astro"; --- - { - newsItems.map((item) => ( -
  • - {item.data.title} -
  • - )) - } +