klei/gulp-inject

Inject part of a file

tadward opened this issue · 1 comments

Is it possible to inject part of a file?

Yes. this is a useful feature. Maybe like this.

source html file:

<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title></title>
</head>
<body>

	<!-- partial:partA -->
	<div>
		this is part A.
	</div>
	<!-- endpartial -->

	<!-- partial:partB -->
	<div>
		this is part B.
	</div>
	<!-- endpartial -->
	
</body>
</html>

index.html

<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title></title>
</head>
<body>

	<!-- inject:partA -->
	<!-- endinject -->

	<!-- inject:partB -->
	<!-- endinject -->
	
</body>
</html>