Pug template syntax
Basic Element
pug
1 | a(class='button' href='google.com') Google |
html
1 | <a class="button" href="google.com">Google</a> |
HTML
input
pug
1 | doctype html |
html
1 | <!DOCTYPE html> |
Varriable
pug
1 | url = 'https://example.com/' |
html
1 | <a href="https://example.com/">Another link</a> |
Escape
pug
1 | div(data="<hello_world>") |
html
1 | <div data="<hello_world>"></div> |
Inline style css
pug
1 | a(style={color: 'red', background: 'green'}) |
html
1 | <a style="color:red;background:green;"></a> |
Mixin (function)
pug
1 | mixin list(id, ...items) |
html
1 | <ul id="my-list"> |