---

# Front Matter (YAML)

author: "demo@plugins.example.com (Plugin Pipeline Demo)"
banner_alt: "Plugin Pipeline Demo banner"
banner_height: "398"
banner_width: "1440"
banner: ""
cdn: "https://cloudcdn.pro"
changefreq: "weekly"
charset: "utf-8"
cname: "plugins.example.com"
copyright: "Copyright © 2024-2026 Plugin Pipeline Demo. All rights reserved."
date: "April 16, 2026"
description: "Developer reference walking through every stage of the SSG plugin pipeline."
download: ""
format-detection: "telephone=no"
hreflang: "en"
icon: ""
id: "https://plugins.example.com"
image_alt: "Plugin Pipeline Demo logo"
image_height: "630"
image_width: "1200"
image: ""
keywords: "plugins, ssg, static site generator, rust, example"
language: "en-GB"
layout: "index"
locale: "en_GB"
logo_alt: "Plugin Pipeline Demo logo"
logo_height: "33"
logo_width: "100"
logo: ""
name: "Plugin Pipeline"
permalink: "https://plugins.example.com/"
rating: "general"
referrer: "no-referrer"
revisit-after: "7 days"
robots: "index, follow"
short_name: "kaishi"
subtitle: "An annotated walkthrough of the plugin lifecycle — read the source alongside the console output."
theme-color: "26, 58, 138"
tags: "plugins, ssg, example"
title: "Plugin Pipeline Demo"
url: "https://plugins.example.com"
viewport: "width=device-width, initial-scale=1, shrink-to-fit=no"

# News - The News SiteMap front matter (YAML).
news_genres: "Blog"
news_keywords: "plugins, ssg, example"
news_language: "en"
news_image_loc: ""
news_loc: "https://plugins.example.com"
news_publication_date: "Wed, 16 Apr 2026 00:00:00 GMT"
news_publication_name: "Plugin Pipeline"
news_title: "Plugin Pipeline Demo"

# RSS - The RSS feed front matter (YAML).
atom_link: https://plugins.example.com/rss.xml
category: "Technology"
docs: https://validator.w3.org/feed/docs/rss2.html
generator: "SSG (version 0.0.37)"
item_description: RSS feed for Plugin Pipeline Demo
item_guid: "https://plugins.example.com/index.html"
item_link: "https://plugins.example.com/index.html"
item_pub_date: "Wed, 16 Apr 2026 00:00:00 GMT"
item_title: "Plugin Pipeline Demo"
last_build_date: "Wed, 16 Apr 2026 00:00:00 GMT"
managing_editor: demo@plugins.example.com (Plugin Pipeline Demo)
pub_date: "Wed, 16 Apr 2026 00:00:00 GMT"
ttl: "60"
type: "website"
webmaster: demo@plugins.example.com (Plugin Pipeline Demo)

# Apple - The Apple front matter (YAML).
apple_mobile_web_app_orientations: "portrait"
apple_touch_icon_sizes: "192x192"
apple-mobile-web-app-capable: "yes"
apple-mobile-web-app-status-bar-inset: "black"
apple-mobile-web-app-status-bar-style: "black-translucent"
apple-mobile-web-app-title: "Plugin Pipeline Demo"
apple-touch-fullscreen: "yes"

# MS Application - The MS Application front matter (YAML).
msapplication-navbutton-color: "rgb(0,102,204)"

# Twitter Card - The Twitter Card front matter (YAML).
twitter_card: "summary"
twitter_creator: "plugins"
twitter_description: "Developer reference walking through every stage of the SSG plugin pipeline."
twitter_image: ""
twitter_image_alt: "Plugin Pipeline Demo logo"
twitter_site: "plugins"
twitter_title: "Plugin Pipeline Demo"
twitter_url: "https://plugins.example.com"

# Humans.txt - The Humans.txt front matter (YAML).
author_website: "https://plugins.example.com"
author_twitter: "@plugins"
author_location: "London, UK"
thanks: "Thanks for reading!"
site_last_updated: "2026-04-16"
site_standards: "HTML5, CSS3, RSS, Atom, JSON, XML, YAML, Markdown, TOML"
site_components: "SSG, Plugin Pipeline Demo Templates"
site_software: "SSG, Rust"

---

## What this example is

A **dev guide** for the SSG plugin pipeline. It shows when each hook fires.

Run it from the repo root:

```sh
cargo run --example plugins
```

The console labels each stage:

1. **Cache check** — `BuildCache::changed_files()` skips work when nothing changed
2. **Compile** — `staticdatagen::compile()` turns markdown into HTML
3. **Plugin pipeline** — `before_compile`, then `after_compile`, then `on_serve`
4. **Output report** — what each plugin made

## Plugins shown here

- `SeoPlugin` — Open Graph + Twitter Card tags
- `CanonicalPlugin` — `<link rel="canonical">`
- `RobotsPlugin` — `robots.txt` file
- `SearchPlugin` — client-side search index + UI
- `MinifyPlugin` — HTML/CSS/JS minify
- `LiveReloadPlugin` — WebSocket script for dev mode

Order matters. `MinifyPlugin` runs after SEO and search. It shrinks the *final* HTML, not a draft.

## How this differs from `quickstart`

`quickstart` is a starter site you clone and ship. This example is a **map** of how plugins work. It has no UI polish. Read `examples/plugins_example.rs` next to the console output.

## Where to go next

- [Browse the source](https://github.com/sebastienrousseau/static-site-generator/blob/main/examples/plugins_example.rs)
- Read the [Plugin trait docs](https://docs.rs/ssg) for each hook
