Browse Source

begin simplification

simplify
Alexander Avery 3 weeks ago
parent
commit
ce224c6bd1
  1. 17
      assets/sass/code.scss
  2. 100
      assets/sass/main.scss
  3. 6
      layouts/404.html
  4. 45
      layouts/_default/list.html
  5. 23
      layouts/_default/single.html
  6. 19
      layouts/authors/list.html
  7. 27
      layouts/games/list.html
  8. 7
      layouts/games/meta-extra.html
  9. 14
      layouts/partials/article-meta.html
  10. 6
      layouts/partials/article.html
  11. 4
      layouts/partials/footer.html
  12. 14
      layouts/partials/header.html
  13. 32
      layouts/partials/image-small.html
  14. 29
      layouts/partials/image.html
  15. 1
      layouts/partials/posts-artfully-enumerated.html
  16. 20
      layouts/partials/posts-enumerated.html

17
assets/sass/code.scss

@ -1,18 +1,4 @@
code { code { white-space: nowrap; }
background: $dark;
border-radius: .4rem;
margin: 0 .2rem;
padding: .2rem .5rem;
white-space: nowrap;
}
p code {
font-size: .9rem !important;
}
li code {
font-size: .9rem !important;
}
pre { pre {
background-color: $background-color !important; background-color: $background-color !important;
@ -27,5 +13,6 @@ pre {
max-width: 100%; max-width: 100%;
overflow-x: auto; overflow-x: auto;
border-left: .3rem solid $code-edge; border-left: .3rem solid $code-edge;
border-radius: .4rem;
} }
} }

100
assets/sass/main.scss

@ -14,95 +14,47 @@ body {
color: $font-color; color: $font-color;
margin: 0px; margin: 0px;
overflow-y: scroll; overflow-y: scroll;
font-family: 'Source Sans Pro'; font-family: 'Helvetica';
font-size: 1.1rem;
} }
header { header {
background-color: $top-bar; background-color: $top-bar;
box-shadow: 0px 5px 10px black; box-shadow: 0px 5px 10px black;
.spread { nav {
gap: 24px; @include screen-max(840px){text-align: center;}
display: flex; img { max-width: 300px; }
align-items: flex-end;
justify-content: space-between;
@include screen-max(1000px){justify-content: center;}
ul {
margin: 0px;
padding: 0px;
list-style-type: none;
a { a {
text-align: center; margin-right: 12px;
margin: auto;
font-weight: bold; font-weight: bold;
text-decoration: none; text-decoration: none;
color: $font-color-alternate; color: $font-color-alternate;
&:visited {color: $font-color-alternate;}
} }
} }
} }
nav {
max-width: 1400px;
margin: 0px auto;
padding: 8px;
flex-wrap: wrap;
a {
@include screen-max(1000px){flex-basis: 100%;}
}
img {
max-width: 300px;
display: block;
@include screen-max(1000px){margin: auto; flex-basis: 100%;}
}
}
}
a {
color: $link-color;
&:visited, &:hover {
color: $link-color-visited;
}
}
main { header, main, section, nav {padding: 0 16px;}
max-width: 820px;
margin: auto;
@include screen-max(840px){padding: 0px 16px;}
img { main, section, nav {max-width: 920px; margin: auto;}
width: 100%; main img {max-width: 100%}
}
}
.center-text { footer {text-align: center;}
text-align: center;
flex-basis: 100%;
}
a, p, li, h2 {
font-size: 1.25rem;
}
img { a {
object-fit: cover; color: $link-color;
&:visited, &:hover { color: $link-color-visited; }
} }
img.featured { img.featured {
border-radius: 8px;
max-height: 500px;
max-width: 100%;
display: block; display: block;
} border-radius: 8px;
.margin {
margin: 12px auto; margin: 12px auto;
} max-height: 888px;
object-fit: cover;
.small-text { aspect-ratio: 4/3;
font-size: 1rem;
}
.large-text {
font-size: 2rem;
} }
.left-to-right { .left-to-right {
@ -117,26 +69,14 @@ img.featured {
align-items: center; align-items: center;
} }
section {
max-width: 1000px;
margin: 16px auto;
padding: 8px;
}
section.article-list { section.article-list {
margin: 8px 0px;
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
justify-content: center; justify-content: center;
gap: 40px; gap: 40px;
} }
.center-box {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
}
.fill-wh { .fill-wh {
width: 100%; width: 100%;
height: 100% height: 100%

6
layouts/404.html

@ -1,7 +1,7 @@
{{ define "main" }} {{ define "main" }}
<div class="center-box"> <main>
<h1>404</h1> <h1>404</h1>
<h2 class="center-text">This page doesn't exist. Let's go <a href="/">home</a></h2> <h2>This page doesn't exist. Let's go <a href="/">home</a></h2>
</div> </main>
{{ end }} {{ end }}

45
layouts/_default/list.html

@ -1,24 +1,39 @@
{{ define "main" }} {{ define "main" }}
{{ $pages := .Site.RegularPages }} {{ $pages := .Site.RegularPages }}
{{if not .IsHome }} {{ $pages = .Pages }} {{ end }}
<main>
<h1>{{ .Title | markdownify | title }}</h1>
{{ if and .IsSection (not .IsHome) }} {{ partial "article-meta.html" . }} {{ end }}
{{ with .Content }}
<section>
{{ . }}
</section>
{{- end }}
</main>
{{if not .IsHome }} <section>
<h2>Latest Posts:</h2>
<h1 class="center-text">{{ .Title | markdownify | lower }}</h1> {{ with $pages.Limit 4 }}
<section class="article-list">
{{ $pages = .Pages }} {{ range . }}
{{ partial "article.html" . }}
{{ end }} {{ end }}
</section>
{{ if templates.Exists "partials/pre-content.html" }}
{{ partial "pre-content.html" . }}
{{ end }} {{ end }}
</section>
<section>{{ .Content }}</section> <section>
<h2>All Posts:</h2>
<section class="article-list"> {{ with $pages }}
{{ range $pages }} {{ range .GroupByDate "2006" }}
{{ partial "article.html" . }} <p>{{ .Key }}</p>
<ul>
{{ range .Pages -}}
<li><a href="{{ .RelPermalink }}">{{ .LinkTitle }}</a></li>
{{ end -}}
</ul>
{{ end }}
{{ end }} {{ end }}
</section> </section>

23
layouts/_default/single.html

@ -4,30 +4,17 @@
<main> <main>
{{ partial "article-meta.html" . }} {{ partial "article-meta.html" . }}
{{ if .Params.toc }}
{{ .TableOfContents }}
{{ end }}
{{ if templates.Exists "partials/pre-content.html" }}
{{ partial "pre-content.html" . }}
{{ end }}
{{ .Content }} {{ .Content }}
</main>
<p> <section>
{{ with .NextInSection }} {{ with .NextInSection }}
<b>Next: </b><a href="{{ .Permalink }}">{{ .Title | markdownify }}</a> <p>Next: <a href="{{ .Permalink }}">{{ .Title | markdownify }}</a></p>
<br>
{{ end }} {{ end }}
{{ with .PrevInSection }} {{ with .PrevInSection }}
<b>Previous: </b><a href="{{ .Permalink }}">{{ .Title | markdownify }}</a> <p>Previous: <a href="{{ .Permalink }}">{{ .Title | markdownify }}</a></p>
<br>
{{ end }} {{ end }}
</section>
<b><a href="/"> >> Home</a></b>
</p>
</main>
{{ end }} {{ end }}

19
layouts/authors/list.html

@ -9,26 +9,27 @@
<h1>{{ .Params.name }}</h1> <h1>{{ .Params.name }}</h1>
<p>{{ .Params.bio }}</p> <p>{{ .Params.bio }}</p>
<a class="small-text" href={{ .Params.projects}}>Projects</a> <a href={{ .Params.projects}}>Projects</a>
<span> | </span> <span> | </span>
<a class="small-text" href="mailto:{{ .Params.email }}">{{ .Params.email}}</a> <a href="mailto:{{ .Params.email }}">{{ .Params.email}}</a>
</div> </div>
</section> </section>
<section> <main>
{{ .Content }} {{ .Content }}
</main>
<h2>Posts:</h2> <section>
<h2>Latest Posts:</h2>
</section> {{ with .Data.Pages }}
<section class="article-list"> <section class="article-list">
{{ range .Data.Pages }} {{ range . }}
{{ partial "article.html" . }} {{ partial "article.html" . }}
{{ end }} {{ end }}
</section> </section>
{{ end }}
</section>
{{ end }} {{ end }}

27
layouts/games/list.html

@ -1,27 +0,0 @@
{{ define "main" }}
<main>
{{ partial "article-meta.html" . }}
{{ if .Params.toc }}
{{ .TableOfContents }}
{{ end }}
{{ .Content }}
</main>
{{ if gt (len .Data.Pages) 0 }}
<section>
<h2>Devlogs:</h2>
</section>
<section class="article-list">
{{ range .Data.Pages }}
{{ partial "article.html" . }}
{{ end }}
</section>
{{ end }}
{{ end }}

7
layouts/games/meta-extra.html

@ -1,7 +0,0 @@
{{ with .Params.releaseDate }}
<h2 class="small-text">Released: {{ dateFormat "Mon | Jan 2, 2006" . }}</h2>
{{ end }}
<h2 class="small-text">Platforms:
<span class="margin small-text">{{ delimit .Params.platforms " · " }}</span>
</h2>

14
layouts/partials/article-meta.html

@ -1,25 +1,19 @@
<section> <section>
<h1 class="large-text">{{ .Title | markdownify }}</h1>
{{ with .Params.authors }} {{ with .Params.authors }}
{{ $author := (index . 0) }} {{ $author := (index . 0) }}
<h2> <h4>Author: <a href={{ printf "/%s/%s" "authors" (urlize $author) }}>{{ $author }}</a></h4>
Author: <a href={{ printf "/%s/%s" "authors" (urlize $author) }}>{{ $author }}</a>
</h2>
{{ end }} {{ end }}
{{ with .Date }} {{ with .Date }}
<h2 class="small-text">Posted: {{ .Format "Mon | Jan 2, 2006" }}</h2> <h4>Posted: {{ .Format "Mon | Jan 2, 2006" }}</h4>
{{ end }} {{ end }}
{{ .Render "meta-extra" }}
{{ range (.GetTerms "tags") }} {{ range (.GetTerms "tags") }}
<span> <span>
<a class="small-text" href="{{ .Permalink }}">{{ .LinkTitle }}</a> <a href="{{ .Permalink }}">{{ .LinkTitle }}</a>
</span> </span>
{{ end }} {{ end }}
{{ $image := (.Resources.GetMatch "featured") }} {{ $image := (.Resources.GetMatch "featured") }}
{{ partial "image.html" (dict "image" $image "alt" .Params.featured.alt "class" "shadow featured margin") }} {{ partial "image.html" (dict "image" $image "alt" .Params.featured.alt "class" "shadow featured") }}
</section> </section>

6
layouts/partials/article.html

@ -2,16 +2,16 @@
<a href=" {{.Permalink }}"> <a href=" {{.Permalink }}">
{{ $image := .Resources.GetMatch "featured" }} {{ $image := .Resources.GetMatch "featured" }}
{{ partial "image.html" (dict "image" $image "alt" .Params.featured.alt) }} {{ partial "image-small.html" (dict "image" $image "alt" .Params.featured.alt) }}
</a> </a>
<div> <div>
{{ with index (.GetTerms "tags") 0 }} {{ with index (.GetTerms "tags") 0 }}
<a class="small-text" href="{{ .Permalink }}">{{ .LinkTitle }}</a> <a href="{{ .Permalink }}">{{ .LinkTitle }}</a>
{{ end }} {{ end }}
<h2 class="title">{{ .Title | markdownify }}</h2> <h4 class="title">{{ .Title | markdownify }}</h4>
{{ with .Date }} {{ with .Date }}
<p>{{ .Format "2006/01/02" }}</p> <p>{{ .Format "2006/01/02" }}</p>

4
layouts/partials/footer.html

@ -1,5 +1,5 @@
<footer> <footer>
<hr> <hr>
<p class="center-text"><a class="small-text" href="/authors">Authors</a></p> <p><a href="/authors">Authors</a></p>
<p class="center-text small-text">{{ $.Site.Copyright | safeHTML }}</p> <p>{{ $.Site.Copyright | safeHTML }}</p>
</footer> </footer>

14
layouts/partials/header.html

@ -1,11 +1,11 @@
<header> <header>
<nav class="spread"> <nav>
<a href="/"><img src="{{ .Site.Params.logo }}" alt="The {{ .Site.Title }} Logo"></a> <a href="/"><img src="{{ .Site.Params.logo }}" alt="The {{ .Site.Title }} Logo"></a>
<ul class="spread"> <div>
{{ range .Site.Params.HeaderLinks }} {{ range .Site.Params.HeaderLinks -}}
<li><a href="{{ .url }}" title="{{ .title }}">{{ .title }}</a></li> <a href="{{ .url }}" title="{{ .title }}">{{ .title }}</a>
{{ end }} {{ end -}}
<li>{{ printf `<a href="/index.xml" title="%s">RSS</a>` $.Site.Title | safeHTML }}</li> {{ printf `<a href="/index.xml" title="%s">RSS</a>` $.Site.Title | safeHTML }}
</ul> </div>
</nav> </nav>
</header> </header>

32
layouts/partials/image-small.html

@ -0,0 +1,32 @@
<img class="{{ .class }}"
{{- with .image -}}
{{ $smallest := (.Resize "305x q60") }}
srcset="
{{- with $smallest -}}
{{ printf "%s %dw," .RelPermalink .Width }}
{{- end -}}
{{- with (.Resize "480x q60") -}}
{{ printf "%s %dw," .RelPermalink .Width }}
{{- end -}}
{{- with (.Resize "600x q70") -}}
{{ printf "%s %dw," .RelPermalink .Width }}
{{- end -}}
"
sizes="
(max-width: 480px) 305px;
(max-width: 600px) 480px;
600px"
src="
{{- with $smallest -}}
{{ .RelPermalink }}
{{- end -}}"
alt="{{ .Params.alt }}"
{{- end -}}
>

29
layouts/partials/image.html

@ -1,18 +1,35 @@
<img class="{{ .class }}" <img class="{{ .class }}"
{{- with .image -}} {{- with .image -}}
{{ $smallest := (.Resize "320x q60") }}
srcset=" srcset="
{{- with (.Resize "600x q40") -}} {{- with $smallest -}}
{{ printf "%s %dw," .RelPermalink .Width }} {{ printf "%s %dw," .RelPermalink .Width }}
{{- end -}} {{- end -}}
{{- with (.Resize "1200x q65") -}} {{- with (.Resize "480x q60") -}}
{{ printf "%s %dw" .RelPermalink .Width }} {{ printf "%s %dw," .RelPermalink .Width }}
{{- end -}}" {{- end -}}
{{- with (.Resize "600x q70") -}}
{{ printf "%s %dw," .RelPermalink .Width }}
{{- end -}}
{{- with (.Resize "800x q90") -}}
{{ printf "%s %dw," .RelPermalink .Width }}
{{- end -}}
"
sizes="(max-width: 900px) 600px, (min-width: 901px) 1200px" sizes="
(max-width: 480px) 320px;
(max-width: 600px) 480px;
(max-width: 800px) 600px;
800px"
src=" src="
{{- with (.Resize "600x q40") -}} {{- with $smallest -}}
{{ .RelPermalink }} {{ .RelPermalink }}
{{- end -}}" {{- end -}}"

1
layouts/partials/posts-artfully-enumerated.html

@ -0,0 +1 @@

20
layouts/partials/posts-enumerated.html

@ -0,0 +1,20 @@
{{ with . }}
<section>
<h2>Latest Posts:</h2>
<section class="article-list">
{{ range .Limit 5 }}
{{ partial "article.html" . }}
{{ end }}
</section>
<h2>All Posts:</h2>
{{ range .GroupByDate "2006" }}
<p>{{ .Key}}</p>
<ul>
{{ range .Pages -}}
<li><a href="{{ .RelPermalink }}">{{ .LinkTitle }}</a></li>
{{ end -}}
</ul>
{{ end }}
</section>
{{ end }}
Loading…
Cancel
Save