CurateCoders.CloudFlarePro 0.2.6.1

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

// Install CurateCoders.CloudFlarePro as a Cake Tool
#tool nuget:?package=CurateCoders.CloudFlarePro&version=0.2.6.1

Curate Coders' Cloudflare Pro helper package

Nuget GitHub Workflow Status (with event)

This package provides helper classes & views to leverage Cloudflare Pro's Image Resizing service for providing responsive images using Umbraco's media cropping facilities.

To get started, install the package via Nuget:

  • Powershell

    Install-Package CurateCoders.CloudflarePro

  • dotnet CLI

    dotnet add package CurateCoders.CloudFlarePro

Once you have installed the package, you'll find an example Razor view in _ExampleView.cshtml.

The main parameter passed to the partial is an instance of the MediaEmbed class, which has the following parameters:

  • umbracoImage - the Umbraco image (an IPublishedContent object) you wish to generate sizes for;
  • width - default width of the primary image;
  • height - default height of the primary image;
  • quality - quality of the images to be generated based on the original (for WebP/JPEG/PNG etc.);
  • lazyLoad - whether responsive images should be lazily loaded;
  • options - Cloudflare Pro-specific options as a a POCO which then gets converted into additional querystring entries upon rendering;
  • sizes - A CSS rule to dictate at which sizes Cloudflare Pro Image Resizing should be invoked - see here for full documentation on the feature;
  • mediaQueries - a list of CloudImageMediaQuery objects, which specify at which screen size breakpoints/viewport widths you want Cloudflare Image Resizing to generate URLs for.

Examples

In progress, in the meantime please check Views\_ExampleView.cshtml for some sample usage.

If using the sample code as-is, please change the URL on line 47 of Views\Shared\_ExamplePartialView.cshtml to be the URL of your Cloudflare account!

Product Compatible and additional computed target framework versions.
.NET 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 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.

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.2.6.1 152 9/1/2023
0.2.0 111 9/1/2023
0.1.0 122 8/30/2023