Skip to content

Link style for external and anchor links #254

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

Merged
merged 5 commits into from
Oct 11, 2023
Merged

Link style for external and anchor links #254

merged 5 commits into from
Oct 11, 2023

Conversation

Simran-B
Copy link
Contributor

@Simran-B Simran-B commented Sep 29, 2023

Description

Use internal link style also for anchor links, as well as for external links. Add icon to external links to indicate that they reference external content and open in a new tab.

Demo: https://deploy-preview-254--docs-hugo.netlify.app/3.11/index-and-search/indexing/working-with-indexes/geo-spatial-indexes/ (note that the GeoJSON anchor link doesn't scroll to the right location but that is addressed by #251 which is part of #232)

Upstream PRs

  • 3.10:
  • 3.11:
  • 3.12:

@arangodb-docs-automation
Copy link
Contributor

Deploy Preview Available Via
https://deploy-preview-254--docs-hugo.netlify.app

@Simran-B Simran-B self-assigned this Sep 29, 2023
Copy link
Contributor

@dandimeo dandimeo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see any changes in the anchor links?
Anyway LGTM

Copy link
Contributor

@nikhil-varma nikhil-varma left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor change. Approving it considering it will be incorporated.

Just a suggestion, we should not be handling links that way. It becomes extremely implicit and increases maintenance. Over time we should move to a batter approach. Noting it here just for remembering.

@Simran-B
Copy link
Contributor Author

@dandimeo The changes should look like this, before:

image

After:

image

Note GeoJSON, which is an anchor link (only anchor, to go to a different headline on the same page)

@nikhil-varma Yes, I agree that having to set the link class for most <a> elements to get the right style and the JS link handling is not good. Should we make it the default style and use an event handler for all links and then filter out the few cases where we want a different style/handling?

@nikhil-varma
Copy link
Contributor

nikhil-varma commented Sep 29, 2023

@Simran-B Styling & class is OK. What I meant was about the event listener JS function. That felt very implicit and needs a better approach. Eg: We are not writing target attribute identifier to ensure it does not update history. Later, if we need to handle a rel attribute, that will incur more handling and increase maintenance.

Can be discussed in a later scope. For now, this is OK to go.

@Simran-B
Copy link
Contributor Author

Created a ticket about the link handler: https://arangodb.atlassian.net/browse/DOC-599

@Simran-B Simran-B marked this pull request as draft October 10, 2023 08:58
@Simran-B
Copy link
Contributor Author

Converted to draft because the current implementation of aliases conflicts with the merged class for internal as well as external links, making the version number/alias appear in external URLs and thus breaking the links.

@Simran-B Simran-B marked this pull request as ready for review October 11, 2023 10:08
Copy link
Contributor

@nerpaula nerpaula left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@nerpaula nerpaula merged commit 5f4477a into main Oct 11, 2023
@nerpaula nerpaula deleted the external-links branch October 11, 2023 10:43
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.

4 participants