-
Notifications
You must be signed in to change notification settings - Fork 40
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
plugins/news: Add support for multiple post authors #111
Conversation
Now you can specify multiple post authors (comma separated), e.g.: title: Multiple Authors Demo author: Be., Pegasus, Albert, Holzhaus date: 2020-06-20 12:00:00
Depends on PR mixxxdj#111
(<a href="https://github.com/{{ post.author_github }}">@{{ post.author_github }}</a>) | ||
{% endif %} | ||
</span> | ||
{% if author.url %}<a href="{{ author.url }}">{{ author.name }}</a>{% else %}{{ author.name }}{% endif %}{% if author.github %} (<a href="https://github.com/{{ author.github }}">@{{ author.github }}</a>){% endif %}</span> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a reason why this is a single line?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, because otherwise it will insert newlines into the HTML source, which creates a space before the comma.
<span class="author">{% if author.url %}<a href="{{ author.url }}">{{ author.name }}</a>{% else %}{{ author.name }}{% endif %}{% if author.github %} (<a href="https://github.com/{{ author.github }}">@{{ author.github }}</a>){% endif %}</span>, | ||
{% endfor %} | ||
{% for author in authors|slice:"-2:-1" %} | ||
<span class="author">{% if author.url %}<a href="{{ author.url }}">{{ author.name }}</a>{% else %}{{ author.name }}{% endif %}{% if author.github %} (<a href="https://github.com/{{ author.github }}">@{{ author.github }}</a>){% endif %}</span> and |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not very familiar with cactus, but is there any way to reduce the duplication using a macro or smth?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not really. We could put it into a separate template and include that here, but that also would also lead to superfluous newlines
@ywwg we forgot to merge this prior to the BLM post. |
Now there is a merge conflict. |
…tiple-news-authors
Resolved. |
oh yeah we need to get this in |
Now you can specify multiple post authors (comma separated), e.g.:
Useful for #110.