Astro features

Astro features

Ainda não há uma tradução neste idioma. Exibindo uma versão disponível.

This page brings together examples of Astro’s built-in Markdown and MDX enhancements.

Content organization

DirectoryPurpose
content/posts/Articles
content/pages/Standalone pages and builtin page introductions

Use a Markdown or MDX file for a simple entry. Create a folder with index.md or index.mdx when an article needs colocated images, components, or attachments. A post’s slug sets its address; for example, slug: demos produces /en/posts/demos/ with the default language-prefix policy.

Posts require a title and publication date. Other useful fields include a description, tags, and a cover image:

YAML
title: An example article
slug: example
date: 2026-01-01
description: Introduce the article in one sentence.
tags: [astro, content]
image: ./cover.webp
featured: true

Bundle images and attachments

Relative paths let you keep article assets beside the content. The cover and examples below are included as attachments in this post bundle.

A soft blue and cyan gradient

Example attachments: plain text, Python code, an HTML page, a Markdown file, and an archive.

Article display options

Choose which article details to show globally in article.display, then override individual entries with the display frontmatter field.

FieldDisplayed content
titleTitle, description
authorAuthor
publishedPublication date
updatedLast update
tagsTags at the bottom
shareShare button and panel
navigationPrevious and next articles

All options are enabled by default. When updated is provided and differs from the publication date, the last update appears at the bottom of the article. To hide only the author on one entry, for example:

YAML
display:
author: false

Other fields inherit the global settings. Standalone pages support the same display options.

Markdown and MDX enhancements

Callouts

Create a callout with markers such as > [!NOTE] or > [!TIP]. Add a custom title after the marker.

Expressive Code blocks

greeting.ts
type Reader = { name: string };
const reader: Reader = { name: 'BlogGPT' };
function greeting({ name }: Reader) {
return `Hello, ${name}!`;
}
Terminal
pnpm check
pnpm build

KaTeX math

Inline math such as E=mc2E=mc^2 appears alongside text. Surround display math with $$:

∫01x2 dx=13\int_0^1 x^2\,dx = \frac{1}{3}

Mermaid diagrams

Write a diagram in a code block marked mermaid:

flowchart LR
A[Write content] --> B[Preview locally]
B --> C[Build the site]
C --> D[Publish]

Image lightbox

Click an image to view it at full size. Zoom, switch images, or press Escape to close the lightbox.

Blue and cyan watercolor

A cyan aurora in a dark blue sky

Interactive MDX components

Adjust the sine wave’s amplitude, period, and initial phase with the sliders. Use arrow keys for smaller adjustments, or click Reset to restore the initial values.

Sine wave explorer

y = 1.0 sin(2πx / 6.28 + 0.00)

Sine curve; adjust parameters using the sliders below-3-2-1123−2π−π0π2π

Import an Astro component into an .mdx file, then place it in the body. This demo keeps the component and calculation helper under article-enhancements/ in its bundle:

MDX
import SineWave from './article-enhancements/SineWave.astro';
<SineWave lang="en" />

Keep one-off components in their article bundle, or write simple markup directly in MDX. Put components shared by multiple articles in custom/components/ and import them using relative paths.

Per-entry enhancement switches

Set global defaults for enhancements under article in blog.config.ts. Outlines use toc.enabled, and automatic share covers use shareCover.enabled. An article or standalone page can override only the fields it needs:

YAML
math: true
mermaid: false
lightbox: true
callouts: true
toc: true
shareCover: false

true enables a feature, false disables it, and omitted fields inherit global settings. Available switches are math (KaTeX), mermaid (diagrams), lightbox (image zoom), callouts, toc (article outline), and shareCover (automatic social image). Disabling math, diagrams, or callouts displays their source or a plain quotation; disabling automatic share covers uses the configured article cover.

Find an article

The homepage and search panel both find content. The default scope is “Articles”; “Titles” includes only article titles and descriptions, “Body” includes only article bodies, and “Everywhere” includes articles, tags and standalone pages.

Body matches include surrounding context. Click a passage to jump to the matching paragraph.

Complete commands and articles

Type / to show matching commands, or @ to complete titles from all public articles.

CommandAction
/randomOpen a random recent public article
/lang enSwitch the interface language
/theme darkChange appearance; light and system are also available
/statusOpen blog statistics
/archivesOpen the archives

Keyboard shortcuts

ShortcutAction
Ctrl+K / ⌘+KOpen search
Ctrl+Shift+S / ⌘+Shift+SToggle the sidebar
Ctrl+Shift+O / ⌘+Shift+OReturn home
Shift+EscFocus the homepage input
Ctrl+/ / ⌘+/View keyboard shortcuts

Resize the sidebar by dragging its edge, or using arrow keys when the resize control is focused.

Site statistics

Open statistics from the bottom-left author menu or by entering /status in the homepage input.

Dates and publication states

SettingPublication behavior
Publication date reachedPublished and included in lists and search
draft: trueSaved as a draft for development preview
Future datePublished when rebuilt after the date is reached
hidden: trueDirect address remains available; omitted from lists and search

date sets publication time, and updated sets the last update. Common date aliases are also supported for migration. See Frontmatter.

Organize existing content

Place Markdown / MDX files in content/posts/, with images and attachments managed in bundles. Convert the previous system’s shortcodes and template tags to Markdown, HTML or MDX. Tags link through slugs. See Content and feature examples for the file layout.

Deploy and update

For automatic blog builds and deployments, connect a Git repository to Vercel (recommended):

  1. Push the theme source to your own Git repository and import it into Vercel.
  2. Select Astro for Framework Preset and keep Root Directory at the repository root.
  3. Set Install Command to pnpm install --frozen-lockfile, Build Command to pnpm build and Output Directory to dist. Select Node.js 24.x and add ENABLE_EXPERIMENTAL_COREPACK=1 to the Production and Preview environment variables.
  4. Set site.baseUrl to the production domain, commit the configuration and deploy. Later pushes to the production branch automatically rebuild and update the site; use other branches for previews.

pnpm build generates bundled attachments, share covers and Pagefind search indexes. Trigger another build when a scheduled article reaches its publication date. Other static hosts can also publish the complete dist/ directory with directory indexes and a 404 page.

See Build and deploy for the full steps.

contentdesigni18nmarkdown

Pesquisar notas

Notas recentes

CurrículoSwift LanguageAndroid Coroutines and FlowKafkaDockerScrum basics

Atalhos de teclado

Pesquisar notas
Ctrl+K
Mostrar ou ocultar a barra lateral
Ctrl+Shift+S
Início
Ctrl+Shift+O
Focar o campo de pesquisa
Shift+Esc
Atalhos de teclado
Ctrl+/

Estatísticas do blog

Notas
17
Caracteres
73.597
Dias no ar
1051
Idioma
en / pt
Primeira publicação
1 de jan. de 1970
Última atualização
16 de nov. de 2026
Tamanho médio
4.329
Intervalo médio
1298.3 dias / nota

Publicações no último ano

SQSdez.jan.fev.mar.abr.mai.jun.jul.ago.set.out.nov.

Notas públicos no fuso horário do site. Tons mais escuros indicam mais publicações.

Tamanho dos notas recentes