Skip to content
This repository has been archived by the owner on Jan 13, 2021. It is now read-only.

No variable for current url or base url #154

Closed
nsrosenqvist opened this issue Oct 18, 2019 · 4 comments
Closed

No variable for current url or base url #154

nsrosenqvist opened this issue Oct 18, 2019 · 4 comments
Labels

Comments

@nsrosenqvist
Copy link

From what I can gather (at least not in the docs) there is no way to access the current URL or site base URL. This prevents configuring opengraph tags and other meta correctly.

Your Environment
Include relevant details, so others can replicate the issue.

  • OS: Ubuntu 18.04
  • Vapid Version: 0.8.6
@amiller-gh
Copy link
Contributor

Mmm, this is a good feature addition. It will be especially needed if we get something like #158 or custom page slugs for collection records. How would you envision the API looking?

Side note – if pages and collection records get a more opinionated "settings" panel (mentioned at the end of #158 and in #8, we may want to add social media metadata config options on a per-page and per-post basis. This page settings proposal as not been written yet though and is probably tangential to a {{_location}} metadata addition. (FWIW, the Ghost Blog interface is great prior art for standard page settings)
Screen Shot 2019-10-30 at 12 44 46 PM

@nsrosenqvist
Copy link
Author

Personally I'd simply want the request information to be made available in a global variable, containing full request url, base url, host and scheme, or a function that allows you to retrieve the absolute url for an asset.

@srobbin
Copy link
Contributor

srobbin commented Nov 3, 2019

I agree. Maybe a {{_request}} tag, which exposes some of the Koa.js request variables (e.g., host, path, origin, query).

So you could end up doing:

<meta property="og:image" content="{{_request.origin}}/images/share.png">

@stale
Copy link

stale bot commented Feb 1, 2020

This issue has been automatically marked as stale after 90 days of inactivity. It will be closed if no further activity occurs.

@stale stale bot added the stale label Feb 1, 2020
@stale stale bot closed this as completed Feb 8, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants