File tree Expand file tree Collapse file tree 9 files changed +263
-6
lines changed
Expand file tree Collapse file tree 9 files changed +263
-6
lines changed Original file line number Diff line number Diff line change @@ -5,8 +5,10 @@ import tailwind from '@astrojs/tailwind';
55
66import alpinejs from '@astrojs/alpinejs' ;
77
8+ import sitemap from '@astrojs/sitemap' ;
9+
810// https://astro.build/config
911export default defineConfig ( {
1012 site : "https://ecuadorintech.org" ,
11- integrations : [ tailwind ( ) , alpinejs ( ) ]
13+ integrations : [ tailwind ( ) , alpinejs ( ) , sitemap ( ) ]
1214} ) ;
Original file line number Diff line number Diff line change 1010 },
1111 "dependencies" : {
1212 "@astrojs/alpinejs" : " ^0.4.0" ,
13+ "@astrojs/rss" : " ^4.0.10" ,
14+ "@astrojs/sitemap" : " ^3.2.1" ,
1315 "@astrojs/tailwind" : " ^5.1.3" ,
1416 "@types/alpinejs" : " ^3.13.11" ,
1517 "alpinejs" : " ^3.14.6" ,
Original file line number Diff line number Diff line change 1+ User-agent: *
2+ Allow: /
3+
4+ Sitemap: https://ecuadorintech.org/sitemap-index.xml
Load Diff Large diffs are not rendered by default.
Original file line number Diff line number Diff line change 11[
22 {
3+ "id" : " git-github-workshop" ,
34 "title" : " Git & GitHub" ,
45 "description" : " Hands-on Workshop para iniciantes." ,
5- "links" : [
6- " https://ecuadorintech.org"
7- ],
6+ "link" : " https://ecuadorintech.org/events" ,
87 "date" : " 2024-12-4" ,
98 "place" : " Online" ,
109 "modality" : " Virtual" ,
1110 "hostedBy" : " Ecuador In Tech" ,
1211 "image" : " /github-workshop.jpg" ,
1312 "attendees" : 31
1413 }
15- ]
14+ ]
1615
Original file line number Diff line number Diff line change 1414 <li ><a href =" /" class =" text-gray-300 hover:text-white" >Inicio</a ></li >
1515 <li ><a href =" /communities" class =" text-gray-300 hover:text-white" >Comunidades</a ></li >
1616 <li ><a href =" /events" class =" text-gray-300 hover:text-white" >Eventos</a ></li >
17+ <li ><a href =" /rss.xml" class =" text-gray-300 hover:text-white" > Suscríbete a nuestro canal RSS</a ></li >
1718 </ul >
1819 </div >
1920 <div >
Original file line number Diff line number Diff line change @@ -10,12 +10,19 @@ const { title } = Astro.props;
1010---
1111
1212<!doctype html >
13- <html lang =" en " >
13+ <html lang =" es " >
1414 <head >
1515 <meta charset =" UTF-8" />
1616 <meta name =" description" content =" Ecuador In Tech" />
1717 <meta name =" viewport" content =" width=device-width" />
1818 <link rel =" icon" type =" image/svg+xml" href =" /favicon.png" />
19+ <link rel =" sitemap" href =" /sitemap-index.xml" />
20+ <link
21+ rel =" alternate"
22+ type =" application/rss+xml"
23+ title =" RSS Feed for Ecuador In Tech"
24+ href ={ new URL (" rss.xml" , Astro .site )}
25+ />
1926 <meta name =" generator" content ={ Astro .generator } />
2027 <title >{ title } </title >
2128
Original file line number Diff line number Diff line change 1+ import rss from '@astrojs/rss' ;
2+ import fs from 'fs' ;
3+ import path from 'path' ;
4+
5+ export async function GET ( context ) {
6+ const filePath = path . join ( process . cwd ( ) , 'src/assets/events.json' ) ;
7+ const fileContents = fs . readFileSync ( filePath , 'utf-8' ) ;
8+ const events = JSON . parse ( fileContents ) ;
9+
10+ return rss ( {
11+ title : 'Eventos de Ecuador In Tech' ,
12+ description : 'Una lista de eventos organizados por Ecuador In Tech.' ,
13+ site : context . site ,
14+ stylesheet : '/rss/styles.xsl' ,
15+ items : events . map ( ( event ) => ( {
16+ title : event . title ,
17+ description : event . description ,
18+ link : event . link ,
19+ date : event . date ,
20+ place : event . place ,
21+ modality : event . modality ,
22+ hostedBy : event . hostedBy ,
23+ customData : `
24+ <date>${ event . date } </date>
25+ <place>${ event . place } </place>
26+ <hostedBy>${ event . hostedBy } </hostedBy>
27+ `
28+ } ) ) ,
29+ } ) ;
30+ }
You can’t perform that action at this time.
0 commit comments