This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//- Pug.js allow writing inline JavaScript code. | |
//- Unbuffered JavaScript code does not output any results. | |
//- Unbuffered code must start with `-` hyphen. | |
- var fieldName = "username" | |
- var required = false | |
input(type="text", name=fieldName, required=required) | |
//- Pug.js also support block Unbuffered code. | |
- |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<input type="text" name="username"/><a class="general link active" href="some-link"></a> | |
<p>Hello World! I am <b>Pug.js!</b></p> | |
<p>Hello World! I am <b>Pug.js!</b></p> | |
<p>I am male.</p> | |
<p><a class="link" href="some-link">Click to log in.</a></p> | |
<ul> | |
<li>current value is 0</li> | |
<li>current value is 1</li> | |
<li>current value is 2</li> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//- Like PHP, we can include content of another file in a file. | |
//- If another file extension is `.pug`, then it's content will be compiled. | |
//- If another files is non-pug file, then it's content will be included as raw text. | |
//- If no file extenstion is given, `.pug` is automatically appended to the file name. | |
doctype html | |
html | |
head | |
title Includes Example | |
include includes/resources.pug |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//- located in includes folder | |
link(rel="stylesheet", href="http://website.com/style.css") | |
script(src="http://website.com/script.js") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Includes Example</title> | |
<link rel="stylesheet" href="http://website.com/style.css"> | |
<script src="http://website.com/script.js"></script> | |
<style> | |
/* located in includes folder */ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//- Mixin is used to create reusable block of code. | |
//- Mixin is just a wrapper around proper Pug code. | |
//- Mixin can also be a function with arguments. | |
mixin notAllowed | |
p: b You are not allowed here | |
mixin user(data) | |
li | |
p.name= data.name | |
p.city= data.city |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="critical-section"> | |
<p> | |
<b>You are not allowed here</b> | |
</p> | |
</div> | |
<ul class="user-list"> | |
<li> | |
<p class="name">Ross Geller</p> | |
<p class="city">New York</p> | |
</li> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const gulp = require('gulp'); | |
const pug = require('gulp-pug'); | |
const sass = require('gulp-sass'); | |
const replace = require('gulp-replace'); | |
const inlineCss = require('gulp-inline-css'); | |
const rename = require('gulp-rename'); | |
const browserSync = require('browser-sync').create(); | |
// browserSync base directory | |
// this will be the base directory of files for web preview |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
doctype html | |
html | |
head | |
title One | Email template! | |
//- import css/scss stylesheets | |
//- these file names will be replace by gulp with proper css file paths | |
link(rel="stylesheet", href="../../sass/basic.scss") | |
link(rel="stylesheet", href="../../sass/one/styles.scss") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html style="margin: 0; padding: 0;"> | |
<head> | |
<title>One | Email template!</title> | |
</head> | |
<body style="margin: 0; padding: 0;"> | |
<table class="table" cellpadding="0" cellspacing="0" style="background-color: #eee; empty-cells: hide; margin: 0 auto; padding: 0; width: 600px;"> | |
<tr> |