<?php

/**
 * @file
 * Initialization of content for d_blog module.
 */

/**
 * Alter content structure.
 *
 * Implements hook_content_structure_alter()
 *
 * @param array $structure
 *   The array with structure.
 * @param string $context
 *   Which structure array is this?
 */
function d_blog_init_content_structure_alter(array &$structure, string $context) {
  $path = \Drupal::service('extension.path.resolver')->getPath('module', 'd_blog_init') . '/pages';

  if ($context == 'all') {
    $structure['blog_post_1'] = ['file' => "$path/post_1.yml"];
    $structure['blog_post_2'] = ['file' => "$path/post_2.yml"];
    $structure['blog_post_3'] = ['file' => "$path/post_3.yml"];
    $structure['blog_post_4'] = ['file' => "$path/post_4.yml"];
  }
}
