Web

Hugo Forms PHP

Wanna add some simple forms and process the Content with PHP ? 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 Post without " " between { and { { {<rawhtml>} } <form action="/welcome.php" method="post"> Name: <input type="text" name="name"><br> E-mail: <input type="text" name="email"><br> <input type="submit"> </form> { {</rawhtml>} } Example Name: E-mail: sha256: 5b73134398129eadc6ca2b6661d2ef98cedc91548cae817c1c5cefb0a7fc71ff

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 ?? 2021-06-16 06:41:54 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 ?