ionide / Fornax

Scriptable static site generator using type safe F# DSL to define page templates.
MIT License
241 stars 44 forks source link

Adjust path to better develop fornax project for gh-pages. #107

Open Freymaurer opened 2 years ago

Freymaurer commented 2 years ago

Is your feature request related to a problem? Please describe. I am currently working on a fornax project to build gh-pages as docs for other repositories. The default gh-pages link is created somewhat like the following

https://{user_name}.github.io/{repo_name}/

After which the fornax structure is appended. This leads to the problem, that relative links, which work fine in dev (exmaple: /content/content.md) will not resolve to the correct page in gh-pages (/{repo_name}/content/content.md).

Describe the solution you'd like Maybe give fornax watch not only an option to user an alternative port, but also to adjust the dev url.

drewknab commented 1 year ago

I don't think it can/should be the responsibility of the cli tool to keep track of this?

I think it might make more sense to let loaders/generators handle URL structures like this. You could, for instance, load the prepended URL structure via a global loader and retrieve it as required in your generators based on some arbitrary dev/prod flag.

Freymaurer commented 1 year ago

Yeah i figured out a way how to manage this. I use this syntax to distinguish the two cases.

#if WATCH
// something something during development
#else
// something something PLUS give the gh pages path as additional parameter