gohugoio / hugoThemesSite

The source for https://themes.gohugo.io.

Home Page:https://themes.gohugo.io/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add GitHub stars

bep opened this issue · comments

And a way to sort with it.

http://drjekyllthemes.github.io/trending

I guess this means rewriting the script to Go or something, maybe; my Bash skills has its limmits.

Wouldn't this just favor older themes? Is that the usual action, to go to theme and star it before you download it?

Wouldn't this just favor older themes?

Yea, maybe. I haven't thought about it too hard, I just made a mental note about it here after seeing the Jekyll dir.

Now with custom outputs fully realized, I'd be happy to help put this into something more JS heavy. Vue.js could work really well with something like this, and it wouldn't be that hard to implement...

There is the result of hugo themes crawler on Google Apps Script https://docs.google.com/spreadsheets/d/1BewJrQPQ3szpCxrfVKVpyxNXqmAupPt5adQGT7IS-Z4/edit?usp=sharing It needs 502 calls per full circle. I'm not sure that is a great idea to call stars for each client in a browser.

And other problems here:

  • Some topics are hosted on other git-sites (bitbucket.org, gitlab.com)
  • bitbucket.org doesn't have a rating system
  • gitlab and github should somehow correlate to exclude underestimated ratings
  • http://drjekyllthemes.github.io/trending isn't updated regularly.

I think for start, we could run the Google Apps Script every 10 days and push the data directly to the repository in the page code. Another option is to read data from Google Drive.

commented

This issue has been automatically marked as stale because it has not had recent activity. Feel free to ask questions. We're glad to help.
This issue will automatically be closed in the near future if no further activity occurs. Thank you for all your contributions.

This is not doable easily.

Currently we have themes hosted on GitHub and GitLab

GitHub's public API is accessible in the following form:
https://api.github.com/repos/<user>/<repo>

GitLab's public API is slightly different (but it makes things more difficult):
https://gitlab.com/api/v4/projects/<project_ID>/

Theoretically we could use getJSON to fetch the stargazers_count for GitHub hosted themes and the star_count for GitLab hosted themes.

However in the case of GitHub we would need to construct the JSON URL by using regular expressions to extract the username and the repository name from the repo URL that is specified in theme.toml

While for GitLab we would need to ask theme authors to update their theme.toml and include the repo project_ID.

Currently we only have 3 GitLab hosted themes featured in the showcase, so theoretically we could ask the authors.

However, I do not see the value in showcasing a theme's star ratings. I think that users who search for a theme have other criteria. Popularity is certainly not one of them.