getgrav / grav-plugin-sitemap

Grav Sitemap Plugin
https://getgrav.org
MIT License
42 stars 42 forks source link

Disable use of Google Fonts #112

Closed Thorn2910 closed 6 months ago

Thorn2910 commented 6 months ago

Plugin uses Google Fonts - this could lead to problems in Germany - can we diable the use of them?

Karmalakas commented 6 months ago

Could you point to the part of code where Google Fonts are used? 🧐

Thorn2910 commented 6 months ago

Found it in sitemap.xsl

and removed

https://github.com/getgrav/grav-plugin-sitemap/blob/81afe6293e44d42478a6542a1dc6abbcfc855866/sitemap.xsl#L17 https://github.com/getgrav/grav-plugin-sitemap/blob/81afe6293e44d42478a6542a1dc6abbcfc855866/sitemap.xsl#L34 https://github.com/getgrav/grav-plugin-sitemap/blob/81afe6293e44d42478a6542a1dc6abbcfc855866/sitemap.xsl#L57

also in sitemap-news.xsl

https://github.com/getgrav/grav-plugin-sitemap/blob/81afe6293e44d42478a6542a1dc6abbcfc855866/sitemap-news.xsl#L19 https://github.com/getgrav/grav-plugin-sitemap/blob/81afe6293e44d42478a6542a1dc6abbcfc855866/sitemap-news.xsl#L36 https://github.com/getgrav/grav-plugin-sitemap/blob/81afe6293e44d42478a6542a1dc6abbcfc855866/sitemap-news.xsl#L59

After reload Google Font Checker could not find anything

rhukster commented 6 months ago

You can just disable the "XSL stylesheet" to not have an HTML version of the sitemap at all, and it will just serve the XML version to the browser like it does to Google. Alternatively you can copy and modify the sitemap.xsl file that contains the references to the Google fonts, and then tell sitemap plugin to use it via the sitemap_news_path config option.

What you did my modifying the core plugin sitemap.xsl file, is going to be lost with the next plugin update.