Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

handlebars-by-pug

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

handlebars-by-pug

Pug mixins for the outputting of the Handlebars code instead of plain HTML.

  • 0.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

Handlebars by Pug

Pug mixins for the outputting of the Handlebars code instead of plain HTML.

Installation

npm i handlebars-by-pug -D -E

Functionality

Will work with plain Handlebars

HandlebarsCondition
dl

  dt.MemberProfile-Profile-KeyCell Full Name
  dd.MemberProfile-Profile-ValueCell {{ fullName }}

  +HandlebarsCondition("phoneNumber")
    dt.MemberProfile-Profile-KeyCell Phone number
    dd.MemberProfile-Profile-ValueCell {{ phoneNumber }}

Output (manually formatted):

<dl>
    
  <dt class="MemberProfile-Profile-KeyCell">Full Name</dt>
  <dd class="MemberProfile-Profile-ValueCell">{{ fullName }}</dd>
    
  {{#if phoneNumber}}
    <dt class="MemberProfile-Profile-KeyCell">Phone number</dt>
    <dd class="MemberProfile-Profile-ValueCell">{{ phoneNumber }}</dd>
  {{/if}}
    
</dl>
HandlebarsIteration
+HandlebarsCondition("items")
  
  ul
  
    +HandlebarsIteration("items")
    
      li {{ this }}

Output (manually formatted):

{{#if items}}
  <ul>
    {{#each items}}
      <li>{{ this }}</li>
    {{/each}}
  </ul>
{{/if}}
HandlebarsHelper
+HandlebarsHelper("unless", "license")
  p WARNING: This entry does not have a license!

Output (manually formatted):

{{#unless license}}
    <p>WARNING: This entry does not have a license!</p>
{{/unless}}

Depends on @yamato-daiwa/handlebars-extensions

npm i @yamato-daiwa/handlebars-extensions -E

AreStringsEqual--HandlebarsHelper

dl

  dt Full Name
  dd {{ fullName }}

  +HandlebarsHelper("isNonEmptyObject", "socialNetworkProfilesURIs")
  
    dt Social networks
    dd
  
      ul
        +HandlebarsIteration("socialNetworkProfilesURIs")
          li
  
            +AreStringsEqual--HandlebarsHelper("@key", "facebook")
              a(href=`{{ this }}`)
                svg
                  // The SVG code of teh Facebook icon ... 
  
            +AreStringsEqual--HandlebarsHelper("@key", "instagram")
              a(href=`{{ this }}`)
                svg
                  // The SVG code of teh Instagram icon ...
  
            +AreStringsEqual--HandlebarsHelper("@key", "twitter")
              a(href=`{{ this }}`)
                svg
                  // The SVG code of teh Twitter icon ...

Output (manually formatted):

<dl>
    
  <dt>Full Name</dt>
  <dd>{{ fullName }}</dd>
    
  {{#isNonEmptyObject socialNetworkProfilesURIs}}
    <dt>Social networks</dt>
    <dd>
      <ul>
           
        {{#each socialNetworkProfilesURIs}}
           
          <li>
              
            {{#areStringsEqual @key "facebook"}}
              <a href="{{ this }}">
                <svg>
                  <!-- The SVG code of teh Facebook icon ... -->
                </svg>
              </a>
            {{/areStringsEqual}}
                 
            {{#areStringsEqual @key "instagram"}}
             <a href="{{ this }}">
              <svg>
                <!-- The SVG code of teh Instagram icon ...-->
              </svg>
             </a>
            {{/areStringsEqual}}
              
            {{#areStringsEqual @key "twitter"}}
              <a href="{{ this }}">
                <svg>
                  <!-- The SVG code of teh Twitter icon ...-->
                </svg>
              </a>
            {{/areStringsEqual}}
              
          </li>
        
        {{/each}}
          
      </ul>
        
    </dd>
  {{/isNonEmptyObject}}
    
</dl>

Keywords

FAQs

Package last updated on 14 Oct 2023

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