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 support for multiple sitemaps, per theme #40

Closed
ghost opened this issue Sep 19, 2016 · 8 comments
Closed

Add support for multiple sitemaps, per theme #40

ghost opened this issue Sep 19, 2016 · 8 comments

Comments

@ghost
Copy link

ghost commented Sep 19, 2016

This plugin only creates a single sitemap file....?

You need to update this to be able to create multiple sitemaps e.g.

<?xml version="1.0" encoding="UTF-8"?>
<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
   <sitemap>
      <loc>http://www.example.com/sitemap1.xml.gz</loc>
      <lastmod>2004-10-01T18:23:17+00:00</lastmod>
   </sitemap>
   <sitemap>
      <loc>http://www.example.com/sitemap2.xml.gz</loc>
      <lastmod>2005-01-01</lastmod>
   </sitemap>
</sitemapindex>
@daftspunk
Copy link
Member

Interesting. Please provide a story where multiple sitemaps would be required, or justify why this is necessary.

@ghost
Copy link
Author

ghost commented Sep 20, 2016

A sitemap can have a max of 50,000 links so for example octobercms.com has a forum and so you would fill up the sitemap very quickly (hopefully) and then get stuck.

I was thinking maybe RainLab Blog and Forum plugins being able to create a separate sitemap for each category you create for example. This is something I need to code for one of my websites as each forum section - I have thousands of posts and so need to create many sitemaps.

~I am sure other people can suggest many ideas; but it's really useful to be able to create several sitemaps etc. thanks.

Sitemap limit: http://www.sitemaps.org/faq.html#faq_sitemap_size

@daftspunk
Copy link
Member

We are aware of the protocol limit of 50,000 records, according to the Google guidelines it cannot exceed this amount any way. I'm still yet to see a compelling reason why this is needed.

@ghost
Copy link
Author

ghost commented Sep 21, 2016

Hard to give some reasons etc. Maybe someone else can suggest some input here.

Best idea I could suggest would be like this:

(octobercms forum)

News / Announcements (sitemap 1) => http://octobercms.com/forum/chan/newsannouncements
Feature Requests (sitemap 2) => http://octobercms.com/forum/chan/feature-requests
Help / Support (sitemap 3) => http://octobercms.com/forum/chan/october-helpsupport
etc.

<?xml version="1.0" encoding="UTF-8"?>
<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
   <sitemap>
      <loc>http://www.example.com/sitemap1.xml.gz</loc>
      <lastmod>2004-10-01T18:23:17+00:00</lastmod>
   </sitemap>
   <sitemap>
      <loc>http://www.example.com/sitemap2.xml.gz</loc>
      <lastmod>2005-01-01</lastmod>
   </sitemap>
   <sitemap>
      <loc>http://www.example.com/sitemap3.xml.gz</loc>
      <lastmod>2005-01-01</lastmod>
   </sitemap>
</sitemapindex>

If I moved one of my vBulletin Forums over this is how I would set it up for Octobercms etc.

For Blogs I would setup different sitemaps for each of the category...

I guess could give a webmaster more control say Google bot has not crawled a section of their website and they want to send that section to Google webmaster tools to get it crawled etc.

Many reasons, but only if it's worth your time (of course) just a suggestion.

@ghost
Copy link
Author

ghost commented Sep 21, 2016

Another story/reason, say I add octobercms.com to Google News I would have to create two sitemaps then.

  1. A Google News Sitemap
  2. A Normal Sitemap

Search engines like Bing, Yahoo!, Yandex, Baidu, Naver etc can only crawl a normal sitemap and not a Google News, Images, Video, Mobile sitemap etc.

Google News sitemap: https://support.google.com/news/publisher/answer/74288?hl=en

@daftspunk
Copy link
Member

daftspunk commented Sep 22, 2016

Yes I see, to satisfy this feature, this plugin needs the following enhancements:

  • Add the ability to create multiple definitions; instead of default loading the definitions assigned to the active theme.
  • Sitemap definitions can make reference to other definitions as included items.
  • Add a checkbox list to the definition allowing multiple themes to be selected; one theme per definition.
  • When a definition is selected for a theme, it acts as the default/entry sitemap.xml
  • Other sitemaps can be assigned unique codes, available via sitemap.xml?code
  • Add an is_active boolean to control definition visibility.

@daftspunk daftspunk self-assigned this Sep 22, 2016
@daftspunk daftspunk changed the title Need to update this plugin badly Add support for multiple sitemaps, per theme Oct 29, 2016
@LukeTowers
Copy link
Contributor

@daftspunk do you still plan on implementing this?

@daftspunk
Copy link
Member

This is much easier to implement as a theme template using the resources component and building nodes using Twig like any other navigation:

url = "/sitemap-two.xml"

[resources]
headers[Content-Type] = 'application/xml'
==
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:xhtml="https://www.w3.org/1999/xhtml" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd">
    <url>
        <loc>https://mysite.tld/blog</loc>
        <lastmod>2022-10-10T00:14:00+00:00</lastmod>
        <changefreq>always</changefreq>
        <priority>0.5</priority>
    </url>
</urlset>

@daftspunk daftspunk closed this as not planned Won't fix, can't repro, duplicate, stale Oct 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants