docs: Add a blog to perfetto.dev - #7261
Open
primiano wants to merge 1 commit into
Open
Conversation
For now the blog is hidden (i.e. it's not linked, works only if you open perfetto.dev/blog/). I plan to unhide it later once we prove everything works fine on the prod site. A post is a directory named YYYY-MM-DD-slug holding post.md plus its images. The date orders the feed but is dropped from the URL, so fixing a wrong date doesn't break a permalink; images are hoisted to /blog/media/<slug>/ so /blog/<slug> can stay an extensionless file like the docs pages. Front matter is title/author/summary, authors being @-prefixed GitHub handles as in rfcs/template.md. The site gains a card index, an Atom feed, its own BM25 search index and per-post covers. A cover is the post's first image, or generated from the title when it has none; the index links 640px thumbnails instead of full screenshots, which takes it from ~1MB of cover art to ~180KB. Avatars are committed under authors/ (tools/fetch_avatars) rather than hotlinked, so a reader loading a post sends nothing to github.com. Two things needed generalizing rather than duplicating: - render.mjs took /docs/ as the only content root. It now takes a `post` and switches link and image handling on it, and renderPage passes the front matter through to the template. - Every article rule was written `.docs .doc`, which would have meant a post claiming to be a docs page to get typography. `.doc` and `.toc` are hoisted to the top level and renamed `.md-content`, which is what they always were; `.docs` and `.blog` are now separate shells that share them. That also fixes the footer licence notice, which was keyed off `.docs` and so went missing on the blog index. The blog is deliberately unlisted for now: no top-bar link, and the feed is advertised only on blog pages. Re-add the link in template_header.html to launch it. Drive-by: marked's mangle option obfuscated mailto: addresses with Math.random(), which made every build byte-different. Disabled, so the output is reproducible again.
| // proxy 301s those to the trailing-slash form; do the same here so the dev | ||
| // server and production agree. | ||
| if (key !== "" && !key.endsWith("/") && currentSite.has(key + "/index.html")) { | ||
| res.writeHead(301, { Location: uri + "/" }); |
🎨 Perfetto UI Builds
|
LalitMaganti
approved these changes
Aug 27, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
For now the blog is hidden (i.e. it's not linked, works only if you
open perfetto.dev/blog/). I plan to unhide it later once we prove
everything works fine on the prod site.
A post is a directory named YYYY-MM-DD-slug holding post.md plus its
images. The date orders the feed but is dropped from the URL, so fixing
a wrong date doesn't break a permalink; images are hoisted to
/blog/media// so /blog/ can stay an extensionless file like
the docs pages. Front matter is title/author/summary, authors being
@-prefixed GitHub handles as in rfcs/template.md.
The site gains a card index, an Atom feed, its own BM25 search index and
per-post covers. A cover is the post's first image, or generated from
the title when it has none; the index links 640px thumbnails instead of
full screenshots, which takes it from ~1MB of cover art to ~180KB.
Avatars are committed under authors/ (tools/fetch_avatars) rather than
hotlinked, so a reader loading a post sends nothing to github.com.
Two things needed generalizing rather than duplicating:
postand switches link and image handling on it, and renderPage passes the
front matter through to the template.
.docs .doc, which would have meant apost claiming to be a docs page to get typography.
.docand.tocare hoisted to the top level and renamed
.md-content, which is whatthey always were;
.docsand.blogare now separate shells thatshare them. That also fixes the footer licence notice, which was
keyed off
.docsand so went missing on the blog index.The blog is deliberately unlisted for now: no top-bar link, and the feed
is advertised only on blog pages. Re-add the link in template_header.html
to launch it.
Drive-by: marked's mangle option obfuscated mailto: addresses with
Math.random(), which made every build byte-different. Disabled, so the
output is reproducible again.