File Tree Test

This article tests the File Tree shortcode functionality in the FixIt theme.

Content Modes

Shortcode body

JSON format

  • src
    • index.ts
    • app.ts
  • README.md
  • .gitignore

YAML format

  • project-root/
    • package.json
    • tsconfig.json

TOML format

  • src
    • index.ts
    • app.ts
  • README.md

File data

TOML format

  • src-toml
    • index.ts
  • public
    • favicon.ico
  • package.json
  • README.md
  • tsconfig.json

TOML with folder slash and level 3:

  • src-toml/
    • components/
      • Header.tsx
      • Footer.tsx
    • utils/
      • helper.ts
      • validator.ts
    • index.ts
  • public/
    • images/
      • logo.png
    • favicon.ico
  • package.json
  • README.md
  • tsconfig.json

JSON format

  • src-json
    • index.ts
  • public
    • favicon.ico
  • package.json
  • README.md
  • tsconfig.json

JSON with folder slash and level 2:

  • src-json/
    • components/
      • Header.tsx
      • Footer.tsx
    • utils/
      • helper.ts
      • validator.ts
    • index.ts
  • public/
    • images/
      • logo.png
    • favicon.ico
  • package.json
  • README.md
  • tsconfig.json

YAML format

Trying the file not found case (should fallback to next mode):

  • my-project
    • package.json
    • README.md
    • tsconfig.json

Hugo data

Basic usage

  • my-project
    • package.json
    • README.md
    • tsconfig.json

Fully expanded

  • my-project
    • src
      • components
        • Header.tsx
        • Footer.tsx
      • utils
        • helper.ts
        • validator.ts
      • index.ts
    • public
      • images
        • logo.png
      • favicon.ico
    • package.json
    • README.md
    • tsconfig.json

Limited expansion

  • my-project
    • package.json
    • README.md
    • tsconfig.json

With folder slash

  • my-project/
    • package.json
    • README.md
    • tsconfig.json

With level and folder slash

  • my-project/
    • src/
      • index.ts
    • public/
      • favicon.ico
    • package.json
    • README.md
    • tsconfig.json

Collapsed with ignore

Filesystem Mode

Basic paths

  • test
    • .hugo_build.lock
    • hugo.toml
    • package.json
  • test
    • .hugo_build.lock
    • hugo.toml
    • package.json
  • content
  • /
    • .hugo_build.lock
    • hugo.toml
    • package.json
  • FixIt/apps/test
    • .hugo_build.lock
    • hugo.toml
    • package.json
  • content/posts
    • _index.md
    • alert-and-admonition-test.md
    • code-tabs-test.md
    • codeblock-test.md
    • color-preview-test.md
    • fontawesome-test.md
    • json-viewer-test.md
    • katex-test.md
    • mathjax-test.md
    • mermaid-diagrams-test.md
    • script-style-test.md
    • tabs-comprehensive-test.md
    • task-list-test.md

Named parameters

  • data
    • filetree
      • example.yml

Expansion levels

  • assets/
    • filetree/
      • example.json
  • assets
    • filetree
      • example.json

With ignore lists

  • test/
    • assets/
    • content/
    • data/
    • hugo.toml
    • package.json

root not exist

path=“nonexistent/path”

Code Block Rendering

Basic code block

YAML format:

  • my-project
    • package.json
    • README.md

TOML format

  • src
    • index.ts
  • README.md

With parameters

  • project/
    • config/
      • config.js
    • src/
      • index.js
    • .gitignore

Fully expanded

  • backend/
    • api/
      • routes/
        • users.js
        • posts.js
      • controllers/
        • userController.js
    • database/
      • models/
      • migrations/
    • app.js