psk-hugo

0.1.4 • Public • Published

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

Readme

Keywords

none

Package Sidebar

Install

npm i psk-hugo

Weekly Downloads

0

Version

0.1.4

License

ISC

Unpacked Size

9.02 kB

Total Files

9

Last publish

Collaborators

  • jpinto3488