Search by

cecil / theme-links

aligny

Cecil Links theme

Package info

github.com/Cecilapp/theme-links

Language:Twig

Type:cecil-theme

pkg:composer/cecil/theme-links

Fund package maintenance!

ArnaudLigny

Open Collective

Statistics

Installs: 659

Dependents: 1

Suggesters: 0

Stars: 0

Open Issues: 0

6.1.0 2026-12-04 01:42 UTC

README

Links is a minimalist theme for creating link-focused pages with Cecil, powered by Tailwind CSS and Font Awesome.

Demo

Screenshot

Features

  • Page built from reusable blocks (content, links, social identities)
  • Links as buttons with custom colors (auto contrast text), a Font Awesome icon and/or a media (image or video), or the image of the linked website
  • Visual on the left of the title, or above it in large (featured links)
  • Video links (video files or YouTube videos), displayed as featured cards
  • Light/dark color scheme, following the system preference, with a toggle button
  • Native share button (when supported by the browser)
  • Accessible: semantic markup, keyboard focus, reduced motion support
  • Customizable with Tailwind CSS semantic classes
  • English and French translations (templates and front matter schema)
  • Front matter schema of the home page, validated by Cecil

Installation

composer require cecil/theme-links

Or download the latest archive and uncompress its content in themes/links.

Usage

Add links in the theme section of the configuration:

theme:
  - links

Blocks

The home page is built from the blocks array of its front matter, each block being rendered by the template layouts/blocks/<type>.html.twig:

  • content: page content (Markdown body)
  • links: list of links, defined in the block items
  • social: social identities (from social configuration)

Only a links block accepts items and options.

Upgrade from 3.x: the type of a block was defined by its name key, replace it by type (e.g. name: links → type: links).

Upgrade from 3.x: the page links variable is no longer supported, move the links to the items of a links block.

A block can be used several times, e.g. to display multiple lists of links:

---
blocks:
  - type: content
  - type: links
    items:
      - title: <title>
        url: <url>
        icon: <style>:<name>     # optional, e.g. "brands:github", or "house" for a solid icon
        color: "<#hexa_code>"    # optional
      - title: <title>
        url: <url>               # without icon nor media: image of the linked website
  - type: links
    options:
      display: featured          # large visuals, above the titles
    items:
      - title: <title>
        url: <url>
        media: <path or URL>     # image
        icon: <style>:<name>     # optional, small icon before the title
      - media: <path or URL>
        alt: <text>              # alternative text, used only if the link has no title
      - title: <title>
        url: <url>
        media: <path or URL>     # video file or YouTube video (featured card)
  - type: social
---

Link

Key Description
title Text of the link (required, except for a featured or video link)
url Target of the link (without URL, the button is not clickable)
icon Font Awesome icon: <style>:<name> (e.g. brands:github), or <name> for a solid icon
media Image or video: path of an asset (e.g. images/photo.jpg for assets/images/photo.jpg) or remote URL; none for no visual
display classic or featured (see Display)
color Background color of the button (hexadecimal code)
alt Alternative text of the image, used only if the link has no title

Icon and media

The visual of a link depends on its icon, its media and its display:

icon media classic featured
— — Image of the linked website, on the left Image of the linked website, above
✓ — Icon, on the left Large icon, above
— ✓ Image (cropped to a square), on the left Image, above
✓ ✓ Icon, on the left (the media is ignored) Image above, icon before the title
✓/— none Icon if set, otherwise title only Icon if set, otherwise title only

Without icon nor media, the image of the linked website is searched in its page, in this order: Open Graph and Twitter images, image_src, microdata, JSON-LD, first image of the content, then icons (apple-touch-icon, favicon). The result of this search is cached (see the Cecil cache.assets.remote.ttl option). If no image is found, or if the website can't be fetched, the button only displays its title: set a media or an icon to choose the visual.

Display

The display of a link defines where its visual is displayed:

  • classic (default): on the left of the title, small (images are cropped to a square)
  • featured: above the title, in large (full button width)

It can be set per link (display: featured), or for all the links of a block or of the site (see Configuration).

Video

A link whose media is a video is always displayed as a featured card: the video above the title, which is the link (the card itself is not, as the video controls are interactive). The video is a video file (path of an asset or remote URL, detected by its extension: mp4, m4v, webm, ogv or mov), or a YouTube video URL (youtube.com/watch?v=…, youtu.be/…, youtube.com/shorts/…, etc.), embedded with the YouTube player (from youtube-nocookie.com, loaded lazily):

      - title: <title>
        url: https://www.youtube.com/watch?v=<id>
        media: https://www.youtube.com/watch?v=<id>

Upgrade from 5.x: thumbnail and video are replaced by icon and media:

  • thumbnail: {type: icon, value: <style>:<name>} → icon: <style>:<name>
  • thumbnail: {type: image, value: <path>} → media: <path>
  • thumbnail: {type: none} → media: none
  • thumbnail: {type: auto} → remove it (default, without icon nor media)
  • thumbnail: {type: auto, value: <path>} → media: <path> (or remove it, to keep the image of the linked website, without fallback)
  • video: <path or URL> → media: <path or URL>

The old keys are not rejected by the front matter schema, but ignored.

Upgrade from 4.x: icon, image and fallback_image are replaced by thumbnail (and display):

  • icon: <style>:<name> → thumbnail: {type: icon, value: <style>:<name>}
  • fallback_image: <path> → thumbnail: {type: auto, value: <path>}
  • image: <path> → thumbnail: {type: image, value: <path>} and display: featured (the image is now displayed inside the button, with its color)

The old keys are not rejected by the front matter schema, but ignored: a link with icon or image displays the image of the linked website instead.

CSS classes: .button-favicon is renamed .button-thumbnail, and .button-media is removed: image and video links are .button-featured cards (e.g. .button-media img → .button-featured .button-thumbnail img), a video link being also a .button-video. If your site compiles its own CSS (an assets/tailwind.css importing the theme one), update your custom styles, then rebuild it: an outdated styles.css lacks the new classes (thumbnails not resized, featured titles on the right of the image).

Each links block is rendered as an <ol class="buttons"> with a unique id (buttons-<block index>), and each link has the id buttons-<block index>-<link index>.

If the home page has no blocks, the default ones are displayed: content and social.

Configuration

links:
  buttons:
    color: page      # use links colors (`page`, default) or CSS colors (`css`)
    display: classic # visual on the left of the title (`classic`, default) or above it, in large (`featured`)

These options can be overridden per block, with options:

blocks:
  - type: links
    options:
      color: css
      display: featured
    items: […]

The display option can also be overridden per link.

Front matter schema

The theme provides the pages schema of the home page (schemas/index.yml): Cecil validates its blocks variable (type, options and links) at build time, according to the pages.validation option, and tools like Cecil Desktop use the labels and descriptions to build an edit form.

The schema uses the when rule (items and options allowed only for a links block), which requires Cecil 9.33 or later.

The schema can be extended or overridden in the site, with a schemas/index.yml file or the pages.schema.index configuration.

The labels and descriptions of the schema are translated in French (translations/schemas.fr.yaml): tools like Cecil Desktop show them in the language of the edited page, with Cecil 9.35 or later. Other languages can be added in the site, with a translations/schemas.<locale>.yaml file keyed by the English text.

The file is generated from the schema with the demo site, which uses the theme (Cecil 9.35 or later): copy translations/schemas.fr.yaml into demo/translations/, run php cecil.phar util:translations:extract --locale=fr --save --extension=yaml in demo/, translate the new texts (prefixed with NEW_) of demo/translations/schemas.fr.yaml, and move it back into translations/.

Customization

Templates only use semantic classes (.layout, .header, .avatar, .site-title, .site-baseline, .content, .footer, .buttons, .button, .button-link, .button-featured, .button-icon, .button-thumbnail, .button-title, .button-title-icon, .button-video, .social, .social-icon, .social-<name>, etc.): their appearance is defined in assets/tailwind.css and can be overridden in your own assets/tailwind.css.

Development

Install tailwind-builder

composer require aligny/tailwind-builder

Rebuild CSS

vendor/bin/tailwind-builder assets/tailwind.css --minify

Demo site

The demo/ directory contains a demo website using the theme under development:

composer install
php demo/link.php
php cecil.phar serve demo

demo/link.php links the repository as demo/themes/links, and the Font Awesome theme as demo/themes/fontawesome.

License

Links theme is a free software distributed under the terms of the MIT license.

© Arnaud Ligny