mirror of
https://github.com/yrzam/yrzam-hugo-theme.git
synced 2026-02-04 14:26:24 +00:00
Compare commits
8 Commits
6654b9665c
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| 6d786905ec | |||
| c854afa1ee | |||
| fe2768af8c | |||
| 702211b68a | |||
| f2b9fcb884 | |||
| 6fac717306 | |||
| dca9541eee | |||
| 8681ac60cc |
@@ -25,10 +25,12 @@ h1,h2,h3,h4,h5,h6 {
|
|||||||
}
|
}
|
||||||
html {
|
html {
|
||||||
font-size: 16px;
|
font-size: 16px;
|
||||||
|
font-family: system-ui;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
scroll-behavior: smooth;
|
scroll-behavior: smooth;
|
||||||
scrollbar-color: $color-fg-accent-op-m transparent;
|
scrollbar-color: $color-fg-accent-op-m transparent;
|
||||||
line-height: 1.3;
|
line-height: 1.3;
|
||||||
|
color-scheme: only dark;
|
||||||
}
|
}
|
||||||
body {
|
body {
|
||||||
height: 100%;
|
height: 100%;
|
||||||
@@ -127,7 +129,7 @@ article {
|
|||||||
object-fit: contain;
|
object-fit: contain;
|
||||||
display: block;
|
display: block;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
max-height: 30rem;
|
max-height: 25rem;
|
||||||
border: 1px solid $color-bg-accent-light;
|
border: 1px solid $color-bg-accent-light;
|
||||||
}
|
}
|
||||||
figcaption {
|
figcaption {
|
||||||
@@ -156,7 +158,7 @@ article {
|
|||||||
ol {
|
ol {
|
||||||
padding-left: 2rem;
|
padding-left: 2rem;
|
||||||
li {
|
li {
|
||||||
margin: 0.5em 0;
|
margin: 0.25em 0;
|
||||||
line-height: 1.5;
|
line-height: 1.5;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -170,6 +172,13 @@ article {
|
|||||||
h4,
|
h4,
|
||||||
h5,
|
h5,
|
||||||
h6 {
|
h6 {
|
||||||
margin: 1.5em 0 0.5em 0;
|
margin: 2em 0 0.5em 0;
|
||||||
|
}
|
||||||
|
h1 + h2,
|
||||||
|
h2 + h3,
|
||||||
|
h3 + h4,
|
||||||
|
h4 + h5,
|
||||||
|
h5 + h6 {
|
||||||
|
margin: 1em 0 0.5em 0 !important;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -76,7 +76,7 @@
|
|||||||
|
|
||||||
/* section specific - single of classic */
|
/* section specific - single of classic */
|
||||||
.classic-layout-container header .content.post {
|
.classic-layout-container header .content.post {
|
||||||
.pub-date {
|
.status {
|
||||||
color: $color-fg-op-m;
|
color: $color-fg-op-m;
|
||||||
margin: 1em 0;
|
margin: 1em 0;
|
||||||
}
|
}
|
||||||
@@ -110,7 +110,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
.main-container {
|
.main-container {
|
||||||
margin: $margin-base-y * 2 $margin-base-x $margin-base-y $margin-base-x;
|
margin: $margin-base-y * 2 $margin-base-x;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -91,30 +91,27 @@
|
|||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
gap: 0.5rem;
|
gap: 0.5rem;
|
||||||
.section-item {
|
.section-item {
|
||||||
|
flex: 1;
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
box-shadow: 0 0 0.25rem rgba(0,0,0,0.5);
|
box-shadow: 0 0 0.25rem rgba(0,0,0,0.5);
|
||||||
|
border-radius: 1rem;
|
||||||
|
border: 1px solid $color-fg-op-m;
|
||||||
&:hover {
|
&:hover {
|
||||||
border: 1px solid $color-fg-accent;
|
border: 1px solid $color-fg-accent;
|
||||||
}
|
}
|
||||||
display: block;
|
display: flex;
|
||||||
flex: 1 0 30%;
|
justify-content: center;
|
||||||
border: 1px solid $color-fg-op-m;
|
align-items: center;
|
||||||
border-radius: 1rem;
|
|
||||||
text-align: center;
|
|
||||||
padding: 1rem;
|
|
||||||
.icon {
|
.icon {
|
||||||
height: 2.5rem;
|
height: 2.5rem;
|
||||||
width: 2.5rem;
|
width: 2.5rem;
|
||||||
vertical-align: middle;
|
|
||||||
color: $color-fg-op-m;
|
color: $color-fg-op-m;
|
||||||
}
|
}
|
||||||
.label {
|
.label {
|
||||||
font-size: 1.3rem;
|
font-size: 1.3rem;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
color: $color-fg-dark;
|
color: $color-fg-dark;
|
||||||
vertical-align: middle;
|
|
||||||
margin: 0 0 0 0.75rem;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -133,6 +130,18 @@
|
|||||||
flex-basis: 100%;
|
flex-basis: 100%;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
.home-layout-container .content.home .section-list {
|
||||||
|
.section-item {
|
||||||
|
flex-wrap: wrap;
|
||||||
|
padding: 1rem 0.75rem;
|
||||||
|
.icon {
|
||||||
|
flex-basis: 100%;
|
||||||
|
}
|
||||||
|
.label {
|
||||||
|
margin: 0.25rem 0 0 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@mixin media--home-content-about_vert_middle {
|
@mixin media--home-content-about_vert_middle {
|
||||||
.home-layout-container {
|
.home-layout-container {
|
||||||
@@ -143,10 +152,14 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
.home-layout-container .content.home .section-list {
|
.home-layout-container .content.home .section-list {
|
||||||
.section-item .label {
|
.section-item {
|
||||||
|
padding: 1rem;
|
||||||
|
.label {
|
||||||
|
margin: 0 0 0 0.75rem;
|
||||||
font-size: 1.6rem;
|
font-size: 1.6rem;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@mixin media--home-content-about_vert_middle_wide {
|
@mixin media--home-content-about_vert_middle_wide {
|
||||||
.home-layout-container .content.home .section-list {
|
.home-layout-container .content.home .section-list {
|
||||||
|
|||||||
@@ -1,4 +1,12 @@
|
|||||||
@import "variables.scss";
|
$color-fg: #{{ .Site.Data.theme.color.fg }};
|
||||||
|
$color-fg-dark: #{{ .Site.Data.theme.color.fg_dark }};
|
||||||
|
$color-fg-accent: #{{ .Site.Data.theme.color.fg_accent }};
|
||||||
|
$color-bg: #{{ .Site.Data.theme.color.bg }};
|
||||||
|
$color-bg-accent-light: #{{ .Site.Data.theme.color.bg_accent_light }};
|
||||||
|
$color-bg-accent-dark: #{{ .Site.Data.theme.color.bg_accent_dark }};
|
||||||
|
$opacity-low: {{ .Site.Data.theme.opacity.low }};
|
||||||
|
$opacity-mid: {{ .Site.Data.theme.opacity.med }};
|
||||||
|
|
||||||
@import "basic.scss";
|
@import "basic.scss";
|
||||||
@import "classic-layout.scss";
|
@import "classic-layout.scss";
|
||||||
@import "home-layout.scss";
|
@import "home-layout.scss";
|
||||||
|
|||||||
@@ -1,9 +0,0 @@
|
|||||||
$color-fg: #ffffff;
|
|
||||||
$color-fg-dark: #b8bcc1;
|
|
||||||
$color-fg-accent: #9988ff;
|
|
||||||
$color-bg: #0d1117;
|
|
||||||
$color-bg-accent-light: #510079;
|
|
||||||
$color-bg-accent-dark: #020030;
|
|
||||||
|
|
||||||
$opacity-low: 0.2;
|
|
||||||
$opacity-mid: 0.55;
|
|
||||||
21
data/theme.json
Normal file
21
data/theme.json
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
{
|
||||||
|
"color": {
|
||||||
|
"fg": "ffffff",
|
||||||
|
"fg_dark": "b8bcc1",
|
||||||
|
"fg_accent": "9988ff",
|
||||||
|
"bg": "0d1117",
|
||||||
|
"bg_accent_light":"510079",
|
||||||
|
"bg_accent_dark":"020030"
|
||||||
|
},
|
||||||
|
"opacity": {
|
||||||
|
"low": 0.2,
|
||||||
|
"med": 0.55,
|
||||||
|
"high": 0.85
|
||||||
|
},
|
||||||
|
"font": {
|
||||||
|
"name_regular": "Roboto",
|
||||||
|
"name_mono": "Roboto Mono",
|
||||||
|
"size_base_pt": 12,
|
||||||
|
"size_step_pt": 1.5
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,12 +1,5 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
set -e
|
set -e
|
||||||
|
cd "$(dirname "$0")"
|
||||||
|
|
||||||
cd "$(dirname "$0")/.."
|
cp ~/.config/theme.json ../data/theme.json
|
||||||
[ -d ./themes/yrzam ] && cd ./themes/yrzam
|
|
||||||
|
|
||||||
VARS=$(printenv | \
|
|
||||||
grep -E 'THEME_.*' | \
|
|
||||||
sed -e 's/[= ].*//g' | sed -e 's/^/\$/' | tr '\n' ' '
|
|
||||||
)
|
|
||||||
|
|
||||||
envsubst "$VARS" < "./assets/css/variables.scss.tmpl" > "./assets/css/variables.scss"
|
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
<!-- prettier-ignore -->
|
<!-- prettier-ignore -->
|
||||||
<title>{{ if not .IsHome }}{{ .LinkTitle | humanize }} - {{ end }}{{ .Site.Title }}</title>
|
<title>{{ if not .IsHome }}{{ .LinkTitle | humanize }} - {{ end }}{{ .Site.Title }}</title>
|
||||||
{{ $opts := dict "transpiler" "libsass" "targetPath" "_style.css" }}
|
{{ $opts := dict "transpiler" "libsass" "targetPath" "_style.css" }}
|
||||||
{{ with resources.Get "css/index.scss" | toCSS $opts | minify | fingerprint }}
|
{{ with resources.Get "css/index.scss" | resources.ExecuteAsTemplate "" . | toCSS $opts | minify | fingerprint }}
|
||||||
<link rel="stylesheet" href="{{ .RelPermalink }}" integrity="{{ .Data.Integrity }}" />
|
<link rel="stylesheet" href="{{ .RelPermalink }}" integrity="{{ .Data.Integrity }}" />
|
||||||
{{ end }}
|
{{ end }}
|
||||||
{{ range resources.Match "favicon/*.png" }}
|
{{ range resources.Match "favicon/*.png" }}
|
||||||
|
|||||||
@@ -5,9 +5,10 @@
|
|||||||
{{ if .Description }}<p>{{ .Description }}</p>{{ end }}
|
{{ if .Description }}<p>{{ .Description }}</p>{{ end }}
|
||||||
{{ partial "taxo_of_single.html" . }}
|
{{ partial "taxo_of_single.html" . }}
|
||||||
{{ if .Lastmod }}
|
{{ if .Lastmod }}
|
||||||
<div class="pub-date">
|
<div class="status">
|
||||||
mtime={{ .Lastmod.Format .Site.Params.dateFormat }}
|
mtime=<span class="mtime">{{ .Lastmod.Format .Site.Params.dateFormat }}</span>
|
||||||
archived={{ default false .Params.archived }}
|
archived={{ default false .Params.archived }}
|
||||||
|
words={{ .WordCount }}
|
||||||
</div>
|
</div>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
13
layouts/shortcodes/file.html
Normal file
13
layouts/shortcodes/file.html
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
{{- if gt ( len .Params ) 1 -}}
|
||||||
|
{{- $.Scratch.Set "format" ( .Get 1 ) -}}
|
||||||
|
{{- else -}}
|
||||||
|
{{- $splits := ( split ( .Get 0 ) "." ) -}}
|
||||||
|
{{- $splitsLength := ( len $splits ) -}}
|
||||||
|
{{- $format := ( index $splits ( sub $splitsLength 1 ) ) -}}
|
||||||
|
{{- $.Scratch.Set "format" $format -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{- $file := ( .Get 0 ) -}}
|
||||||
|
{{- $format := ( $.Scratch.Get "format" ) -}}
|
||||||
|
|
||||||
|
{{- ( print "```" $format "\n" ( readFile $file ) "\n" "```" ) | markdownify -}}
|
||||||
Reference in New Issue
Block a user