Improve topics plugin support

This commit is contained in:
lowlighter
2021-04-07 17:58:57 +02:00
parent 25c138627d
commit 29f44ea1fe
4 changed files with 19 additions and 5 deletions

View File

@@ -1,11 +1,14 @@
<%_ if (plugins.topics) { _%>
**[📌 Starred topics](https://github.com/<%= user.login %>?tab=stars)**
**[📌 <%= {starred:"Starred topics", mastered:"Mastered technologies and topics"}[plugins.topics.mode] %>](https://github.com/<%= user.login %>?tab=stars)**
<%_ if (plugins.topics.error) { _%>
<%= plugins.topics.error.message _%>
<%_ } else if (plugins.topics.list.length) { _%>
<%_ for (const {name, icon} of plugins.topics.list) { _%>
* <img src="<%= icon %>" width="24" height="24" alt=""> [<%= name %>](https://github.com/topics/<%= name.toLocaleLowerCase().replace(/ /g, "-") %>)
<%_ for (const {name, icon24} of plugins.topics.list.slice(0, plugins.topics.list.length-1)) { _%>
[![](https://img.shields.io/static/v1?style=flat&label=&message=<%= encodeURIComponent(name) %>&color=222&logo=<%= icon24 %>)](https://github.com/topics/<%= name.toLocaleLowerCase().replace(/ /g, "-") %>)
<%_ } _%>
[<%= plugins.topics.list[plugins.topics.list.length-1].name %>](https://github.com/<%= user.login %>?tab=stars)
<%_ } else { _%>
No starred topics
<%_ } _%>