Commit dd1c22a1 authored by Pawel Ginalski's avatar Pawel Ginalski
Browse files

Issue #3109090 by gbyte, cgmonroe, michele.lucchina, chr.fritsch, donaldinou:...

Issue #3109090 by gbyte, cgmonroe, michele.lucchina, chr.fritsch, donaldinou: Sitemap variant index functionality
parent 60a53819
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
id: default
label: Default
description: The default hreflang sitemap.
description: 'The default hreflang sitemap - lists URLs to be indexed by modern search engines.'
type: default_hreflang
weight: 0
status: true
+9 −0
Original line number Diff line number Diff line
id: index
label: Sitemap Index
description: 'The sitemap index listing all other sitemaps - useful if there are at least two other sitemaps. In most cases this sitemap should be last in the generation queue and set as the default sitemap.'
type: index
weight: 1000
status: false
dependencies:
  config:
    - simple_sitemap.type.index
+1 −1
Original line number Diff line number Diff line
id: default_hreflang
label: Default hreflang
description: The default hreflang sitemap type.
description: 'The default hreflang sitemap type. A sitemap of this type is understood by most modern search engines.'
sitemap_generator: default
url_generators:
  - custom
+6 −0
Original line number Diff line number Diff line
id: index
label: Sitemap Index
description: 'The sitemap index sitemap type. A sitemap of this type lists sitemaps of all other types.'
sitemap_generator: index
url_generators:
  - index
+36 −1
Original line number Diff line number Diff line
@@ -843,7 +843,7 @@ function simple_sitemap_update_8402() {
 */
function simple_sitemap_update_8403() {

  // Create default_hreflang sitemap type.
  // Create the default_hreflang sitemap type.
  $type_storage = \Drupal::entityTypeManager()->getStorage('simple_sitemap_type');
  if ($type_storage->load('default_hreflang') === NULL) {
    $type_storage->create([
@@ -891,3 +891,38 @@ function simple_sitemap_update_8404() {
    $sitemap->save();
  }
}

/**
 * Create the index sitemap type.
 */
function simple_sitemap_update_8405() {
  $type_storage = \Drupal::entityTypeManager()->getStorage('simple_sitemap_type');
  if ($type_storage->load('index') === NULL) {
    $type_storage->create([
      'id' => 'index',
      'label' => 'Sitemap Index',
      'description' => 'The sitemap index sitemap type. A sitemap of this type lists sitemaps of all other types.',
      'sitemap_generator' => 'index',
      'url_generators' => ['index'],
    ])->save();
  }
}

/**
 * Create the index sitemap.
 */
function simple_sitemap_update_8406() {
  $sitemap_storage = \Drupal::entityTypeManager()->getStorage('simple_sitemap');
  if ($sitemap_storage->load('index') === NULL) {
    $sitemap_storage->create([
      'id' => 'index',
      'label' => 'Sitemap Index',
      'description' => 'The sitemap index listing all other sitemaps - useful if there are at least two other sitemaps. In most cases this sitemap should be last in the generation queue and set as the default sitemap.',
      'type' => 'index',
      'weight' => 1000,
      'status' => FALSE,
    ])->save();
  }

  return t('A sitemap index which lists all other sitemaps is now available and can be enabled.');
}
Loading