Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Human readable stylesheets #273

Closed
mesge opened this issue Apr 18, 2017 · 5 comments
Closed

Human readable stylesheets #273

mesge opened this issue Apr 18, 2017 · 5 comments

Comments

@mesge
Copy link

mesge commented Apr 18, 2017

I noticed there's no option to configure a stylesheet for generated sitemaps. Having a human-readable sitemap can often be useful for debugging (imagine you're not a developer and reading raw XML or ruby code is daunting). Is there any intention to add a feature like this to the roadmap? More than happy to help out with a PR if maintainers are interested.

@kjvarga
Copy link
Owner

kjvarga commented Apr 18, 2017 via email

@mesge
Copy link
Author

mesge commented Apr 18, 2017

Not exactly. For example, in the Wordpress ecosystem a plugin made by Yoast generates styled xml sitemaps with linkable locations. Here's what it looks like.

A styled sitemap is a little easier to digest than the document tree shown by most browsers when the stylesheet isn't present. Can be handy to confirm that everything is in order.

I'm just proposing an optional config option that can point to a stylesheet.

@kjvarga
Copy link
Owner

kjvarga commented Sep 26, 2017

Would the user would have to host their own stylesheet? Or is there a public one we can use?

@kjvarga
Copy link
Owner

kjvarga commented Oct 12, 2017

This isn't a priority for most people. I'd consider including a stylesheet if it was hosted remotely and was reliable.

@kjvarga kjvarga closed this as completed Oct 12, 2017
@jess
Copy link

jess commented Feb 27, 2023

I came across this need today @kjvarga. I monkey patched for now, but I could submit a pr to make this optional if you want.

Something like:

SitemapGenerator::Sitemap.stylesheet_path = '/stylesheets/xml-stylesheet.xsl'

That would add the reference to the sitemap:

<?xml-stylesheet type="text/xsl" href="/stylesheets/xml-stylesheet.xsl"?>

We could include a simple example of a xsl file to help people get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants