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

Add sitemap.xsl if exists #143

Merged
merged 2 commits into from Dec 4, 2016
Merged

Add sitemap.xsl if exists #143

merged 2 commits into from Dec 4, 2016

Conversation

a-mt
Copy link
Contributor

@a-mt a-mt commented Dec 2, 2016

No description provided.

Copy link
Contributor

@benbalter benbalter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Small style change, but 👍

@@ -46,6 +46,7 @@ def sitemap
site_map.content = File.read(source_path).gsub(MINIFY_REGEX, "")
site_map.data["layout"] = nil
site_map.data["static_files"] = static_files.map(&:to_liquid)
site_map.data["xsl"] = File.exist? @site.in_source_dir("sitemap.xsl")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd abstract sitemap_exists to be file_exists? and share the logic between the two methods.

@@ -1,4 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
{% if page.xsl %}
<?xml-stylesheet type="text/xsl" href="{{ "/sitemap.xsl" | absolute_url }}"?>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd intent this for readability (it's minifified anyways)

Copy link
Contributor

@benbalter benbalter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work!

@benbalter
Copy link
Contributor

@jekyllbot: merge +minor

@jekyllbot jekyllbot merged commit 73a50cb into jekyll:master Dec 4, 2016
jekyllbot added a commit that referenced this pull request Dec 4, 2016
@pathawks pathawks mentioned this pull request Dec 4, 2016
@a-mt a-mt deleted the xsl branch December 6, 2016 09:06
@jekyll jekyll locked and limited conversation to collaborators Apr 27, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants