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

Add ${content.url} variable (to existing content.uri) #479

Open
OndraZizka opened this issue Jul 23, 2018 · 2 comments
Open

Add ${content.url} variable (to existing content.uri) #479

OndraZizka opened this issue Jul 23, 2018 · 2 comments

Comments

@OndraZizka
Copy link
Contributor

OndraZizka commented Jul 23, 2018

I have a shared footer with:

<div class="fb-comments" data-href="${content.uri!}" data-width="800" data-numposts="5"></div>

In a page (About), this creates a proper URL. But in a post, it creates:

blog/2018/test-post.html

I assume this is because it's an URI, not URL.

For cases like this, it would be useful to consistently have the whole future URL at hand in the templates. Otherwise one needs to do boilerplate like this:

<#assign url = content.uri?starts_with(config.site_host)?then(content.uri, config.site_host + "/" + content.uri) >
@jonbullock
Copy link
Member

Hmm I would have expected the value on both a page and a post to be a relative URI without the config.site_host value?

@OndraZizka
Copy link
Contributor Author

I will get familiar with how to create JBake tests and create one, hopefully soon.

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

2 participants