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

#5 Solve a problem with URL reference of category #27

Merged
merged 2 commits into from
Sep 14, 2016

Conversation

brunojdo
Copy link
Contributor

Solve a little problem commented in the issue #5 about the missmatch reference between 127.0.0.1 and the real DNS URL.

Solve a little problem commented in the issue codeasashu#5 about the missmatch reference between 127.0.0.1 and the real DNS URL.
@GreatEmerald
Copy link
Contributor

I'm surprised this could cause any issues. Technically shere should be no difference between one slash and two slashes (aside from visually looking a bit iffy). What browser are you using?

@brunojdo
Copy link
Contributor Author

Hi @GreatEmerald I'm using Chrome. In _config.yml add the url: xxxx.github.io and do this test.

This is also was strange to me, but with two slashes this problem happens. I'm testing in Firefox and the problem persists too.

@brunojdo
Copy link
Contributor Author

I just found another problem in this page, the categories buttons are pointing to {{ site.url }}. I changed to baseurl and works fine.

Current: <a href="{{ site.url }}/category/{{ c_slug }}" class="btn btn-sm btn-default btn-raised">{{ c_slug }}</a>

Change: <a href="{{ site.baseurl }}/category/{{ c_slug }}" class="btn btn-sm btn-default btn-raised">{{ c_slug }}</a>

Can I do this PR too?

Best regards,

@GreatEmerald
Copy link
Contributor

Why would you want to define url, instead of using baseurl in your config? In general it should all be site.baseurl and not site.url in the code too.
And in your suggestion, you are also using an extra slash after {{ site.baseurl }} there, which would create double slashes if baseurl is defined with a trailing slash (which I'm not sure about: is it normally required by Jekyll to define it with one?).

@brunojdo
Copy link
Contributor Author

I see in many Jekyll templates that url is define with the DNS of the web page, and baseurl is the root of the site that, in general, is empty. But you could define as a /blog for example. I may be wrong, however, It was how I understood the usage of baseurl and url.

@brunojdo
Copy link
Contributor Author

Another solution is just remove {{ site.url }} from the a href

@GreatEmerald
Copy link
Contributor

Hm, right, I do have both defined on my site as well (with a baseurl of /jekyll without a trailing slash). So is it post.url that has a leading slash in it, then?

And no, you need to have {{ site.baseurl }} in there, else baseurl support gets broken.

I suppose you can add the second change to this PR as well, then.

@brunojdo
Copy link
Contributor Author

Ouky douky! 👍

Copy link
Owner

@codeasashu codeasashu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR

@codeasashu codeasashu merged commit a61c5ae into codeasashu:gh-pages Sep 14, 2016
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.

3 participants