Skip to content

Using --root seems to make it miss shortcodes #1692

Open
@ralfbiedert

Description

@ralfbiedert

Bug Report

Environment

Zola version: master

Expected Behavior

Running cargo run -- --root ..\..\cheats.rs build should make it find short codes, and generally 'just work'.

Current Behavior

When working on #1690 I originally tried to invoke zola from its source directory so I could run it via CLions integrated debugger:

cargo run -- --root ..\..\cheats.rs build

Unfortunately this led to an error:

Building site...
Failed to build the site
Error: Failed to render content of //?/D:/Development/Source/cheats.rs/content/_index.md
Reason: Found usage of a shortcode named `book` but we do not know about. Make sure it's not a typo and that a field name `book.{html,md} exists in the `templates/shortcodes` directory.
error: process didn't exit successfully: `target\debug\zola.exe --root ..\..\cheats.rs build` (exit code: 1)

However, the directory both has a config.toml:

❯ cat ..\..\cheats.rs\config.toml
# The URL the site will be built for
base_url = "https://cheats.rs"
title = "Rust Language Cheat Sheet"
compile_sass = true

And the respective book.html:

❯ cat ..\..\cheats.rs\templates\shortcodes\book.html
[<sup class="entry">BK</sup>](https://doc.rust-lang.org/book/{{page}})

Also, I can just go into that direction and invoke ..\_thirdparty\zola\target\debug\zola.exe build instead, which works just fine:

❯ ..\_thirdparty\zola\target\debug\zola.exe build
Building site...
Checking all internal links with anchors.
> Successfully checked 41 internal link(s) with anchors.
-> Creating 1 pages (0 orphan) and 0 sections
Done in 2.0s.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Need Windows helpWe need someone using Windows to help us with this issuebug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions