page.js icon indicating copy to clipboard operation
page.js copied to clipboard

Added option to disable baseUrl in pathname

Open clayrisser opened this issue 8 years ago • 8 comments

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.

clayrisser avatar Jul 08 '17 02:07 clayrisser

Reference issue #234.

clayrisser avatar Jul 08 '17 02:07 clayrisser

Coverage Status

Coverage remained the same at 89.209% when pulling 0b541336374e7686d17244c2288633979d0bf0a4 on jamrizzi:master into 1034c8cbed600ea7da378a73716c885227c03270 on visionmedia:master.

coveralls avatar Jul 08 '17 02:07 coveralls

Hey @jamrizzi, I don't totally understand the issue you're fixing. Can you give some code examples of the undesirable behavior?

matthewp avatar Jan 13 '18 12:01 matthewp

https://github.com/thingdown/blogdown/commit/6ebd304820c3ce31fb6bd2c7f3ef1c41ae666b0b

clayrisser avatar Jan 13 '18 14:01 clayrisser

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.

matthewp avatar Jan 21 '18 21:01 matthewp

Correct

clayrisser avatar Jan 22 '18 04:01 clayrisser

There are cases where it is needed. Specifically, websites where the root is not directly on a domain, but several directories in.

clayrisser avatar Jan 22 '18 04:01 clayrisser

For example, github pages

clayrisser avatar Jan 22 '18 04:01 clayrisser