Cambio con hashtags
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
---
|
||||
// src/layouts/PostLayout.astro
|
||||
import { getHeadings } from '../utils/getHeadings'; // Asumimos que crearemos esta utilidad
|
||||
import RelatedPosts from '../components/PostsRelacionados.astro'; // Componente para posts relacionados
|
||||
import Navbar from '../components/Navbar.astro';
|
||||
import Footer from '../components/Footer.astro';
|
||||
@@ -48,7 +47,7 @@ const linkedinShareUrl = `https://www.linkedin.com/shareArticle?mini=true&url=${
|
||||
"headline": "${frontmatter.titulo}",
|
||||
"image": "${frontmatter.imagen && new URL(frontmatter.imagen, Astro.site)}",
|
||||
"datePublished": "${frontmatter.fecha}",
|
||||
"dateModified": "${frontmatter.lastModified || frontmatter.fecha}",
|
||||
"dateModified": "${frontmatter.fecha}",
|
||||
"author": {
|
||||
"@type": "Person",
|
||||
"name": "${frontmatter.autor}"
|
||||
@@ -154,7 +153,7 @@ const linkedinShareUrl = `https://www.linkedin.com/shareArticle?mini=true&url=${
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<Navbar posts="/" proyectos="/" />
|
||||
<Navbar proyectos="/" />
|
||||
|
||||
<header class="post-header">
|
||||
<div class="container">
|
||||
|
||||
@@ -5,6 +5,7 @@ autor: 'Lucas Curiel'
|
||||
fecha: '08/10/24'
|
||||
descripcion: 'Descripcion de prueba. Esto es un post de ejemplo con muchas de las cosas que se pueden poner en los posts'
|
||||
imagen: 'https://upload.wikimedia.org/wikipedia/commons/0/04/Forest_nature_reserve_Grady_nad_Moszczenica3%2C_Poland%2C_6_May_2006.JPG'
|
||||
hashtags: ['ODS', 'Desarrollo Sostenible', 'Naciones Unidas']
|
||||
---
|
||||
import ImagenMD from "../../components/ImagenMD.astro"
|
||||
|
||||
@@ -13,6 +14,7 @@ import ImagenMD from "../../components/ImagenMD.astro"
|
||||
Los Objetivos de Desarrollo Sostenible (ODS) son un conjunto de 17 objetivos globales establecidos por las Naciones Unidas en 2015 como parte de la Agenda 2030 para el Desarrollo Sostenible. Estos objetivos buscan erradicar la pobreza, proteger el planeta y asegurar la prosperidad para todos.
|
||||
|
||||
<ImagenMD alt="Bosque" src="https://upload.wikimedia.org/wikipedia/commons/0/04/Forest_nature_reserve_Grady_nad_Moszczenica3%2C_Poland%2C_6_May_2006.JPG"/>
|
||||
<ImagenMD alt="Bosque" src="https://ecobjetivos.h4ckdata.es/imgs/logo.png"/>
|
||||
## Los 17 Objetivos
|
||||
|
||||
### 1. Fin de la Pobreza
|
||||
|
||||
@@ -1,14 +0,0 @@
|
||||
export function getHeadings(content) {
|
||||
const headingRegex = /^(#{1,6})\s+(.+)$/gm;
|
||||
const headings = [];
|
||||
let match;
|
||||
|
||||
while ((match = headingRegex.exec(content)) !== null) {
|
||||
const depth = match[1].length;
|
||||
const text = match[2];
|
||||
const slug = text.toLowerCase().replace(/[^\w]+/g, '-');
|
||||
headings.push({ depth, text, slug });
|
||||
}
|
||||
|
||||
return headings;
|
||||
}
|
||||
Reference in New Issue
Block a user