Skip to content

Commit c54c858

Browse files
peternewmanArachnid
authored andcommitted
Create a list of organisations (pidcodes#181)
* Remove errant .DS_Store file * Ignore .DS_Store * Create a list of organisations * Add an org list * Show number of PIDs per org * Fix HTML issue, sort orgs by title * Try and fix the PID count * Try and fix issues * Try again to fix issues * Try yet again to fix issues * Correct the urlpart * Change to sort_natural, minor code tidy * Try and fix the sorting * Try again to fix the sorting * Remove debugging * Add a link to orgs page
1 parent ce052c0 commit c54c858

3 files changed

Lines changed: 22 additions & 0 deletions

File tree

_includes/navigation.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<a href="{{ site.baseurl }}/about/">About</a>
22
<a href="{{ site.baseurl }}/pids/">All PIDs</a>
3+
<a href="{{ site.baseurl }}/orgs/">All Orgs</a>
34
<a href="{{ site.baseurl }}/howto/">Get a PID</a>
45
<a href="{{ site.baseurl }}/faq/">FAQ</a>

_includes/orgtable.html

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{% include data.html %}
2+
<table>
3+
<thead>
4+
<tr><th>Organisation</th><th>Number of PIDs</th></tr>
5+
</thead>
6+
{% assign sortedorgs = {{site.pages|where:"layout","org"|sort:"title"}} %}
7+
{% for org in sortedorgs %}
8+
{% assign urlparts = org.url|split:"/" %}
9+
{% assign owner = urlparts[2] %}
10+
<tr>
11+
<th><a href="{{org.url}}">{{org.title}}</a></th>
12+
<td>{{ pids | where:"owner",owner | size }}</td>
13+
</tr>
14+
{% endfor %}
15+
</table>

orgs.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
layout: page
3+
title: Organisation List
4+
permalink: /orgs/
5+
---
6+
{%include orgtable.html %}

0 commit comments

Comments
 (0)