ihp
ihp copied to clipboard
Sitemap instructions fails at parseRoute
Hi!
Tried to follow the SEO guide at the IHP docs: https://ihp.digitallyinduced.com/Guide/seo.html
In FrontController.hs is fails with the following error message:
⢠Could not deduce (Controller SitemapController)
arising from a use of āparseRouteā
from the context: (?applicationContext::IHP.ApplicationContext.ApplicationContext,
?application::WebApplication, ?context::RequestContext)
bound by the type signature for:
controllers :: forall controller.
(?applicationContext::IHP.ApplicationContext.ApplicationContext,
?application::WebApplication, ?context::RequestContext) =>
[RouteParser]
at /home/lillo/kode/kompak.ai/Web/FrontController.hs:14:5-15
⢠In the expression: parseRoute @SitemapController
In the expression:
[startPage WelcomeAction, parseRoute @SitemapController,
parseRoute @StaticController, parseRoute @PostsController]
In an equation for ācontrollersā:
controllers
= [startPage WelcomeAction, parseRoute @SitemapController,
parseRoute @StaticController, ....]typecheck(-Wdeferred-type-errors)
Likely an import Web.Controller.SitemapController is missing?
Aha! Yes, that was it, thank you!
Could you add the missing import to the docs?
Will do!
I also noticed that if lastModified date is Nothing, it produces a self-closing </lastmod> which Google Search Console says is invalid. Should I try to fix this as well?
I suspect it's here
Where it should maybe return as a plain mempty instead of a <lastmod> element containing mempty
Here is the invalid result.
<urlset>
<url>
<loc>
http://localhost:8000/nyheter/velkommen-til-fremtidens-kommunikasjonspakke
</loc>
<lastmod>2023-05-08</lastmod>
<changefreq>hourly</changefreq>
</url>
<url>
<loc>
http://localhost:8000/nyheter/artikkel-her-med-fengende-tittel
</loc>
<lastmod>2023-05-09</lastmod>
<changefreq>hourly</changefreq>
</url>
<url>
<loc>http://localhost:8000/nyheter/roboter-er-kule</loc>
<lastmod>2023-05-09</lastmod>
<changefreq>hourly</changefreq>
</url>
<url>
<loc>http://localhost:8000/nyheter/tezter</loc>
<lastmod>2023-05-09</lastmod>
<changefreq>hourly</changefreq>
</url>
<url>
<loc>http://localhost:8000/nyheter/test</loc>
<lastmod>2023-05-09</lastmod>
<changefreq>hourly</changefreq>
</url>
<url>
<loc>http://localhost:8000/nyheter/hey-godamn</loc>
<lastmod>2023-05-09</lastmod>
<changefreq>hourly</changefreq>
</url>
<url>
<loc>https://kompak.ai</loc>
<lastmod/>
<changefreq>hourly</changefreq>
</url>
<url>
<loc>https://kompak.ai/nyheter</loc>
<lastmod/>
<changefreq>hourly</changefreq>
</url>
</urlset>
Yes that sounds good š If possible, maybe you can also add a unit test for that