Skip to content

Added option to disable baseUrl in pathname#418

Open
clayrisser wants to merge 1 commit into
visionmedia:masterfrom
clayrisser:master
Open

Added option to disable baseUrl in pathname#418
clayrisser wants to merge 1 commit into
visionmedia:masterfrom
clayrisser:master

Conversation

@clayrisser
Copy link
Copy Markdown

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
Copy link
Copy Markdown
Author

Reference issue #234.

@coveralls
Copy link
Copy Markdown

Coverage Status

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

@matthewp
Copy link
Copy Markdown
Collaborator

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

@clayrisser
Copy link
Copy Markdown
Author

@matthewp
Copy link
Copy Markdown
Collaborator

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.

@clayrisser
Copy link
Copy Markdown
Author

Correct

@clayrisser
Copy link
Copy Markdown
Author

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

@clayrisser
Copy link
Copy Markdown
Author

For example, github pages

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants