laget.Templates 1.1.50

The ID prefix of this package has been reserved for one of the owners of this package by NuGet.org. Prefix Reserved
There is a newer version of this package available.
See the version list below for details.
dotnet add package laget.Templates --version 1.1.50
NuGet\Install-Package laget.Templates -Version 1.1.50
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="laget.Templates" Version="1.1.50" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add laget.Templates --version 1.1.50
#r "nuget: laget.Templates, 1.1.50"
#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 laget.Templates as a Cake Addin
#addin nuget:?package=laget.Templates&version=1.1.50

// Install laget.Templates as a Cake Tool
#tool nuget:?package=laget.Templates&version=1.1.50

laget.Templates

A simple template framework utilizing Handlebars.Net...

Nuget Nuget

Usage

Templates

  • Default

Properties

Club

Provides branding information about the club and is mandatory.

  • Id club id.
  • Badge club emblem.
  • Color club primary and secondary colors.
  • Name club name.
Hero

The hero is the header section that provides the emblem and the name of the club as well as a title and a massage.

  • Title (optional)
  • Message (optional)
Constructor properties
{
    Margin = "0px",
    Padding = "30px"
}
Style

Provides the ability to configure the styling of the block, not all blocks, teasers and elements support all style properties.

public class Style
{
    [JsonProperty("background-color")]
    public string BackgroundColor { get; set; }
    [JsonProperty("border-radius")]
    public string BorderRadius { get; set; } = "0px";
    public string Color { get; set; } = "#ffffff";
    [JsonProperty("font-family")]
    public string FontFamily { get; set; } = "Helvetica, Verdana, sans-serif";
    [JsonProperty("font-size")]
    public string FontSize { get; set; } = "14px";
    public string Height { get; set; }
    [JsonProperty("line-height")]
    public string LineHeight { get; set; } = "100%";
    public string Margin { get; set; } = "0 0 0 0";
    [JsonProperty("max-height")]
    public string MaxHeight { get; set; } = "auto";
    [JsonProperty("max-width")]
    public string MaxWidth { get; set; } = "auto";
    [JsonProperty("min-width")]
    public string MinWidth { get; set; } = "auto";
    [JsonProperty("min-height")]
    public string MinHeight { get; set; } = "auto";
    public string Padding { get; set; }
    [JsonProperty("text-align")]
    public string TextAlign { get; set; } = "initial";
    [JsonProperty("text-decoration")]
    public string TextDecoration { get; set; } = "none";
    public string Width { get; set; }
}

Blocks

Button

A simple button with a solid background.

  • Message
  • Url
Constructor properties
{
    BackgroundColor = "#000000",
    BorderRadius = "0px",
    Color = "#ffffff",
    FontSize = "14px",
    LineHeight = "150%",
    MinWidth = "145px",
    Padding = "10px",
    TextAlign = "center",
    Width = "280px"
}

A simple link.

  • Message
  • Url
Constructor properties
{
    Color = "#0099ff",
    Margin = "initial",
    Padding = "initial",
    TextAlign = "initial",
    TextDecoration = "none"
}
Separator
  • Height
Simple

A simple block containing a title and a message.

  • Title
  • Message
Constructor properties
{
    Margin = "0px",
    Padding = "0px"
}

Teasers

Applications

This provides a teaser that show links to our mobile applications for Google Android and Apple iOS.

Example

var club = new Club
{
    Id = 67347,
    Badge = "https://az729104.cdn.laget.se/emblem_8378582.png?w=160&h=40&mode=max&scale=both&anchor=middlecenter",
    Color = new Color
    {
        Primary = "#1c252b",
        Secondary = "#ff6a00"
    },
    Name = "FC GonAce"
};

var data = new Template(club)
{
    Hero = new Hero
    {
        Title = "Lorem ipsum dolor sit amet, consectetur adipiscing elit.",
        Message = "Donec a risus augue. Cras ac blandit nibh. Donec fermentum erat massa, ut porta mauris scelerisque ut. Nullam in mauris nulla. Pellentesque gravida nulla vel luctus consequat."
    },
    Blocks = new List<Block>
    {
        new Simple
        {
            Title = "Lorem ipsum dolor sit amet, consectetur adipiscing elit.",
            Message = "Donec a risus augue. Cras ac blandit nibh. Donec fermentum erat massa, ut porta mauris scelerisque ut. Nullam in mauris nulla. Pellentesque gravida nulla vel luctus consequat."
        },
        new Separator(height: 25),
        new Simple
        {
            Title = "Lorem ipsum dolor sit amet, consectetur adipiscing elit.",
            Message = "Donec a risus augue. Cras ac blandit nibh. Donec fermentum erat massa, ut porta mauris scelerisque ut. Nullam in mauris nulla. Pellentesque gravida nulla vel luctus consequat."
        },
        new Separator(height: 25),
        new Button(background: "#ff6a00", padding: "15px 20px", width: "auto")
        {
            Text = "Gå till insamlingen: Insamling till FC GonAce",
            Url = "https://insamling.laget.se/FCGonAce/2"
        }
    },
    Teasers = new List<Teaser>
    {
        new Applications()
    },
    Footer = new List<Link>
    {
        new Link
        {
            Text = "Support",
            Url = "https://www.laget.se"
        },
        new Link
        {
            Text = "Inställningar",
            Url = "https://www.laget.se"
        }
    }
};

var factory = new Factory()
    .WithTemplate(Enums.Template.Default);

var html = factory.Compile(_data);
Result

alternate text is missing from this package README image

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  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 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. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 is compatible. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos 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
1.1.51 164 5/6/2024
1.1.50 100 4/5/2024
1.1.49 1,540 1/20/2024
1.1.47 1,549 11/22/2023
1.1.45 144 9/4/2023
1.1.44 130 7/3/2023
1.1.42 213 4/3/2023
1.1.41 233 3/10/2023
1.0.40 218 3/6/2023
1.0.38 245 2/6/2023
1.0.37 282 1/2/2023
1.0.36 301 12/12/2022
1.0.35 275 12/5/2022
1.0.34 308 11/7/2022
1.0.29 418 5/2/2022
1.0.28 445 4/4/2022
1.0.27 411 4/4/2022
1.0.26 419 3/16/2022
1.0.25 396 3/7/2022
1.0.23 408 2/7/2022
1.0.21 399 1/17/2022
1.0.20 380 1/17/2022
1.0.19 399 1/14/2022
1.0.18 265 1/3/2022
1.0.17 265 12/13/2021
1.0.14 705 8/16/2021
1.0.13 328 8/13/2021
1.0.12 1,251 7/1/2021
1.0.8 378 6/30/2021
1.0.7 449 6/24/2021
1.0.6 317 6/23/2021
1.0.5 323 6/21/2021
1.0.3 328 6/21/2021
1.0.1 334 6/21/2021