Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/tidyui/statica

Simple Piranha Module for creating a partial page structure from local Markdown files
https://github.com/tidyui/statica

asp-net-core markdown netstandard piranha-website

Last synced: 11 days ago
JSON representation

Simple Piranha Module for creating a partial page structure from local Markdown files

Awesome Lists containing this project

README

        

# Welcome to Statica

![Statica](http://piranhacms.org/assets/icon-statica.png)

## About

Statica is a module for [Piranha CMS](https://www.github.com/piranhacms/piranha.core) that turns
a **recursive** structure of `Markdown` files into a page structure that can be accessed from your
**Piranha website**. The module can for example be used to display documentation on your website that
you want to author and edit somewhere else than through your website.

For example the module will be used on the official [Piranha website](http://www.piranhacms.org) to
render the documentation section.

## Setup

Adding statica to your application is easy. The only important this is that `UseStatica` should be placed **after** `UseStaticFiles` but **before** any dynamic handlers like `Mvc` is added to the middleware pipeline.

using Statica.Models;

public void ConfigureServices(IServiceCollection services)
{
...

//
// Adds a new statica structure with the base slug
// docs and assets enabled
//
services.AddStatica(new Statica.Models.StaticStructure
{
Id = "docs",
DataPath = "docs/src",
BaseSlug = "docs",
UseAssets = true
});

...
}

public void Configure(IApplicationBuilder app, IHostingEnvironment env)
{
...

app.UseStaticFiles();
app.UseStatica(env);

...
}

If `UseAssets` is set to `true`, Statica will **assume** that you have the folder `_assets` in your DataPath. Your assets will be exposed in your application on `BaseSlug/_assets`.