Permalink vs RelPermalink

I see these two used a lot interchangeably in different themes/projects/tutorials. Is there a reason for this? Or a preference for one over the other?

Here are a couple of cases where an absolute URL (.Permalink) is preferred:

There may be others.

I have used .Permalink in my theme before I encountered .RelPermalink. Other than cases that require absolute paths, should I default to the latter? Or that is just a matter of choice?

I think it’s largely a matter of choice. Although this is just noise, you save a few bytes on each link.

https://example.org/posts
/posts 

The later saves 13 bytes.

But once it’s compressed while serving this is just noise.

Another advantage of .RelPermalink is the ability to use the produced pages offline from the file system (although it may requires additional settings or theme support).

Thanks. I went through my template and these are the areas I left .Permalink:-

  1. RSS and Sitemap templates.
  2. Head/Foot partial files (canonical, open graph, JSON-LD).
  3. Post share buttons.

I have read through the headless docs if that’s what you are referring to. I don’t have a use case for that yet.

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.