I think one of the major features jekyll lacks is the facility to have temporary variables which can be very convenient. For example, {{site.url}} gives me https://prahladyeri.github.io/ and {{page.url}} gives me /blog/2024/06/most-aesthetic-google-fonts.html which is fine. However, at many places I have to use a combination of these two. For setting the canonical attribute for example:
Is there a way to concat these two into a temporary variable so that I can simply use {{full_url}} ? If so, where do I do that? Please note that I’m using Github Pages and don’t have actual Ruby/Jekyll running on my machine, Github Pages only supports a handful of official plugins.
not an answer to your original question ( I don’t think there is) but a better way to do what you want in the example - use the absolute_url filter - which will also add in the baseurl if needed which your example does not:
@george-gca But this needs to be declared inside every single include file where I want to use, right? Is there any way to declare it just once (for eg, _config.yml) and be able to use it in any of the jekyll includes/templates?