Showcase: Functions

Author: Stefan Published: 26.11.2025 04:55 Edited: 30.11.2025 16:52

Gravitron includes a series of handy functions like tags, categories, a page media gallery… And more is still to come. A demo for the sitemap-style listing of all existing pages is available here.

Per-page custom CSS

If enabled by setting css: in the page head and the specified CSS file exists in the folder of the page, the file is loaded automatically last in order: This way CSS overrides or extensions are possible per page, see the nicotine background gradient to the right bottom of this page:

css: "showcase-functions-custom.css"

Page aliases

Pages can have one or more alias URLs. The YAML page header of /showcase/theme has defined 3 alias URLs:

aliases:
    - "/demopage"
    - "/showcase/css"
    - "/css"

The page is reachable via /demopage, /showcase/css and /css. The canonical page is however SEO friendly set to the real URL, see the meta tag in its source:

<link rel="canonical" href="https://gravitron.dev/showcase/theme">

Be sure not to define identical alias URLs for more than one page or an alias with a primary URL of a page! While primary page URLs are processed first, multiple identical aliases may lead to unpredictable results. (The first match in pages order wins, but I won't tell you…)

Taxonomy

If present in the page, meta.tags and meta.categories are accessible:

Tags

Gravitron CMS Content Management System Markup Brainrot Somewhat like Grav Web development CSS PHP HTML Twig

Categories

Features Showcase Functions Documentation CSS HTML Theme

Files

If enabled globally via ENABLE_PAGE_FILES, files in a page folder are propagated to the Twig array meta.files for file extensions listed in ALLOWED_PAGE_FILETYPES. Any custom page CSS file is ignored, see section "Per-page custom CSS" above:

Media files

If enabled globally via ENABLE_PAGE_FILES, image and video files defined in ALLOWED_MEDIA_FILETYPES, are available in meta.media_files and can automatically be shown in an in-page gallery. — see below. Andre Rinas SimpleLightbox is used for image links with rel="lightbox". Any custom page CSS file is ignored, see section "Per-page custom CSS" above:

Gallery

Theme information

This theme has a user/config/theme.yaml file. If present and valid, its content together with configuration data is propagated to the Twig array theme: