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

Change the absolute path to {{ site.baseurl }} to make hyperlinks and resources valid when published as a project page. #37

Closed
wants to merge 2 commits into from

Conversation

codinfox
Copy link

When published as a project page, since the base url is username.github.io/projectname/, most links in the site break. Using site.baseurl could enable correct links and resources path both on local machine and on github.

When pushed to gh-pages, one should add baseurl: username.github.io/projectname/ to _config.yml. The trailing / is essential

I left id part in the atom.xml to be site.url.

@@ -14,7 +14,7 @@ <h1 class="post-title">{{ page.title }}</h1>
{% for post in site.related_posts limit:3 %}
<li>
<h3>
<a href="{{ post.url }}">
<a href="{{ site.baseurl }}.{{ post.url }}">
Copy link
Member

Choose a reason for hiding this comment

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

No need for the dot here between these.

@mdo mdo closed this in 299196a May 11, 2014
@mdo mdo added this to the v2.0.0 milestone May 11, 2014
seon54 added a commit to seon54/seon54.github.io that referenced this pull request Mar 13, 2022
seon54 added a commit to seon54/seon54.github.io that referenced this pull request Mar 13, 2022
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.

None yet

2 participants