Skip to content

Commit

Permalink
Implement better directory structure for pug
Browse files Browse the repository at this point in the history
  • Loading branch information
jr-cologne committed May 10, 2019
1 parent 729b2a8 commit 114e22a
Show file tree
Hide file tree
Showing 8 changed files with 30 additions and 21 deletions.
4 changes: 2 additions & 2 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ gulp.task('html', () => {
});

gulp.task('pug', () => {
return gulp.src([ src_folder + '**/*.pug' ], { base: src_folder })
return gulp.src([ src_folder + 'pug/**/!(_)*.pug' ], { base: src_folder + 'pug' })
.pipe(plumber())
.pipe(pug())
.pipe(gulp.dest(dist_folder))
Expand Down Expand Up @@ -139,7 +139,7 @@ gulp.task('watch', () => {

const watch = [
src_folder + '**/*.html',
src_folder + '**/*.pug',
src_folder + 'pug/**/*.pug',
src_assets_folder + 'sass/**/*.sass',
src_assets_folder + 'scss/**/*.scss',
src_assets_folder + 'js/**/*.js'
Expand Down
19 changes: 0 additions & 19 deletions src/index-pug.pug

This file was deleted.

1 change: 1 addition & 0 deletions src/pug/_includes.pug
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
include helpers/_mixins
Empty file added src/pug/helpers/_mixins.pug
Empty file.
9 changes: 9 additions & 0 deletions src/pug/index.pug
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
extends templates/_default

block content
h1.title Gulp Starter Kit

p.description
strong A simple Gulp 4 Starter Kit for modern web development.

img.image(src="/assets/images/sample.jpg" alt="")
8 changes: 8 additions & 0 deletions src/pug/templates/_default.pug
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
include ../_includes

include partials/_head

body
block content

include partials/_foot
2 changes: 2 additions & 0 deletions src/pug/templates/partials/_foot.pug
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
link(rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:100,300")
script(async src="/assets/js/all.js")
8 changes: 8 additions & 0 deletions src/pug/templates/partials/_head.pug
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
doctype html
html(lang="en")
head
meta(charset="UTF-8")
meta(name="viewport" content="width=device-width, initial-scale=1.0")
meta(http-equiv="X-UA-Compatible" content="ie=edge")
title Gulp Starter Kit
link(rel="stylesheet" href="/assets/css/pages/index.css")

0 comments on commit 114e22a

Please sign in to comment.