Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/alesanchezr/html-template-engine
Pure HTML template engine, no need for any other language or knowledge.
https://github.com/alesanchezr/html-template-engine
html html-include html-require html-template template-engine template-engine-html
Last synced: 14 days ago
JSON representation
Pure HTML template engine, no need for any other language or knowledge.
- Host: GitHub
- URL: https://github.com/alesanchezr/html-template-engine
- Owner: alesanchezr
- Created: 2018-03-21T17:33:28.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2024-02-08T03:17:11.000Z (9 months ago)
- Last Synced: 2024-10-10T18:33:32.971Z (27 days ago)
- Topics: html, html-include, html-require, html-template, template-engine, template-engine-html
- Language: JavaScript
- Homepage: https://alesanchezr.github.io/html-template-engine/demo/
- Size: 43 KB
- Stars: 6
- Watchers: 3
- Forks: 20
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# HTML Template Engine [(live demo)](https://alesanchezr.github.io/html-template-engine/demo/)
Include other files into your current file:
```html
```## Instalation
- Using NPM
```sh
$ npm install html-template-engine --save
```
- Or using a **simple script tag** before your body closing tag and use the **autoload** feature to avoid using any Javascript whatsoever.
```html```
Important! Please notice the **?autoload** at the end of the script url, [here is the library code](../../tree/master/dist)## Usage (Remember to install the library first)
On your HTML paste the following code whenever you want to include another html file (nested calls are supported since version 0.0.5)
```html
```Only for NPM installations:
```js
import TemplateManager from 'html-template-engine';//if you want to load the templates when the website finishes loading
window.onload = function(){ TemplateManager.start(); }
```### Additional Available Params
1. Log on the console all the pieces being loaded into the html
```html
```2. Set a base template path for all your url's
```html
...
```## Authors
| ![Alejandro Sanchez](https://www.gravatar.com/avatar/92dc7ea3850dea745ac8a4932583827d?s=20) | Alejandro Sanchez | [@alesanchezr](https://twitter.com) | [alesanchezr.com](https://alesanchezr.com) |
|---------------------------------------------------------------------------------------------|-------------------|-------------------------------------|--------|