hugo

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 { {< 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:

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 ?? 2020-07-10 02:02:51 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 ?