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

fix!: allow URIs without authority component #22

Merged
merged 1 commit into from
Oct 30, 2023

Conversation

cjshearer
Copy link
Owner

@cjshearer cjshearer commented Oct 30, 2023

Previously, links were naively required to be provided as a so-called protocol and link pair, where protocol was a scheme and link referred the authority and path. The purpose of this format was to provide a simple way to display urls without the scheme, while including the scheme in hrefs by constructing them with {{protocol}}://{{link}}.

This made the implicit assumption that all URIs had an authority component, which was shown to be untrue by the presence of a mailto link, which would incorrectly have a // placed between the scheme (mailto) and the path (cjshearer@live.com).

This commit changes the format expected for urls provided in resume.yaml back to a single string. Where the scheme is not desired for display, the builtin URL parsing is used to assist removing it.

resolves #19

Previously, links were naively required to be provided as a so-called
`protocol` and `link` pair, where `protocol` was a `scheme` and `link`
referred the `authority` and `path`. The purpose of this format was to
provide a simple way to display urls without the `scheme`, while
including the scheme in `href`s by constructing them with
`{{protocol}}://{{link}}`.

This made the implicit assumption that all URIs had an authority
component, which was shown to be untrue by the presence of a `mailto`
link, which would incorrectly have a `//` placed between the `scheme`
(mailto) and the `path` (cjshearer@live.com).

This commit changes the format expected for urls provided in
`resume.yaml` back to a single string. Where the `scheme` is not desired
for display, the builtin URL parsing is used to assist removing it.

resolves #19
@cjshearer cjshearer force-pushed the fix/allow-links-without-authority-component branch from 1c20916 to 79ee153 Compare October 30, 2023 14:38
@cjshearer cjshearer merged commit 8dd6dc1 into main Oct 30, 2023
2 checks passed
@cjshearer cjshearer deleted the fix/allow-links-without-authority-component branch October 30, 2023 14:42
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

Successfully merging this pull request may close these issues.

Remove authority component from default social links
1 participant