Statiq.Plugins 0.0.2

dotnet add package Statiq.Plugins --version 0.0.2
                    
NuGet\Install-Package Statiq.Plugins -Version 0.0.2
                    
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.Plugins" Version="0.0.2" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Statiq.Plugins" Version="0.0.2" />
                    
Directory.Packages.props
<PackageReference Include="Statiq.Plugins" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Statiq.Plugins --version 0.0.2
                    
#r "nuget: Statiq.Plugins, 0.0.2"
                    
#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.
#:package Statiq.Plugins@0.0.2
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Statiq.Plugins&version=0.0.2
                    
Install as a Cake Addin
#tool nuget:?package=Statiq.Plugins&version=0.0.2
                    
Install as a Cake Tool

<img src="src/Statiq.Plugins/icon.png" width="30px" /> Statiq Plugins

Various Plugins

Statiq Web

NuGet Version NuGet Downloads

Made With

Plugins

  • Image Gallery
  • Reading Time

A Statiq shortcode to produce an inline image gallery using Lightbox2.

Add the ImageGalleryConfigurator to your bootstrapper:

return await Bootstrapper
  .Factory
  .CreateWeb(args)
  .AddConfigurator<Bootstrapper>(new ImageGalleryConfigurator())
  .RunAsync();

Include the Lightbox2 CSS and JS in your layout (e.g. via CDN):

<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/lightbox2/2.11.4/css/lightbox.min.css" crossorigin="anonymous" referrerpolicy="no-referrer" />
<script src="https://cdnjs.cloudflare.com/ajax/libs/lightbox2/2.11.4/js/lightbox.min.js" crossorigin="anonymous" referrerpolicy="no-referrer"></script>

Note: For production use, add Subresource Integrity (SRI) integrity attributes to the above tags. You can generate the hashes at srihash.org or retrieve them from the cdnjs library page.

Then use the shortcode in any Markdown or Razor content file. Use the raw shortcode syntax (<?! ... ?>) so the body is not pre-processed by Markdown (which would otherwise wrap each line in <p> tags):

<?! ImageGallery Name=my-gallery ?>
/images/photo1.jpg|Caption for photo 1|Image Alt
/images/photo2.jpg|Caption for photo 2
/images/photo3.jpg
<?!/ ImageGallery ?>

Parameters:

Parameter Required Default Description
Name No gallery The Lightbox2 gallery group name. Images sharing the same name can be cycled through.
Class No (none) Additional CSS class(es) to add to the wrapping <div>.
AlbumLabel No "Image %1 of %2" Text shown below the image count. Use %1 and %2 for current/total.
WrapAround No false Wrap around to the first/last image when navigating past the end/beginning.
DisableScrolling No false Prevent page scrolling while the lightbox is open.
FadeDuration No 300 Duration (ms) of the fade-in/fade-out animation.
ImageFadeDuration No 300 Duration (ms) of the image fade animation.
ResizeDuration No 700 Duration (ms) of the resize animation.
FitImagesInViewport No true Resize images that are larger than the viewport.
ShowImageNumberLabel No true Show the AlbumLabel text in the lightbox.
MaxWidth No (none) Maximum width (px) of the lightbox image.
MaxHeight No (none) Maximum height (px) of the lightbox image.
ImageWidth No 100 The size of the preview images in the gallery

Content format:

Each line inside the shortcode is one image. Fields are pipe-separated: src, optional title (shown as caption in lightbox), and optional alt (alt text for the lightbox image — falls back to title if omitted).

src
src|title
src|title|alt

The shortcode renders Lightbox2-compatible markup:

<div class="image-gallery">
  <a href="/images/photo1.jpg" data-lightbox="my-gallery" data-title="Caption for photo 1" data-alt="Caption for photo 1">
    <img src="/images/photo1.jpg" alt="Caption for photo 1" />
  </a>
  ...
</div>

When any Lightbox2 options are provided, a configuration <script> block is also emitted:

<?! ImageGallery Name=my-gallery WrapAround=true AlbumLabel="Photo %1 of %2" ?>
/images/photo1.jpg|Caption for photo 1
/images/photo2.jpg|Caption for photo 2
<?!/ ImageGallery ?>
<script>
lightbox.option({
  'wrapAround': true,
  'albumLabel': "Photo %1 of %2"
});
</script>

Reading time

Adding reading time estimates to blog posts from @ Jeremy Davis

In your appsettings.json add a new property ReadingSpeed and set it to your desired value:

"ReadingSpeed": 100

You can then override the input/_header.cshtml of your theme and place the calculated time after the tags.

<span>~@Model.GetString("ReadingTime") minutes</span>

Docs

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.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.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.0.2 117 6/12/2026
0.0.1 194 12/30/2024