ParitoshBh / grav-coder

https://paritoshbh.me
MIT License
28 stars 8 forks source link

Add support for rel=me in the social media links in the footer #26

Closed Habmala closed 3 years ago

Habmala commented 3 years ago

Not sure if this is the right place to write but I was missing the ability to link my mastodon account that uses the rel=me format to my site through the link in my footer.

I rewrote the footer.html.twig to check for it and wanted to share. I don't how to do pull requests and such but figured I'd post the code as a feature request, feel free to just run with it if you want. The only change is to line six here. And then I added a line saying "rel: me" to the link under social media in grav-coder.yaml under the config/themes folder.

section class="container centered">
  <div class="about">
    <ul>
      {% for type, meta in theme_config.social %}
        <li>
          <a href="{{ meta.url }}" {% if meta.rel %}rel="{{ meta.rel }}" {% endif %}class="btn btn-link" title="{{ meta.title }}">
            <i class="fab {{ meta.icon }}"></i>
          </a>
          {% if loop.last == false %}
            <span class="separator">•</span>
          {% endif %}
        </li>
      {% endfor %}
    </ul>
  </div>
</section>
<section class="container">
  <span class="copyright">
    ©
    {% if theme_config.footer.copyright_start_year %}
      {{ theme_config.footer.copyright_start_year }} -
    {% endif %}
    {{ "now"|date("Y") }} <a href="{{ home_url }}">{{ theme_config.footer.copyright }}</a>
  </span>
ParitoshBh commented 3 years ago

Thanks for sharing the snippet. If you want to create a PR (for the sake of learning), I can walk you through the process. If it's about time then worry not, I'll push the update myself!

Habmala commented 3 years ago

Glad you liked it. I'd be happy to learn, I should have done so long ago, just haven't gotten around to it. I'll try to look in to it over the weekend. :)

Habmala commented 3 years ago

I think I've managed to make the change and do a pull request. First time in ages though so let me know if something is off and I'll try to fix it.

Also I didn't know where to write any type of comment or documentation. Since it's not used by default it's basically a hidden option as long as it's undocumented. Let me know if you want me to write a couple of lines explaining it, I'd be happy to.

ParitoshBh commented 3 years ago

Pushed in v0.1.9!