From 0683be2044095a011cf15d05e415ca1c68f6d5eb Mon Sep 17 00:00:00 2001 From: Shivan Sivakumaran <51132467+shivan-s@users.noreply.github.com> Date: Sat, 19 Oct 2024 00:26:25 +1300 Subject: [PATCH] Improves the header of the main page (#6) --- archetypes/default.md | 4 +- assets/css/main.css | 146 +++++++++++++++++++++++------- content/_index.md | 9 -- hugo.toml | 23 ----- hugo.yml | 30 ++++++ layouts/_default/baseof.html | 15 ++- layouts/_default/home.html | 19 ++-- layouts/_default/list.html | 11 +-- layouts/_default/single.html | 13 ++- layouts/partials/breadcrumbs.html | 8 ++ layouts/partials/footer.html | 13 ++- layouts/partials/header.html | 8 +- layouts/partials/menu.html | 59 ++++++------ theme.toml | 31 ------- theme.yml | 21 +++++ 15 files changed, 250 insertions(+), 160 deletions(-) delete mode 100644 content/_index.md delete mode 100644 hugo.toml create mode 100644 hugo.yml create mode 100644 layouts/partials/breadcrumbs.html delete mode 100644 theme.toml create mode 100644 theme.yml diff --git a/archetypes/default.md b/archetypes/default.md index c6f3fce..2120614 100644 --- a/archetypes/default.md +++ b/archetypes/default.md @@ -1,5 +1,5 @@ -+++ +--- title = '{{ replace .File.ContentBaseName "-" " " | title }}' date = {{ .Date }} draft = true -+++ +--- diff --git a/assets/css/main.css b/assets/css/main.css index e0cc053..602aa38 100644 --- a/assets/css/main.css +++ b/assets/css/main.css @@ -1,67 +1,151 @@ :root { + /* Colors */ --primary-color: #196680; --secondary-color: #80dfff; --alternative-color: #ff9b33; --text-color: #222222; + + /* Spacing */ + --small-gap: 0.5rem; + --gap: 1rem; + --variable-gap: calc(8px + 1.5625vw); } -a { - color: var(--primary-color); +* { + transition: all 0.3s ease-in-out; } -.dark a { - color: var(--secondary-color); +h1, +h2 { + font-family: + Optician Sans, + sans-serif; } -a:hover { - color: var(--alternative-color); +header, +footer { + font-family: + Optician Sans, + sans-serif; } -h1, -h2, -h3 { +header nav { + display: flex; + flex-direction: column; + align-items: center; +} + +header nav a { + display: flex; + flex-grow: 1; + justify-content: center; +} + +header nav ul { + display: flex; + flex-wrap: wrap; + justify-content: center; +} + +header nav ul:hover a:not(:hover) { + opacity: 0.8; + filter: blur(1px); +} + +header nav ul a:hover { + outline: 2px ridge var(--text-color); + filter: none; + border-radius: 4rem; + box-shadow: 0 0 0 2pt var(--text-color); +} + +header nav ul li a { + padding: 0.5rem 1rem; +} + +header nav ul li { + list-style: none; +} + +[aria-current="page"] { + outline: 2px ridge var(--text-color); + filter: none; + border-radius: 4rem; + box-shadow: 0 0 0 2pt var(--text-color); +} + +section { + border-radius: 1rem; + padding: 0rem calc(var(--gap) / 2); +} + +section.info { + display: flex; + flex-direction: column; + box-shadow: 1px 1px 1px black; + border: 1px solid var(--text-color); +} + +section.info a.more { + align-self: end; + padding: 1rem; +} + +a { color: var(--primary-color); + text-decoration: underline dotted; } -.dark h1, -.dark h2, -.dark h3 { - color: var(--secondary-color); +a:hover { + color: var(--alternative-color); + text-decoration: underline solid; } -.dark .pagination a { +h1, +h2, +h3 { color: var(--primary-color); } body { - color: #222; + display: flex; + margin: 0; + flex-direction: column; + width: 100dvw; + min-height: 100dvh; + color: var(--text-color); font-family: Monaspace Argon, sans-serif; - line-height: 1.5; - margin: 1rem; - max-width: 768px; } -header { - border-bottom: 1px solid #222; - margin-bottom: 1rem; +main { + display: flex; + flex-direction: column; + gap: var(--small-gap); + margin-left: auto; + margin-right: auto; + padding: 0 var(--variable-gap); + width: 100%; + max-width: calc(75ch + var(--variable-gap)); + flex-grow: 1; } footer { - border-top: 1px solid #222; - margin-top: 1rem; + display: flex; + align-items: center; + justify-content: center; + gap: var(--gap); } -a { - color: #00e; - text-decoration: none; +ul#breadcrumbs { + list-style: none; + display: flex; + gap: 1ch; } -h1 { - font-family: - Optician Sans, - sans-serif; +ul#breadcrumbs>li:not(:last-child)::after { + content: " /"; } @font-face { @@ -80,5 +164,5 @@ h1 { @font-face { font-family: "Monaspace Argon"; font-style: normal; - src: url("/fonts/MonaspaceArgon-Medium.woff") format("woff"); + src: url("/fonts/MonaspaceArgon-Regular.woff") format("woff"); } diff --git a/content/_index.md b/content/_index.md deleted file mode 100644 index 0e6a35a..0000000 --- a/content/_index.md +++ /dev/null @@ -1,9 +0,0 @@ ---- -title: "Home" ---- - -# Hi there - -Welcome to your new Hugo site. - -Now go build something great. diff --git a/hugo.toml b/hugo.toml deleted file mode 100644 index 6c35bc4..0000000 --- a/hugo.toml +++ /dev/null @@ -1,23 +0,0 @@ -baseURL = 'https://example.org/' -languageCode = 'en-US' -title = 'My New Hugo Site' - -[[menus.main]] -name = 'Home' -pageRef = '/' -weight = 10 - -[[menus.main]] -name = 'Posts' -pageRef = '/posts' -weight = 20 - -[[menus.main]] -name = 'Tags' -pageRef = '/tags' -weight = 30 - -[module] - [module.hugoVersion] - extended = false - min = "0.116.0" diff --git a/hugo.yml b/hugo.yml new file mode 100644 index 0000000..634a5ac --- /dev/null +++ b/hugo.yml @@ -0,0 +1,30 @@ +--- +baseURL: https://example.org/ +languageCode: en-US +title: My New Hugo Site + +params: + author: + email: author@email.com + name: Author name + welcome: + title: Welcome + body: Stuff in here + image: image.webp + +menus: + main: + - name: About + pageRef: /about + weight: 10 + - name: Posts + pageRef: /posts + weight: 20 + - name: Projects + pageRef: /projects + weight: 30 + +module: + hugoVersion: + extended: false + min: "0.116.0" diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html index 39dcbec..b7fd44b 100644 --- a/layouts/_default/baseof.html +++ b/layouts/_default/baseof.html @@ -1,17 +1,16 @@ - + +
{{ partial "head.html" . }} + -Copyright {{ now.Year }}. All rights reserved.
++ Made with 💗 by + {{ .Site.Params.author.name + }} +
+·
++ âš¡ by + Hugo in + +
diff --git a/layouts/partials/header.html b/layouts/partials/header.html index 7980a00..c9cab34 100644 --- a/layouts/partials/header.html +++ b/layouts/partials/header.html @@ -1,2 +1,6 @@ -