Skip to content

Commit 557b5d9

Browse files
committed
Make RSMD info on front page driven by a data file
1 parent 56fe77f commit 557b5d9

File tree

2 files changed

+21
-37
lines changed

2 files changed

+21
-37
lines changed

data/rsmd.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
[
2+
{"aspect":"1.5", "description":"Keep the machine readable intrinsic metadata information in a single source file, and automatically generate other file formats", "class":"Useful", "link": "https://fair-impact.github.io/RSMD-guidelines/1.General/#rsmd-15"},
3+
{"aspect":"4.1", "description":"Add software name and description of the software's functionality and purpose", "class":"Essential", "link": "https://fair-impact.github.io/RSMD-guidelines/4.Description_Classification/#rsmd-41"},
4+
{"aspect":"4.2", "description":"Add descriptive metadata for classification purposes embedded in the code", "class":"Important", "link": "https://fair-impact.github.io/RSMD-guidelines/4.Description_Classification/#rsmd-42"},
5+
{"aspect":"4.3", "description":"Cite related resources (e.g journal articles) describing the software with a persistent identifier or stable URL", "class":"Important", "link": "https://fair-impact.github.io/RSMD-guidelines/4.Description_Classification/#rsmd-43"},
6+
{"aspect":"4.4", "description":"Add descriptive metadata of the software in a machine readable format", "class":"Important", "link": "https://fair-impact.github.io/RSMD-guidelines/4.Description_Classification/#rsmd-44"},
7+
{"aspect":"5.1", "description":"Add intrinsic metadata about authors, this information can be captured in a human readable format", "class":"Essential", "link": "https://fair-impact.github.io/RSMD-guidelines/5.Credit_Attribution/#rsmd-51"}
8+
]

layouts/shortcodes/rsmd.html

Lines changed: 13 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,17 @@
11

22
<div id="rsmd-carousel" class="carousel slide rounded-2 text-center pb-4" data-bs-ride="carousel" data-bs-touch="true">
33
<div class="carousel-inner">
4-
<div class="carousel-item active rounded-2" data-bs-interval="20000">
4+
{{ $counter := 0 }}
5+
{{ range .Site.Data.rsmd }}
6+
<div class="carousel-item rounded-2{{ if eq $counter 0 }} active{{ end }}" data-bs-interval="20000">
57
<dl class="m-3 px-md-5">
6-
<dt>RSMD 4.1</dt>
7-
<dd class="px-5">Add software name and description of the software's functionality and purpose <a class="fw-bold" href="https://fair-impact.github.io/RSMD-guidelines/4.Description_Classification/#rsmd-41">[...]</a></dd>
8-
<dd class="fst-italic fw-bold">Essential</dd>
9-
</dl>
10-
</div>
11-
<div class="carousel-item rounded-2" data-bs-interval="20000">
12-
<dl class="m-3 px-md-5">
13-
<dt>RSMD 4.2</dt>
14-
<dd class="px-5">Add descriptive metadata for classification purposes embedded in the code <a class="fw-bold" href="https://fair-impact.github.io/RSMD-guidelines/4.Description_Classification/#rsmd-42">[...]</a></dd>
15-
<dd class="fst-italic fw-bold">Important</dd>
16-
</dl>
17-
</div>
18-
<div class="carousel-item rounded-2" data-bs-interval="20000">
19-
<dl class="m-3 px-md-5">
20-
<dt>RSMD 4.3</dt>
21-
<dd class="px-5">Cite related resources (e.g journal articles) describing the software with a persistent identifier or stable URL <a class="fw-bold" href="https://fair-impact.github.io/RSMD-guidelines/4.Description_Classification/#rsmd-43">[...]</a></dd>
22-
<dd class="fst-italic fw-bold">Important</dd>
23-
</dl>
24-
</div>
25-
<div class="carousel-item rounded-2" data-bs-interval="20000">
26-
<dl class="m-3 px-md-5">
27-
<dt>RSMD 4.4</dt>
28-
<dd class="px-5">Add descriptive metadata of the software in a machine readable format <a class="fw-bold" href="https://fair-impact.github.io/RSMD-guidelines/4.Description_Classification/#rsmd-44" >[...]</a></dd>
29-
<dd class="fst-italic fw-bold">Important</dd>
30-
</dl>
31-
</div>
32-
<div class="carousel-item rounded-2" data-bs-interval="20000">
33-
<dl class="m-3 px-md-5">
34-
<dt>RSMD 5.1</dt>
35-
<dd class="px-5">Add intrinsic metadata about authors, this information can be captured in a human readable format <a class="fw-bold" href="https://fair-impact.github.io/RSMD-guidelines/5.Credit_Attribution/#rsmd-51">[...]</a></dd>
36-
<dd class="fst-italic fw-bold">Essential</dd>
8+
<dt>{{ .aspect }}</dt>
9+
<dd class="px-5">{{ .description }} <a class="fw-bold" href="{{ .link }}" aria-label="See the full {{ .aspect }} description on the RSMD site">[...]</a>
10+
<dd class="fst-italic fw-bold">{{ .class }}</dd>
3711
</dl>
3812
</div>
13+
{{ $counter = add $counter 1 }}
14+
{{ end }}
3915
<button class="carousel-control-prev" type="button" data-bs-target="#rsmd-carousel" data-bs-slide="prev">
4016
<span class="carousel-control-prev-icon" aria-hidden="true"></span>
4117
<span class="visually-hidden">Previous</span>
@@ -46,10 +22,10 @@
4622
</button>
4723
</div>
4824
<div class="carousel-indicators my-0">
49-
<button type="button" data-bs-target="#rsmd-carousel" data-bs-slide-to="0" class="carousel-indicator active" aria-current="true" aria-label="Slide 1"></button>
50-
<button type="button" data-bs-target="#rsmd-carousel" data-bs-slide-to="1" class="carousel-indicator" aria-label="Slide 2"></button>
51-
<button type="button" data-bs-target="#rsmd-carousel" data-bs-slide-to="2" class="carousel-indicator" aria-label="Slide 3"></button>
52-
<button type="button" data-bs-target="#rsmd-carousel" data-bs-slide-to="3" class="carousel-indicator" aria-label="Slide 4"></button>
53-
<button type="button" data-bs-target="#rsmd-carousel" data-bs-slide-to="4" class="carousel-indicator" aria-label="Slide 5"></button>
25+
{{ $counter := 0 }}
26+
{{ range .Site.Data.rsmd }}
27+
<button type="button" data-bs-target="#rsmd-carousel" data-bs-slide-to="{{ $counter }}" class="carousel-indicator{{ if eq $counter 0 }} active{{ end }}" aria-current="true" aria-label="Slide {{ $counter }}"></button>
28+
{{ $counter = add $counter 1 }}
29+
{{ end }}
5430
</div>
5531
</div>

0 commit comments

Comments
 (0)