Skip to content
This repository has been archived by the owner on Jan 5, 2021. It is now read-only.

Redirects get included in sitemap, but they have "noindex, follow" metatag #11

Open
komor72 opened this issue Sep 19, 2018 · 2 comments

Comments

@komor72
Copy link

komor72 commented Sep 19, 2018

Hello again. :) Just found another side-effect. Redirects created in config.rb like:

redirect 'tags/peperoni.html', to: 'tags/pepperoni.html'

do get included in sitemap (which is probably fine?), but the Middleman includes a "noindex, follow" metatag in generated HTML code:

<meta name="robots" content="noindex,follow" />

which is being considered as an error by Google Search. Anybody has an opinion on which is better: disable redirects being added to sitemap, or changing the Middleman template HTML-code for redirects? Or create a new config option in middleman-search_engine_sitemap?

@komor72
Copy link
Author

komor72 commented Oct 8, 2018

A workaround for this behavious can be easily implemented using the exclude_if option:

activate :search_engine_sitemap, default_change_frequency: "weekly", exclude_if: ->(resource) {
  resource.source_file.nil?
}

The reason is that dynamically generated redirects have no source_file attributes (proxies do have source_file set to proxy template source file). If you guys think this is enough, then we can close this issue. But maybe it would helpful to think, what's right.

@Aupajo
Copy link
Owner

Aupajo commented Feb 27, 2019

Hey, sorry @komor72. I'm not maintaining this any more. It's been a few years since I used it myself, and I've lost touch with what's happening inside the Middleman codebase.

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

No branches or pull requests

2 participants