~dmbaturin/soupault

1

How to wrap contents of body in a div?

John Magolske
Details
Message ID
<20200515082229.GZ23246@s70206.gridserver.com>
DKIM signature
missing
Download raw message
Hi,

I'm looking into using soupault to rebuild my website, and am stuck on
the task of wrapping the contents of the body in a div. Trying this in
/templates/main.html :

    <body>
       <div class="container">
       <!-- your page content will be inserted here,
            see the content_selector option in soupault.conf -->
       </div>
    </body>

Generates this output:

    <body>
   	   <div class="container"></div>
   	      <h1>My Site...</h1>
	      <p>Blah blah blah...</p>
    </body>

I'm trying to figure out how to have the closing </div> tag show up
after body content, like so:

    <body>
   	   <div class="container">
   	      <h1>My Site</h1>
	      <p>Blah blah blah...</p>
       </div>
    </body>

Would this perhaps require use of widgets in my soupault.conf ?

Thanks for any help,

John


-- 
John Magolske
http://b79.net/contact
Details
Message ID
<67fb769a-69c6-955b-0656-c0e08c9a72ef@baturin.org>
In-Reply-To
<20200515082229.GZ23246@s70206.gridserver.com> (view parent)
DKIM signature
pass
Download raw message
Hi John,

No, it can be done without any widgets. There's a content_selector
option under settings that takes a CSS selector of the element in
template where content should be inserted. It default to "body", but can
be any valid selector.

On my own site I use a <div id="content">, so I have it setup like this:
https://github.com/dmbaturin/baturin.org/blob/master/soupault.conf#L17-L18

For your template you will need:

[settings]
  content_selector = "div.container"


On 5/15/20 3:22 PM, John Magolske wrote:
> Hi,
>
> I'm looking into using soupault to rebuild my website, and am stuck on
> the task of wrapping the contents of the body in a div. Trying this in
> /templates/main.html :
>
>     <body>
>        <div class="container">
>        <!-- your page content will be inserted here,
>             see the content_selector option in soupault.conf -->
>        </div>
>     </body>
>
> Generates this output:
>
>     <body>
>    	   <div class="container"></div>
>    	      <h1>My Site...</h1>
> 	      <p>Blah blah blah...</p>
>     </body>
>
> I'm trying to figure out how to have the closing </div> tag show up
> after body content, like so:
>
>     <body>
>    	   <div class="container">
>    	      <h1>My Site</h1>
> 	      <p>Blah blah blah...</p>
>        </div>
>     </body>
>
> Would this perhaps require use of widgets in my soupault.conf ?
>
> Thanks for any help,
>
> John
>
>
Export thread (mbox)