Created
September 12, 2019 12:59
-
-
Save sarvar/8ae17928c2c1c04937dd039ff58ed7c0 to your computer and use it in GitHub Desktop.
The Simplest Ways to Handle HTML Includes
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
| var fileinclude = require('gulp-file-include'), | |
| gulp = require('gulp'); | |
| gulp.task('fileinclude', function() { | |
| gulp.src(['index.html']) | |
| .pipe(fileinclude({ | |
| prefix: '@@', | |
| basepath: '@file' | |
| })) | |
| .pipe(gulp.dest('./')); | |
| }); |
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
| <body> | |
| @@include('./header.html') | |
| Content | |
| @@include('./footer.html') | |
| </body> |
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
| npm i gulp-file-include |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment