StaticWebEpiserverPlugin 1.0.0

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

// Install StaticWebEpiserverPlugin as a Cake Tool
#tool nuget:?package=StaticWebEpiserverPlugin&version=1.0.0                

EpiServer - StaticWeb (Example)

Project is built on top of vanilla EpiServer Alloy website.

Introduction

Project showcasing creating a static website but still using EpiServer CMS for editorial changes.

Pro

  • Reliable serverside response time
  • Very easy to scale up
  • No database dependency for visitor
  • No serverside code requried
  • Very secure (hard to hack static pages)

Con/limitations

  • No serverside dynamic content can be used
  • No serverside personalized content can be used
  • Only pages inheriting from PageData will trigger page write
  • Only block inheriting from BlockBata will trigger page write
  • Only supports following types:
    • css (only support dependencies declared in url())
    • javascript (no dependencies)
    • Web fonts (woff and woff2)
    • Images (png, jpg, jpeg, jpe, gif, webp)
    • documents (pdf)
    • Icons (ico)

Requirements

  • EpiServer 7.5+
  • .Net 4.7+
  • All pages need to inherit from PageData
  • All blocks needs to inherit from BlockData
  • Website has to return pages, javascript and css as UTF-8
  • Must allow visits with user-agent Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.149 Safari/537.36 StaticWebPlugin/0.1

Installation

  • Copy StaticWebEpiserverPlugin folder and add StaticWebEpiserverPlugin.csproj into your solution.
  • Change rootUrl in Initialization/StaticWebInitialization.cs to your website url (must allow anonymous access)
  • Change rootPath in Initialization/StaticWebInitialization.cs to folder you want to write to (for example a GitHub repository folder)

When is running?

  • Do changes for a page or block(must be placed on a page) in EpiServer and publish your changes.
  • StaticWebPlugin will now try to access your website and write back the result it gets to the folder you have entered.

What extra functionality can be used

  • StaticWeb is registering a displaychannel called "StaticWeb" (See Header.cshtml and Header.staticweb.cshtml for examples on how to use it). It is perfect for removing functionality that can't be used in a static website (like filitering or search). It also makes it possible for you to view how the page will look and work on the static version.
Product Compatible and additional computed target framework versions.
.NET Framework net472 is compatible.  net48 was computed.  net481 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
3.0.1 335 12/4/2021
3.0.0 290 12/4/2021
2.0.0 433 5/27/2020
1.1.0 420 4/15/2020
1.0.1 413 3/30/2020
1.0.0 446 3/30/2020

Initial release. Includes generating pages on publishing event and scheduled job