Separate notes collection with proper /notes/ permalinks and documentation#108
Separate notes collection with proper /notes/ permalinks and documentation#108
Conversation
…ermalinks Co-authored-by: benkutil <228373+benkutil@users.noreply.github.com>
Deploying benkutil-github-io with
|
| Latest commit: |
b419e89
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://4ab93f4b.benkutil-github-io.pages.dev |
| Branch Preview URL: | https://copilot-update-slug-for-note.benkutil-github-io.pages.dev |
|
@copilot two updates:
|
Co-authored-by: benkutil <228373+benkutil@users.noreply.github.com>
Done! I've created both:
I've also updated Commit: |
AGENTS.md
Outdated
| The project includes specialized agents for specific tasks: | ||
|
|
||
| - **Writing Agent** (`.github/agents/writing-agent.md`) - Content creation and editing following the site's writing style | ||
| - **Content Collections Agent** (`.github/agents/content-collections-agent.md`) - Managing posts and notes collections, directory structure, and permalinks |
There was a problem hiding this comment.
Removed the Content Collections Agent reference from AGENTS.md.
Commit: b419e89
Co-authored-by: benkutil <228373+benkutil@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Separates “notes” into their own Eleventy collection so they publish under /notes/…/ instead of /posts/…/, and adds contributor documentation for publishing content.
Changes:
- Added directory data files to define
postsandnotescollections and their permalink patterns. - Introduced
src/notes/and added/moved note content into it. - Added a detailed publishing guide and updated contributor/agent documentation.
Reviewed changes
Copilot reviewed 4 out of 10 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| src/posts/posts.json | Defines default posts tag + /posts/{{ … }}/ permalink pattern for files in src/posts/. |
| src/notes/notes.json | Defines default notes tag + /notes/{{ … }}/ permalink pattern for files in src/notes/. |
| src/notes/2023-01-04-context.md | Adds note content under the new notes collection. |
| src/notes/2022-12-22-the-stretch-pants-of-work.md | Adds note content under the new notes collection. |
| src/notes/2022-12-18-order-of-operations.md | Adds note content under the new notes collection. |
| src/notes/2022-12-15-debugging-is-hard.md | Adds note content under the new notes collection. |
| src/notes/2022-12-14-christmas-lists-are-boring.md | Adds note content under the new notes collection. |
| src/notes/2022-12-13-gov-org-chart.md | Adds note content under the new notes collection. |
| docs/how-to/publishing-content.md | Documents how to publish posts/notes, including permalink conventions and examples. |
| AGENTS.md | Updates project structure + adds content management quick reference and agent links. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| - **Notes**: Short thoughts in `src/notes/`, URL pattern `/notes/{slug}/` | ||
| - Both use directory data files (`posts.json`, `notes.json`) for default configuration | ||
| - Filenames use date prefix: `YYYY-MM-DD-title.md` | ||
| - Permalinks are clean, without date prefixes |
There was a problem hiding this comment.
This quick reference says permalinks are “clean, without date prefixes”, but the current collection permalinks use {{ page.fileSlug }}, which will include the YYYY-MM-DD- prefix when filenames follow the documented convention. Align this statement with the actual permalink behavior (or update permalink generation to strip the date prefix).
| - Permalinks are clean, without date prefixes | |
| - Permalinks include the date prefix from the filename (e.g. `/posts/2024-01-01-title/`) |
| - **Writing Agent** (`.github/agents/writing-agent.md`) - Content creation and editing following the site's writing style | ||
|
|
||
| When working on tasks related to these domains, consult the appropriate agent documentation. |
There was a problem hiding this comment.
AGENTS.md references .github/agents/content-collections-agent.md, but that file does not exist in the repo (only .github/agents/writing-agent.md is present). Either add the missing agent doc or remove/update this reference to avoid a broken link.
| The `{slug}` is derived from your filename, removing the date prefix: | ||
|
|
||
| - File: `2026-02-03-my-new-post.md` | ||
| - URL: `/posts/my-new-post/` | ||
|
|
There was a problem hiding this comment.
This section says {slug} is derived by removing the date prefix (e.g., 2026-02-03-my-new-post.md → /posts/my-new-post/), but the configured permalinks use {{ page.fileSlug }}, which will include the full filename (including the date prefix). Update the documentation examples (including earlier localhost URLs) or change permalink/slug generation so URLs actually drop the date prefix.
| @@ -0,0 +1,4 @@ | |||
| { | |||
| "tags": "posts", | |||
| "permalink": "/posts/{{ page.fileSlug }}/" | |||
There was a problem hiding this comment.
page.fileSlug includes the full filename (e.g., 2026-02-03-my-new-post), so this permalink will keep the date prefix in the URL. This contradicts the PR goal/docs of “clean” slugs without date prefixes. Consider using a computed slug that strips the leading YYYY-MM-DD- (or update the docs/file-naming guidance to match the actual URL behavior).
| "permalink": "/posts/{{ page.fileSlug }}/" | |
| "permalink": "/posts/{{ page.fileSlug | split('-') | slice(3) | join('-') }}/" |
| @@ -0,0 +1,4 @@ | |||
| { | |||
| "tags": "notes", | |||
| "permalink": "/notes/{{ page.fileSlug }}/" | |||
There was a problem hiding this comment.
page.fileSlug preserves the date prefix from filenames like 2022-12-14-..., so this will generate /notes/2022-12-14-.../ rather than the documented /notes/{slug}/ without the date. If the intended behavior is to drop the date prefix, update the permalink to use a computed slug that strips it.
| "permalink": "/notes/{{ page.fileSlug }}/" | |
| "permalink": "/notes/{{ page.fileSlug | slice(11) }}/" |
Description
Notes were tagged correctly but stored in
src/posts/, causing them to generate/posts/{slug}/URLs. Site infrastructure (feeds, home layout) already expected a separate notes collection. This PR implements the proper collection structure and adds comprehensive documentation for managing content.Related Issue
Changes Made
src/notes/directory and moved 6 note files fromsrc/posts/src/posts/posts.json:permalink: "/posts/{{ page.fileSlug }}/"src/notes/notes.json:permalink: "/notes/{{ page.fileSlug }}/"docs/how-to/publishing-content.mdwith:AGENTS.mdwith:Result: Notes now generate
/notes/{slug}/URLs, posts generate/posts/{slug}/URLs (cleaner, date-prefix removed)Checklist
npm run build:prod)npm start)Screenshots (if applicable)
N/A - Content reorganization and documentation, no visual changes to rendered pages
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.