I'm trying to use Enlive to generate a multilingual, multi-regional sitemap following the Google spec/example here:
...and not having much progress. Say my template file looks like this,
(require '[net.cgrand.enlive-html :as html])
(html/defsnippet xhtml-link-snippet "sitemap-mlmr.xml"
[:xhtml:link]
[hreflang-m]
[:xhtml:link] (html/set-attr :hreflang (:hreflang hreflang-m)
:href (:href hreflang-m)))
(html/defsnippet url-snippet "sitemap-mlmr.xml"
[:url]
[url-m]
[:loc] (html/content (:loc url-m))
[[(html/nth-last-child 1)]] (html/content (map xhtml-link-snippet
(:hreflang-list url-m))))
(html/deftemplate sitemap-mlmr "sitemap-mlmr.xml"
[url-list]
[:urlset] (html/content (map url-snippet url-list)))
(def sample-urls
])
(reduce str (sitemap-mlmr sample-urls))
The self-closing xhtml:link tag seems to cause issues, but is not the only problem. Any tips/help appreciated, thanks!