Añadiendo un blog
Configuración inicial
Para configurar el sitio de su blog, comience por crear una carpeta blog
en el directorio website
de su repositorio.
Luego, agrega un enlace de encabezado a tu blog dentro de siteConfig.js
:
headerLinks: [
...
{blog: true, label: 'Blog'},
...
]
Añadiendo un blog
Para publicar en el blog, cree un archivo dentro de la carpeta del blog con un nombre formateado de YYYY-MM-DD-My-Blog-Post-Title.md
. La fecha de publicación se extrae del nombre del archivo.
Por ejemplo, en website/blog/2017-08-18-Introducing-Docusaurus.md
:
---
author: Frank Li
authorURL: https://twitter.com/foobarbaz
authorFBID: 503283835
title: Introducing Docusaurus
---
Lorem Ipusm..
Opciones de encabezado
El único campo obligatorio es title
; sin embargo, brindamos opciones para agregar información del autor a la publicación de tu blog.
author
- La etiqueta de texto del autor por línea.authorURL
- La url asociada con el autor. Esta podría ser una cuenta de Twitter, GitHub, Facebook, etc.authorFBID
- La identificación de Facebook que se utiliza para extraer la imagen de perfil.title
- El título de la publicación del blog.
Plan de resumen
Utilice el marcador <!--truncate-->
en su publicación de blog para representar lo que se mostrará como el resumen al visualizar todas las publicaciones de blog publicadas en el blog. Cualquier cosa sobre <!--truncate-->
será parte del resumen. Por ejemplo:
---
title: Truncation Example
---
All this will be part of the blog post summary.
Even this.
<!--truncate-->
But anything from here on down will not be.
Not this.
Or this.
Changing How Many Blog Posts Show on Sidebar
By default, 5 recent blog posts are shown on the sidebar.
You can configure a specific amount of blog posts to show by adding a blogSidebarCount
setting to your siteConfig.js
.
The available options are an integer representing the number of posts you wish to show or a string with the value 'ALL'.
Ejemplo:
blogSidebarCount: 'ALL'
RSS Feed
Docusaurus provides a simple RSS feed for your blog posts. Both RSS and Atom feed formats are supported. This data is automatically to your website page's HTML
tag.
A summary of the post's text is provided in the RSS feed up to the <!--truncate-->
. If no <!--truncate-->
tag is found, then all text up 250 characters are used.
Social Buttons
If you want Facebook and/or Twitter social buttons at the bottom of your blog posts, set the facebookAppId
and/or twitter
site configuration options in siteConfig.js
.