Skip to content

Commit

Permalink
Added site metrics to community page #3
Browse files Browse the repository at this point in the history
  • Loading branch information
webilhan committed Mar 11, 2019
1 parent 5e4c76e commit 524b5e3
Show file tree
Hide file tree
Showing 3 changed files with 91 additions and 1 deletion.
55 changes: 55 additions & 0 deletions _data/metrics.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
{
"metrics": [
{
"name": "unique visitors",
"lastWeek": 90,
"total": 245
},
{
"name": "registered members",
"lastWeek": 4,
"total": 34
},
{
"name": "chat message count",
"lastWeek": 655,
"total": 2345
},
{
"name": "site updates",
"lastWeek": 63,
"total": 334
},
{
"name": "issues",
"lastWeek": 12,
"total": 452
}
],
"mostActive": [
{
"type": "repository",
"value": "Inter Customs Ledger",
"url": "https://github.com/edi3/edi3-icl"
},
{
"type": "contributor",
"value": "monkeypants",
"url": "https://github.com/onthebreeze"
}
],
"links": [
{
"text": "Google site metrics",
"url": ""
},
{
"text": "Slack team metrics",
"url": ""
},
{
"text": "Github project metrics",
"url": ""
}
]
}
35 changes: 35 additions & 0 deletions _includes/metrics.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<h4>Metrics</h4>
{%- assign metrics = site.data.metrics -%}
<table>
<thead>
<tr>
<th>Metric</th>
<th>last week</th>
<th>total</th>
</tr>
</thead>
<tbody>
{% for metric in metrics.metrics %}
<tr>
<td>{{ metric.name }}</td>
<td>{{ metric.lastWeek }}</td>
<td>{{ metric.total }}</td>
</tr>
{% endfor %}
</tbody>
</table>


<h4>Activity</h4>
<ul>
{% for activity in metrics.mostActive %}
<li>Most active {{ activity.type }}: <a href="{{ activity.url }}" target="_blank">{{ activity.value }}</a></li>
{% endfor %}
</ul>

<h4>Detailed analytics links</h4>
<ul>
{% for link in metrics.links %}
<li><a href="{{ link.url }}" target="_blank">{{ link.text }}</a></li>
{% endfor %}
</ul>
2 changes: 1 addition & 1 deletion pages/community.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ For those that want to contribute to our work. [Github](https://github.com/edi3)

## Site Metrics

Put some cool numbers, trends & links here
{% include metrics.html %}

0 comments on commit 524b5e3

Please sign in to comment.