Questions about url

Questions about url

Vimwiki has long been used to write its own documents, but there was a url problem with rendering

Example:

first.md:

> [test](https://github.com/gohugoio/hugo/issues/test)

hugo run:
open first。

> https://xxx.io/first/

open test。

> https://xxx.io/first/test/

I want open test。

> https://xxx.io/test/

I myself tried to modify some functions from vimwiki to fix the markdown link style from the

> [test](test) -> [test](/test)

but the problem is that some aspects of vimwiki will be affected

So, I would like to ask how to deal with this problem from the hugo side?

add to first.md:

---
slug: "test"
---
test

add to config.toml:

[permalinks]
  first = "/:slug"
1 Like

You can override the .Page permalink simply by entering a url parameter in the front matter of the relevant content files, without needing to change the permalinks configuration.

For example in the content file under /content/first/test.md entering:

+++
url = "test"
+++

Will generate the page permalink under /test/ and not /first/test/

1 Like