Create a type-safe website with less than 15 lines of code.
struct MySite: Site {
var name = "Raptor | Swift Static Site Generator"
var url = URL(static: "https://raptor.build")
var layout = MainLayout()
var homePage = Home()
}
struct Home: Page {
var title = "Home"
var body: some HTML {
Text("Welcome to Raptor")
}
}
POWERFUL FEATURES
Multilingual Sites
Build fully localized sites with automatic routing, locale-aware content loading, and clean URLs for every supported language.
Vapor Integration
Run Raptor on Vapor for server-side rendering, dynamic routing, previews, and deploying sites that scale beyond static builds.
Side-Wide Search
Index all posts and pages automatically, enabling fast, accurate search results without external services or client-side JavaScript.
Framework Agnostic
Raptor generates clean HTML without third-party CSS frameworks, giving you full freedom over CSS, JavaScript, and styling.
Highly Customizable
Control layouts, themes, typography, colors, syntax highlighting, and rendering behavior through a flexible, structured API.
First-Class Docs
Raptor provides thorough, well-structured documentation that’s easy to read, navigate, and understand.
DOCUMENTATION
Getting Started
Learn how to install Raptor, create and build your first site, preview it locally, and understand the workflow for developing static websites in Swift.
Project Structure
Understand Raptor's project structure—Assets, Posts, Sources, localization, Markdown rendering, and how your files become pages.
Site
Define your website using the Site protocol—metadata, layouts, themes, pages, feeds, localization, and publishing behavior in one place.
Layouts
Learn how Layouts structure pages with regions, content injection, metadata management, and per-page overrides.
Navigation
Build responsive navigation bars with logos, flexible layouts, fixed positioning, and adaptive behavior across screen sizes.
Static Pages
Create standalone pages with custom paths, titles, metadata, and layouts using the Page protocol.
Error Pages
Create custom error pages, register HTTP errors handled by your site, and define your own HTTPError types for precise error handling.
Search
Build site-wide search with SearchPage—display results, handle queries, and integrate search input with SearchField.
Posts
Convert Markdown files to pages using YAML front matter, PostPage layouts, tags, categories, localization, and custom post processors.
Post Widgets & Includes
Embed custom HTML components via PostWidget and include external files in Markdown posts with a simple token syntax.
Category Pages
Create custom pages for organizing posts by tags, dates, authors, and other categories.
Themes
Customize your site's visual identity with themes—control colors, typography, page width, and color schemes.
Syntax Highlighting
Customize code block syntax highlighting with built-in themes, custom configurations, and per-language token colors.
Styles
Create reusable, environment-aware visual treatments with the Style protocol, automatic CSS generation, and adaptive behavior.
Fonts
Add custom fonts, map weights and variants through filename conventions, and construct font families with FontSource.
Elements
Learn how Raptor elements work, including composition, nesting, modifiers, and reusable components for building structured HTML pages.
Buttons
Create interactive buttons with actions, tinting, sizing, shapes, control sizes, multiple actions, and reusable button styles.
Links
Create hyperlinks, wrap interactive content, apply link styles, and protect sensitive URLs with Raptor's Link APIs.
Media
Display images, system icons, and embed external content with resizing, lazy loading, accessibility support, and automatic light/dark variants.
Grids
Build responsive, two-dimensional layouts using Grid and GridRow with flexible columns, adaptive spacing, alignment control, and explicit column sizing.
Forms
Build accessible, composable forms using Form, GridForm, and specialized types like SubscribeForm.
Code
Configure syntax highlighting for code blocks, apply themes, show line numbers and invisibles, and manage highlighting behavior with custom post processors.
Disclosures
Create accessible, expandable content using Disclosure, with native HTML semantics, coordinated grouping, and fully customizable label styles.
Menus
Dropdown menus with buttons, actions, icons, primary actions, tinting, anchors, dismissal behavior, split-button style, and custom dropdown styles.
Segmented Controls
Segmented controls for mutually exclusive options with buttons, default selection, persisted state, view modes, filters, and toggles.
Lists
Create ordered and unordered lists, customize markers, generate rows from data, and style list rows with backgrounds, padding, borders, spacing, and corner radius.
Scroll Views
Scrollable containers with horizontal or vertical scrolling, snap alignment, autoplay, infinite marquee scrolling, and programmatic scroll actions.
Tables
Structured tables with rows, columns, headers, filtering, striped styles, captions, alignment, column spanning, and separator tinting.
Includes
Reusable HTML fragments, external resources, JSON decoding, shared markup, structured data loading, and dynamic content rendering.
Modifiers
Modifiers for styling and transforming HTML elements, custom HTMLModifier types, composable chains, reusable transformations, and extensions.
Frames & Overlays
Control element sizing with fixed, container-relative, and screen-relative frames, plus overlays for layered content.
Presentations
Present modal dialogs and popovers, control alignment and dismissal behavior, and customize presentation backgrounds.
Animations
Animate elements with transition modifiers, keyframe animations, hover and tap triggers, viewport entry animations, timing curves, and transform anchors.
Effects
Add interactive, state-driven, and environment-aware behavior to your views using hover effects, entry animations, identity effects, and environment-driven effects.
Integrating Vapor
Run your site on Vapor for server-side rendering, dynamic routing, per-request state, sessions, and server-driven interactions.
Migrating to Raptor
A practical migration guide for moving an existing Ignite project to Raptor, including type mappings and common before-and-after examples.