Skip to content

Issue: Can't preview index.md of hugo reaf bundle with "previewPath": "/{{pathToken.relPath}}" #603

Description

@n-arakawa

Describe the bug

Previewing of hugo bundle(index.md) fails with 404.
Generated url is wrong when setting "previewPath" to "/{{pathToken.relPath}}"

To Reproduce

frontmatter.json

  "frontMatter.content.pageFolders": [{
    "title": "content",
    "path": "[[workspace]]/content",
    "filePrefix": null,
    "previewPath": "/{{pathToken.relPath}}"
  }]

contents

$ tree content
content
└── post
    └── bundle
        └── index.md

previewing content/post/bundle/index.md leads to wrong url:
http://localhost:1313/post/bundle/bundle

Expected behavior

expected url:
http://localhost:1313/post/bundle

Desktop (please complete the following information):

  • OS: Ubuntu2204
  • vscode: 1.79.2
  • frontMatter version: v8.4.0

Additional context

The vscode-front-matter/src/commands/Preview.ts seems try to handele index as a special case,
Howevere, slug = Article.getSlug(); at line number 100 sets slag to dir name(bundle in above example)

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions