I've created a (currently sandbox) module to add some URL processing functions to Metatag: Metatag URLs.

There are 2 tasks that I'm hoping the Metatag pros can help me with:

  • Sanity check: I tried reading all of the Metatag docs, and looking at the code, and to my eyes the features of my module are not redundant, but could actually be useful (I needed them for my use case, anyway). Did I miss something obvious?
  • If the module is sane, I'd be happy to make it a full project. Could it be listed on the Metatag project page?

Thanks in advance!

Comments

jay.dansand created an issue. See original summary.

DamienMcKenna’s picture

Is there any reason that you couldn't use [site:url] in front of the image paths?

jay.dansand’s picture

That's a really good question! I wasn't sure, so I checked: [site:url]foo.bar is an absolute URL with the requested scheme (which may cause problems depending on caching reverse proxy setups), and urlFromUri(base:foo.bar) is root-relative.

If requesting over http (not https):

[site:url]foo.bar => http://example.com/foo.bar
urlFromUri(base:foo.bar) => /foo.bar

The difference probably doesn't matter to many, but may matter to some (I have no idea how many; maybe just me).

DamienMcKenna’s picture

I don't see a way of getting the relative path using tokens, so I opened a feature request issue for it: #2923851: Additional sub tokens for [site:url] token

DamienMcKenna’s picture

jay.dansand’s picture

Thanks for looking into it! I'm relieved that it wasn't an obvious "why not just X?" I was missing.

I'll let this issue linger for a while; if it ultimately seems useful, I'll make it a full project. Might as well let others benefit.