Shortcodes
Recommended Posts
Author
oxypteros
Recommended Cases
Code
{{< recommended TITLE="Recommended Cases" LIMIT="2" >}}
Overview
Displays a list of recommended posts as card links with the title, series, category, and a pseudo-dynamic New badge.
Usage
- Add
recommend = true
in the frontmatter of the content you want to highlight. - Use this shortcode on the homepage and/or section pages (i.e.
_index.md
). - Posts published within 7 days from the latest site build will show a New badge..
Tip: If you set a LIMIT
, the most recent recommended posts (sorted by date) will appear, up to that number.
Parameters Reference
- TITLE
TITLE="Example Title"
— (string, optional)- H2 heading, centered above the list.
- LIMIT
LIMIT="4"
— (integer, optional)- Maximum number of posts to display.
- Default value:
4
Error Reporting
- Warnings are printed to the Hugo terminal.
- OCD enabled.
Error Codes
- ocd-sc-181
- Unrecognized parameter detected.
- ocd-sc-182
- Invalid number or non integer value.
- ocd-sc-183
- No pages marked with
recommended = true