Skip to content
This repository has been archived by the owner on Jan 15, 2024. It is now read-only.

{{ site.baseurl }} and {{ site.baseurl_root }} don't seem to work when included #166

Open
erciccione opened this issue May 24, 2020 · 4 comments

Comments

@erciccione
Copy link

I tried to use {{ site.baseurl_root }} in a file in _include/file.html. This file gets included in a layout, which will be used by the final page.

Looks like {{ site.baseurl_root }} and {{ site.baseurl }} don't get recognized as a valid instruction if added in a layout or in a file inside _includes, which results in the final page not showing the baseurl. Is this an expected behaviour or i'm missing something?

@mondeja
Copy link

mondeja commented Aug 15, 2020

I've found the same problem, and not sure if it is the expected behaviour, but it would be awesome if this could be fixed or clarified. For now, I'm executing my own exclude_from_localizations function after the build process to ensure that my folder assets/css is removed. You can see the patch as a Rake task here.

@volkerholloh
Copy link

volkerholloh commented Mar 12, 2022

+1
I am facing this in "includes footer", which keeps me from using "translate link" to localized files.

@george-gca
Copy link
Collaborator

I just found out when this happens (at least for me). See #119.

@montahaee
Copy link

I tried to use {{ site.baseurl_root }} in a file in _include/file.html. This file gets included in a layout, which will be used by the final page.

Looks like {{ site.baseurl_root }} and {{ site.baseurl }} don't get recognized as a valid instruction if added in a layout or in a file inside _includes, which results in the final page not showing the baseurl. Is this an expected behaviour or i'm missing something?

Hey, I faced the same problem, and in my case, the baseurl was not correctly set. After setting it to an empty string (e.g., baseurl: ""), everything works very well.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants