Templates

Welcome Page

home.twig

The home.twig template renders the homepage of the Minniark site.
Its layout and content depend on the style setting defined in home.yml.
Depending on this configuration, it can act as a welcome page, a photo showcase, or redirect to another section such as Blog or Page.


What it does

  • Serves as the main entry point (/ or /home)
  • Reads configuration from /userdata/content/home.yml
  • Supports multiple styles:
    • start – Default hero-style homepage with text and optional image
    • album – Displays a specific album as the homepage
    • page – Redirects to a static page (/p/{slug})
    • blog – Redirects to the blog overview (/blog)
    • collection – (reserved for collection-style home, not yet active)
  • Integrates navigation, theme, and global settings automatically

Available Twig Variables

Depending on the chosen style, the following variables are available:


Global Variables (available in all home styles)

Variable Type Description
title string Page title (usually the same as the site headline)
site_title string Site name from settings
theme string Active theme name
themepath string Path to theme directory (/userdata/template/{theme})
settings array Global configuration (site-wide settings)
navItems array Navigation structure built from theme
current_path string Current path (home or empty)
current_url string Full URL to the current page

Style: start (default homepage)

Variable Type Description
headline string Main heading text
sub_headline string Optional subheading
content string Optional text content (HTML-safe)
home_image string (optional) Cached single image (if default_image_style: image)
home_images array (optional) Array of image objects (if default_image_style: album)

Example Twig usage:

<section class="text-center py-12">
   {% if home_image %} <img src="{{ home_image }}" alt="{{ title }}" class="mx-auto rounded-xl shadow mb-8 max-w-3xl" /> {% endif %}
   {% if headline %}
   <h1 class="text-4xl font-bold mb-2">{{ headline }}</h1>
   {% endif %}
   {% if sub_headline %}
   <h2 class="text-lg text-gray-500 mb-6">{{ sub_headline }}</h2>
   {% endif %}
   {% if content %}
   <div class="prose mx-auto text-gray-700 text-center">
      {{ content|raw }}
   </div>
   {% endif %}
</section>

If default_image_style is set to album, you’ll instead have home_images:

<div class="grid gap-4 sm:grid-cols-2 lg:grid-cols-3">
  {% for image in home_images %}
    <img src="{{ image.file }}" alt="{{ image.title }}" class="rounded-lg shadow-md w-full h-auto" />
  {% endfor %}
</div>
Previous
Collection