starter-project/src/pug/pages/about.pug
extends ../layouts/app.pug
block variables
- var pageTitle = " - About"
block content
div
#home
.main-wrap
include ../components/header/header.pug
+header(true)
.container-wrap.py-10.py-sm-4
section.space-top.space-bottom
h2.display-3.text-center.mb-4 About Us
section.space-top
include ../components/footer.pug
Generate the HTML
gulp build
It will generate file about.html in root directory.
And watch the changes result
gulp
src/pug/components/
hello.pug
// file: /src/pug/components/hello.pug
div
h4 Hello World
h5.display-1.text-center Lorem ipsum dolor sit amet, consectetur adipiscing elit.
p Vestibulum dignissim orci vitae eros rutrum euismod. Vestibulum tempor, sem et molestie egestas, dui tortor laoreet tellus, id rhoncus mauris neque malesuada augue. Duis tristique metus magna, lobortis aliquam risus euismod sit amet.
p Suspendisse porttitor velit nisl, feugiat tincidunt nisl mattis ut. Nulla lobortis nunc vitae nisi semper semper. Sed mi neque, convallis at ipsum at, blandit pretium enim. Nunc quis sem quis velit tincidunt congue a sit amet ante. In hac habitasse platea dictumst.
src/pug/pages/about.pug
. (Example page that we've made in previous section)
include ../components/hello.pug
// file: src/pug/pages/about.pug
extends ../layouts/app.pug
block variables
- var pageTitle = " - About"
block content
div
#home
.main-wrap
include ../components/header/header.pug
+header(true)
.container-wrap.py-10.py-sm-4
section.space-top.space-bottom
h2.display-3.text-center.mb-4 About Us
// Add new component
include ../components/footer.pug
section.space-top
include ../components/footer.pug
gulp
command, the updates will change immediately. And the physical file will be updated in about.htmlsrc/api.json
brand": {
"agency": {
"name": "Agency",
"desc": "Nirwana Agency - HTML5 Bootstrap Landing Page Template",
"prefix": "Nirwana",
"footerText": "Nirwana Agency - All Rights Reserved 2020",
"logoText": "Nirwana Theme",
"projectName": "Agency Project",
"url": "nirwana.ux-maestro.com/agency",
"img": "/images/agency-logo.png",
"notifMsg": "Donec sit amet nulla sed arcu pulvinar ultricies commodo id ligula"
}
},
gulp build
it will affect in HTML ‹head› content and other branding purpose.
src/pug/layouts/document.pug
meta(
name="description"
content=brand.agency.desc
)
meta(property="og:url" content=brand.agency.url)
meta(property="og:title" content=brand.agency.projectName)
title #{brand.agency.name} - #{pageTitle}
src/pug/layouts/app.pug
.m-application
by switch between .theme--dark
or .theme--light
#app.m-application.theme--dark.transition-page
- Light mode:
#app.m-application.theme--light.transition-page
.m-content
by change .[theme-name]-var
with available theme from src/scss/utils/_color-var.scss
- In example joker theme color
#main-wrap.m-content.passion.joker-var
// file: src/pug/layouts/app.pug
extends ./document.pug
block variables
block layout
#app.m-application.theme--dark.transition-page
.loading
#main-wrap.m-content.passion.joker-var
block content-
If you change the palette variable, don't forget to update this following files as well
** Crytpo Theme:crypto-theme/src/pug/components/gradient-deco.pug
saas-theme/src/pug/components/testimonials.pug
hosting-theme/src/js/banner-animation.js
Make sure the stop-color has same value as in src/scss/utils/_color-var.scss
This template including illustration vector images. And for the HTML uses PNG format with 2 version, Flat(2D) and 3D. You can switch between them and applied to all HTML files.
src/pug/layouts/base.pug
img_artwork
(For homepage) and img_artworkInner
(for inner page) with avalable value (commented) src/api.json
- var img_artwork = imgAPI.agency3d
- var img_artworkInner = imgAPI.agencyInner3d
- var img_artwork = imgAPI.agency2d
- var img_artworkInner = imgAPI.agencyInner2d
Generate the HTML
gulp build
This template coming with 7 variant headers, 4 variant footers and 2 type bottom corner.
As You can see in custom-components/
, but for implementatin, that's need to copy manually.
With Pug.js, You can use them and generate all html files instantly.
src/pug/layouts/base.pug
headerType
, footerType
and cornerType// file: src/pug/layouts/base.pug
//- UI Header
- var headerType = 'basic' // available: mixed, basic, droplist, mega, hamburger, navscroll, search
//- UI Footer
- var footerType = 'blog' // available: basic, blog, contact, sitemap
//- UI Floating corner
- var cornerType = 'nav' // available: chat, nav
Generate the HTML
gulp build
src/pug/layouts/base.pug
doc_dir
to RTL or LTR. And you need to adjust the language variable doc_lang
as well.// file: src/pug/layouts/base.pug
//- HTML attribute
- var doc_lang = 'ar'
- var doc_dir = 'rtl'
This template us Youtube API To use this feature we recommend to use https in production. If not there will be some warnings in browser console related cookies and security.
You can disable this feature by open src/api.json
in "youtube" object then set set use: false
.
"youtube": {
"use": true
}
gulpfile.js
view()
change the locales to any locale json filelocales: 'src/locales/pt.json'
function views() {
var options = {
i18n: {
dest: './',
namespace: '$t',
localeExtension: true,
locales: 'src/locales/pt.json'
},
data: JSON.parse(fs.readFileSync('./src/api.json'))
};
return (
gulp.src('src/pug/pages/*.pug')
.pipe(plumber())
.pipe(pugI18n(options))
.pipe(prettyHtml({ indent_size: 2 }))
.pipe(ext_replace('.html', '.en.html'))
.pipe(gulp.dest(options.i18n.dest))
.pipe(connect.reload())
)
}
src/locales/[localeCode].json
└── src └── locales ├── en.json ├── de.json └── pt.json
For example portuguese in src/locales/pt.json
"agency_landing": {
"header_login": "Conecte-se",
"header_register": "registro"
}
/componens/header/header.pug
h4.use-text-title2 #{$t.agency_landing.header_login}
h4.use-text-title2 #{$t.agency_landing.header_register}
gulp build
. The translated result will in root directory.assets
in src/pug/layouts/base.pug
//- Assets Path
- var multilang = '../../assets'
- var prod = '../assets'
- var dev = './assets'
//- Use assets path
- var assets = multilang // Change this
Then please run
gulp translate
multilang/**/*.html