Skip to content
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

Broken Links (not including the .html) #556

Closed
mcapodici opened this issue Aug 19, 2017 · 4 comments
Closed

Broken Links (not including the .html) #556

mcapodici opened this issue Aug 19, 2017 · 4 comments
Labels
Discussion/Question Discussions or questions about the code

Comments

@mcapodici
Copy link

To reproduce:

wyam.exe new --recipe Blog
wyam.exe --recipe Blog --theme CleanBlog

Run in IIS Express
Open site in browser

First Post link is "http://localhost:62812/posts/first-post"

Should be "http://localhost:62812/posts/first-post.html"

@mcapodici
Copy link
Author

I just noticed there is the option

Wyam.exe --preview --watch

It works under this web server. I guess because it is mapping the urls.

However I think this is not extensible to deploy on a simple file hosting.

@daveaglick daveaglick added the Discussion/Question Discussions or questions about the code label Aug 19, 2017
@daveaglick
Copy link
Member

That's by design. Since most static hosts hide the .html extension to allow static sites to present nice extensionless URLs, that's the default for Wyam generation and the preview server.

You can change this behavior with a setting. Add this to your config.wyam file:

Settings[Keys.LinkHideExtensions] = false;

Keep in mind if you also want to use the preview server with extensions you'll need to pass --force-ext on the command line to prevent extensionless URLs from being valid (thus replicating a server like IIS).

@mcapodici
Copy link
Author

@daveaglick - thanks for the explanation. It might be worth mention this on the quickstart so that it doesn't confuse people.

@daveaglick
Copy link
Member

Good call, I'll make this behavior more obvious in the getting started docs (Wyamio/Wyam.Web#51).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Discussion/Question Discussions or questions about the code
Development

No branches or pull requests

2 participants