Create a lambda function to send the contact message Setup SES and verify sender email address Create an IAM role for lambda with policy details below { "Version": "2012-10-17", "Statement": [ { "Sid": "VisualEditor0", "Effect": "Allow", "Action": [ "ses:SendEmail", "logs:CreateLogStream", "logs:PutLogEvents" ], "Resource": "*" } ] } Create the lambda function const aws = require("aws-sdk"); const ses = new aws.SES({ region: "ap-southeast-2" }); exports.handler = async function (event) { console.log('EVENT: ', event) // Extract the properties from the event body try { const { senderEmail, senderName, message } = JSON.
Enable support of raw html Hugo disables html element rendering by default, we need to enable it.
Enable for an entire site Add below in the config file
[markup.goldmark.renderer] unsafe= true Enable for a single page Create layout/shortcodes/unsafe.html with the following content: {{ .Inner }}
In the markdown page, use it like this,
{{< unsafe >}} <ul> <li>First item</li> <li>Second item <li>Third item</li> </ul> {{< /unsafe >}} above will be rendered like this, First item Second item Third item Reference How To Escape Shortcode In Hugo Template Configure Markup Create Your Own Shortcodes Enable unsafe=true for a single page
Install hugo on Centos7 Add epel repo The Hugo package can be found at https://copr.fedorainfracloud.org/coprs/daftaupe/hugo/, take the correct version, and place it in /etc/yum.repos.d/hugo.repo
vim /etc/yum.repos.d/hugo.repo # add content below the file [copr:copr.fedorainfracloud.org:daftaupe:hugo] name=Copr repo for hugo owned by daftaupe baseurl=https://download.copr.fedorainfracloud.org/results/daftaupe/hugo/epel-7-$basearch/ type=rpm-md skip_if_unavailable=True gpgcheck=1 gpgkey=https://download.copr.fedorainfracloud.org/results/daftaupe/hugo/pubkey.gpg repo_gpgcheck=0 enabled=1 enabled_metadata=1 Install yum -y install hugo hugo version Quick start # Create a new site hugo new site mysite # Add a Theme cd mysite git init git submodule add https://github.