make-docs-pages.sh 409 B

12345678910111213141516171819202122
  1. #!/bin/bash
  2. DOCS_DIR="${1:-doc}"
  3. DOC_FILES=$( find $DOCS_DIR -maxdepth 1 -type f -name '*.md' )
  4. i=4000
  5. for docFile in $DOC_FILES; do
  6. export PAGE_INDEX="$i"
  7. export IS_NAVBAR="false"
  8. baseName="$(basename -s .md $docFile)"
  9. pageFile="md-pages/doc-$baseName.md" # todo flatten
  10. title="Doc: ${baseName}"
  11. scripts/import/md-to-page.sh "$docFile" "$title" > "$pageFile"
  12. i=$(expr $i + 1)
  13. done