-
Notifications
You must be signed in to change notification settings - Fork 868
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Allow extensionless URL HTML file access #10436
base: main
Are you sure you want to change the base?
Conversation
58072f4
to
8cca247
Compare
@@ -44,6 +48,7 @@ public static void Exec(string folder, string host, int? port, bool openBrowser, | |||
Console.WriteLine($"Serving \"{folder}\" on {url}"); | |||
Console.WriteLine("Press Ctrl+C to shut down"); | |||
using var app = builder.Build(); | |||
app.UseExtensionlessHtmlUrl(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be opt-in? I think the default behavior should remain a standard static file server so it can be hosted by a variety of web servers.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This settings is works on docfx serve
command only.
And not affect generated HTML files.
So I though it's not a problems by enabled default. (And not support config to disable)
When supporting feature that rewrite URL to extensionless URL
automatically.
It should be supported as user's opt-in features.
8cca247
to
0f2d784
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #10436 +/- ##
==========================================
+ Coverage 74.31% 79.28% +4.96%
==========================================
Files 536 547 +11
Lines 23189 23649 +460
Branches 4056 4065 +9
==========================================
+ Hits 17234 18749 +1515
+ Misses 4853 3730 -1123
- Partials 1102 1170 +68 ☔ View full report in Codecov by Sentry. |
This PR is intended to add support for extensionless HTML URLs for
docfx serve
command.Background
GitHub Pages
support extensionless URLs. (e.g. https://dotnet.github.io/docfx/docs/basic-concepts)And other static HTML hosting site also have similar features.
So I thought it's reasonable to support extensionless URLs with the
docfx serve
command.Extensionless URL support is partially related to #2865.
It might be better to add options to output extensionless URLs for docfx internal links.