hugo

Hugo Copy Button

I like Websites with the Copy Button for certain Snippets. Why not integrate into the own Blog ? Folder, Copy JS Stuff Change to Hugo Root Folder mkdir -p static/js/ cat << 'EOF' > static/js/copy-code.js (function() { 'use strict'; if(!document.queryCommandSupported('copy')) { return; } function flashCopyMessage(el, msg) { el.textContent = msg; setTimeout(function() { el.textContent = "Copy"; }, 1000); } function selectText(node) { var selection = window.getSelection(); var range = document.createRange(); range.selectNodeContents(node); selection.

Comments

just trying a new feature for leaving comments … it’s selfhosted, done with isso and quite painfull to install :( some people may like to provide feedback, ask questions, … sha256: fed502f0a96744470fa42b910138efed8d462ce13a2f5329c61ad23fc133281e

Hugo Forms PHP

Wanna add some simple forms and process the Content with PHP ? Add RawHTML Template if not yet done mkdir layouts/shortcodes/ cat << 'EOF' > layouts/shortcodes/rawhtml.html <!-- raw html --> {{.Inner}} EOF Create Script cat << 'EOF' > static/welcome.php <html> <body> Welcome <?php echo $_POST["name"]; ?><br> Your email address is: <?php echo $_POST["email"]; ?> </body> </html> EOF Create new Post and add rawhtml without " " between { and {

HugoIO Templates

Custom Template Stuff mkdir -p layouts/shortcodes cat << 'EOF' > layouts/shortcodes/date.html {{ now.Format "2006-01-02 03:04:05" }} EOF Insert Code in Template current date ? { {< date >} } Result ? current date ?? 2022-06-28 11:03:09 Add RawHTML Create Template cat << 'EOF' > layouts/shortcodes/rawhtml.html <!-- raw html --> {{.Inner}} EOF Add Code { {< rawhtml >} } <p class="speshal-fancy-custom"> This is <strong>raw HTML</strong>, inside Markdown. </p> { {< /rawhtml >} } Result ?

Update_hugo

how to update hugo you can use ports (pkg_add hugo) and get the lastest stable hugo package based on OpenBSD release cycles (2 x year), or grab the latest binary from github and put it on your machine. Releases: https://github.com/gohugoio/hugo/releases cd /tmp ftp https://github.com/gohugoio/hugo/releases/download/v0.62.0/hugo_0.62.0_OpenBSD-64bit.tar.gz tar xfz hugo_0.62.0_OpenBSD-64bit.tar.gz doas mv hugo /usr/local/bin/ or find latest automatically doas su - cd /tmp/ u=$(lynx -dump -listonly https://github.com/gohugoio/hugo/releases/latest |grep "OpenBSD-64bit" |sed 's/.*https/https/') f=$(echo $u |sed 's/.