Skip to content
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

Load linkgrid metadata from files #250

Open
3 tasks done
ljcbaby opened this issue Apr 15, 2021 · 8 comments
Open
3 tasks done

Load linkgrid metadata from files #250

ljcbaby opened this issue Apr 15, 2021 · 8 comments
Assignees
Labels
Feature Request New feature or request

Comments

@ljcbaby
Copy link
Member

ljcbaby commented Apr 15, 2021

Please follow this Issue template to provide relevant information, such as source code repository, website URL and screenshots, which will help us investigate.
请按照此 Issue 模版提供相关信息,例如源码仓库、网站链接和屏幕截图,这将有助于我们进行调查。

Issue Checklist

  • I am using NexT version 8.0 or later.
  • I have already read the relevant documents of Hexo and NexT.
  • I have already searched for current issues, which does not help me.

Expected behavior

load linkgrid metadata from json files

Actual behavior

use like:

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

Other Information

As pr #229

@ljcbaby ljcbaby added the Feature Request New feature or request label Apr 15, 2021
@ljcbaby ljcbaby linked a pull request Apr 15, 2021 that will close this issue
12 tasks
@stevenjoezhang
Copy link
Member

Is the content of the json file generated automatically or edited by the blogger?

@ljcbaby
Copy link
Member Author

ljcbaby commented Apr 15, 2021

I think it should be automatically generated
This is mainly used for the update and maintenance of friend links, allowing the applicant to maintain the information themselves (via Pull Request)

@ljcbaby
Copy link
Member Author

ljcbaby commented Apr 15, 2021

However, CORS issues may exist
image

@ljcbaby
Copy link
Member Author

ljcbaby commented Apr 15, 2021

I think it should be automatically generated
This is mainly used for the update and maintenance of friend links, allowing the applicant to maintain the information themselves (via Pull Request)

Example:https://github.com/SukkaW/Friends

@ljcbaby
Copy link
Member Author

ljcbaby commented Jun 13, 2021

Can this feature be implemented?

@ljcbaby
Copy link
Member Author

ljcbaby commented Jun 28, 2021

However, CORS issues may exist
image

This has not been reproduced again on my new computer's Egde.

@ljcbaby ljcbaby changed the title Allow load linkgrid metadata from files Load linkgrid metadata from files Aug 26, 2021
@stevenjoezhang stevenjoezhang added this to the 8.10.1 milestone Feb 15, 2022
@stevenjoezhang stevenjoezhang self-assigned this Feb 15, 2022
@stevenjoezhang stevenjoezhang modified the milestones: 8.10.1, 8.10.2 Mar 3, 2022
@leirock
Copy link
Contributor

leirock commented Mar 18, 2022

Here is my code just for your reference.

Code: https://github.com/leirock/friends/tree/next
Blog: https://blog.dlzhang.com/friends/

  • source/friends/friendslist.yml: raw data in YAML format
  • scripts/inline-lables.js: enable inline label {% friendslink %}
  • scripts/friendslist.js: convert YAML to JSON
  • source/friends/index.md: use code {% friendslink friendslist.json %} to load JSON file in link page (but can only load one JSON file in one page)
  • source/_data/styles.styl: link grid style for friends links (I didn't design a new style for friends links, just modifed NexT's link grid style)

@stevenjoezhang stevenjoezhang removed this from the 8.11.0 milestone Apr 1, 2022
@sghuang19
Copy link
Member

Seems like a valid use case.

@stevenjoezhang is this something that we are going to implement in the future?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature Request New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants