New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

html-templates

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

html-templates

Simple tool to define and reuse snippets of HTML in other files.

latest
npmnpm
Version
1.0.0
Version published
Weekly downloads
18
5.88%
Maintainers
1
Weekly downloads
 
Created
Source

HTML Templates

Simple tool to define and reuse snippets of HTML in other files.

npm i html-templates -g

Examples

config.json

{
    "source": "src",
    "templates": "src/templates",
    "output": "out"
}

src/templates/nav.html

<nav class="navbar">
    <a href="/">Home</a>
    <a href="/usage">Usage</a>
    <a href="/examples">Examples</a>
    <a href="/about">About</a>
</nav>

Use it in some other page

src/index.html

...
<body>
   {include "nav.html"}
   <h1>My Amazing Site</h1>
   ... 
</body>
...

You can now run hcc to "compile" your site and include all the templates, which will appear in the output folder.

All Special Tags

{include "template.html"}

Inserts the contents of the file inside the templates folder where you placed the include statement.

{less "filename.less"}

Compiles the LESS file to filename.css and places a css <link> tag where you placed the less statement.

{sass "filename.less"}

Compiles the sass file to filename.css and places a css <link> tag where you placed the less statement.

{markdown "filename.md"}

Compiles the markdown file and places the contents where you placed the markdown statement.

Live Development Server

Type hcc-server to start a localhost server on port 8080, where the site will be live updated when you save a source file.

Planned Features

  • TypeScript Compiling
  • Better Error Messages
  • Template Variables/Inputs
  • Webpack integration

FAQs

Package last updated on 29 Jul 2018

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