Files
uni-web-site/src/components/template.pug
2025-12-29 00:12:35 +10:00

70 lines
1.9 KiB
Plaintext

include data.pug
mixin detailsPage(pageData)
doctype html
html(lang="en")
head
meta(charset="UTF-8")
title= pageData.title
body(bgcolor="#F0F8FF")
//- Menu
details
summary Menu
ul
each item in menu
li
if item.title === pageData.menuTitle
a(href=item.href)
h4= item.title
else
a(href=item.href)= item.title
//- Page Title
h2(align="center")= pageData.title
hr(width="800" align="center")
//- Header Images
if pageData.images && pageData.images.length > 0
p(align="center")
each img in pageData.images
if img.height
img(src=img.src alt=img.alt height=img.height)
else if img.width
img(src=img.src alt=img.alt width=img.width)
else
img(src=img.src alt=img.alt)
//- Paragraphs
if pageData.paragraphs
each para in pageData.paragraphs
p(align="justify")!= para
//- Table (for embedded page)
if pageData.table
h3(align="center")= pageData.table.title
table(border="1" align="center" cellpadding="6" cellspacing="0")
tr
each header in pageData.table.headers
th= header
each row in pageData.table.rows
tr
each cell in row
td= cell
//- Content (for opencv page)
if pageData.content
hr(width="500" align="center")
p!= pageData.content.text
//- Gallery (for photography page)
if pageData.gallery
each row in pageData.gallery
p(align="center")
each img in row
img(src=img.src alt=img.alt width=img.width)
//- Footer
if pageData.footer
p(align="right")= pageData.footer