#4041: page.html

site/_layouts/page.html

Path: site/_layouts/page.html · Lines: 23 · Type: Jekyll layout (Liquid template)

Purpose: The standard page layout — used by ~60% of all pages on the site. Wraps content in a UIkit section + container, renders an article with h1 title, and supports width variants (small, large, expand). Inherits from the default layout which provides the full HTML shell (head, navbar, footer).

Source: GitHub

23 lines · 17 code · 0 comments · 6 blank
CommitMessage
ac75fabf32021-08-10 Jekyll site migration
Layout inheritance chain: page.htmldefault.html → outputs full HTML. The layout: default front matter (line 2) means this layout wraps its output INSIDE the default layout. The default layout provides <html>, <head>, navbar include, footer include, and script includes.

The width system — three rendering modes

{% if page.width == 'expand' %}       <!-- Full-width, no container -->
  {{ content }}                        <!-- Raw content, no wrapper -->
{% else %}
  <div class="uk-section">             <!-- Standard UIkit section wrapper -->
    <div class="uk-container{% if page.width %} uk-container-{{page.width}}{% endif %}">
      <article class="uk-article">
        <h1 class="uk-article-title">{{ page.title | escape }}</h1>
        <div class="article-content link-primary">
          {{ content }}
        </div>
      </article>
    </div>
  </div>
{% endif %}

Pages set their width via front matter:

Front matterContainer classTypical max-widthUsed for
(none).uk-container1200pxStandard documentation pages
width: small.uk-container-small900pxSearch page (#4093), legal pages, narrow content
width: large.uk-container-large1600pxWide tables, comparison pages
width: expandNo container at all100% viewportFull-bleed layouts, landing pages

The expand mode is special — it bypasses the entire section/article wrapper and outputs raw {{ content }} directly. This is used for pages that need full viewport width control (custom hero sections, landing pages).

Semantic HTML choices

<article> (line 11): The use of the HTML5 <article> element indicates that each page is considered a self-contained composition — good for SEO and accessibility. The .uk-article class is themed by article.scss (#4029) for typography.

link-primary (line 15): This custom class on the content wrapper makes all links inside use the primary color. In the ProjectForge brand SCSS (projectforge.scss #3945), this is overridden to #BF4040 (ProjectForge red). Without this class, links inside article content would use UIkit's default blue.

{{ page.title | escape }} (line 13): The | escape Liquid filter prevents XSS — if a page title somehow contains HTML/JS, it's escaped rather than rendered. Defense-in-depth for content that comes from Markdown/AsciiDoc front matter.

Key takeaways