~dricottone/blog

7790daaad6b15e48089dfc79a7a7bb0a09d31bd4 — Dominic Ricottone 2 years ago b243021
Multiple design changes

Refactored header and footer into distinct partials. Also centralized
the CSS for these sections.

Refactored blog post lists into a partial.

Refactored blog HTML and CSS to be more universally clear across my
domains.
M layouts/_default/baseof.html => layouts/_default/baseof.html +3 -11
@@ 6,19 6,11 @@
    {{ partial "navi.html" . }}
  </div>
  <main>
    <table id="header">
      <tbody>
        <tr><td class="main">Dominic Ricottone</td></tr>
        <tr><td class="sub">Personal Blog and CV</td></tr>
      </tbody>
    </table>
    <div id="content">
      {{ block "main" . }}{{ end }}
    </div>
    {{ partial "header.html" . }}
    {{ block "main" . }}{{ end }}
  </main>
  <div id="footer">
    generated by <a href="https://gohugo.io/">Hugo</a> at {{ now.Format "2006-01-02 13:04:05 MST" }}
    {{ partial "footer.html" . }}
  </div>
</body>
</html>


M layouts/_default/list.html => layouts/_default/list.html +14 -17
@@ 1,20 1,17 @@
{{ define "main" }}
<!-- content/<collection>/_index.md -->
<article>
  {{ .Content }}
</article>
<div id="blog-content">

<ul id="list-posts">
  <!-- content/<collection>/*.md -->
  {{ range .Pages }}
  <li>
    <h2><a href="{{ .Permalink }}">{{ .Title }}</a></h2>
    <div class="post">
      <p><i>posted on {{ .Date.Format "2006-01-02" }}</i></p> <!-- see https://gohugo.io/functions/format/#hugo-date-and-time-templating-reference -->
      <p>{{ .Summary }}</p>
      {{ if .Truncated }} <p><a href="{{ .Permalink }}">Read More…</a></p> {{ end }}
    </div>
  </li>
  {{ end }}
</ul>
  <article>
    {{ .Content }}
  </article>

  <ul id="blog-post-list">
    {{ range .Pages }}
    <li>
    {{ partial "blog-post-listitem.html" . }}
    </li>
    {{ end }}
  </ul>

</div>
{{ end }}

M layouts/_default/single.html => layouts/_default/single.html +13 -10
@@ 1,13 1,16 @@
{{ define "main" }}
{{ if (.Params.toc) }}
<div id="toc">
  <h2>Table of Contents</h2>
  {{ .TableOfContents }}
</div>
{{ end }}
<div id="content">

  {{ if (.Params.toc) }}
  <div id="toc">
    <h2>Table of Contents</h2>
    {{ .TableOfContents }}
  </div>
  {{ end }}

<article>
  <!-- content/<collection>/*.md -->
  {{ .Content }}
</article>
  <article>
    {{ .Content }}
  </article>

</div>
{{ end }}

M layouts/index.html => layouts/index.html +20 -18
@@ 1,24 1,26 @@
{{ define "main" }}
<div>

<div id="content">
  {{ .Content }}

  <hr />
</div>

<hr />
<h2>Blog</h2>
<p>These are my three most recent blog posts. More posts can be found on the 'Blog' tab.<p>

<ul id="list-posts">
  {{ with .Site.GetPage "/posts" }}
    {{ range first 3 .Pages }}
    <li>
      <h3><a href="{{ .Permalink }}">{{ .Title }}</a></h3>
      <div class="post">
        <p><i>posted on {{ .Date.Format "2006-01-02" }}</i></p> <!-- see https://gohugo.io/functions/format/#hugo-date-and-time-templating-reference -->
        <p>{{ .Summary }}</p>
        {{ if .Truncated }} <p class="read-more"><a href="{{ .Permalink }}">Read More...</a></p> {{ end }}
      </div>
    </li>

<div id="blog-content">

  <p>These are my three most recent blog posts. More posts can be found on the 'Blog' tab.<p>

  <ul id="blog-post-list">
    {{ with .Site.GetPage "/posts" }}
      {{ range first 3 .Pages }}
      <li>
      {{ partial "blog-post-listitem.html" . }}
      </li>
      {{ end }}
    {{ end }}
  {{ end }}
</ul>
  </ul>

</div>

{{ end }}

A layouts/partials/blog-post-listitem.html => layouts/partials/blog-post-listitem.html +9 -0
@@ 0,0 1,9 @@
<h2><a href="{{ .Permalink }}">{{ .Title }}</a></h2>
<div class="blog-post">
  <p><i>posted on {{ .Date.Format "2006-01-02" }}</i></p>
  <p>{{ .Summary }}</p>

  {{ if .Truncated }}
  <p><a href="{{ .Permalink }}">Read More…</a></p>
  {{ end }}
</div>

A layouts/partials/footer.html => layouts/partials/footer.html +1 -0
@@ 0,0 1,1 @@
<p>generated by <a href="https://gohugo.io/">Hugo</a> at {{ now.Format "2006-01-02 13:04:05 MST" }}</p>

A layouts/partials/header.html => layouts/partials/header.html +6 -0
@@ 0,0 1,6 @@
<table id="header">
  <tbody>
    <tr><td class="main">Dominic Ricottone</td></tr>
    <tr><td class="sub">Personal Blog and CV</td></tr>
  </tbody>
</table>

M layouts/posts/single.html => layouts/posts/single.html +21 -17
@@ 1,24 1,28 @@
{{ define "main" }}
<article>
  <h1>{{ .Title }}</h1>
  <p><b>Date:</b> {{ .Date.Format "Mon 2006-01-02" }}</p>
  <p><b>Permalink:</b> <a href="{{ .Permalink }}">{{ .Permalink }}</a></p>
<div id="blog-content">

  <article>
    <h1>{{ .Title }}</h1>
    <p><b>Date:</b> {{ .Date.Format "Mon 2006-01-02" }}</p>
    <p><b>Permalink:</b> <a href="{{ .Permalink }}">{{ .Permalink }}</a></p>

    <br />

    <div class="blog-post">
      {{ .Content }}
    </div>
  </article>

  <br />
  <div class="post">
    {{ .Content }}

  <div>
    {{ with .PrevInSection }}
      <p><b>Previous article:</b> <a href="{{ .Permalink }}">{{ .Title }}</a></p>
    {{ end }}
    {{ with .NextInSection }}
      <p><b>Next article:</b> <a href="{{ .Permalink }}">{{ .Title }}</a></p>
    {{ end }}
  </div>
</article>

<br />
<div>
  {{ with .PrevInSection }}
    <p><b>Previous article:</b> <a href="{{ .Permalink }}">{{ .Title }}</a></p>
  {{ end }}
  {{ with .NextInSection }}
    <p><b>Next article:</b> <a href="{{ .Permalink }}">{{ .Title }}</a></p>
  {{ end }}
</div>

{{ end }}


M static/css/blog.css => static/css/blog.css +11 -7
@@ 1,22 1,26 @@
div#content {
div#blog-content {
  margin: 0;
  max-width: 800px;
  padding: 0 0 0 10px;
}
ul#list-posts {
  list-style-type: none; /* no bullets for post lists */

ul#blog-post-list {
  margin: 0;
  padding: 0;
  list-style-type: none;
}
ul#list-posts li {

ul#blog-post-list li {
  margin: 0;
  padding: 0; /* no indentation on list item--title should not be indented */
  padding: 0;
}
div.post p {

div.blog-post p {
  padding: 0 0 0 2em;
  text-indent: 2em;
}
div.post p.read-more {

div.blog-post p.read-more {
  font-style: italic;
  text-indent: 0;
}

M static/css/common.css => static/css/common.css +6 -0
@@ 2,6 2,7 @@ body {
  margin: 0 0 50vh 0;
  padding: 0;
}

main {
  font-family: sans-serif;
  font-size: 10pt;


@@ 9,6 10,11 @@ main {
  padding: 4px;
}

div#content {
  max-width: 800px;
  padding-left: 10px;
}

hr {
  margin: 2em 0;
  padding: 0;