Skip to content
This repository was archived by the owner on Jun 10, 2025. It is now read-only.

Commit ed58aad

Browse files
authored
Merge pull request #84 from serjxupypr/master
Request for updates of web-kit-starter
2 parents 6ab243f + c3e8c66 commit ed58aad

File tree

14 files changed

+15689
-24
lines changed

14 files changed

+15689
-24
lines changed

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ This is not to say that Web Starter Kit cannot be used in browsers older than th
4646
| Performance optimization | Minify and concatenate JavaScript, CSS, HTML and images to help keep your pages lean (Run `gulp` to create an optimised version of your project to `/assets`). |
4747
| Code Linting | JavaScript code linting is done using [esLint](https://www.npmjs.com/package/gulp-eslint) - a linter tool for identifying and reporting on patterns in JavaScript (used airbnb-base rules https://www.npmjs.com/package/eslint-config-airbnb-base). HTML code hinting is done using [HtmlHint](https://www.npmjs.com/package/gulp-htmlhint). |
4848
| ES2015(ES6) Support | Optional ES2015 support .You can use all kind of ES6 features here. ES2015 source code will be automatically transpiled to ES5 for wide browser support. |
49+
| HTML templating | Used [gulp-file-include](https://www.npmjs.com/package/gulp-file-include) for templating html files. |
4950
| Built-in HTTP Server | A built-in server for previewing your site locally while you develop and iterate. |
5051
| Live Browser Reloading | Reload the browser in real-time anytime an edit is made without the need for an extension (Run `gulp` and edit your files). |
5152
| Cross-device Synchronization | Synchronize clicks, scrolls, forms and live-reload across multiple devices as you edit your project. Powered by [BrowserSync](http://browsersync.io) (Run `gulp` and open up the IP provided on other devices on your network). |
@@ -179,6 +180,9 @@ In `src` folder you can find all sources for the project (images, sass , javascr
179180
## `src` folder structure
180181

181182
```
183+
├── html
184+
├── partials #Folder for html components, that we can include into the templates
185+
├── templates #Folder for source html templates of pages
182186
├── images #Folder for storing images
183187
├── js #Folder for storing js files
184188
├── modules #Folder for storing js modules
@@ -273,6 +277,7 @@ Also, you might want to add these sass files to the ignore list (check `getPathe
273277
| build-styles-vendors | Compiles and minifies all plugins scss from `src/vendor_entries` to `production` folder. |
274278
| clean-production | `production` folder removing. |
275279
| copy-folders | Need to copy all folders from sources to assets. |
280+
| file-include | Compiles all html templates into html files. |
276281
| templates | Compiles all pug files into html files. |
277282
| html-hint | Need to hint html files. |
278283
| es-lint | Need to lint js files. |

gulp-config.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@ module.exports = {
1515
vendorScss: 'vendor.scss',
1616
vendorScssMin: 'vendor.min.css',
1717
},
18+
fileInclude: {
19+
templates: 'src/html/templates',
20+
dest: './',
21+
},
1822
task: {
1923
htmlHint: 'html-hint',
2024
esLint: 'es-lint',
@@ -30,6 +34,7 @@ module.exports = {
3034
cleanBuild: 'clean-build',
3135
copyFolders: 'copy-folders',
3236
copyFoldersProduction: 'copy-folders-production',
37+
fileInclude: 'file-include',
3338
browserSync: 'browser-sync-server',
3439
watch: 'watch',
3540
},

gulpfile.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,19 @@
6565
}
6666
}
6767

68+
/**
69+
* template HTML
70+
*/
71+
72+
requireTask(`${cfg.task.fileInclude}`, `./${cfg.folder.tasks}/`, {
73+
templates: cfg.fileInclude.templates,
74+
dest: cfg.fileInclude.dest
75+
});
76+
6877
/**
6978
* Hint HTML
7079
*/
80+
7181
requireTask(`${cfg.task.htmlHint}`, `./${cfg.folder.tasks}/`);
7282

7383
/**
@@ -206,6 +216,7 @@
206216
requireTask(`${cfg.task.watch}`, `./${cfg.folder.tasks}/`, {
207217
sassFilesInfo: cfg.getPathesForSassCompiling(),
208218
src: cfg.folder.src,
219+
templates: cfg.folder.templates,
209220
dest: cfg.folder.build,
210221
imageExtensions: cfg.imageExtensions,
211222
browserSync: browserSync,
@@ -215,6 +226,7 @@
215226
buildCustomJs: cfg.task.buildCustomJs,
216227
buildSass: cfg.task.buildSass,
217228
esLint: cfg.task.esLint,
229+
fileInclude: cfg.task.fileInclude,
218230
htmlHint: cfg.task.htmlHint,
219231
imageMin: cfg.task.imageMin
220232
}
@@ -231,6 +243,7 @@
231243
cfg.task.buildSass,
232244
cfg.task.buildSassFiles,
233245
cfg.task.buildStylesVendors,
246+
cfg.task.fileInclude,
234247
cfg.task.htmlHint,
235248
cfg.task.esLint,
236249
cfg.task.imageMin
@@ -253,6 +266,7 @@
253266
cfg.task.buildSass,
254267
cfg.task.buildSassFiles,
255268
cfg.task.buildStylesVendors,
269+
cfg.task.fileInclude,
256270
cfg.task.htmlHint,
257271
cfg.task.imageMin
258272
),
@@ -274,6 +288,7 @@
274288
cfg.task.buildSassProd,
275289
cfg.task.buildSassFiles,
276290
cfg.task.buildStylesVendors,
291+
cfg.task.fileInclude,
277292
cfg.task.htmlHint,
278293
cfg.task.esLint,
279294
cfg.task.imageMin

index.html

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<!DOCTYPE html>
33
<html lang="en">
44

5-
<head>
5+
<head>
66
<meta charset="utf-8">
77
<meta name="viewport" content="width=device-width, initial-scale=1.0">
88
<title>Web Starter Kit</title>
@@ -13,12 +13,13 @@
1313
<body>
1414
<div id="wrapper">
1515
<div class="entry-section">
16-
<div id="home-canvas"></div>
17-
</div>
16+
<div id="home-canvas"></div>
17+
</div>
18+
1819
<section class="starter-box">
19-
<h1>JustCoded</h1>
20-
<p>Web Starter Kit</p>
21-
</section>
20+
<h1>JustCoded</h1>
21+
<p>Web Starter Kit</p>
22+
</section>
2223
</div>
2324
<script src="assets/js/vendor.min.js" defer></script>
2425
<script src="assets/js/app.js" defer></script>

0 commit comments

Comments
 (0)