Relative URLs in JSON
sinhayash opened this issue · comments
Can we specify relative URLs here?: https://github.com/techfolios/template/blob/e2b8a5022ecd952e9dc7ede5f8656242b428030e/_data/bio.json#L5
For example if later I move my page to some other directory, I should be able to just update URL, or base URL here: https://github.com/techfolios/template/blob/e2b8a5022ecd952e9dc7ede5f8656242b428030e/_config.yml#L9
This is an interesting idea. The problem is, what is the URL going to be relative to? That picture is used in at least two places in the standard themes (the home page, and the navbar that appears on all interior pages). So it can't be relative to the "current" page, because there's no fixed current page.
The only alternative that I can think of is to make it relative to a fixed page (such as the baseurl for the site). But that just makes it "absolute" rather than relative, just in an implicit rather than explicit way.
I'll leave this issue open for a while in case someone comes up with a good way around this. But for the moment, I think absolute URLs for the picture is the simplest and least error-prone approach.
We can use {{ site.url }}{{ site.baseurl }}{{ site.data.bio.basics.picture }}
in HTML file. This works at both pages.
I updated the bio , config. setting name and still it's not loading from my fork ?
this the url I'm trying to get work https://theyush.github.io/
it's over here
https://github.com/theyush/theyush.github.io/blob/master/_data/bio.json
everything is loading from here https://techfolios.github.io/
except title
The problem is the "theme" parameter on the last line of your _config.yml:
https://github.com/theyush/theyush.github.io/blob/master/_config.yml
Delete it (line 29) and you should be fine.