psk-hugo v0.1.4
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
- MetaTags: Added support for canonical link, always pointing to himself
- MetaTags: now title supports seoTitle parameter
- FormBuilder: added support for "form alias" that fills the form's name attribute
- FormBuilder: added support for "subject" and "successPage" parameters
- FormBuilder: bugfixing on previous release
- 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.
- Added MetaTags partial
- Addeed MarkdownifyP and FormBuilder partials
- First Release