jekyll / github-metadata

Jekyll plugin to propagate the `site.github` namespace and set default values for use with GitHub Pages.
https://jekyll.github.io/github-metadata/
MIT License
282 stars 127 forks source link

looks like there is no releases in the site.github.public_repositories #221

Closed yalov closed 2 years ago

yalov commented 2 years ago
{%- for repository in site.github.public_repositories %}
{%- for release in repository.releases %}
{{release.name}}
{%- endfor %}
{%- endfor %}

output nothing, while the https://github.com/jekyll/github-metadata/blob/master/docs/site.github.md mentions the releases item

ashmaroli commented 2 years ago

Do you mind posting the rendered output of <pre>{{ site.github }}</pre> here..?

yalov commented 2 years ago

{{ site.github }} is too large, this is the one of the repository

{%- for repository in site.github.public_repositories %}
{%- if repository.fork == false %}
    <pre>{{repository}}</pre>

https://jpst.it/2KbkG - no the "releases" item

ashmaroli commented 2 years ago

{{ site.github }} is too large..

The document you linked to pertains to the top-level object {{ site.github }}. The releases you're referring to is {{ site.github.releases }}.

yalov commented 2 years ago

Oh, yes, the previous code area in the wiki (site.github.public_repositories) have confused me.

Is it possible to expose releases of not just current repo (where the github pages is), but to the all repos, as in the releases API? I was trying to replace javascript there https://yalov.github.io/github-repos because of the limits of the unauthorized API requests

ashmaroli commented 2 years ago

Is it possible to expose releases of not just current repo (where the github pages is), but to the all repos, as in the releases API?

pinging @parkr for assistance.

parkr commented 2 years ago

Is it possible to expose releases of not just current repo (where the github pages is), but to the all repos, as in the releases API?

This would certainly be possible, though it would be expensive since it's a GET call for every single repo. This could put you close to your API limits or close to the GitHub Pages timeout.

We populate public_repositories with Octokit::Client#list_repos(username):

$ curl -H "Accept: application/vnd.github.mercy-preview+json" https://api.github.com/users/yalov/repos?type=public

A list of repositories for your user is returned, with a releases_url field. We could add a field releases to this response which calls the releases_url via repo.rels[:releases].get.data as a Drop so it's only rendered when asked for.

I'm 👍 on adding this feature if anyone has time to code it up!

jekyllbot commented 2 years ago

This issue has been automatically marked as stale because it has not been commented on for at least two months.

The resources of the Jekyll team are limited, and so we are asking for your help.

If this is a bug and you can still reproduce this error on the master branch, please reply with all of the information you have about it in order to keep the issue open.

If this is a feature request, please consider whether it can be accomplished in another way. If it cannot, please elaborate on why it is core to this project and why you feel more than 80% of users would find this beneficial.

This issue will automatically be closed in two months if no further activity occurs. Thank you for all your contributions.

parkr commented 2 years ago

I took a swing at this today: https://github.com/jekyll/github-metadata/pull/224.