Our.Umbraco.HeadlessPreview 2.0.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package Our.Umbraco.HeadlessPreview --version 2.0.0                
NuGet\Install-Package Our.Umbraco.HeadlessPreview -Version 2.0.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="Our.Umbraco.HeadlessPreview" Version="2.0.0" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Our.Umbraco.HeadlessPreview --version 2.0.0                
#r "nuget: Our.Umbraco.HeadlessPreview, 2.0.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.
// Install Our.Umbraco.HeadlessPreview as a Cake Addin
#addin nuget:?package=Our.Umbraco.HeadlessPreview&version=2.0.0

// Install Our.Umbraco.HeadlessPreview as a Cake Tool
#tool nuget:?package=Our.Umbraco.HeadlessPreview&version=2.0.0                

CI-CD NuGet PRs Welcome

Our.Umbraco.HeadlessPreview

This package overrides the default Umbraco preview button and lets you configure an alternative preview url.

Installation

Install the NuGet package to get started.

Install the NuGet package

With .NET CLI

dotnet add package Our.Umbraco.HeadlessPreview --version <version>

Using the Package Manager

Install-Package Our.Umbraco.HeadlessPreview -Version <version>

Configuration

The package can be configured using the appsetings.json file or using the UI which will save the configuration in the database.

Setting Default value Description
TemplateUrl `` The URL used for preview. It can contain dynamic placeholder values to support different types of URL's.<br /><br />Typically used template URL are:<br/><br/><ul><li>https://mysite.com/api/preview?slug={slug}&secret=mySecret</li><li>{hostname}/api/preview?slug={slug}&secret=mySecret</li><li>https://mysite.com/{slug}?preview=true</li></ul>

UI

If you just have a single environment it's easy to just configure the plugin directly from the Umbraco Backoffice in the Settings section.

Configuration

appsettings.json

This is typically the preferred way if you have a multi environment setup as you can use environment specific settings.

"HeadlessPreview": {
    "TemplateUrl": "https://mysite.com/api/preview?slug={slug}&secret=mySecret"
}

Placeholders

Placeholders are predefined keys enclosed in curly braces that you can use in your tempalte URL. Placeholders are automatically replaced with real values based on the page you are previewing.

Placeholder Description
{hostname} The hostname added on nearest ancestor node or self with the right culture in Umbraco. If multiple hostname has same culture it takes the first.
{slug} The relative path of the page being previewed.

Changelog

See new features, fixes and breaking changes for each Release.

Contributing

Pull requests are very welcome.

Please fork this repository and make a PR when you are ready.

Otherwise you are welcome to open an Issue in our issue tracker.

License

Our.Umbraco.HeadlessPreview is MIT licensed

Product Compatible and additional computed target framework versions.
.NET net5.0 is compatible.  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 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
2.2.1 144 11/8/2024
2.2.0 3,652 4/1/2024
2.1.1 15,499 11/1/2023
2.1.0 1,126 9/8/2023
2.0.0 1,293 3/28/2023
1.1.0 231 3/19/2023
1.0.5 265 2/26/2023
1.0.4 265 2/15/2023
1.0.3 246 2/15/2023
1.0.2 246 2/15/2023
1.0.1 253 2/14/2023
1.0.0 258 2/14/2023
1.0.0-alpha4 155 12/30/2022
1.0.0-alpha3 157 12/30/2022
1.0.0-alpha2 154 12/30/2022
1.0.0-alpha1 159 12/30/2022