0

I am building a wiki app with lots of static pages (for articles). I am using the same layout I use everywhere in the mother app, and I want to include only content parts with the articles into a single template based on the request href. For example, if href is "/wiki/article_one", I would like to include partial template article_one.pug in the layout.

Here is my Pug code for the layout

extends partials/layout
block head
    include partials/head
block header
    include partials/header
block content
    include partials/wiki/main   // here I would like to replace the last main with partial template name
block logs
    include partials/logs
block footer
    include partials/footer
block scripts
    include partials/scripts-chat

partials/wiki/#{article} approach doesn't work. I looked at mixins but mixin names are also fixed. At this point I can make bunch of full article templates and copy/paste layout. Or there will be huge "if else if" block where I will match the right mixin (really hate this one). Is there a better way?

0 Answers0