{
  "$schema": "https://playground.wordpress.net/blueprint-schema.json",
  "preferredVersions": {
    "php": "8.2",
    "wp": "latest"
  },
  "login": true,
  "landingPage": "/sitemap-block-demo/",
  "steps": [
    {
      "step": "installPlugin",
      "pluginData": {
        "resource": "wordpress.org/plugins",
        "slug": "html-sitemap"
      },
      "options": {
        "activate": true
      }
    },
    {
      "step": "setSiteOptions",
      "options": {
        "blogname": "HTML Sitemap Plugin Demo",
        "blogdescription": "Exploring the HTML Sitemap block and shortcode",
        "permalink_structure": "/%postname%/"
      }
    },
    {
      "step": "runPHP",
      "code": "<?php\nrequire_once( 'wordpress/wp-load.php' );\n\n$dq = chr( 34 );\n\n// Build a sitemap block comment with optional attributes\nfunction hs_make_block( $attrs = array() ) {\n    global $dq;\n    $sc = '[html_sitemap';\n    foreach ( $attrs as $k => $v ) {\n        $sc .= ' ' . $k . '=' . $dq . esc_attr( $v ) . $dq;\n    }\n    $sc .= ']';\n    $j = empty( $attrs ) ? '' : ' ' . wp_json_encode( $attrs );\n    $c = 'wp-block-html-sitemap-html-sitemap-block';\n    return '<!-- wp:html-sitemap/html-sitemap-block' . $j . ' --><div class=' . $dq . $c . $dq . '>' . $sc . '</div><!-- /wp:html-sitemap/html-sitemap-block -->';\n}\n\nfunction hs_h( $t, $l = 2 ) {\n    global $dq;\n    $c = 'wp-block-heading';\n    return '<!-- wp:heading {' . chr(34) . 'level' . chr(34) . ':' . $l . '} --><h' . $l . ' class=' . $dq . $c . $dq . '>' . esc_html( $t ) . '</h' . $l . '><!-- /wp:heading -->';\n}\n\nfunction hs_p( $t ) {\n    return '<!-- wp:paragraph --><p>' . $t . '</p><!-- /wp:paragraph -->';\n}\n\nfunction hs_hr() {\n    global $dq;\n    return '<!-- wp:separator --><hr class=' . $dq . 'wp-block-separator has-alpha-channel-opacity' . $dq . '/><!-- /wp:separator -->';\n}\n\nfunction hs_sc( $s ) {\n    return '<!-- wp:shortcode -->' . $s . '<!-- /wp:shortcode -->';\n}\n\nfunction hs_page( $title, $content, $parent = 0, $order = 0, $slug = '' ) {\n    $args = array(\n        'post_title'   => $title,\n        'post_content' => $content,\n        'post_status'  => 'publish',\n        'post_type'    => 'page',\n        'post_parent'  => $parent,\n        'menu_order'   => $order,\n    );\n    if ( $slug ) {\n        $args['post_name'] = $slug;\n    }\n    return wp_insert_post( $args );\n}\n\n// ── Top-level pages ──────────────────────────────────────────\n$about     = hs_page( 'About Us',       hs_p( 'Learn about our company, team, and mission.' ),       0, 10 );\n$services  = hs_page( 'Services',       hs_p( 'Explore our professional services.' ),                0, 20 );\n$products  = hs_page( 'Products',       hs_p( 'Browse our product offerings.' ),                     0, 30 );\n$resources = hs_page( 'Resources',      hs_p( 'Find guides, documentation, and support.' ),          0, 40 );\nhs_page( 'Contact Us',     hs_p( 'Get in touch with our team.' ),                           0, 50 );\nhs_page( 'Privacy Policy', hs_p( 'Our privacy policy and data handling practices.' ),       0, 60 );\nhs_page( 'Terms of Use',   hs_p( 'Terms and conditions for using our services.' ),          0, 70 );\n\n// ── About children ───────────────────────────────────────────\nhs_page( 'Our Team',        hs_p( 'Meet the people behind our company.' ),         $about, 1 );\nhs_page( 'Our Mission',     hs_p( 'Our vision, purpose, and core values.' ),        $about, 2 );\nhs_page( 'Company History', hs_p( 'Our story over the years.' ),                   $about, 3 );\n\n// ── Services children ────────────────────────────────────────\nhs_page( 'Web Design',   hs_p( 'Custom web design and development solutions.' ),    $services, 1 );\nhs_page( 'SEO Services', hs_p( 'Get found online with our SEO expertise.' ),       $services, 2 );\nhs_page( 'Consulting',   hs_p( 'Strategic digital guidance for your business.' ),  $services, 3 );\n\n// ── Products children ────────────────────────────────────────\nhs_page( 'Product Catalog', hs_p( 'Browse our full product line.' ),               $products, 1 );\nhs_page( 'Pricing Plans',   hs_p( 'Flexible pricing for every budget.' ),           $products, 2 );\nhs_page( 'Compare',         hs_p( 'Side-by-side comparison of our products.' ),    $products, 3 );\n\n// ── Resources children ───────────────────────────────────────\nhs_page( 'Getting Started', hs_p( 'Everything you need to get up and running.' ),  $resources, 1 );\nhs_page( 'Documentation',   hs_p( 'Comprehensive technical documentation.' ),      $resources, 2 );\nhs_page( 'FAQ',             hs_p( 'Answers to frequently asked questions.' ),      $resources, 3 );\nhs_page( 'Support',         hs_p( 'Get help from our support team.' ),             $resources, 4 );\n\n// ── Block Demo Page ───────────────────────────────────────────\n$bd =\n    hs_h( 'HTML Sitemap Block — Feature Showcase' ) .\n    hs_p( 'Each block below uses different settings to showcase the flexibility of the HTML Sitemap plugin. Add the block to any page via the block inserter (Widgets &#x2192; HTML Sitemap).' ) .\n    hs_hr() .\n\n    hs_h( '1. Default — All Pages, All Levels', 3 ) .\n    hs_p( 'Block with no configuration: displays the full page hierarchy.' ) .\n    hs_make_block() .\n    hs_hr() .\n\n    hs_h( '2. Top-Level Pages Only (depth=1)', 3 ) .\n    hs_p( 'Shows only the top-level parent pages, no children.' ) .\n    hs_make_block( array( 'depth' => '1' ) ) .\n    hs_hr() .\n\n    hs_h( '3. Two Levels Deep (depth=2)', 3 ) .\n    hs_p( 'Shows pages up to two levels of nesting.' ) .\n    hs_make_block( array( 'depth' => '2' ) ) .\n    hs_hr() .\n\n    hs_h( '4. Numbered List — Top Level (ordered_list_type=1)', 3 ) .\n    hs_p( 'Ordered list using numbers, top-level pages only.' ) .\n    hs_make_block( array( 'depth' => '1', 'ordered_list_type' => '1' ) ) .\n    hs_hr() .\n\n    hs_h( '5. Alphabetic Ordered List, 2 Levels (ordered_list_type=a)', 3 ) .\n    hs_p( 'Ordered list using lowercase letters, two levels deep.' ) .\n    hs_make_block( array( 'depth' => '2', 'ordered_list_type' => 'a' ) ) .\n    hs_hr() .\n\n    hs_h( '6. Roman Numeral List — Top Level (ordered_list_type=I)', 3 ) .\n    hs_p( 'Ordered list using uppercase roman numerals.' ) .\n    hs_make_block( array( 'depth' => '1', 'ordered_list_type' => 'I' ) ) .\n    hs_hr() .\n\n    hs_h( '7. Sorted A-Z with Published Date (show_date=true)', 3 ) .\n    hs_p( 'All pages in alphabetical order, published date shown beside each entry.' ) .\n    hs_make_block( array( 'sort_column' => 'post_title', 'sort_order' => 'ASC', 'show_date' => 'true' ) ) .\n    hs_hr() .\n\n    hs_h( '8. Most Recently Modified with Modified Date (show_date=modified)', 3 ) .\n    hs_p( 'Pages ordered by last modified date, newest first, with the modification date shown.' ) .\n    hs_make_block( array( 'sort_column' => 'post_modified', 'sort_order' => 'DESC', 'show_date' => 'modified' ) );\n\nhs_page( 'HTML Sitemap — Block Demo', $bd, 0, 80, 'sitemap-block-demo' );\n\n// ── Shortcode Demo Page ───────────────────────────────────────\n$sd =\n    hs_h( 'HTML Sitemap Shortcode — Feature Showcase' ) .\n    hs_p( 'Each section below demonstrates a different [html_sitemap] shortcode configuration using the classic Shortcode block.' ) .\n    hs_hr() .\n\n    hs_h( '1. Default Sitemap', 3 ) .\n    hs_p( '<code>[html_sitemap]</code> — full site hierarchy, no parameters.' ) .\n    hs_sc( '[html_sitemap]' ) .\n    hs_hr() .\n\n    hs_h( '2. Top-Level Pages Only (depth=1)', 3 ) .\n    hs_p( '<code>[html_sitemap depth=' . $dq . '1' . $dq . ']</code>' ) .\n    hs_sc( '[html_sitemap depth=' . $dq . '1' . $dq . ']' ) .\n    hs_hr() .\n\n    hs_h( '3. Two Levels Deep (depth=2)', 3 ) .\n    hs_p( '<code>[html_sitemap depth=' . $dq . '2' . $dq . ']</code>' ) .\n    hs_sc( '[html_sitemap depth=' . $dq . '2' . $dq . ']' ) .\n    hs_hr() .\n\n    hs_h( '4. Numbered Ordered List (ordered_list_type=1)', 3 ) .\n    hs_p( '<code>[html_sitemap ordered_list_type=' . $dq . '1' . $dq . ' depth=' . $dq . '1' . $dq . ']</code>' ) .\n    hs_sc( '[html_sitemap ordered_list_type=' . $dq . '1' . $dq . ' depth=' . $dq . '1' . $dq . ']' ) .\n    hs_hr() .\n\n    hs_h( '5. Alphabetic Ordered List (ordered_list_type=a)', 3 ) .\n    hs_p( '<code>[html_sitemap ordered_list_type=' . $dq . 'a' . $dq . ' depth=' . $dq . '2' . $dq . ']</code>' ) .\n    hs_sc( '[html_sitemap ordered_list_type=' . $dq . 'a' . $dq . ' depth=' . $dq . '2' . $dq . ']' ) .\n    hs_hr() .\n\n    hs_h( '6. Roman Numeral List (ordered_list_type=I)', 3 ) .\n    hs_p( '<code>[html_sitemap ordered_list_type=' . $dq . 'I' . $dq . ' depth=' . $dq . '1' . $dq . ']</code>' ) .\n    hs_sc( '[html_sitemap ordered_list_type=' . $dq . 'I' . $dq . ' depth=' . $dq . '1' . $dq . ']' ) .\n    hs_hr() .\n\n    hs_h( '7. With Published Dates, Sorted A-Z', 3 ) .\n    hs_p( '<code>[html_sitemap show_date=' . $dq . 'true' . $dq . ' sort_column=' . $dq . 'post_title' . $dq . ' sort_order=' . $dq . 'ASC' . $dq . ']</code>' ) .\n    hs_sc( '[html_sitemap show_date=' . $dq . 'true' . $dq . ' sort_column=' . $dq . 'post_title' . $dq . ' sort_order=' . $dq . 'ASC' . $dq . ']' ) .\n    hs_hr() .\n\n    hs_h( '8. Modified Date, Newest First', 3 ) .\n    hs_p( '<code>[html_sitemap show_date=' . $dq . 'modified' . $dq . ' sort_column=' . $dq . 'post_modified' . $dq . ' sort_order=' . $dq . 'DESC' . $dq . ']</code>' ) .\n    hs_sc( '[html_sitemap show_date=' . $dq . 'modified' . $dq . ' sort_column=' . $dq . 'post_modified' . $dq . ' sort_order=' . $dq . 'DESC' . $dq . ']' );\n\nhs_page( 'HTML Sitemap — Shortcode Demo', $sd, 0, 90, 'sitemap-shortcode-demo' );\n\nflush_rewrite_rules();\n"
    }
  ]
}
