سؤال

I am building a blog with jekyll. I would like to insert a link next each heading on the page but I have no easy way to modify the output HTML. Is there an alternative to is

<h1 is="x-link"></h1>

which doesn't require extra markup and allows me to target all h* elements?

هل كانت مفيدة؟

المحلول

This is unrelated to Polymer.

On polymer-project.org we add anchor links to all headings. It's done client-side and the page has control whether or not it displays them using add_permalinks variable.

See:

It's also worth noting the Kramdown markdown engine has support for inline attributes on block elements. So you can do something like this:

# Heading
{:is="x-link"}

I might switch things over now that I know that works. Good idea :)

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top