Skip to content

feat: set page title from filename#74

Merged
jfernandez merged 1 commit intojfernandez:mainfrom
taylorcjensen:set-page-title-from-content
Apr 2, 2026
Merged

feat: set page title from filename#74
jfernandez merged 1 commit intojfernandez:mainfrom
taylorcjensen:set-page-title-from-content

Conversation

@taylorcjensen
Copy link
Copy Markdown
Contributor

@taylorcjensen taylorcjensen commented Mar 18, 2026

The browser tab always shows "Markdown Preview" regardless of which document is open. This sets the page title to the filename stem via a template variable on the server side, so each file gets a meaningful tab title.

In directory mode, the title updates on each navigation since the server renders a fresh page per file.

Since live reload does a full page reload, the title also updates automatically when switching files.

The browser tab always shows 'Markdown Preview' regardless of content.
Use the filename (without extension) as the page title. This is passed
from the server as a template variable so it works in both single-file
and directory mode.
@taylorcjensen taylorcjensen force-pushed the set-page-title-from-content branch from 4a2bf94 to 6b34aeb Compare March 19, 2026 02:14
@jfernandez
Copy link
Copy Markdown
Owner

Hey, the code looks good but the PR title and description don't match what it actually does. The title says "from first h1 heading" and the body talks about a JS function extracting h1, but the code sets the title from the filename stem server-side via a template variable. No JS involved.

Your commit message ("set page title from filename") is the accurate one. Can you update the PR title and description to match?

@taylorcjensen taylorcjensen changed the title feat: set page title from first h1 heading feat: set page title from filename Apr 2, 2026
@taylorcjensen
Copy link
Copy Markdown
Contributor Author

Sorry about the confusion — I updated the title and description to match what the code actually does. Thanks for catching that.

@jfernandez jfernandez merged commit b05d7fe into jfernandez:main Apr 2, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants