跳到主要内容

内容

实操

线上真实问题的定位与修复步骤。

2026年4月18日

How to generate OG images at build time

Produce share cards in a build step: one template, a loop over your content, and a content hash so nothing re-renders unless content changes.

阅读 →

2026年4月18日

How to set up X (Twitter) cards correctly

One tag decides the layout, the rest fall back to Open Graph: the card types, the fallback rules, the image limits and the property-versus-name trap.

阅读 →

2026年4月14日

How to find and fix a redirect loop

A loop is almost always two rules pointing at each other. Trace the hops, find the pair, and collapse them into one canonical rule that ends in a 200.

阅读 →

2026年4月12日

How to add JSON-LD to an Astro site

Build the schema object in frontmatter, inject it with set:html, and avoid the two traps that break most Astro installs: dead expressions and a stray <.

阅读 →

2026年4月10日

How to block AI crawlers with robots.txt

The user-agent tokens to disallow — GPTBot, ClaudeBot, CCBot and the rest — plus why robots.txt is only a request, and what to do when a bot ignores it.

阅读 →

2026年4月7日

How to generate a sitemap (and check it before you ship)

Hand-write one, or let your framework emit it. Concrete Astro and Next.js setups, when each is right, and the self-check to run before the file goes live.

阅读 →

2026年3月17日

How to debug Open Graph tags behind a CDN

When a site sits behind Cloudflare, Vercel or Nginx, three HTML documents exist. Here is how to confirm, layer by layer, what the crawler sees.

阅读 →

2026年3月10日

How to fix a missing favicon in Next.js

The App Router and the Pages Router expect favicons in different places, and static export adds its own failure modes. Here is the fix.

阅读 →