How can I get the current page's URL?
I have tried:
{{ site.url }}
But this fails to out put anything.
You need to define that in your _config.yml
.
It's empty by default.
Once defined you might want something like {{site.url}}{{page.url}}
to get the whole path.
To capture the whole path in a variable you can use
{% capture url_path %}{{site.url}}{{page.url}}{% endcapture %}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With