Backlinks

Last updated:
2020-09-25 19:06

Purpose: This document explains how to render backlinks in your Firn layouts.

Prerequistes: an understanding of The Render Function and how layouts work.

Overview

Backlinks are used to display a list of links to the current document you are reading.

A document has backlinks if an org-mode file links to another org-mode file using a "file" link.

Usage

(render :backlinks)

The above will render a list of backlinks. However, you may want to check first if backlinks exist. The below code samples creates a backlinks section, with a bit of styling and a headline to indicate the sections intent:

(when-let [backlinks (render :backlinks)] ; if backlinks exist, store them in a let bindings.
  [:div
   [:hr]
   [:div.backlinks
    [:h4 "Backlinks to this document:"]
    backlinks]])
Previous: Adjacent Files Next: Firn Tags