Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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
- Host: GitHub
- URL: https://github.com/tidyui/statica
- Owner: tidyui
- License: mit
- Created: 2019-09-03T22:05:11.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2024-06-06T20:59:09.000Z (5 months ago)
- Last Synced: 2024-10-11T15:08:59.623Z (about 1 month ago)
- Topics: asp-net-core, markdown, netstandard, piranha-website
- Language: C#
- Homepage:
- Size: 40 KB
- Stars: 11
- Watchers: 2
- Forks: 5
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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`.