Protocols - Structs - Enumerations

author: none

Jun 10, 2024


Protocols

Action

One action that can be triggered on the page. Actions compile to JavaScript.

BaseElement

Describes any element that can be rendered to HTML.

BlockElement

Describes a HTML element that is rendered in block style, i.e. that it occupies the full width of the page by default.

Component

A type that provides a reusable part of a page, e.g. a common header or footer.

ContentPage

Content pages describe custom page structures for articles. You can provide one layout in your site to use that for all articles, or create custom layouts and assign them uniquely to individual articles.

DropdownElement

Elements that conform to DropdownElement can be shown inside Dropdown objects.

HTMLRootElement

Describes elements that can exist directly inside a HTML container.

HeadElement

A metadata element that can exist in the Head struct.

HorizontalAligning

Determines which elements can have horizontal alignment attached,

InlineElement

An element that exists inside a block element, such as an emphasized piece of text.

LazyLoadable

A protocol that determines which elements can be loaded lazily.

MarkdownRenderer

A protocol defining the basic information we need to get good Markdown parsing. This is implemented by the default MarkdownToHTML parser included with Ignite, but users can override that default in their Site conformance to get a custom parser if needed.

NavigationItem

Describes elements that can be placed into navigation bars.

PageElement

A user-visible element that can appear anywhere on a page, block or otherwise.

RobotsConfiguration

A simple protocol that lets users create custom robot configurations easily.

Site

Describes one site being generated by Ignite.

StaticPage

One static page in your site, where the content is entirely standalone rather than being produced in conjunction with an external Markdown file.

TagPage

Tag pages show all articles on your site that match a specific tag, or all articles period if tag is nil. You get to decide what is shown on those pages by making a custom type that conforms to this protocol.

Theme

Themes allow you to have complete control over the HTML used to generate your pages.

ThemedPage

The ThemedPage protocol allows all pages on your site, whether static, content-driven, or layouts, to adapt to a theme of your design.


Structures

Abbreviation

Renders an abbreviation.

Accordion

A control that displays a list of section titles that can be folded out to display more content.

Alert

Shows a clearly delineated box on your page, providing important information or warnings to users.

AttributeValue

A simple key-value pair of strings that is able to store custom attributes.

Badge

A small, capsule-shaped piece of information, such as a tag.

Body

The main, user-visible contents of your page.

Button

A clickable button with a label and styling.

ButtonGroup

A container that automatically adjusts the styling for buttons it contains so that they sit more neatly together.

Card

A group of information placed inside a gently rounded

Carousel

A collection of slides the user can swipe through.

Code

An inline snippet of programming code, embedded inside a larger part of your page. For dedicated code blocks that sit on their own line, use CodeBlock instead.

CodeBlock

An separated section of programming code. For inline code that sit along other text on your page, use Code instead.

Color

Colors that can be used for backgrounds and foregrounds. Comes with all the standard HTML color names, can be created using RGB values as integer or doubles, can be created a grayscale, or using a hex string.

Column

A column inside a table row.

Content

One piece of Markdown content for this site.

ContentPreview

A wrapper around Card, specifically aimed at presenting details about some content on your site. This automatically links to your content page and adds in tags.

CoreAttributes

A handful of attributes that all HTML types must support, either for rendering or for publishing purposes.

CustomAction

Allows the user to inject hand-written JavaScript into an event. The code you provide will automatically be escaped.

DefaultRobotsConfiguration

A simple default robots configuration that disallows nothing.

DiagonalEdge

Describes diagonal edges on an element, e.g. top-leading, or bottom-trailing, along with groups of edges such as “top” (top leading and top-trailing).

DisallowRule

A rule that disallows one specific robot from one or more paths on your site.

Divider

A horizontal divider for your page, that can also be used to divide elements in a dropdown.

Dropdown

Renders a button that presents a menu of information when pressed. Can be used as a free-floating element on your page, or in a NavigationBar.

Edge

Describes edges on an element, e.g. top or leading, along with groups of edges such as “horizontal” (leading and trailing).

ElementBuilder

A result builder that lets us generically build arrays of some content.

Embed

Embeds a custom URL, such as YouTube or Vimeo.

Emphasis

Renders text with emphasis, which usually means italics.

EmptyTagPage

A default tag page that does nothing; used to disable tag pages entirely.

EmptyTheme

A theme that applies almost no styling.

FeedConfiguration

Configures feed generation for a site.

Group

Creates some arbitrary group of content in your page. This is used extensively on the modern web pages to divide pages up into smaller, styled sections.

HTML

The top-level element of all web pages, containing one Head element and one Body element.

Head

A group of metadata headers for your page, such as its title, links to its CSS, and more.

HideElement

Hides a page element by appending the “d-none” CSS class.

Ignite

A handful of shared values useful for using the Ignite framework.

IgniteFooter

Displays “Created by Ignite”, with a link back to the Ignite project on GitHub. Including this is definitely not required for your site, but it’s most appreciated 🙌

Image

An image on your page. Can be vector (SVG) or raster (JPG, PNG, GIF).

Include

Lets you include arbitrary HTML on a page.

Item

One item inside an accordion.

Link

A hyperlink to another resource on this site or elsewhere.

List

Creates a list of items, either ordered or unordered.

ListItem

Creates one item in a list. This isn’t always needed, because you can place other elements directly into lists if you wish. Use ListItem when you specifically need a styled HTML element.

MarkdownToHTML

A simple Markdown to HTML parser powered by Apple’s swift-markdown.

MetaLink

An item of metadata that links to an external resource somehow, such as a stylesheet.

MetaTag

An item of metadata that helps browsers and search engines understand your page better.

MissingTheme

A theme that does nothing at all. This is used as the default theme, so we can detect that no theme has been applied to a page.

NavigationBar

A bar that sits across the top of your page to provide top-level navigation throughout your site.

Page

A single flattened page from any source – static or dynamic – ready to be passed through a theme.

Quote

A block quote of text.

Row

One row inside a Table.

Script

Embeds some JavaScript inside this page, either directly or by referencing an external file.

Section

Creates one distinct section on your page, where content inside is fitted to a 12-column grid. If the items in your section have widths that add up to 12 then they will fit in a single row, otherwise they will be placed on multiple rows. This element automatically adapts to constrained horizontal dimensions by placing your content across multiple rows automatically.

ShowAlert

Shows a browser alert dialog with an OK button.

ShowElement

Shows a page element by removing the “d-none” CSS class.

Slide

One slide in a Carousel.

Spacer

Creates vertical space of a specific value.

Span

An inline subsection of another element, useful when you need to style just part of some text, for example.

Strikethrough

Renders text with a strikethrough effect.

Strong

Renders text with a strong text effect, which usually means bold.

Table

Used to create tabulated data on a page.

Tag

Able to become any HTML tag. Useful for when Ignite has not implemented a specific tag you need.

Text

A structured piece of text, such as a paragraph of heading. If you are just placing content inside a list, table, table header, and so on, you can usually just use a simple string. Using Text is required if you want a specific paragraph of text with some styling, or a header of a particular size.

Title

Provides the title for a given page, which is rendered in the browser and also appears in search engine results.

Underline

Renders text with an underline.

UnitPoint


Enumerations

AspectRatio

Specific aspect ratios that are commonly used

BackgroundStyle

Custom background styles that involve creating gradients.

ButtonSize

Controls the display size of buttons. Medium is the default.

ColumnWidth

Controls how many columns a given block element takes up in a Section.

Font

The list of core text types supported by Bootstrap.

FontWeight

The list of standard font weights supported by HTML. This is designed to match the same order provided by SwiftUI. Note: Bootstrap provides its own font weights as classes, but these are less close to both regular CSS and SwiftUI.

ForegroundStyle

Common foreground styles that allow for clear readability.

HorizontalAlignment

Controls how elements are horizontally positioned in side their container.

KnownRobot

A collection of known robots.

Language

An enum providing RFC-5646 language codes used for web pages.

OrderedListStyle

Some of the (many!) ways of numbering ordered lists.

Position

Specific values that can be used to position this element.

PublishingError

All the primary errors that can occur when publishing a site. There are other errors that can be triggered, but they are handled through fatalError() because something is seriously wrong.

Role

Roles let us attach semantic meaning to various elements, which Bootstrap uses to add specific styling. For example, .danger elements will be colored some shade of red.

SpacingAmount

Adaptive spacing amounts that are used by Bootstrap to provide consistency in site design.

SyntaxHighlighter

The collection of syntax highlighters supported by Ignite.

TextDecoration

Property sets the appearance of decorative lines on text.

TextSelection

Controls whether the user can select the text inside this element or not.

UnorderedListStyle