Socket
Book a DemoInstallSign in
Socket

psk-hugo

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

psk-hugo

PositionerStarterKit for Hugo

latest
npmnpm
Version
0.1.4
Version published
Maintainers
1
Created
Source

PSK - Hugo

Positioner Starter Kit for Hugo websites.

This package includes a set of helpers to develop websites with Hugo

Partials

psk/FormBuilder

Given a formObject containing form/fields parameters it will output a complete and working form, see below a sample of a formObject with all parameters currently supported.

form:
  alias: contact-form
  title: Contact form
  subject: Contact form
  successPage: /en/thank-you/
  submitLabel: Submit
  requiredFieldsLabel: Required fields
  fields:
  - label: First name
    type: text
    alias: firstName
    required: true
  - label: E-Mail
    type: email
    alias: email
    required: true
  - label: Message
    type: textarea
    alias: message
    required: true
  - label: DatePicker
    type: datepicker
    alias: dp1
    required: true
  - label: DDL Field
    type: dropdownlist
    alias: ddlField
    required: true
    items:
      - text: please select
      - text: Item 1
        value: item-1
      - text: Item 2
        value: item-2
  - label: I consent the <a href="#some-url" target="_blank">Terms & Condiitons</a>
    type: checkbox
    alias: termsConditions
    required: true

psk/GetParamML

Usefull only for multilingual website, tries to retrieve a parameter from current language, if the parameter is not available will fallback to default language.

psk/MarkdownifyP

Renders a text that may have multiple lines, forcing to always be enclosed inside a [p] tag. Standard markdownify will add [p] tags only if the text has multiple paragraphs, and avoid adding the tag if there's only one paragraph. This partial will verify if there is only one paragraph and add the missing [p] tag

Contrusctor

{{ $paramVal := partial "psk/GetParamML" (dict "context" . "paramKey" "key")}}

psk/MetaTags

Handles title, description and open graph meta tags. the supported parameters are:

  • title: default title of the page
  • seoTitle: will overwrite the "title" param, is used for the [title] and [og:title] tag
  • seoDescription: used for meta tag [description] and [og:description]

Release notes

0.1.4 - 31.05.2023

  • MetaTags: Added support for canonical link, always pointing to himself
  • MetaTags: now title supports seoTitle parameter

0.1.3 - 01.07.2021

  • FormBuilder: added support for "form alias" that fills the form's name attribute

0.1.2 - 30.06.2021

  • FormBuilder: added support for "subject" and "successPage" parameters

0.1.1 - 18.05.2021

  • FormBuilder: bugfixing on previous release

0.1.0 - 18.05.2021

  • FormBuilder: Added field types DDL and DatePicker
  • FormBuilder constructor has changed! When updating you must update the constructor where the partial is already being used.

0.0.3 - 05.05.2021

  • Added MetaTags partial

0.0.2 - 15.04.2021

  • Addeed MarkdownifyP and FormBuilder partials

0.0.1 - 09.04.2021

  • First Release

FAQs

Package last updated on 31 May 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