Statiq.Alerts 0.1.0

dotnet add package Statiq.Alerts --version 0.1.0                
NuGet\Install-Package Statiq.Alerts -Version 0.1.0                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Statiq.Alerts" Version="0.1.0" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Statiq.Alerts --version 0.1.0                
#r "nuget: Statiq.Alerts, 0.1.0"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install Statiq.Alerts as a Cake Addin
#addin nuget:?package=Statiq.Alerts&version=0.1.0

// Install Statiq.Alerts as a Cake Tool
#tool nuget:?package=Statiq.Alerts&version=0.1.0                

Statiq.Alerts

License Build Downloads

Extension for Statiq site generator to add alerts.

Table of Contents

Install

  1. Add the Statiq.Alerts NuGet package to the Statiq project
  2. Call .AddAlertShortCodes() on the bootstrapper

Requirements

The extension requires that Bootstrap and FontAwesome are loaded by the Statiq theme.

Usage

See Using Shortcodes for detailed instructions how to use shortcodes in Statiq.

Tip

<?# Tip ?>
This is a tip
<?#/ Tip ?>

Shows a tip alert:

Tip alert

Info

<?# Info ?>
This is an info message
<?#/ Info ?>

Shows an info message:

Info alert

Note

<?# Note ?>
This is a note
<?#/ Note ?>

Shows a note:

Note alert

Warning

<?# Warning ?>
This is a warning
<?#/ Warning ?>

Shows a warning:

Warning alert

Important

<?# Important ?>
This is an important message
<?#/ Important ?>

Shows an important message:

Important alert

API

Custom Shortcuts

Additional custom shortcuts can be implemented by inheriting from the AlertShortcode class and define the DefaultAlertClass, DefaultAlertIcon and DefaultAlertTitle properties. See Parameters for documentation about possible values.

Parameters

The following parameters are available on all shortcuts and allow to override the default styling.

Class

The Class parameter allows to override the CSS class of the alert div element:

<?# Note Class="alert-secondary"?>
This is a note rendered in the secondary color
<?#/ Note ?>

The alert class will always be set.

Icon
Changing the icon

The Icon parameters allows to override the icon of the alert:

<?# Note Title="fa-check"?>
This is a note with a different icon
<?#/ Note ?>

Any Fontawesome icon can be used. The fa-solid class will always be set.

Removing the icon

To remove the icon the Icon parameter can be set to an empty string:

<?# Note Iocn=""?>
This is a note without an icon
<?#/ Note ?>
Title
Changing the title

The Title parameters allows to override the title of the alert:

<?# Note Title="Custom Title"?>
This is a note with a custom title
<?#/ Note ?>
Removing the title

To remove the title the Title parameter can be set to an empty string:

<?# Note Title=""?>
This is a note without a title
<?#/ Note ?>

Contributing

We accept Pull Requests

License

MIT © Swiss GRC AG

Product Compatible and additional computed target framework versions.
.NET net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 is compatible.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
0.1.0 2,992 3/14/2024