Skip to content
/ statica Public

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

License

Notifications You must be signed in to change notification settings

tidyui/statica

Folders and files

NameName
Last commit message
Last commit date

Latest commit

c46b99f · Jun 6, 2024

History

27 Commits
Jun 6, 2024
Sep 4, 2019
Jun 6, 2024
Sep 3, 2019
May 15, 2020
Sep 3, 2019
Oct 14, 2019
May 29, 2020
May 29, 2020

Repository files navigation

Welcome to Statica

Statica

About

Statica is a module for Piranha CMS 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 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.

About

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

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published