danielmoch.com

Static site for www.danielmoch.com
git clone git://git.danielmoch.com/danielmoch.com.git
Log | Files | Refs | LICENSE

commit dc0a466ea95b9d0e4ed5d7abaf9a2dbd044a751e
parent 080d6cf9dcd95ec1b6e4795e38a3fdfce51a62a6
Author: Daniel Moch <daniel@danielmoch.com>
Date:   Fri, 26 Nov 2021 13:20:00 -0500

Refactor templates

Diffstat:
MDagfile | 3++-
MMakefile | 12++++++++----
Dfiles/about/index.html | 89-------------------------------------------------------------------------------
Msrc/assets/css/site.scss | 24+++++++++++++++++++-----
Atemplates/about.html | 70++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Mtemplates/landing_header.html | 19++-----------------
Atemplates/nav.html | 19+++++++++++++++++++
Mtemplates/post_header.html | 17+----------------
8 files changed, 121 insertions(+), 132 deletions(-)

diff --git a/Dagfile b/Dagfile @@ -4,7 +4,8 @@ target "target" { suffix /index.html { require "templates/post_header.html" require "templates/post_footer.html" - filter 'm4 -DDESCRIPTION="$(lowdown -Xdescription -Tterm $<)" -DPAGE_TITLE="$(lowdown -Xtitle -Tterm $<)" -DSLUG=https://www.danielmoch.com/$(echo $< | sed "s/^src\///;s/\.md//")/ $1 >$>' + require "templates/nav.html" + filter 'm4 -I templates -DDESCRIPTION="$(lowdown -Xdescription -Tterm $<)" -DPAGE_TITLE="$(lowdown -Xtitle -Tterm $<)" -DSLUG=https://www.danielmoch.com/$(echo $< | sed "s/^src\///;s/\.md//")/ $1 >$>' filter "lowdown -Thtml $< >>$>" filter "cat <$2 >>$>" filter 'dagindex -A -a"$(lowdown -Xauthor -Tterm $<)" -c"$(lowdown -Xcategory -Tterm $<)" -d"$(lowdown -Xdescription -Tterm $<)" -p "$(lowdown -Xdate -Tterm $<)" -s $(echo $< | sed "s/^src\///;s/\.md//")/ -t "$(lowdown -Xtitle -Tterm $<)" -u $(stat -f%m $<)' diff --git a/Makefile b/Makefile @@ -3,11 +3,17 @@ all: dag target/index.html target/sitemap.xml target/rss.xml -target/index.html: index.db templates/landing_header.html templates/landing_footer.html - cat templates/landing_header.html >$@ +target/index.html: index.db target/about/index.html templates/landing_header.html templates/landing_footer.html + m4 -I templates templates/landing_header.html >$@ dagindex -Gohtml >>$@ cat templates/landing_footer.html >>$@ +target/about/index.html: templates/about.html templates/nav.html + dagindex -A -t "About" -s "about/" \ + -p $$(stat -f%m templates/about.html) -x 1 + mkdir -p target/about + m4 -I templates templates/about.html >$@ + target/sitemap.xml: index.db dagindex -Gositemap -f https://www.danielmoch.com >$@ @@ -18,8 +24,6 @@ target/rss.xml: index.db dag: dag - dagindex -A -t "About" -s "about/" \ - -p $$(stat -f%m files/about/index.html) -x 1 serve: python3 -m http.server -d target -b 127.0.0.1 8000 diff --git a/files/about/index.html b/files/about/index.html @@ -1,89 +0,0 @@ -<!DOCTYPE html> -<html prefix="og: http://ogp.me/ns# article: http://ogp.me/ns/article#" vocab="http://ogp.me/ns" lang="en"> -<head> - <meta charset="utf-8"> - <meta http-equiv="X-UA-Compatible" content="IE=edge"> - <meta name="viewport" content="width=device-width, initial-scale=1"> - <title>About | Daniel Moch's Weblog</title> - <link href="/assets/css/site.css" rel="stylesheet" type="text/css"> - <meta name="theme-color" content="#155799"> - <meta name="generator" content="dag (git.danielmoch.com/dag)"> - <link rel="alternate" type="application/rss+xml" title="RSS" hreflang="en" href="/rss.xml"> - <link rel="canonical" href="SLUG"> - <link rel="icon" href="/favicon.ico" sizes="16x16"> - <link rel="icon" href="/favicon.ico" sizes="32x32"> - <link rel="icon" href="/favicon.ico" sizes="48x48"> - <link rel="icon" href="/favicon.ico" sizes="64x64"> - <link rel="icon" href="/favicon.ico" sizes="256x256"> - <meta property="og:site_name" content="Daniel Moch's Weblog"> - <meta property="og:title" content="About"> - <meta property="og:type" content="article"> - <meta property="og:image" content="https://www.danielmoch.com/assets/initials-blue.jpg"> - <meta name="twitter:image" content="https://www.danielmoch.com/assets/initials-blue.jpg"> - <meta name="twitter:card" content="About Daniel Moch"> -</head> -<body> - <header> - <nav> - <table> - <tr> - <td> - <img src="/assets/initials-blue.png" alt="Daniel Moch's Weblog"> - <a href="/">Home</a> - | - <a href="https://git.danielmoch.com">Git</a> - | - <a href="/about/">About</a> - </td> - </tr> - </table> - </nav> - </header> - <div id="main"> - <h1>About Me</h1> - <div class="h-card"> - <img class="u-photo" src="/assets/avatar.jpg" id="logo" alt="Daniel Moch"> - <h2 class="p-name">Daniel Moch</h1> - <div class="p-note"> - I am a <span class="p-job-title">Software Engineer</span> currently living in - Orlando, Florida. My interests range from technology to entrepreneurship. I - am also interested in writing, movies, and astronomy. I'm also passionate - about seeing people take control of their own data. - </div> - <table style="width: auto; margin: 1em 2em;"> - <tr> - <td>Email:</td> - <td><a class="u-email" rel="me" href="mailto:daniel@danielmoch.com">daniel@danielmoch.com</a></td> - </tr> - <tr> - <td>Github:</td> - <td><a class="u-url" rel="me" href="https://github.com/djmoch">djmoch</a></td> - </tr> - <tr> - <td>PGP:</td> - <td><a class="u-url" rel="me" href="/static/gpg.asc">84BDDD43</a></td> - </tr> - <tr> - <td>Signify:</td> - <td><a class="u-url" rel="me" href="/static/djmoch-signify.pub">djmoch-signify.pub</a></td> - </tr> - <tr> - <td>Social Media:</td> - <td><a href="https://www.amazon.com/Arguments-Deleting-Social-Media-Accounts/dp/1250239087">deleted</a></td> - </tr> - </table> - </div> - <h2>License Info</h2> - <table style="width: auto; margin: 1em 2em;"> - <tr> - <td>Content: </td> - <td><a href="https://creativecommons.org/licenses/by-sa/4.0/">CC BY-SA 4.0</a></td> - </tr> - <tr> - <td>Code: </td> - <td><a href="https://git.danielmoch.com/danielmoch.com/file/LICENSE.html">ISC</a></td> - </tr> - </table> - </div> -</body> -</html> diff --git a/src/assets/css/site.scss b/src/assets/css/site.scss @@ -2,11 +2,14 @@ nav, #main { font-family: sans-serif; max-width: 80ex; margin: 0px auto; - text-align: justify; } h1, h2, h3 { font-family: serif; + + code { + display: inline; + } } table { @@ -42,13 +45,24 @@ code { border-radius: 5px; } -p code { - border: initial; - border-radius: initial; - display: inline; +p { + code { + border: initial; + border-radius: initial; + display: inline; + } } blockquote { padding: 10px 20px; border-left: 5px solid #eee; } + +.subtle { + color: #000; + text-decoration: none; +} + +.subtle:hover { + text-decoration: underline; +} diff --git a/templates/about.html b/templates/about.html @@ -0,0 +1,70 @@ +<!DOCTYPE html> +<html prefix="og: http://ogp.me/ns# article: http://ogp.me/ns/article#" vocab="http://ogp.me/ns" lang="en"> +<head> + <meta charset="utf-8"> + <meta http-equiv="X-UA-Compatible" content="IE=edge"> + <meta name="viewport" content="width=device-width, initial-scale=1"> + <title>About | Daniel Moch's Weblog</title> + <link href="/assets/css/site.css" rel="stylesheet" type="text/css"> + <meta name="theme-color" content="#155799"> + <meta name="generator" content="dag (git.danielmoch.com/dag)"> + <link rel="alternate" type="application/rss+xml" title="RSS" hreflang="en" href="/rss.xml"> + <link rel="canonical" href="SLUG"> + <link rel="icon" href="/favicon.ico" sizes="16x16"> + <link rel="icon" href="/favicon.ico" sizes="32x32"> + <link rel="icon" href="/favicon.ico" sizes="48x48"> + <link rel="icon" href="/favicon.ico" sizes="64x64"> + <link rel="icon" href="/favicon.ico" sizes="256x256"> + <meta property="og:site_name" content="Daniel Moch's Weblog"> + <meta property="og:title" content="About"> + <meta property="og:type" content="article"> + <meta property="og:image" content="https://www.danielmoch.com/assets/initials-blue.jpg"> + <meta name="twitter:image" content="https://www.danielmoch.com/assets/initials-blue.jpg"> + <meta name="twitter:card" content="About Daniel Moch"> +</head> +<body> +include(nav.html) + <div id="main"> + <h1>About Me</h1> + <div class="h-card"> + <img class="u-photo" src="/assets/avatar.jpg" id="logo" alt="Daniel Moch"> + <h2 class="p-name">Daniel Moch</h1> + <div class="p-note"> + I am a <span class="p-job-title">Software Engineer</span> currently living in + Orlando, Florida. My interests range from technology to entrepreneurship. I + am also interested in writing, movies, and astronomy. I'm also passionate + about seeing people take control of their own data. + </div> + <table style="width: auto; margin: 1em 2em;"> + <tr> + <td>Email:</td> + <td><a class="u-email" rel="me" href="mailto:daniel@danielmoch.com">daniel@danielmoch.com</a></td> + </tr> + <tr> + <td>PGP:</td> + <td><a class="u-url" rel="me" href="/static/gpg.asc">84BDDD43</a></td> + </tr> + <tr> + <td>Signify:</td> + <td><a class="u-url" rel="me" href="/static/djmoch-signify.pub">djmoch-signify.pub</a></td> + </tr> + <tr> + <td>Social Media:</td> + <td><a href="https://www.amazon.com/Arguments-Deleting-Social-Media-Accounts/dp/1250239087">deleted</a></td> + </tr> + </table> + </div> + <h2>License Info</h2> + <table style="width: auto; margin: 1em 2em;"> + <tr> + <td>Content: </td> + <td><a href="https://creativecommons.org/licenses/by-sa/4.0/">CC BY-SA 4.0</a></td> + </tr> + <tr> + <td>Code: </td> + <td><a href="https://git.danielmoch.com/danielmoch.com/file/LICENSE.html">ISC</a></td> + </tr> + </table> + </div> +</body> +</html> diff --git a/templates/landing_header.html b/templates/landing_header.html @@ -26,21 +26,6 @@ <meta name="twitter:card" content="summary"> </head> <body> - <header> - <nav> - <table> - <tr> - <td> - <img src="/assets/initials-blue.png" alt="Daniel Moch's Weblog"> - <a href="/">Home</a> - | - <a href="https://git.danielmoch.com">Git</a> - | - <a href="/about/">About</a> - </td> - </tr> - </table> - </nav> - </header> +include(nav.html) <div id="main"> - <h1>Daniel Moch's Weblog</h1> + <h1><a class="subtle h-card" href="/about/">Daniel Moch</a>'s Weblog</h1> diff --git a/templates/nav.html b/templates/nav.html @@ -0,0 +1,19 @@ + <header> + <nav> + <table> + <tr> + <td align="left"> + <img src="/assets/initials-blue.png" alt="Daniel Moch's Weblog"> + <a href="/">Home</a> + | + <a href="https://git.danielmoch.com">Git</a> + </td> + <td align="right"> + <a class="u-url" rel="me" href="https://github.com/djmoch">GitHub</a> + | + <a href="/about/">About</a> + </td> + </tr> + </table> + </nav> + </header> diff --git a/templates/post_header.html b/templates/post_header.html @@ -24,22 +24,7 @@ <meta name="twitter:card" content="DESCRIPTION"> </head> <body> - <header> - <nav> - <table> - <tr> - <td> - <img src="/assets/initials-blue.png" alt="Daniel Moch's Weblog"> - <a href="/">Home</a> - | - <a href="https://git.danielmoch.com">Git</a> - | - <a href="/about/">About</a> - </td> - </tr> - </table> - </nav> - </header> +include(nav.html) <div id="main"> <article class="h-entry"> <h1 class="p-name">PAGE_TITLE</h1>