Skip to content

Fix duplicate .well-known path causing Laika parser errors during site build #613

@Piyush-t24

Description

@Piyush-t24

While trying to run the website locally using:

scala-cli build.scala -- serve

I encountered a Laika parsing error caused by duplicate paths under .well-known:

Duplicate path: /.well-known/openpgpkey/policy
Duplicate path: /.well-known/security.txt

After investigating the build configuration, I noticed that the input tree includes:

.addDirectory("src")

and also explicitly adds:

.addDirectory("src/.well-known", Path.Root / ".well-known")

There is a comment in the code stating:

// Laika skips .dotfiles by default

which suggests that .well-known would normally be ignored when scanning src.
However, in my local setup it appears that the .well-known directory is already included through .addDirectory("src"), so adding it again results in duplicate paths during parsing.

When I comment out the following line:

.addDirectory("src/.well-known", Path.Root / ".well-known")

the site builds and runs successfully.

I wanted to ask whether this explicit directory mapping is still required with the current Laika version, or if it may now be redundant.

For reference, I have attached the stack trace produced during the build.

Happy to adjust the fix if there is a preferred approach.

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions