MinimalApis.LiquidViews
2.2.1
There is a newer version of this package available.
See the version list below for details.
See the version list below for details.
dotnet add package MinimalApis.LiquidViews --version 2.2.1
NuGet\Install-Package MinimalApis.LiquidViews -Version 2.2.1
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.2.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add MinimalApis.LiquidViews --version 2.2.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: MinimalApis.LiquidViews, 2.2.1"
#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 MinimalApis.LiquidViews as a Cake Addin #addin nuget:?package=MinimalApis.LiquidViews&version=2.2.1 // Install MinimalApis.LiquidViews as a Cake Tool #tool nuget:?package=MinimalApis.LiquidViews&version=2.2.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
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.
Sample usage
These files demonstrates how to return a view result, which will be able to use
- a
_layout
file to act as a template for multiple pages - a
_viewstart
file to be executed for each view - a
component
file to act like partial views
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' %}
From /Views/_ViewStart.liquid
component.liquid
<div>Using a component {{ x }} + {{ y }} = {{ x | plus: y }}</div>
_layout.liquid
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.0-beta3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-eOJMYsd53ii+scO/bJGFsiCZc+5NDVN2yr8+0RDqr0Ql0h+rP48ckxlpbzKgwra6" crossorigin="anonymous">
<title>Hello, world!</title>
</head>
<body>
<div class="px-4 py-5 my-5 text-center">
<h1 class="display-5 fw-bold">Title from the layout</h1>
<div class="col-lg-6 mx-auto">
<p class="lead mb-4">
{% renderbody %}
{% partial 'Component', x: 1, y:2 %}
</p>
</div>
</div>
<pre>
{% rendersection footer %}
</pre>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.0.0-beta3/dist/js/bootstrap.bundle.min.js" integrity="sha384-JEW9xMcG8R+pH31jmWH6WWP0WintQrMb4s7ZOdauHnUtxwoG2vI5DkLtS3qm9Ekf" crossorigin="anonymous"></script>
</body>
</html>
Product | Versions 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 was computed. 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 was computed. 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.
-
net6.0
- Fluid.ViewEngine (>= 2.2.1)
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.13.1 | 65 | 11/24/2024 |
2.13.0 | 63 | 11/24/2024 |
2.12.0 | 76 | 11/6/2024 |
2.11.1 | 619 | 7/23/2024 |
2.11.0 | 100 | 7/11/2024 |
2.10.0 | 126 | 5/17/2024 |
2.9.0 | 130 | 4/23/2024 |
2.8.0 | 117 | 4/4/2024 |
2.7.0 | 129 | 3/18/2024 |
2.6.0 | 127 | 3/11/2024 |
2.5.0 | 2,268 | 9/28/2023 |
2.4.0 | 1,281 | 3/1/2023 |
2.3.1 | 437 | 12/17/2022 |
2.3.0 | 291 | 11/30/2022 |
2.2.16 | 421 | 9/21/2022 |
2.2.15 | 684 | 4/12/2022 |
2.2.14 | 487 | 1/13/2022 |
2.2.13 | 264 | 1/8/2022 |
2.2.12 | 260 | 1/7/2022 |
2.2.11 | 267 | 1/7/2022 |
2.2.10 | 277 | 1/7/2022 |
2.2.9 | 265 | 1/5/2022 |
2.2.8 | 493 | 12/9/2021 |
2.2.7 | 282 | 12/2/2021 |
2.2.6 | 287 | 12/1/2021 |
2.2.5 | 1,362 | 11/27/2021 |
2.2.4 | 3,016 | 11/25/2021 |
2.2.3 | 288 | 11/22/2021 |
2.2.2 | 1,053 | 11/20/2021 |
2.2.1 | 1,068 | 11/20/2021 |