Skip to content

Latest post as index page? #200

Closed Answered by daveaglick
rgiese asked this question in Q&A
Discussion options

You must be logged in to vote

Sure! Statiq is one of those tools that can do anything, but it sometimes takes a bit of background and experience to figure stuff out quickly. In this case, the approach that came to me only took a few minutes to write, but it would certainly have been tricky to figure out on your own.

This relies on using the CleanBlog theme (or any other theme that has an archive of posts as the default index file):

using Microsoft.Extensions.DependencyInjection;
using Statiq.App;
using Statiq.Web;
using Statiq.Web.Modules;

await Bootstrapper.Factory
    .CreateWeb(args)
    // Prevent the original archives index page from being output
    .ModifyPipeline(
        nameof(Statiq.Web.Pipelines.Archives),

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by rgiese
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants