Browse Source

Added anchored headings back, deleted photos entirely.

main
gryffyn 12 months ago
parent
commit
b86987bc12
Signed by: gryffyn GPG Key ID: 6948DD6514D02BEF
  1. 64
      assets/css/console.css
  2. 2
      assets/css/syntax.css
  3. 8
      layouts/_default/baseof.html
  4. 19
      layouts/gallery/list.html
  5. 14
      layouts/gallery/single.html
  6. 3
      layouts/index.html
  7. 2
      layouts/partials/anchored_headings.html
  8. 11
      layouts/partials/favicon.html
  9. 4
      layouts/partials/footer.html
  10. 16
      layouts/partials/index-photos.html
  11. 2
      layouts/posts/single.html

64
assets/css/console.css

@ -33,14 +33,14 @@
pre {
border:0;
padding-bottom: 0;
background-color: #3a3b40;
background-color: var(--code-bg-color);
}
pre code {
overflow: auto;
font-size: 14px;
margin: 0 0 2px 0;
background-color: #3a3b40;
background-color: var(--code-bg-color);
}
.post code {
@ -48,7 +48,7 @@ pre code {
}
code {
background-color: #3a3b40;
background-color: var(--code-bg-color);
}
pre code::after code::before {
@ -62,15 +62,16 @@ code::after code::before {
:root {
--global-font-size: 18px;
--global-font-color: #dadadb;
--background-color: #1d1e20;
--mono-font-stack: Source Code Pro, Menlo, Monaco, Lucida Console, Liberation Mono, DejaVu Sans Mono, Bitstream Vera Sans Mono, Courier New, monospace, serif;
--font-stack: Source Code Pro, Menlo, Monaco, Lucida Console, Liberation Mono, DejaVu Sans Mono, Bitstream Vera Sans Mono, Courier New, monospace, serif;
--global-line-height: 1.4em;
--page-width: 64em;
--display-h1-decoration: 1;
--code-bg-color: #1d1e20;
--code-bg-color: #2C2E31;
--font-color: #dadadb;
--primary-color: #f5a8b8;
--invert-font-color: #1d1e20;
--invert-font-color: var(--background-color);
/* --secondary-color: #5bcefb; */
}
@ -78,7 +79,7 @@ code::after code::before {
:root {
--global-font-size: 14px;
--global-font-color: #dadadb;
--global-line-height: 1.6em;
--global-line-height: 1.3em;
--page-width: 70em;
}
}
@ -106,7 +107,7 @@ code::after code::before {
body {
font-family: -apple-system,BlinkMacSystemFont,segoe ui,Roboto,Oxygen,Ubuntu,Cantarell,open sans,helvetica neue,sans-serif;
font-size: var(--global-font-size);
background-color: #1d1e20;
background-color: var(--background-color);
margin-bottom: 75px;
}
@ -150,16 +151,26 @@ h1 {
font-size: 32px;
}
.post-content h1 a,
.post-content h2 a,
.post-content h3 a,
.post-content h4 a {
text-decoration: none;
position: relative;
left: -1px;
color: var(--secondary-color);
}
.post-meta {
color: var(--secondary-color);
}
.index-about h1,
.index-photos h1,
.index-posts h1 {
font-size: 36px;
}
.post h1 {
font-size: 18px;
}
h1::after {
pointer-events: none;
content: "";
@ -209,6 +220,7 @@ figure {
}
.footer {
font-size: 14px;
clear: both;
margin-top: 100px;
padding-top: 10px;;
@ -216,23 +228,10 @@ figure {
color: var(--global-font-color);
}
.image-grid {
display: grid;
grid-template-rows: auto;
grid-gap: 1em;
grid-template-columns: repeat(auto-fit,
minmax(calc(var(--page-width) / 5), 1fr));
}
.terminal-prompt::before {
content: none;
}
.gallery-image {
margin-top: 10px;
margin-bottom: 10px;
}
.posts-list {
position: relative;
padding-left: 150px;
@ -242,6 +241,8 @@ figure {
.post h1 {
padding-top: 0;
font-size: 18px;
text-decoration: none;
}
.posts-list .date {
@ -256,8 +257,6 @@ figure {
@media only screen and (max-width: 850px) {
.site-name {
width: 2ch;
overflow: hidden;
display: inline-block;
}
@ -279,6 +278,19 @@ figure {
margin-right: 20px;
}
.terminal-logo {
flex-basis: unset;
}
.terminal code {
padding: 2px 4px;
}
.title-sep,
.title-loc {
text-overflow: clip;
}
.logo {
padding: calc(var(--global-space) * 1) 0 calc(var(--global-space) * 1);
}

2
assets/css/syntax.css

@ -1,4 +1,4 @@
/* Background */ .chroma { color: #f8f8f2; background-color: #3a3b40 }
/* Background */ .chroma { color: #f8f8f2; background-color: #2C2E31 }
/* Other */ .chroma .x { }
/* Error */ .chroma .err { }
/* LineTableTD */ .chroma .lntd { vertical-align: top; padding: 0; margin: 0; border: 0; }

8
layouts/_default/baseof.html

@ -5,16 +5,16 @@
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>{{ .Site.Title }}{{ $url := urls.Parse .Page.Permalink }}{{ $url.Path }}</title>
{{ with .Site.Params.description }}<meta name="description" content="{{ . }}">{{ end }}
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="robots" content="all,follow">
<meta name="googlebot" content="index,follow,snippet,archive">
{{ $css := resources.Get "css/terminal-0.7.2.min.css" }}
{{ $style := $css | resources.Minify | fingerprint }}
<link rel="stylesheet" href="{{ $style.Permalink | absURL }}" integrity="{{ $style.Data.Integrity }}">
{{ $css := resources.Get "css/console.css" }}
{{ $css := resources.Get "css/syntax.css" }}
{{ $style := $css | resources.Minify | fingerprint }}
<link rel="stylesheet" href="{{ $style.Permalink | absURL }}" integrity="{{ $style.Data.Integrity }}">
{{ $css := resources.Get "css/syntax.css" }}
{{ $css := resources.Get "css/console.css" }}
{{ $style := $css | resources.Minify | fingerprint }}
<link rel="stylesheet" href="{{ $style.Permalink | absURL }}" integrity="{{ $style.Data.Integrity }}">
{{ `
@ -41,7 +41,7 @@
<div class="logo">
{{ $url := replace .Permalink ( printf "%s" .Site.BaseURL) "" }}
{{ $.Scratch.Add "path" .Site.BaseURL }}
<a href="{{ .Site.BaseURL }}" class="no-style {{ with .Site.Params.TitleCutting }}site-name{{ end }}">{{ .Site.Title }}</a>/{{ range $index, $element := split $url "/" }}{{ $.Scratch.Add "path" $element }}{{ if ne $element "" }}<a href='{{ $.Scratch.Get "path" | absURL }}'>{{ . }}</a>/{{ $.Scratch.Add "path" "/" }}{{ end }}{{ end }}</div></header>
<a href="{{ .Site.BaseURL }}" class="no-style {{ with .Site.Params.TitleCutting }}site-name{{ end }}">{{ .Site.Title }}</a>/{{ range $index, $element := split $url "/" }}{{ $.Scratch.Add "path" $element }}{{ if ne $element "" }}<a class="title-loc" href='{{ $.Scratch.Get "path" | absURL }}'>{{ . }}</a><span class="title-sep">/</span>{{ $.Scratch.Add "path" "/" }}{{ end }}{{ end }}</div></header>
<nav class="terminal-menu">
<ul vocab="https://schema.org/" typeof="BreadcrumbList">
{{ range .Site.Params.navlinks }}

19
layouts/gallery/list.html

@ -1,19 +0,0 @@
{{ define "main" }}
<div class="post-title">
<h1>{{ .Page.Title }}</h1>
</div>
{{ .Content }}
<div class="image-grid">
{{ range sort .Data.Pages "Date" "desc" }}
{{ if and (isset .Params "image") .Params.image }}
<a href="{{ .Permalink }}" title="{{ .Title }}">
{{ $image := .Page.Resources.GetMatch .Params.image }}
{{ with $image }}
{{ $thumb := .Resize "400x" }}
<img src="{{ $thumb.RelPermalink }}" alt="{{ .Title }}" class="img-responsive">
{{end}}
</a>
{{ end }}
{{ end }}
</div>
{{ end }}

14
layouts/gallery/single.html

@ -1,14 +0,0 @@
{{ define "main" }}
<h1>{{ .Page.Title }}</h1>
{{ if and (isset .Params "image") .Params.image }}
{{ $image := .Page.Resources.GetMatch .Params.image }}
{{ with $image }}
{{ $thumb := .Resize "1000x" }}
{{ printf `<img src="%s" alt="%s" class="img-responsive gallery-image">` $thumb.RelPermalink .Title | safeHTML }}
{{end}}
{{ end }}
{{ .Content }}
{{ end }}

3
layouts/index.html

@ -5,7 +5,4 @@
<div class="index-posts">
{{ partial "index-posts" . }}
</div>
<div class="index-photos">
{{ partial "index-photos" . }}
</div>
{{ end }}

2
layouts/partials/anchored_headings.html

@ -0,0 +1,2 @@
<!-- https://github.com/adityatelange/hugo-PaperMod/blob/master/layouts/partials/anchored_headings.html -->
{{ . | replaceRE "(<h[1-6] id=\"([^\"]+)\".+)(</h[1-6]+>)" "${1}<span> </span><a class=\"anchor\" href=\"#${2}\">#</a>${3}" | safeHTML }}

11
layouts/partials/favicon.html

@ -1 +1,10 @@
<link rel="icon" href="{{- .Site.Params.assets.favicon | default "favicon.ico" | absURL -}}">
<link rel="icon" type="image/png" sizes="16x16" href="
{{- .Site.Params.assets.favicon16x16 | default "favicon-16x16.png" | absURL -}}">
<link rel="icon" type="image/png" sizes="32x32" href="
{{- .Site.Params.assets.favicon32x32 | default "favicon-32x32.png" | absURL -}}">
<link rel="apple-touch-icon" href="
{{- .Site.Params.assets.apple_touch_icon | default "apple-touch-icon.png" | absURL -}}">
<link rel="mask-icon" href="{{- .Site.Params.assets.safari_pinned_tab | default "safari-pinned-tab.svg" | absURL -}}">
<meta name="theme-color" content="#1d1e20">
<meta name="msapplication-TileColor" content="#1d1e20">

4
layouts/partials/footer.html

@ -1,4 +1,6 @@
{{ with $.Site.Params.Footer }}
<div class="footer">
by: <a href="https://github.com/gryffyn">gryffyn</a> using: <a href="https://gohugo.io/">hugo</a> theme:
by: <a href="{{ .Link }}">{{ .Name }}</a> using: <a href="https://gohugo.io/">hugo</a> theme:
<a href="https://github.com/gryffyn/hugo-theme-console/">console</a>
</div>
{{ end }}

16
layouts/partials/index-photos.html

@ -1,16 +0,0 @@
{{ if .Site.Params.Sections.Photos }}
<h1>Latest photos</h1>
<div class="image-grid">
{{ with .Site.GetPage "/photos" }}
{{ range first 3 (sort .Data.Pages "Date" "desc")}}
<a href="{{ .Permalink }}" title="{{ .Title }}">
{{ $image := .Page.Resources.GetMatch .Params.image }}
{{ with $image }}
{{ $thumb := .Resize "400x" }}
<img src="{{ $thumb.RelPermalink }}" alt="{{ .Title }}" class="img-responsive">
{{end}}
</a>
{{ end }}
{{ end }}
</div>
{{ end }}

2
layouts/posts/single.html

@ -11,6 +11,6 @@
</div>
</br>
<div class="post-content">
{{ .Content }}
{{ partial "anchored_headings" .Content }}
</div>
{{ end }}

Loading…
Cancel
Save