page.js
page.js copied to clipboard
Added option to disable baseUrl in pathname
I think it's terrible to force explicitly mentioning the baseUrl in every href. I propose adding the option baseUrlInPathname. I set its default value to true, so it won't break anything.
Reference issue #234.
Coverage remained the same at 89.209% when pulling 0b541336374e7686d17244c2288633979d0bf0a4 on jamrizzi:master into 1034c8cbed600ea7da378a73716c885227c03270 on visionmedia:master.
Hey @jamrizzi, I don't totally understand the issue you're fixing. Can you give some code examples of the undesirable behavior?
https://github.com/thingdown/blogdown/commit/6ebd304820c3ce31fb6bd2c7f3ef1c41ae666b0b
I was hoping for a small code example. I think what you are saying is that you expect to be able to do:
page.base('/some/base');
page('/foo', function(){
});
And then have links like:
<a href="/foo">Hello world</a>
Is this correct? If so I agree that this shouldn't be needed.
Correct
There are cases where it is needed. Specifically, websites where the root is not directly on a domain, but several directories in.
For example, github pages