Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions apps/editorial-loop/publish.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ async function main() {

const content = fs.readFileSync(POST_PATH, 'utf8');

// Derive public URL from file path: content/blog/2026-04-18-my-slug.md → /blog/my-slug/
const filename = POST_PATH.split('/').pop().replace('.md', '');
const slug = filename.replace(/^\d{4}-\d{2}-\d{2}-/, '');
// Derive public URL from file path: content/blog/2026-04-18-my-slug.md → /blog/2026-04-18-my-slug/
// Hugo permalink includes the date prefix; the full basename (sans .md) is the slug.
const slug = POST_PATH.split('/').pop().replace('.md', '');
const postUrl = `${BASE_URL}/blog/${slug}/`;

console.log(`📖 Post: ${POST_PATH}`);
Expand Down
Loading