You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This page explains how the "Vital statistics" sidebar works.
8
+
The "Vital Statistics" sidebar (statbox) is a dynamic component that displays metadata about software components or people. It appears on the right side of wiki pages when relevant fields are provided in the page's YAML front matter.
9
9
10
-
The sidebar supports quite a few fields; see [this comment](https://github.com/imagej/imagej.github.io/blob/-/_includes/layout/statbox#L31-L75) for a list. Including at least one of these fields will cause the statbox to appear; otherwise, there will be no statbox for the page.
10
+
## Overview
11
11
12
-
## Tips
12
+
The statbox operates in two modes:
13
13
14
-
### Multi-part URL statistics
14
+
1.**Manual mode**: You specify metadata fields manually in the page front matter
15
+
2.**Automatic mode**: The statbox scrapes information from Maven repositories using JavaScript
15
16
16
-
Several URL-type stats have multiple related keys (e.g. `release-url` and `release-version`). This is to give you control over displayed text in the limited space of the Vital Statistics box. Note that entering a URL alone is typically insufficient to display: you must also enter a corresponding label.
17
+
The two modes can be combined: the automatic population only fills empty fields, which allows manual overrides as needed.
17
18
18
-
#### Source URLs
19
+
##Basic Usage
19
20
20
-
The `source-url` key is an exception and does not require a corresponding label. Appropriate text will be auto-generated based on the URL domain.
21
+
To enable the statbox, add at least one supported field to your page's YAML front matter:
21
22
22
-
### Keys with Special Values
23
+
```yaml
24
+
---
25
+
title: My Component
26
+
name: My Component Name
27
+
icon: /media/icons/my-component.png
28
+
source-url: https://github.com/myorg/my-component
29
+
---
30
+
```
31
+
32
+
## Supported Fields
33
+
34
+
### General Fields
35
+
36
+
| Field | Description | Example |
37
+
|-------|-------------|---------|
38
+
|`icon`| URL of the image icon to show in the statbox header |`/media/icons/fiji.png`|
39
+
|`name`| Name of the component or person |`"Fiji"`|
The `affiliation` field supports the `Name | URL` format:
158
+
159
+
```yaml
160
+
affiliation:
161
+
- 'University of Wisconsin-Madison | https://wisc.edu'
162
+
- 'Morgridge Institute for Research | https://morgridge.org'
163
+
```
164
+
165
+
## Examples
166
+
167
+
### Manual Component Example
168
+
169
+
```yaml
170
+
---
171
+
title: Fiji
172
+
name: Fiji
173
+
icon: /media/icons/fiji.png
174
+
website: https://fiji.sc
175
+
source-url: https://github.com/fiji/fiji
176
+
license-url: /licensing/gpl
177
+
license-label: GPLv3
178
+
release-version: "2.14.0"
179
+
release-date: "2023-06-01"
180
+
dev-status: Active
181
+
support-status: Active
182
+
team-leads: '@ctrueden'
183
+
team-developers: '@ctrueden, @hinerm'
184
+
forum-tag: fiji
185
+
---
186
+
```
187
+
188
+
### Automatic Component Example
189
+
190
+
```yaml
191
+
---
192
+
title: ImgLib2
193
+
artifact: net.imglib2:imglib2
194
+
---
195
+
```
196
+
197
+
### Person Example
198
+
199
+
```yaml
200
+
---
201
+
title: Curtis Rueden
202
+
name: Curtis Rueden
203
+
gravatar: abc123def456
204
+
affiliation: 'University of Wisconsin-Madison | https://wisc.edu'
205
+
website: https://ctrue.name
206
+
github: ctrueden
207
+
forum: ctrueden
208
+
orcid: 0000-0001-7055-6707
209
+
scholar: VqJdqBEAAAAJ
210
+
honorific: Fiji Maintainer
211
+
---
212
+
```
27
213
28
-
***Name \| link** - Displays the given name with a custom link. This can be absolute (`Google | https://google.com`) or relative (`Google | /people/google`)
214
+
## Implementation Details
29
215
30
-
#### Team members
216
+
The statbox is implemented in `_includes/layout/statbox` using Liquid templating and enhanced with JavaScript from `assets/js/maven.js` for automatic population features. When `artifact` or `pom-url` is specified, the JavaScript automatically fetches and parses Maven metadata to populate empty fields.
31
217
32
-
All of the `team-` sections (e.g. `team-leads`, `team-developers`) accept comma-separated (`,`) lists of one or more individual(s). Each person can be in one of three formats, and the formats can be mixed and matched:
218
+
The automatic metadata population logic works best for components using [Maven](/development/maven) as their project management/build tool, and which extend the [pom-scijava parent](https://github.com/scijava/pom-scijava) for build configuration and dependency version management, because pom-scijava [enforces the presence of all the needed metadata](https://github.com/scijava/pom-scijava-base?tab=readme-ov-file#enforcer-rules-declared-in-this-parent). See [here](https://github.com/fiji/fiji/blob/fiji-2.14.0/pom.xml#L16-L178) for an example of how populated metadata might look in your project's `pom.xml` file.
33
219
34
-
***@person** - Looks up the person as an id in the [people directory](/people). Note that the `@` can appear anywhere in the id, but can not be the very first character of a value - which can be solved by putting the value in quotes, i.e. `'@ctrueden, @hinerm'`
35
-
***Name \| link** - Displays the given name with a custom link. See also [Affiliation](#affiliation).
220
+
The refresh button (⟲) allows users to reload the automatic data, useful when new releases are available.
0 commit comments