MinimalApis.LiquidViews 2.22.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package MinimalApis.LiquidViews --version 2.22.0
                    
NuGet\Install-Package MinimalApis.LiquidViews -Version 2.22.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="MinimalApis.LiquidViews" Version="2.22.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="MinimalApis.LiquidViews" Version="2.22.0" />
                    
Directory.Packages.props
<PackageReference Include="MinimalApis.LiquidViews" />
                    
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 MinimalApis.LiquidViews --version 2.22.0
                    
#r "nuget: MinimalApis.LiquidViews, 2.22.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.
#:package MinimalApis.LiquidViews@2.22.0
                    
#: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=MinimalApis.LiquidViews&version=2.22.0
                    
Install as a Cake Addin
#tool nuget:?package=MinimalApis.LiquidViews&version=2.22.0
                    
Install as a Cake Tool

MinimalApis.LiquidViews

This library provides some extensions to ASP.NET Minimal APIs that allow to return templated view results using the Liquid language. Liquid is fast and safe. Views are interpreted so changes are reflected very quickly without a compilation phase.

This View Engine is based on Fluid, a Liquid template engine for .NET.

Sample usage

By default, all views and partials go in the Views folder. This can be configured with the FluidViewEngineOptions class.

These files demonstrate how to use the different elements of the view engine.

  • a Views\_layout.liquid file to act as a template for multiple pages.
  • a Views\_viewstart.liquid file to be executed for each view that is in the same folder.
  • a Views\component.liquid file to act like partial views.

The full sample can be found here

Program.cs
var builder = WebApplication.CreateBuilder(args);

// Add services to the container.

builder.Services.AddFluid();

var app = builder.Build();

// Configure the HTTP request pipeline.

app.MapGet("/", () => Results.Extensions.View("Index", new Todo(1, "Go back to work!", false)));

await app.RunAsync();

record Todo(int Id, string Name, bool IsComplete);
index.liquid
<hr />
Hello World from the body

Name: {{ Name }} <br />
IsComplete: {{ IsComplete}}
<hr />

{% section footer %}
Hello from the footer section
{% endsection %}
_viewstart.liquid
{% layout '_Layout' %}
component.liquid
<div>Using a component {{ x }} + {{ y }} = {{ x | plus: y }}</div>
_layout.liquid
<!doctype html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <title>Hello, world!</title>
  </head>
  <body>

    <h1>Title from the layout</h1>
    {% renderbody %}

    {% partial 'Component', x: 1, y:2 %}

    <footer>
      {% rendersection footer %}
    </footer>

  </body>
</html>

File locations

By default Views and Partials are located in the Views folder. The Partial views can also be placed in the Views/Partials folder.

Product Compatible and additional computed target framework versions.
.NET 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 is compatible.  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
2.25.0 112 7/15/2025
2.24.0 269 4/27/2025
2.23.0 310 4/22/2025
2.22.0 229 4/17/2025
2.21.0 399 3/24/2025
2.20.0 179 3/22/2025
2.19.0 778 1/15/2025
2.18.0 163 1/7/2025
2.17.0 139 12/30/2024
2.16.0 288 12/13/2024
2.15.0 578 12/6/2024
2.14.0 131 12/2/2024
2.13.1 144 11/24/2024
2.13.0 129 11/24/2024
2.12.0 135 11/6/2024
2.11.1 2,985 7/23/2024
2.11.0 145 7/11/2024
2.10.0 169 5/17/2024
2.9.0 170 4/23/2024
2.8.0 157 4/4/2024
2.7.0 171 3/18/2024
2.6.0 166 3/11/2024
2.5.0 2,309 9/28/2023
2.4.0 1,322 3/1/2023
2.3.1 478 12/17/2022
2.3.0 337 11/30/2022
2.2.16 464 9/21/2022
2.2.15 744 4/12/2022
2.2.14 548 1/13/2022
2.2.13 324 1/8/2022
2.2.12 318 1/7/2022
2.2.11 333 1/7/2022
2.2.10 341 1/7/2022
2.2.9 328 1/5/2022
2.2.8 551 12/9/2021
2.2.7 342 12/2/2021
2.2.6 349 12/1/2021
2.2.5 1,423 11/27/2021
2.2.4 3,077 11/25/2021
2.2.3 350 11/22/2021
2.2.2 1,111 11/20/2021
2.2.1 1,127 11/20/2021