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

{{ root_url }} always evaluates to empty string in asides #1348

Open
brantb opened this issue Sep 5, 2013 · 4 comments
Open

{{ root_url }} always evaluates to empty string in asides #1348

brantb opened this issue Sep 5, 2013 · 4 comments

Comments

@brantb
Copy link

brantb commented Sep 5, 2013

The {{ root_url }} expression in asides evaluates to an empty string when deploying to a subdirectory.

Normally this bug doesn't reveal any problems, because the expand_urls filter catches any text that looks like src="/foo" or href="/foo" and prepends root_url to the value.

However, if root_url is being used somewhere other than a src or href attribute, it causes problems. Example, example.
#221 and #758 seem related to this bug. (Despite having been closed, they are still issues)

@wakproductions
Copy link

I am also having trouble with the {{ root_url }} tag. It is blank no matter where I use it. I can't find in the code where root_url is set. Could it be a deprecated feature?

@AlexisEvo
Copy link

@wakproductions was having the same issue, eventually found out that root_url is set in the default theme's "default" layout. https://github.com/imathis/octopress/blob/master/.themes/classic/source/_layouts/default.html#L1

@eduncan911
Copy link

Thanks @AlexisEvo . But, I already have that in my default.html I am using as well as:

{{ content | expand_urls: root_url }}

We must be missing something as it still evaluates empty.

@kaworu
Copy link
Contributor

kaworu commented Sep 2, 2014

This is an issue in source/_includes/asides/github.html where {{ root_url }} is used to link the jXHR.js script. You can see at http://kaworu.github.io/octopress/ that you get a 404 to http://kaworu.github.io/javascripts/libs/jXHR.js because {{ root_url }} is evaluated as empty although it should be "octopress/" (and the full URL should be http://kaworu.github.io/octopress/javascripts/libs/jXHR.js which is valid as you can check).

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

No branches or pull requests

5 participants