This isn't possible - a naked ampersand would be invalid xml. Literal ampersands in xml have to be replaced with &
Disable urlencode in sitemap_generator gem
-
06-07-2023 - |
Question
i am using sitemap_generator gem and i have a problem with alternates
this is the generating of the sitemap:
alternates = [ #adding mobile deep link
{lang: 'en',
href: "http://mysite/linker?view=user&user_id=1234"}
]
add user_path, :changefreq => 'weekly', :priority => 0.6, :images => user_images, :alternates => alternates
but in the sitemap xml file, i get
<xhtml:link rel="alternate" hreflang="en" href="http://mysite/linker?view=user&cat_id=1234"/>
so it replaces the &
with &
is there a way to leave it as is? with regular &
?
Solution
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow