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

Alternate Links does not works properly #203

Closed
diegodurante opened this issue Jul 15, 2015 · 1 comment
Closed

Alternate Links does not works properly #203

diegodurante opened this issue Jul 15, 2015 · 1 comment

Comments

@diegodurante
Copy link

Hi everybody,
If we try to create links using alternate links feature as reported into official documentation, the xml file generated is broken.

Tryed to create a sitemap.rb with just the code reported into official documentation:
config/sitemap.rb

SitemapGenerator::Sitemap.default_host = "http://www.example.com"
  SitemapGenerator::Sitemap.create do
    add('/index.html', :alternate => {
      :href => 'http://www.example.de/index.html',
      :lang => 'de',
      :nofollow => true
    })
end

Run the command: rake sitemap:refresh and got a sitemap.xml file with this output:

screen shot 2015-07-15 at 15 31 14

That of course is not an XML format.

Instead having a simple sitemap.rb file like this:

SitemapGenerator::Sitemap.default_host = "http://www.example.com"
  SitemapGenerator::Sitemap.create do
    add '/index.html',  priority: 1,   changefreq: 'daily'
end

Will produce a correct XML file like this:

screen shot 2015-07-15 at 15 48 30

Tested with these versions:

  • Ruby 2.1.3
  • Rails 4.2.3
  • sitemap_generator: 5.0.5

What is going on?
Thanks,
Diego.

@kjvarga
Copy link
Owner

kjvarga commented Jul 15, 2015

I've run the same test with the same versions and it works as it should.

Are you viewing the xml file in a browser? Only the contents of the XML elements will be shown, and not the element tags themselves.

@kjvarga kjvarga closed this as completed Jul 15, 2015
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

2 participants