URL taken
warning A warning says what Statac did instead, and the build goes on.
A draft, or a scheduled post, would be published at a URL that something else already uses. The message says what is published there now.
What you’ll see
warning URL taken: this draft would be published at `/post-1/`, where `content/post-2.md` is already
Give one of them another `permalink` before it is published.
More: https://statac.dev/e/url-taken/
In the terminal, the message also shows the file and line, if there is one, and marks the exact text.
Why Statac warns
A page left out of the build isn’t published, so for now it doesn’t
clash with anything. On the day it is published, two things would be
published at the same URL, and the build would stop. Statac warns
you now, while there is still time to choose, and builds the site as
usual. With --drafts, and in statac serve, Statac builds the page,
so it reports the clash as same-url instead.
How to fix it
Give one of the two a different URL with permalink, or move or
rename its file. If the page that is left out is meant to replace the
other, remove the other on the day it is published.
If a redirect has taken the URL, because another page lists it in its
redirect_from, the message says so and names that page. Often
the page was renamed and the old URL kept as a redirect, and the draft
now wants it back. Take the URL out of that redirect_from if the draft
is to be published there, or give the draft a permalink of its own if
the redirect should stay.
Once you have understood the warning, you can quieten it by name.
Example
content/post-1.md is published at /post-1/, and this draft in
content/post-2.md asks for the same URL:
---
title: Post 2
draft: true
permalink: /post-1/
---
Give the draft a URL of its own:
---
title: Post 2
draft: true
permalink: /post-2/
---
Its name
| Name | url-taken |
|---|---|
| In the terminal | statac explain url-taken |
| To stop showing it | quiet: [url-taken] in statac.yaml, once you have understood it. Statac still counts it. |
Something unclear or wrong? Open an issue.