Skip to main content

Page Actions

Published:

Page actions add a per-page dropdown menu with utilities for sharing and inspecting content.

Configuration

All keys go under params in hugo.yaml. pageShowActions can also be set per-page in front matter.

KeyTypeDescription
pageShowActionsboolShow the page actions menu
repoURLstringBranch root URL, enables View Repo Source
repoSubdirstringPath from repo root to Hugo project directory; set when the Hugo project is not at the repo root

repoURL must point to the branch root, not the repository root. For example:

hugo.yaml
params:
  pageShowActions: true
  repoURL: https://github.com/example/my-site/blob/main
  repoSubdir: exampleSite  # omit if Hugo project is at repo root

Actions

Some actions are always available. Others require additional configuration to activate.

ActionCondition
Copy URLAlways present
Copy MarkdownRequires markdown in page outputs
View SourceRequires markdown in page outputs
View Repo SourceRequires repoURL

Copy Markdown and View Source serve the raw Markdown of the current page. Hugo only generates this output when markdown is listed under outputs.page:

hugo.yaml
outputs:
  page:
    - HTML
    - markdown

Article Connections