diff --git a/quartz/plugins/emitters/contentIndex.ts b/quartz/plugins/emitters/contentIndex.ts
index 1c7feae..1d0af6d 100644
--- a/quartz/plugins/emitters/contentIndex.ts
+++ b/quartz/plugins/emitters/contentIndex.ts
@@ -29,7 +29,7 @@ const defaultOptions: Options = {
function generateSiteMap(cfg: GlobalConfiguration, idx: ContentIndex): string {
const base = cfg.baseUrl ?? ""
const createURLEntry = (slug: SimpleSlug, content: ContentDetails): string => `
- https://${base}/${slug}
+ https://${base}/${encodeURIComponent(slug)}
${content.date?.toISOString()}
`
const urls = Array.from(idx)
@@ -44,8 +44,8 @@ function generateRSSFeed(cfg: GlobalConfiguration, idx: ContentIndex): string {
const createURLEntry = (slug: SimpleSlug, content: ContentDetails): string => `-
${content.title}
- ${root}/${slug}
- ${root}/${slug}
+ ${root}/${encodeURIComponent(slug)}
+ ${root}/${encodeURIComponent(slug)}
${content.description}
${content.date?.toUTCString()}
`