Open AndreyAkinshin opened 6 years ago
Not supported for now, but it will be supported in vNext.
@superyyrrzz great! Any ETA when it will be available?
We don't have an exact release date yet, it is a work on progress.
This is implemented in v3.
We use pretty url by default: http://a.com/article-name/
. It can be into http://a.com/article-name.html
by setting uglifyUrl: true
@yufeih, awesome, thanks! By the way, it will be possible to automatically generate redirects from ugly urls to pretty urls? (e.g., http://a.com/article-name.html -> http://a.com/article-name/). With such redirects, all external links to old urls will be valid after prettification.
This is a static switch. docfx
has no idea when you made the switch. It'll generate redirects for every new file.
Automatic redirect generation is best handled by other tools that know the exact files to be redirected during a change.
Today, there's still no v3 released. So, this is a small quick and dirty workarround:
$destinationRoot = "path/to/output"
[RegEx]$Search = '(index\.html)"'
$Replace = '"'
[RegEx]$Search2 = '(\.html)"'
$Replace2 = '"'
ForEach ($File in (Get-ChildItem -Path $destinationRoot -Recurse -File)) {
(Get-Content $File.FullName) -Replace $Search,$Replace -Replace $Search2,$Replace2 |
Set-Content $File.FullName
}
Live sample: https://www.aximo.games (hostet on github pages)
@yufeih is it possible to backport this feature to v2?
Reopen as the feature isn't available in v2.
@yufeih any ETA when this feature will be available? Really looking forward to it! Thanks! 😊
@mjegob A fixed is released in v2.73.2 to allow TOC expansion work on URL rewrite. Full URL prettifier however isn't supported yet.
Any plans to add an option to build the docs with pretty urls like v3 did?
Right now, markdown files (articles) are translated to html files which are available via direct link like
https://mydomain.com/articles/article-name.html
. I want to "prettify" it and get an url likehttps://mydomain.com/articles/article-name/
. Actually, I want a copy ofarticle-name.html
inhttps://mydomain.com/articles/article-name/index.html
. Does DocFX provide any API for that?