jekyll icon indicating copy to clipboard operation
jekyll copied to clipboard

using the link tag with anchors

Open steveoh opened this issue 4 years ago • 33 comments

Is the correct way to use the link tag with anchors like the following?

[link text]({% link path/to/item.with-extension %}#to-anchor)
<a href="{% link path/to/item.with-extension %}#to-anchor">link text</a>

Are there plans to allow a more friendly syntax or one that even checks for the existence of the elements id?

steveoh avatar Jun 16 '20 00:06 steveoh

Yes, they're the correct way to use the link tag with anchors in Markdown and HTML text respectively.

a more friendly syntax or one that even checks for the existence of the elements id?

Please elaborate on this question, @steveoh. What would be a more friendly syntax according to you?

even checks for the existence of the elements id

I think this is not practical since (according to given example) the id is within a different document's content string.

ashmaroli avatar Jun 16 '20 15:06 ashmaroli

I'd recommend relying on JS to automate anchors: https://github.com/bryanbraun/anchorjs

DirtyF avatar Jun 16 '20 16:06 DirtyF

@ashmaroli What's your take on being able to suffix a link tag with an #id? [link text]({% link path/to/item.with-extension#to-anchor %})

DirtyF avatar Jun 16 '20 16:06 DirtyF

@ashmaroli What's your take on being able to suffix a link tag with an #id? [link text]({% link path/to/item.with-extension#to-anchor %})

This would be a more intuitive syntax.

steveoh avatar Jun 16 '20 20:06 steveoh

@steveoh @DirtyF I thought about the suggestion.. I was wondering if we could instead go for an optional parameter named suffix* for clarity:

{% link path/to/item.with-extension suffix="#to-anchor" %}

*you're welcome to suggest a better name.

The deal with using the parameter version is (theoretically) flexible implementation. The string can be anything the user gives the tag and it'll simply be appended to the computed URL of the requested page. In the former proposal, the implementation will have to actively check if the substring after the computed URL is:

  • an anchor href (e.g./about/#foobar)
  • or a query segment (e.g. /search.html?author=ashmaroli)
  • or something else entirely.

ashmaroli avatar Jun 17 '20 10:06 ashmaroli

I was aiming to solve the most common problem. When would you need to pass params to a static HTML file? I don't see the need to add complexity when nobody asked to pass query params to a link tag :)

I'd advocate for a simpler and intuitive syntax and solve only the anchor problem.

DirtyF avatar Jun 17 '20 11:06 DirtyF

This issue has been automatically marked as stale because it has not been commented on for at least two months.

The resources of the Jekyll team are limited, and so we are asking for your help.

If this is a bug and you can still reproduce this error on the latest 3.x-stable or master branch, please reply with all of the information you have about it in order to keep the issue open.

If this is a feature request, please consider building it first as a plugin. Jekyll 3 introduced hooks which provide convenient access points throughout the Jekyll build pipeline whereby most needs can be fulfilled. If this is something that cannot be built as a plugin, then please provide more information about why in order to keep this issue open.

This issue will automatically be closed in two months if no further activity occurs. Thank you for all your contributions.

jekyllbot avatar Aug 17 '20 12:08 jekyllbot

Could this be done as a plugin?

steveoh avatar Aug 17 '20 15:08 steveoh

This issue has been automatically marked as stale because it has not been commented on for at least two months.

The resources of the Jekyll team are limited, and so we are asking for your help.

If this is a bug and you can still reproduce this error on the latest 3.x-stable or master branch, please reply with all of the information you have about it in order to keep the issue open.

If this is a feature request, please consider building it first as a plugin. Jekyll 3 introduced hooks which provide convenient access points throughout the Jekyll build pipeline whereby most needs can be fulfilled. If this is something that cannot be built as a plugin, then please provide more information about why in order to keep this issue open.

This issue will automatically be closed in two months if no further activity occurs. Thank you for all your contributions.

jekyllbot avatar Oct 17 '20 16:10 jekyllbot

🦗

steveoh avatar Oct 19 '20 15:10 steveoh

This issue has been automatically marked as stale because it has not been commented on for at least two months.

The resources of the Jekyll team are limited, and so we are asking for your help.

If this is a bug and you can still reproduce this error on the latest 3.x-stable or master branch, please reply with all of the information you have about it in order to keep the issue open.

If this is a feature request, please consider building it first as a plugin. Jekyll 3 introduced hooks which provide convenient access points throughout the Jekyll build pipeline whereby most needs can be fulfilled. If this is something that cannot be built as a plugin, then please provide more information about why in order to keep this issue open.

This issue will automatically be closed in two months if no further activity occurs. Thank you for all your contributions.

jekyllbot avatar Dec 19 '20 16:12 jekyllbot

🦗🦗

steveoh avatar Dec 23 '20 00:12 steveoh

This issue has been automatically marked as stale because it has not been commented on for at least two months.

The resources of the Jekyll team are limited, and so we are asking for your help.

If this is a bug and you can still reproduce this error on the latest 3.x-stable or master branch, please reply with all of the information you have about it in order to keep the issue open.

If this is a feature request, please consider building it first as a plugin. Jekyll 3 introduced hooks which provide convenient access points throughout the Jekyll build pipeline whereby most needs can be fulfilled. If this is something that cannot be built as a plugin, then please provide more information about why in order to keep this issue open.

This issue will automatically be closed in two months if no further activity occurs. Thank you for all your contributions.

jekyllbot avatar Feb 23 '21 01:02 jekyllbot

🦗🦗🦗

steveoh avatar Feb 23 '21 01:02 steveoh

This issue has been automatically marked as stale because it has not been commented on for at least two months.

The resources of the Jekyll team are limited, and so we are asking for your help.

If this is a bug and you can still reproduce this error on the latest 3.x-stable or master branch, please reply with all of the information you have about it in order to keep the issue open.

If this is a feature request, please consider building it first as a plugin. Jekyll 3 introduced hooks which provide convenient access points throughout the Jekyll build pipeline whereby most needs can be fulfilled. If this is something that cannot be built as a plugin, then please provide more information about why in order to keep this issue open.

This issue will automatically be closed in two months if no further activity occurs. Thank you for all your contributions.

jekyllbot avatar Apr 23 '21 02:04 jekyllbot

🦗🦗🦗🦗

steveoh avatar Apr 23 '21 13:04 steveoh

This issue has been automatically marked as stale because it has not been commented on for at least two months.

The resources of the Jekyll team are limited, and so we are asking for your help.

If this is a bug and you can still reproduce this error on the latest 3.x-stable or master branch, please reply with all of the information you have about it in order to keep the issue open.

If this is a feature request, please consider building it first as a plugin. Jekyll 3 introduced hooks which provide convenient access points throughout the Jekyll build pipeline whereby most needs can be fulfilled. If this is something that cannot be built as a plugin, then please provide more information about why in order to keep this issue open.

This issue will automatically be closed in two months if no further activity occurs. Thank you for all your contributions.

jekyllbot avatar Jun 23 '21 14:06 jekyllbot

🦗🦗🦗🦗🦗

steveoh avatar Jun 23 '21 15:06 steveoh

This issue has been automatically marked as stale because it has not been commented on for at least two months.

The resources of the Jekyll team are limited, and so we are asking for your help.

If this is a bug and you can still reproduce this error on the latest 3.x-stable or master branch, please reply with all of the information you have about it in order to keep the issue open.

If this is a feature request, please consider building it first as a plugin. Jekyll 3 introduced hooks which provide convenient access points throughout the Jekyll build pipeline whereby most needs can be fulfilled. If this is something that cannot be built as a plugin, then please provide more information about why in order to keep this issue open.

This issue will automatically be closed in two months if no further activity occurs. Thank you for all your contributions.

jekyllbot avatar Aug 23 '21 16:08 jekyllbot

🦗🦗🦗🦗🦗🦗

steveoh avatar Aug 23 '21 16:08 steveoh

This issue has been automatically marked as stale because it has not been commented on for at least two months.

The resources of the Jekyll team are limited, and so we are asking for your help.

If this is a bug and you can still reproduce this error on the latest 3.x-stable or master branch, please reply with all of the information you have about it in order to keep the issue open.

If this is a feature request, please consider building it first as a plugin. Jekyll 3 introduced hooks which provide convenient access points throughout the Jekyll build pipeline whereby most needs can be fulfilled. If this is something that cannot be built as a plugin, then please provide more information about why in order to keep this issue open.

This issue will automatically be closed in two months if no further activity occurs. Thank you for all your contributions.

jekyllbot avatar Oct 23 '21 17:10 jekyllbot

🦗🦗🦗🦗🦗🦗🦗

steveoh avatar Oct 24 '21 04:10 steveoh

This issue has been automatically marked as stale because it has not been commented on for at least two months.

The resources of the Jekyll team are limited, and so we are asking for your help.

If this is a bug and you can still reproduce this error on the latest 3.x-stable or master branch, please reply with all of the information you have about it in order to keep the issue open.

If this is a feature request, please consider building it first as a plugin. Jekyll 3 introduced hooks which provide convenient access points throughout the Jekyll build pipeline whereby most needs can be fulfilled. If this is something that cannot be built as a plugin, then please provide more information about why in order to keep this issue open.

This issue will automatically be closed in two months if no further activity occurs. Thank you for all your contributions.

jekyllbot avatar Dec 24 '21 05:12 jekyllbot

🦗

steveoh avatar Dec 28 '21 03:12 steveoh

This issue has been automatically marked as stale because it has not been commented on for at least two months.

The resources of the Jekyll team are limited, and so we are asking for your help.

If this is a bug and you can still reproduce this error on the latest 3.x-stable or master branch, please reply with all of the information you have about it in order to keep the issue open.

If this is a feature request, please consider building it first as a plugin. Jekyll 3 introduced hooks which provide convenient access points throughout the Jekyll build pipeline whereby most needs can be fulfilled. If this is something that cannot be built as a plugin, then please provide more information about why in order to keep this issue open.

This issue will automatically be closed in two months if no further activity occurs. Thank you for all your contributions.

jekyllbot avatar Feb 28 '22 04:02 jekyllbot

🦗

steveoh avatar Feb 28 '22 16:02 steveoh

This issue has been automatically marked as stale because it has not been commented on for at least two months.

The resources of the Jekyll team are limited, and so we are asking for your help.

If this is a bug and you can still reproduce this error on the latest 3.x-stable or master branch, please reply with all of the information you have about it in order to keep the issue open.

If this is a feature request, please consider building it first as a plugin. Jekyll 3 introduced hooks which provide convenient access points throughout the Jekyll build pipeline whereby most needs can be fulfilled. If this is something that cannot be built as a plugin, then please provide more information about why in order to keep this issue open.

This issue will automatically be closed in two months if no further activity occurs. Thank you for all your contributions.

jekyllbot avatar Apr 28 '22 17:04 jekyllbot

🦊

steveoh avatar Apr 28 '22 17:04 steveoh

This issue has been automatically marked as stale because it has not been commented on for at least two months.

The resources of the Jekyll team are limited, and so we are asking for your help.

If this is a bug and you can still reproduce this error on the latest 3.x-stable or master/main branch, please reply with all of the information you have about it in order to keep the issue open.

If this is a feature request, please consider building it first as a plugin. Jekyll 3 introduced hooks which provide convenient access points throughout the Jekyll build pipeline whereby most needs can be fulfilled. If this is something that cannot be built as a plugin, then please provide more information about why in order to keep this issue open.

This issue will automatically be closed in two months if no further activity occurs. Thank you for all your contributions.

jekyllbot avatar Jun 28 '22 18:06 jekyllbot

Ok, last time I bump this. I don't care anymore. And neither does anyone else.

steveoh avatar Jun 28 '22 19:06 steveoh