You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hugo does not sanitize the url front matter field. This means you have the ability to generate:
File paths that contain characters reserved by the operating system. For example, a file path on Windows may not contain a colon (:). Hugo throws an error if you include reserved characters. Learn more about Windows file naming conventions.
URLs that contain disallowed characters. For example, the less than sign (<) is not allowed in a URL.
If you need to include a colon in the url front matter field, escape it with backslash characters. Use one backslash if you wrap the string within single quotes, or use two backslashes if you wrap the string within double quotes. As described above, this will fail on Windows because the colon (:) is a reserved character.
The text was updated successfully, but these errors were encountered:
jmooring
changed the title
Document backslash escaping in url and permalinks
Document backslash escaping in the url front matter field
Oct 16, 2024
jmooring
added a commit
to jmooring/hugo-docs
that referenced
this issue
Oct 16, 2024
Pending merge/release of gohugoio/hugo#12938.
See gohugoio/hugo#12918 for examples.
Wait until these are resolved:
Notes:
Hugo does not sanitize the
url
front matter field. This means you have the ability to generate::
). Hugo throws an error if you include reserved characters. Learn more about Windows file naming conventions.<
) is not allowed in a URL.If you need to include a colon in the
url
front matter field, escape it with backslash characters. Use one backslash if you wrap the string within single quotes, or use two backslashes if you wrap the string within double quotes. As described above, this will fail on Windows because the colon (:
) is a reserved character.The text was updated successfully, but these errors were encountered: