Latest Threat Research:SANDWORM_MODE: Shai-Hulud-Style npm Worm Hijacks CI Workflows and Poisons AI Toolchains.Details
Socket
Book a DemoInstallSign in
Socket

handlebars-helper-autolink

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

handlebars-helper-autolink

{{autolink}} handlebars helper. Generate relative links from the "current page" to other dest pages.

latest
Source
npmnpm
Version
0.1.1
Version published
Weekly downloads
11
450%
Maintainers
1
Weekly downloads
 
Created
Source

Generate relative links from the "current page" to other dest pages.

Installation

Use npm to install the package: npm i handlebars-helper-autolink.

Register the helper

In your project's Gruntfile, to register the helper add handlebars-helper-autolink to the helpers property in the Assemble task or target options:

grunt.initConfig({
  assemble: {
    options: {
      // the 'handlebars-helper-autolink' npm module must also be listed in
      // devDependencies for assemble to automatically resolve the helper
      helpers: ['handlebars-helper-autolink', 'foo/*.js']
    },
    files: {
      'dist/': ['src/templates/*.hbs']
    }
  }
});

Alternatively, you can avoid defining the helper in the Assemble task options by adding module to both the devDependencies and keywords in your project's package.json.

{
  "name": "foo",
  "version": "0.1.0",
  "devDependencies": {
    "handlebars-helper-autolink": "*"
  },
  "keywords": [
    "handlebars-helper-autolink"
  ]
}

Usage

With the helper registered, you may now begin using it in your templates.

In a "page"

{{#each pages}}
  <a href="{{autolink}}">{{data.title}}</a>
{{/each}}

In a "layout"

{{#each pages}}
  <a href="{{autolink}}">{{../title}}</a>
{{/each}}

Author

Jon Schlinkert

Licensed under the MIT License Copyright (c) Jon Schlinkert, contributors.

Keywords

assemble

FAQs

Package last updated on 05 Dec 2013

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