Blog header should support blog deployed at <root.url/base> in addition to <root.url>
Blog header should not hardcode website root to / but /<base> to support website deployed at /<base>.
When <base> is empty, the original behaviour is preserved.
Do a PR
I initially considered it.
However, I decided to develop my own blog from scratch.
Easier to satisfy all my current and future requirements.
Okay, Good luck ! I am intersted, when you finish it, feel free to share it to me !
Thank you.
Unfortunately, this will be a private repo.
Hello @davidandreoletti You mean something like this?
import { SITE } from "@config";
---
<a href={SITE.website ?? "/"}>Home</a>
I think you meant something like this. (Correct me if I'm wrong)
<a
href=`${import.meta.env.BASE_URL}/posts/`
class={activeNav === "posts" ? "active" : ""}
>
Posts
</a>
The thing is that it is not suitable for every scenario.
It works if base is specified properly other than /.
It won't work well if base is not specified or set to /.
The docs itself is suggesting like this:
<p>Read more <a href="/about/">about</a> Astro!</p>
<!-- With `base: "/docs"` configured -->
<p>Learn more in our <a href="/docs/reference/">reference</a> section!</p>
Please, do let me know if you have any solution I missed. @davidandreoletti Thanks.
Closing this issue for now. Feel free to reopen it if you’d like to continue the discussion. Thanks for your understanding.