Citeauthor Kirbytag

Just a little snippet for those who are citing and quoting a lot in their texts. I do, because it’s important for others to know where those quotes are coming from (that’s why I’m also using the Footnote plugin :wink: )

Therefore I’ve made a little tag for it:

<?php

kirbytext::$tags['citeauthor'] = array(
  'html' => function($tag) {
    return '<footer>
            <cite>' . markdown($tag->attr('citeauthor')) . '</cite>
            </footer>';
  }
);

It’s really basic and it is potentially right to extend it widely with source informations like book, article, pages, year, ISBN and so on. Feel free to use it wherever you want. :smile:

If you want to style this right, you can also use this SCSS code:

blockquote footer {
    display: block;
    position: relative;
    margin-top: 1rem;
    p {
      margin-left: 18px;
      margin-bottom: 0;
      &:before {
        content: "— ";
        position: absolute;
        margin-left: -18px;
      }
    }
  }

This adds a m-dash and position everything right.

1 Like