Spike

Spike

A modern static build tool, powered by webpack

Get Started    Support
Ask A Question

Questions

Nested Blocks and locals in includes

Posted by Oliver Braun 2 months ago

Hi,

two more questions:

  1. Is it possible to put a block inside a block?

    I tried something like this and it doesn't work:

     block(name='content')
       h1 Hello world!
       block(name='subcontent1')
       h1 Hello Olli!
       block(name='subcontent2')
    
  2. Is it possible to include something depending on a variable.

    I tried something like this and it doesn't work:

     include(src='includes/lectures/{{ name }}.sgr')
    

The background is the following:

I would like to generate my site https://ob.cs.hm.edu/ using spike.
Code can be found at https://github.com/obcode/ob.cs.hm.edu/tree/spike.
Some pages under /lecture have the same structure, but different content. I would like to use one
layout and "inject" the content. I can do it via locals, but some parts are larger than just one value.

Loading comments...