next-theme / hexo-theme-next

🎉 Elegant and powerful theme for Hexo.
https://theme-next.js.org
Other
2.34k stars 420 forks source link

add issues-api and friends tag-plugin #229

Closed xaoxuu closed 3 years ago

xaoxuu commented 3 years ago

PR Checklist

PR Type

What is the current behavior?

Issue resolved:

What is the new behavior?

How to use?

In NexT _config.yml:

issues_api: https://issues-api.vercel.app/v1/

In blog markdown file (example):

{% friends repo:xaoxuu/friends %}
iShot2021-03-12 21 11 17
welcome[bot] commented 3 years ago

Thanks so much for opening your first PR here!

CLAassistant commented 3 years ago

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

stevenjoezhang commented 3 years ago

The function of the friends tag is similar to the existing link-grid, I suggest make it as another style of link-grid.

xaoxuu commented 3 years ago

In my opinion, the usage and style of both of them are very different.

linkgrid:

{% linkgrid %}
Theme NexT | https://theme-next.js.org/ | Stay Simple. Stay NexT. | /images/apple-touch-icon-next.png
Theme NexT | https://theme-next.js.org/ | Stay Simple. Stay NexT. | /images/apple-touch-icon-next.png
Theme NexT | https://theme-next.js.org/ | Stay Simple. Stay NexT. | /images/apple-touch-icon-next.png
Theme NexT | https://theme-next.js.org/ | Stay Simple. Stay NexT. | /images/apple-touch-icon-next.png
% Theme NexT | https://theme-next.js.org/ | Stay Simple. Stay NexT. | /images/apple-touch-icon-next.png
{% endlinkgrid %}

but friends tag:

{% friends repo:xxx/xxx %}
stevenjoezhang commented 3 years ago

The data in data.json contains almost the same information as the current link-grid tag. At this point, I think the functions of the two tag plugins are similar.

ljcbaby commented 3 years ago

This way of loading information from files has merit compared to styles, allowing faster updating of friend link information rather than regeneration, and allowing submitters to maintain the information themselves (via Github, etc.)

English is not my native language; please excuse typing errors.

pplmx commented 3 years ago

Look forward to this feature.

PaperStrike commented 3 years ago

I think it's better to extend the exsisting usage of link-grid, making it possible to mix the one-by-one grammer with your grammer together. Since % is considered as the comment symbol, you may try to make something implemented as:

{% linkgrid %}
Theme NexT | https://theme-next.js.org/ | Stay Simple. Stay NexT. | /images/apple-touch-icon-next.png
% friends example/friends
{% endlinkgrid %}

Possibly more sources together:

{% linkgrid %}
Theme NexT | https://theme-next.js.org/ | Stay Simple. Stay NexT. | /images/apple-touch-icon-next.png
% friends example/friends
% friends example2/friends
{% endlinkgrid %}
xaoxuu commented 3 years ago

Sorry, my js is very amateur, maybe I should close this PR and submit a suggestion issue for professionals to finish it.