Skip to content
Range Log

Range Log shortcode reference

4 min read
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 >}}
OptionDefaultNotes
first argument or valuerequiredThe caliber, in any common spelling
inlineoffInline pill instead of a card
link / nolink, or link="true"caliberLinksLink 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.

OptionDefaultNotes
pricerequiredPrice of the box or case; $ and commas are allowed
roundsrequiredRounds in it
formatdollarsdollars or cents
decimals2 (dollars), 1 (cents)
currency$Or set currency in [params.rangelog]
suffix/rdOr set cprSuffix in [params.rangelog]
fallbackText 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 prices, lowest cost per round first
AmmoPriceRoundsPer round
Example load B$289.991,000$0.29/rd Lowest
Example load A$18.9950$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 >}}
Inline rows
AmmoStorePriceRoundsPer round
Example load DLocal shop$9.9920$0.50/rd Lowest
Example load COnline$12.4920$0.62/rd
OptionDefaultNotes
fromammo_pricesFront matter key to read the rows from
captionTable caption
sortcprcpr, price, rounds or none
formatdollarsdollars or cents for the per-round column
besttrueMark the lowest cost per round
decimals, currencyAs 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" />}}
From front matter
FirearmAmmoRoundsMalfunctions
Example rifleExample load600
Total600
From inner content
FirearmAmmoRoundsMalfunctionsNotes
Example pistolExample 9mm load1000Drills at 7 yd
Example rifleExample .22 LR load1501One light strike
Example pistol1000
Example rifle1501
Total2501
OptionDefaultNotes
fromrange_logFront matter key to read the rows from
captionRange log
totalstrueShow 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" >}}
Beretta A300 Outlander, all posts
FirearmSessionsRoundsMalfunctionsLast session
Beretta A300 Outlander11502Oct 25, 2026
OptionDefaultNotes
firearmallShow one firearm only (not case sensitive)
fromrange_logFront matter key
caption