Skip to content

Instantly share code, notes, and snippets.

@Graywolf9
Graywolf9 / generate_list.php
Created September 11, 2023 19:59 — forked from dooug/generate_list.php
Generate list of pages in Drupal
<?php
/**
* @file gets "path, title" csv format of entries from node, menu_links, menu_router
*
* run from within drupal project root: drush scr generate_list.php
*/
// Bootstrap Drupal
define('DRUPAL_ROOT', getcwd());
require_once DRUPAL_ROOT . '/includes/bootstrap.inc';
#!/bin/env ruby
require 'yaml'
require 'json'
removed = Hash.new { |hash, key| hash[key] = 0 }
ARGV.each do |base|
Dir.glob(["**/*.html", "**/*.md"], base: base).each do |path|
file = File.join(base, path)