mirror of
https://github.com/zhigang1992/probot.github.io.git
synced 2026-04-29 12:45:27 +08:00
Sync installation stats show on site
This commit is contained in:
@@ -54,6 +54,8 @@ screenshots:
|
|||||||
authors: [ your-username, other-usernames ]
|
authors: [ your-username, other-usernames ]
|
||||||
# The repository where the code is located
|
# The repository where the code is located
|
||||||
repository: your-username/your-app
|
repository: your-username/your-app
|
||||||
|
# The address where this app is deployed
|
||||||
|
host: https://my-probot-app.awesomecloudhost.com
|
||||||
---
|
---
|
||||||
|
|
||||||
Any documentation can go here. Many apps just use their README.md here.
|
Any documentation can go here. Many apps just use their README.md here.
|
||||||
|
|||||||
@@ -4,6 +4,9 @@
|
|||||||
<p class="text-gray lh-condensed px-3 pb-3">{{ app.description }}</p>
|
<p class="text-gray lh-condensed px-3 pb-3">{{ app.description }}</p>
|
||||||
<div class="text-gray-light pl-3 pr-2 py-2 bg-gray-light border-top" style="margin-top: auto;">
|
<div class="text-gray-light pl-3 pr-2 py-2 bg-gray-light border-top" style="margin-top: auto;">
|
||||||
<div class="d-flex flex-row">
|
<div class="d-flex flex-row">
|
||||||
|
{% if app.installations %}
|
||||||
|
<div class="col-3 tooltipped tooltipped-s" aria-label="{{ app.installations }} installations">{% octicon cloud-download heigh:16 class:"v-align-middle" %} <span class="">{{ app.installations }}</span></div>
|
||||||
|
{% endif %}
|
||||||
<div class="col-3 tooltipped tooltipped-s" aria-label="{{ app.stars }} stars">{% octicon star heigh:16 class:"v-align-middle" %} <span class="">{{ app.stars }}</span></div>
|
<div class="col-3 tooltipped tooltipped-s" aria-label="{{ app.stars }} stars">{% octicon star heigh:16 class:"v-align-middle" %} <span class="">{{ app.stars }}</span></div>
|
||||||
<div class="col-9 text-right">
|
<div class="col-9 text-right">
|
||||||
{% for author in app.authors %}
|
{% for author in app.authors %}
|
||||||
|
|||||||
@@ -15,6 +15,9 @@ layout: default
|
|||||||
Add to GitHub
|
Add to GitHub
|
||||||
</a>
|
</a>
|
||||||
<div class="text-gray-light">
|
<div class="text-gray-light">
|
||||||
|
{% if page.installations %}
|
||||||
|
<div class="mr-2 d-inline tooltipped tooltipped-s" aria-label="{{ page.installations }} installations">{% octicon cloud-download heigh:16 class:"v-align-middle" %} <span class="">{{ page.installations }}</span></div>
|
||||||
|
{% endif %}
|
||||||
<div class="d-inline tooltipped tooltipped-s" aria-label="{{ page.stars }} stars">{% octicon star heigh:16 class:"v-align-middle" %} <span class="">{{ page.stars }}</span></div>
|
<div class="d-inline tooltipped tooltipped-s" aria-label="{{ page.stars }} stars">{% octicon star heigh:16 class:"v-align-middle" %} <span class="">{{ page.stars }}</span></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -69,6 +72,16 @@ layout: default
|
|||||||
{{ content }}
|
{{ content }}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="col-md-3">
|
||||||
|
{% if page.organizations %}
|
||||||
|
<h4 class="mb-1 alt-h4 text-gray">Used By</h4>
|
||||||
|
{% for org in page.organizations %}
|
||||||
|
<a href="https://github.com/{{ org }}" aria-label="{{ org }}" class="tooltipped tooltipped-n avatar-group-item">
|
||||||
|
<img class="avatar" src="https://github.com/{{ org }}.png" alt-"{{ org }}" width="35" height="35">
|
||||||
|
</a>
|
||||||
|
{% endfor %}
|
||||||
|
{% endif %}
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ title: Featured Apps
|
|||||||
<h1 class="alt-h2">{{ page.title }}</h1>
|
<h1 class="alt-h2">{{ page.title }}</h1>
|
||||||
|
|
||||||
<div class="d-md-flex flex-wrap gutter flex-auto">
|
<div class="d-md-flex flex-wrap gutter flex-auto">
|
||||||
{% assign apps = site.apps | sort: 'stars' | reverse %}
|
{% assign apps = site.apps | sort: 'installations' | reverse %}
|
||||||
{% for app in apps %}
|
{% for app in apps %}
|
||||||
{% include app.html app=app %}
|
{% include app.html app=app %}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ layout: default
|
|||||||
</p>
|
</p>
|
||||||
|
|
||||||
<div class="d-md-flex flex-wrap gutter flex-auto">
|
<div class="d-md-flex flex-wrap gutter flex-auto">
|
||||||
{% assign apps = site.apps | sort: 'stars' | reverse %}
|
{% assign apps = site.apps | sort: 'installations' | reverse %}
|
||||||
{% for app in apps limit:6 %}
|
{% for app in apps limit:6 %}
|
||||||
{% include app.html app=app %}
|
{% include app.html app=app %}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|||||||
@@ -18,9 +18,13 @@ files.each do |path|
|
|||||||
app['updated'] = repo[:pushed_at].to_s
|
app['updated'] = repo[:pushed_at].to_s
|
||||||
|
|
||||||
if app['host']
|
if app['host']
|
||||||
stats = JSON.parse(URI(app['host'] + '/stats').open.read)
|
begin
|
||||||
app['installations'] = stats['installations']
|
stats = JSON.parse(URI(app['host'] + '/probot/stats').open.read)
|
||||||
app['organizations'] = stats['popular'].map { |org| org['login'] }
|
app['installations'] = stats['installations']
|
||||||
|
app['organizations'] = stats['popular'].map { |org| org['login'] }
|
||||||
|
rescue => e
|
||||||
|
warn e.message
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
content = File.read(path)
|
content = File.read(path)
|
||||||
|
|||||||
Reference in New Issue
Block a user