diff options
| author | Alexander Kavon <me+git@alexkavon.com> | 2025-07-05 15:58:46 -0400 |
|---|---|---|
| committer | Alexander Kavon <me+git@alexkavon.com> | 2025-07-05 15:58:46 -0400 |
| commit | 9557c4ca3c1d8944672a281ef0de6f8daef132b9 (patch) | |
| tree | 0e9591fd7cb18c3f9ee2998573976d3741916cab | |
| parent | a9608134cf2402fb0e6d9405e96db9dc92ed4849 (diff) | |
use page template for index
| -rw-r--r-- | static/contact.xsl | 19 | ||||
| -rw-r--r-- | static/index.html | 41 | ||||
| -rw-r--r-- | static/index.xml | 4 | ||||
| -rw-r--r-- | static/index.xsl | 16 | ||||
| -rw-r--r-- | static/templates.xsl | 37 |
5 files changed, 63 insertions, 54 deletions
diff --git a/static/contact.xsl b/static/contact.xsl index 505d534..aa814d0 100644 --- a/static/contact.xsl +++ b/static/contact.xsl @@ -8,19 +8,18 @@ <xsl:param name="title"> <xsl:text>Contact</xsl:text> </xsl:param> + <xsl:param name="message-placeholder"> + <xsl:text>you@ema.il + +Hey I think I might build an idol and start worshiping you. Which of the following materials would please you? Gold, Silver,...</xsl:text> + </xsl:param> + <xsl:param name="content"> <form id="contact-form" method="POST" action="/contact"> <label> - Name - <input id="name_in" type="text" name="name" placeholder="Name" /> - </label> - <label> - Email - <input id="email_in" type="email" name="email" placeholder="you@ema.il" /> - </label> - <label> - Message - <textarea id="message_in" name="message" placeholder="What's up bud?"></textarea> + Send me a message + <textarea id="message_in" name="message" placeholder="{$message-placeholder}" rows="5"></textarea> + <small>Follow the template instructions or be sent to the trash!</small> </label> <button type="submit">Transmit</button> </form> diff --git a/static/index.html b/static/index.html deleted file mode 100644 index 289545e..0000000 --- a/static/index.html +++ /dev/null @@ -1,41 +0,0 @@ -<!DOCTYPE html> -<html> - <head> - <title>Alexander F. Kavon</title> - <link rel="stylesheet" href="/css/main.css" /> - <style> - * { - color: #333; - } - .icon { - width: 24px; - height: 24px; - stroke: currentColor; - stroke-width: 2px; - stroke-linecap: round; - stroke-linejoin: round; - fill: none; - } - </style> - </head> - <body> - <div class="nav-hover-head"> - <img alt="smiling" src="/images/smiling-head.png" /> - </div> - <nav id="navigation"> - <ul> - <li><a href="/log">Log (thoughts, photos, videos, sturdy timber, et al.)</a></li> - <li><a href="/contact">Contact</a></li> - <li><a href="/stand-up">Stand-up Comedy</a></li> - <li><a target="_blank" href="http://hivemindcomedy.com"><img class="icon" src="/icons/video.svg#video"></img>Hive Mind Comedy (sketches)</a></li> - <li><a target="_blank" href="https://gitlab.com/alexkavon"><img class="icon" src="/icons/gitlab.svg#gitlab"></img>Code</a></li> - </ul> - </nav> - <nav id="navigation-social-media"> - <ul> - <li><a target="_blank" href="https://instagram.com/afk_comedy"><img class="icon" src="/icons/instagram.svg#instagram"></img></a></li> - <li><a target="_blank" href="https://github.com/lgtmak"><img class="icon" src="/icons/github.svg#github"></img></a></li> - </ul> - </nav> - </body> -</html> diff --git a/static/index.xml b/static/index.xml new file mode 100644 index 0000000..f05b31c --- /dev/null +++ b/static/index.xml @@ -0,0 +1,4 @@ +<?xml version="1.0"?> +<?xml-stylesheet type="text/xsl" href="index.xsl"?> +<root> +</root> diff --git a/static/index.xsl b/static/index.xsl new file mode 100644 index 0000000..d457e11 --- /dev/null +++ b/static/index.xsl @@ -0,0 +1,16 @@ +<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> + <xsl:output method="html" indent="yes" /> + <xsl:include href="templates.xsl" /> + + <xsl:param name="content"> + <div class="nav-hover-head"> + <img alt="smiling" src="/images/smiling-head.png" /> + </div> + </xsl:param> + + <xsl:template match="/"> + <xsl:call-template name="page"> + <xsl:with-param name="content" select="$content" /> + </xsl:call-template> + </xsl:template> +</xsl:stylesheet> diff --git a/static/templates.xsl b/static/templates.xsl index 204485a..9f022ad 100644 --- a/static/templates.xsl +++ b/static/templates.xsl @@ -1,13 +1,24 @@ <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:param name="title" /> <xsl:param name="icon" /> + <xsl:template name="icon-title"> + <xsl:if test="normalize-space($icon)"> + <img class="icon" src="/icons/{$icon}.svg#{$icon}" /><xsl:text> </xsl:text> + </xsl:if> + <xsl:if test="normalize-space($title)"> + <xsl:value-of select="$title" /> + </xsl:if> + </xsl:template> <xsl:template name="head"> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <meta name="viewport" content="width=device-width, initial-scale=1" /> <title> - <xsl:value-of select="$title" /> + <xsl:if test="normalize-space($title)"> + <xsl:value-of select="$title" /> |<xsl:text> </xsl:text> + </xsl:if> + Alexander F. Kavon </title> <link rel="stylesheet" @@ -16,6 +27,22 @@ </head> </xsl:template> + <xsl:template name="navigation"> + <aside> + <nav id="navigation"> + <ul> + <li><a href="/log">Log (thoughts, photos, videos, sturdy timber, et al.)</a></li> + <li><a href="/contact">Contact</a></li> + <li><a href="/stand-up">Stand-up Comedy</a></li> + <li><a target="_blank" href="http://hivemindcomedy.com"><img class="icon" src="/icons/youtube.svg#youtube"></img>Hive Mind Comedy (sketches)</a></li> + <li><a target="_blank" href="https://gitlab.com/alexkavon"><img class="icon" src="/icons/gitlab.svg#gitlab"></img>Code</a></li> + <li><a target="_blank" href="https://instagram.com/afk_comedy"><img class="icon" src="/icons/instagram.svg#instagram"></img></a></li> + <li><a target="_blank" href="https://github.com/lgtmak"><img class="icon" src="/icons/github.svg#github"></img></a></li> + </ul> + </nav> + </aside> + </xsl:template> + <xsl:template name="page"> <xsl:param name="content" /> @@ -25,8 +52,12 @@ </xsl:call-template> <body> - <h1><img class="icon" src="/icons/{$icon}.svg#${icon}" /><xsl:text> </xsl:text><xsl:value-of select="$title" /></h1> - <hr /> + <xsl:call-template name="navigation" /> + + <xsl:if test="normalize-space($title)"> + <h1><xsl:call-template name="icon-title" /></h1> + <hr /> + </xsl:if> <xsl:copy-of select="$content" /> </body> </html> |
