mirror of
https://github.com/zyllian/webdog.git
synced 2025-05-10 10:36:39 -07:00
add support for custom partials
Some checks are pending
Build Site / build (push) Waiting to run
Build Site / deploy (push) Blocked by required conditions
Some checks are pending
Build Site / build (push) Waiting to run
Build Site / deploy (push) Blocked by required conditions
This commit is contained in:
parent
fd40a5d31a
commit
1d502881f6
7 changed files with 690 additions and 350 deletions
|
@ -20,6 +20,10 @@ learn about standard webdog pages here
|
|||
|
||||
learn how to use webdog templates
|
||||
|
||||
## <a href="webdog-html">webdog html</a>
|
||||
|
||||
learn about webdog html extensions
|
||||
|
||||
## <a href="styling">styling</a>
|
||||
|
||||
learn about webdog styling
|
||||
|
|
34
site/pages/docs/webdog-html.md
Normal file
34
site/pages/docs/webdog-html.md
Normal file
|
@ -0,0 +1,34 @@
|
|||
---
|
||||
title: webdog html
|
||||
template: docs.tera
|
||||
---
|
||||
|
||||
# webdog html
|
||||
|
||||
webdog adds some extensions to html to make building your site easier.
|
||||
|
||||
## `wd-partial`
|
||||
|
||||
any template can be used as a partial in another template or page.
|
||||
|
||||
in a template like this:
|
||||
|
||||
```html
|
||||
<p>this is a partial.</p>
|
||||
<p>the hi argument is {{ userdata.hi }}</p>
|
||||
<p>the hello argument is {{ userdata.hello }}</p>
|
||||
<div>
|
||||
<p>and here's the inner content:
|
||||
{{ page | safe }}
|
||||
</div>
|
||||
```
|
||||
|
||||
simply include the `wd-partial` html tag like so:
|
||||
|
||||
```html
|
||||
<wd-partial t="template-to-use.tera" hello="hi" hi="hello">
|
||||
hiiiiiiiiiii~
|
||||
</wd-partial>
|
||||
```
|
||||
|
||||
a `wd-partial` tag consists of the `t` attribute to determine the template and any number of additional arguments, which are passed on to the partial template.
|
Loading…
Add table
Add a link
Reference in a new issue