-
-
Notifications
You must be signed in to change notification settings - Fork 49
Installation
Currently supporting ASP.NET Core 1.0, built against Microsoft.NETCore.App 1.0.0-rc2-3002702
Nuget:
Install-Package Smidge -Pre
In Startup.ConfigureServices:
//You can pass in an IConfiguration instance here which contains the Smidge configuration
//values, alternatively you can use a separate smidge.json file (see below)
services.AddSmidge();
In Startup.Configure
app.UseSmidge();
The configuration format for Smidge is as follows. You can either include this structure in your own configuration file and pass in the IConfiguration
reference to the AddSmidge
method above or add a config file to your app root (not wwwroot) called smidge.json:
{
"dataFolder": "App_Data/Smidge",
"version": "1"
}
- dataFolder: where the cache files are stored
- version: can be any string, this is used for cache busting in URLs generated
Create a file in your ~/Views folder: _ViewImports.cshtml
(This is an ASP.NET MVC Core way of injecting services into all of your views)
In _ViewImports.cshtml
add an injected service and a reference to Smidge's tag helpers:
@inject Smidge.SmidgeHelper Smidge
@addTagHelper *, Smidge
NOTE: There is a website example project in this source for a reference: https://github.com/Shazwazza/Smidge/tree/master/src/Smidge.Web