photogabble / eleventy-plugin-interlinker

Adds wikilink and wikilink embed support with tracking of backlinks.
https://photogabble.co.uk/projects/eleventyjs-interlink-plugin/
MIT License
17 stars 1 forks source link

Adding description (or other YAML metada) in the backlinks data #58

Open yazae opened 4 months ago

yazae commented 4 months ago

Hi,

Thanks for this plugin, it really is way better than the hack I used previously. And I can do embeded files now o/

The only caveat I have with your plugin is with backlinks : there is not enough informations gathered by the plugin to do a proper backlink support. For example, I would like to add the content of my description tag to have a sort of preview of the content of the note backlinked :

{%- if backlinks.length > 0 -%}
  <ul class="backlink">
    {%- for link in backlinks -%}
      <li class="backlink-note">
        <a href="{{- link.url -}}" {%- if link.lang != nil -%} lang="{{- link.lang -}}"{% endif %}>
          <span class="larger">
            {{- link.title -}}
          </span>
            {{- link.description | markdownify -}}
        </a>
      </li>
    {%- endfor -%}
  </ul>
{%- else -%}

We could also imagine a use for the first x <p> of the note (to do a real preview of the note), a use for the tags YAML tag, a use for the creation date

For now, may I ask for description and date who are some of the more importants I think ? Maybe lang too but I know it’s not common. Maybe "just" a way to add optional tags to be added in the config ? I don’t really know javascript so I’m a bit lost on how I could do the changes myself :thinking:

Only if you find it useful ofc but for me it will greatly improve the efficiency of backlinks in a digital garden :)

Thanks again !