Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

base script #67

Open
ryanve opened this issue Aug 11, 2021 · 0 comments
Open

base script #67

ryanve opened this issue Aug 11, 2021 · 0 comments

Comments

@ryanve
Copy link
Member

ryanve commented Aug 11, 2021

GOAL with this pattern from #66 is to relate relative links via actual page URL. Alternative is absolute links as usual.

<base data-www href=.>
<script data-local>
  location.host ? null :
  document.querySelector("base").href = "https://s9a.page"
</script>

DOT as base href relates relative to context. When opened locally as file this script sets absolute base because file destinations don't relate. Ternary on fleek. Data reminds.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant