Range Log shortcode reference
Contents
Range Log adds five shortcodes. Each one is shown below with the code and what it renders.
caliber
A card with the standard name of a caliber, its type, and spellings that stores use for it. Write the caliber the
way you normally would: 9mm, 9x19, .223 Rem, 5.56 NATO, 300 BLK, 12ga, .30-06.
{{< caliber "300 BLK" >}}
If this site has posts tagged with the caliber in the calibers front matter, the card links to them, even when
the spelling is different. Add inline for a small pill inside a sentence:
The rifle shoots {{< caliber "300 BLK" inline >}} and 5.56.
The rifle shoots .300 AAC Blackout and 5.56.
With link, the card also links to the caliber’s price comparison page on GunsNPrices. This is off unless you add
link or set caliberLinks = true in [params.rangelog]:
{{< caliber "6.5 Creedmoor" link >}}
| Option | Default | Notes |
|---|---|---|
first argument or value | required | The caliber, in any common spelling |
inline | off | Inline pill instead of a card |
link / nolink, or link="true" | caliberLinks | Link to GunsNPrices |
aliases="3" | caliberAliases (6) | How many store spellings to show; 0 hides them |
A caliber that is not in the list is shown as written, with a dashed border, and Hugo prints a warning with the file and line.
cost-per-round
{{< cost-per-round price="18.99" rounds="50" >}}
{{< cost-per-round 289.99 1000 >}}
{{< cost-per-round price="289.99" rounds="1000" format="cents" >}}
Renders $0.38/rd, $0.29/rd and 29.0¢/rd.
| Option | Default | Notes |
|---|---|---|
price | required | Price of the box or case; $ and commas are allowed |
rounds | required | Rounds in it |
format | dollars | dollars or cents |
decimals | 2 (dollars), 1 (cents) | |
currency | $ | Or set currency in [params.rangelog] |
suffix | /rd | Or set cprSuffix in [params.rangelog] |
fallback | Text to show when the numbers are missing |
ammo-prices
A table of price, rounds and cost per round, lowest cost per round first. The rows come from the ammo_prices list
in front matter:
ammo_prices:
- product: Example load A
store: Local shop # optional
price: 18.99
rounds: 50
url: https://... # optional, links the product name
{{< ammo-prices />}}
| Ammo | Price | Rounds | Per round |
|---|---|---|---|
| Example load B | $289.99 | 1,000 | $0.29/rd Lowest |
| Example load A | $18.99 | 50 | $0.38/rd |
Or write the rows inside the shortcode, one per line: product, price, rounds and an optional store, separated
by |. A header row and Markdown links in the product name are fine.
{{< ammo-prices caption="Inline rows" sort="price" >}}
Example load C | 12.49 | 20 | Online
Example load D | 9.99 | 20 | Local shop
{{< /ammo-prices >}}
| Ammo | Store | Price | Rounds | Per round |
|---|---|---|---|---|
| Example load D | Local shop | $9.99 | 20 | $0.50/rd Lowest |
| Example load C | Online | $12.49 | 20 | $0.62/rd |
| Option | Default | Notes |
|---|---|---|
from | ammo_prices | Front matter key to read the rows from |
caption | Table caption | |
sort | cpr | cpr, price, rounds or none |
format | dollars | dollars or cents for the per-round column |
best | true | Mark the lowest cost per round |
decimals, currency | As in cost-per-round |
range-log
Rounds fired in a session, with totals, and subtotals when more than one firearm was used. Rows come from the
range_log list in front matter, or from lines inside the shortcode: firearm, ammo, rounds, malfunctions and notes.
The last two are optional.
range_log:
- firearm: Example rifle
ammo: Example load
rounds: 60
malfunctions: 0 # optional
notes: "" # optional
This page keeps its sample rows under example_log and reads them with from="example_log", so they stay out of
the club’s round counts:
{{< range-log from="example_log" caption="From front matter" />}}
| Firearm | Ammo | Rounds | Malfunctions |
|---|---|---|---|
| Example rifle | Example load | 60 | 0 |
| Total | 60 | 0 | |
| Firearm | Ammo | Rounds | Malfunctions | Notes |
|---|---|---|---|---|
| Example pistol | Example 9mm load | 100 | 0 | Drills at 7 yd |
| Example rifle | Example .22 LR load | 150 | 1 | One light strike |
| Example pistol | 100 | 0 | ||
| Example rifle | 150 | 1 | ||
| Total | 250 | 1 | ||
| Option | Default | Notes |
|---|---|---|
from | range_log | Front matter key to read the rows from |
caption | Range log | |
totals | true | Show subtotals and the total |
round-count
Adds up the range_log front matter of every page on the site, per firearm. Rows written inside a range-log
shortcode are not counted.
{{< round-count >}}
{{< round-count firearm="Beretta A300 Outlander" >}}
| Firearm | Sessions | Rounds | Malfunctions | Last session |
|---|---|---|---|---|
| Beretta A300 Outlander | 1 | 150 | 2 | Oct 25, 2026 |
| Option | Default | Notes |
|---|---|---|
firearm | all | Show one firearm only (not case sensitive) |
from | range_log | Front matter key |
caption |