Compiled temapltes.
Benchmark cleanup
This commit is contained in:
15
examples/demo/views/home.pug
Normal file
15
examples/demo/views/home.pug
Normal file
@@ -0,0 +1,15 @@
|
||||
doctype html
|
||||
html
|
||||
head
|
||||
title #{title}
|
||||
link(rel="stylesheet" href="/style.css")
|
||||
body
|
||||
header
|
||||
h1 #{title}
|
||||
if authenticated
|
||||
span.user Welcome back!
|
||||
main
|
||||
p This page is rendered using a compiled template.
|
||||
p Compiled templates are 3x faster than Pug.js!
|
||||
footer
|
||||
p © 2024 Pugz Demo
|
||||
15
examples/demo/views/index.pug
Normal file
15
examples/demo/views/index.pug
Normal file
@@ -0,0 +1,15 @@
|
||||
doctype html
|
||||
html
|
||||
head
|
||||
title hello
|
||||
body
|
||||
p some thing
|
||||
| ballah
|
||||
| ballah
|
||||
+btn("click me ", "secondary")
|
||||
br
|
||||
a(href='//google.com' target="_blank") Google 1
|
||||
br
|
||||
a(class='button' href='//google.com' target="_blank") Google 2
|
||||
br
|
||||
a(class='button', href='//google.com' target="_blank") Google 3
|
||||
7
examples/demo/views/layout-2.pug
Normal file
7
examples/demo/views/layout-2.pug
Normal file
@@ -0,0 +1,7 @@
|
||||
html
|
||||
head
|
||||
block head
|
||||
script(src='/vendor/jquery.js')
|
||||
script(src='/vendor/caustic.js')
|
||||
body
|
||||
block content
|
||||
10
examples/demo/views/layout.pug
Normal file
10
examples/demo/views/layout.pug
Normal file
@@ -0,0 +1,10 @@
|
||||
html
|
||||
head
|
||||
title My Site - #{title}
|
||||
block scripts
|
||||
script(src='/jquery.js')
|
||||
body
|
||||
block content
|
||||
block foot
|
||||
#footer
|
||||
p some footer content
|
||||
5
examples/demo/views/mixins/buttons.pug
Normal file
5
examples/demo/views/mixins/buttons.pug
Normal file
@@ -0,0 +1,5 @@
|
||||
mixin btn(text, type="primary")
|
||||
button(class="btn btn-" + type)= text
|
||||
|
||||
mixin btn-link(href, text)
|
||||
a.btn.btn-link(href=href)= text
|
||||
11
examples/demo/views/mixins/cards.pug
Normal file
11
examples/demo/views/mixins/cards.pug
Normal file
@@ -0,0 +1,11 @@
|
||||
mixin card(title)
|
||||
.card
|
||||
.card-header
|
||||
h3= title
|
||||
.card-body
|
||||
block
|
||||
|
||||
mixin card-simple(title, body)
|
||||
.card
|
||||
h3= title
|
||||
p= body
|
||||
15
examples/demo/views/page-a.pug
Normal file
15
examples/demo/views/page-a.pug
Normal file
@@ -0,0 +1,15 @@
|
||||
extends layout.pug
|
||||
|
||||
block scripts
|
||||
script(src='/jquery.js')
|
||||
script(src='/pets.js')
|
||||
|
||||
block content
|
||||
h1= title
|
||||
p Welcome to the pets page!
|
||||
ul
|
||||
li Cat
|
||||
li Dog
|
||||
ul
|
||||
each val in items
|
||||
li= val
|
||||
5
examples/demo/views/page-appen-optional-blk.pug
Normal file
5
examples/demo/views/page-appen-optional-blk.pug
Normal file
@@ -0,0 +1,5 @@
|
||||
extends layout
|
||||
|
||||
append head
|
||||
script(src='/vendor/three.js')
|
||||
script(src='/game.js')
|
||||
11
examples/demo/views/page-append.pug
Normal file
11
examples/demo/views/page-append.pug
Normal file
@@ -0,0 +1,11 @@
|
||||
extends layout-2.pug
|
||||
|
||||
block append head
|
||||
script(src='/vendor/three.js')
|
||||
script(src='/game.js')
|
||||
|
||||
block content
|
||||
p
|
||||
| cheks manually the head section
|
||||
br
|
||||
| hello there
|
||||
9
examples/demo/views/page-b.pug
Normal file
9
examples/demo/views/page-b.pug
Normal file
@@ -0,0 +1,9 @@
|
||||
extends sub-layout.pug
|
||||
|
||||
block content
|
||||
.sidebar
|
||||
block sidebar
|
||||
p nothing
|
||||
.primary
|
||||
block primary
|
||||
p nothing
|
||||
1
examples/demo/views/pet.pug
Normal file
1
examples/demo/views/pet.pug
Normal file
@@ -0,0 +1 @@
|
||||
p= petName
|
||||
9
examples/demo/views/sub-layout.pug
Normal file
9
examples/demo/views/sub-layout.pug
Normal file
@@ -0,0 +1,9 @@
|
||||
extends layout.pug
|
||||
|
||||
block content
|
||||
.sidebar
|
||||
block sidebar
|
||||
p nothing
|
||||
.primary
|
||||
block primary
|
||||
p nothing
|
||||
11
examples/demo/views/users.pug
Normal file
11
examples/demo/views/users.pug
Normal file
@@ -0,0 +1,11 @@
|
||||
doctype html
|
||||
html
|
||||
head
|
||||
title Users
|
||||
body
|
||||
h1 User List
|
||||
ul.user-list
|
||||
each user in users
|
||||
li.user
|
||||
strong= user.name
|
||||
span.email= user.email
|
||||
Reference in New Issue
Block a user