Socket
Socket
Sign inDemoInstall

gulp-advanced-include-template

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gulp-advanced-include-template

extend or include html file using gulp


Version published
Weekly downloads
5
Maintainers
1
Weekly downloads
 
Created
Source

gulp-advanced-include-template

Easiest way to extend or include html file using gulp.

example

gulpfile.js

const gulp = require('gulp');
const includeTemplate = require('gulp-advanced-include-template');

gulp.task('test', function() {
	gulp.src('./demo/src/index.html')
		.pipe(includeTemplate())
		// .pipe(htmlmin())
		.pipe(gulp.dest('./demo/dist/'))
});

index.html

<t-include src="./layout.html"
	title="gulp-advanced-include-template"
	css="global.css | index.css"
	js="global.js | index.js">

	<div>hello, world!</div>

</t-include>

layout.html

<!DOCTYPE html>
<html>
<head>
	<title><%= title %></title>
	<!-- @foreach(css) -->
	<link rel="stylesheet" href="<%= item %>">
	<!-- @endforeach -->
</head>
<body>
	<!-- slot area -->
	<t-slot></t-slot>

	<!-- @foreach(js) -->
	<script src="<%= item %>"></script>
	<!-- @endforeach -->
</body>
</html>

index-parsed.html

<html>
<head>
	<title>gulp-advanced-include-template</title>

	<link rel="stylesheet" href="global.css">
	<link rel="stylesheet" href="index.css">
</head>
<body>
	<div>hello, world!</div>

	<script src="global.js"></script>
	<script src="index.js"></script>
</body>
</html>

Keywords

FAQs

Package last updated on 06 Dec 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc