From 390ad616942c7a62c4bef07b57233832b1e824c0 Mon Sep 17 00:00:00 2001
From: Ian Cook <6866411+nai888@users.noreply.github.com>
Date: Mon, 20 Mar 2023 19:45:44 -0500
Subject: [PATCH 1/5] Enable inverting homepage section styling
Add invert Param to the config file. Add the 'odd' class to the
post-holders and the 'even' class to the post-afters using Hugo if
statements instead of using JS. Marking invert = true in the config file
flips which sections are marked odd and even.
---
assets/js/index.js | 8 --------
exampleSite/config.toml | 3 +++
layouts/index.html | 4 ++--
3 files changed, 5 insertions(+), 10 deletions(-)
diff --git a/assets/js/index.js b/assets/js/index.js
index 838adbc..5a1a4e1 100644
--- a/assets/js/index.js
+++ b/assets/js/index.js
@@ -28,17 +28,9 @@ var $sitehead = $("#site-head");
}
}
$(document).ready(function () {
- $postholder.each(function (e) {
- if (e % 2 != 0) $(this).addClass("odd");
- });
-
$postafter.each(function (e) {
var bg = $(this).parent().css("background-color");
$(this).css("border-top-color", bg);
-
- if (e % 2 == 0) {
- $(this).addClass("even");
- }
});
$("a.btn.site-menu").click(function (e) {
diff --git a/exampleSite/config.toml b/exampleSite/config.toml
index e105224..c7ac694 100644
--- a/exampleSite/config.toml
+++ b/exampleSite/config.toml
@@ -44,6 +44,9 @@ title = "Jane Doe - Nutrition Coach & Chef Consultant"
# This theme will, by default, inject a design-by-line at the bottom of the page.
# You can turn it off, but we would really appreciate if you don’t :-)
hidedesignbyline = false
+
+ # The sections of the home page alternate styling. Mark invert as true to swap the styling of the sections
+ invert = false
[params.meta]
keywords = "some, keywords, for, seo, you, know, google, duckduckgo, and, such"
diff --git a/layouts/index.html b/layouts/index.html
index 764616f..673a156 100644
--- a/layouts/index.html
+++ b/layouts/index.html
@@ -28,7 +28,7 @@
+
{{ end }}
From 104cb845702a62427f65e230a659cb612a7320ef Mon Sep 17 00:00:00 2001
From: Ian Cook <6866411+nai888@users.noreply.github.com>
Date: Tue, 21 Mar 2023 10:12:20 -0500
Subject: [PATCH 2/5] Change "invert" Param to "invertSectionColors"
---
exampleSite/config.toml | 2 +-
layouts/index.html | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/exampleSite/config.toml b/exampleSite/config.toml
index c7ac694..089c65d 100644
--- a/exampleSite/config.toml
+++ b/exampleSite/config.toml
@@ -46,7 +46,7 @@ title = "Jane Doe - Nutrition Coach & Chef Consultant"
hidedesignbyline = false
# The sections of the home page alternate styling. Mark invert as true to swap the styling of the sections
- invert = false
+ invertSectionColors = false
[params.meta]
keywords = "some, keywords, for, seo, you, know, google, duckduckgo, and, such"
diff --git a/layouts/index.html b/layouts/index.html
index 673a156..a781026 100644
--- a/layouts/index.html
+++ b/layouts/index.html
@@ -28,7 +28,7 @@
{{ range $index_val, $elem_val := $filtered }}
-
+
{{ end }}
From 147b87c3de6886f5bc0659943f6f2e8bfbc4f46c Mon Sep 17 00:00:00 2001
From: Ian Cook <6866411+nai888@users.noreply.github.com>
Date: Tue, 21 Mar 2023 10:13:01 -0500
Subject: [PATCH 3/5] Swap "odd" and "even" for "dark" and "light" classes
---
assets/css/screen.css | 12 ++++++------
layouts/index.html | 4 ++--
2 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/assets/css/screen.css b/assets/css/screen.css
index 15f3019..4425658 100644
--- a/assets/css/screen.css
+++ b/assets/css/screen.css
@@ -356,13 +356,13 @@ table table table {
background-color: #fff;
}
-table tbody > tr:nth-child(odd) > td,
-table tbody > tr:nth-child(odd) > th {
+table tbody > tr:nth-child(dark) > td,
+table tbody > tr:nth-child(dark) > th {
background-color: #f6f6f6;
}
-table.plain tbody > tr:nth-child(odd) > td,
-table.plain tbody > tr:nth-child(odd) > th {
+table.plain tbody > tr:nth-child(dark) > td,
+table.plain tbody > tr:nth-child(dark) > th {
background: transparent;
}
@@ -466,7 +466,7 @@ li {
background: #f2efe8;
position: relative;
}
-.post-holder.odd {
+.post-holder.dark {
background: #b80135;
color: white;
}
@@ -528,7 +528,7 @@ a.fn-item.active {
border-top: 50px solid #f2efe8;
border-radius: 25px;
}
-.post-after.even {
+.post-after.light {
left: 6%;
}
diff --git a/layouts/index.html b/layouts/index.html
index a781026..2c1d62d 100644
--- a/layouts/index.html
+++ b/layouts/index.html
@@ -28,7 +28,7 @@
{{ range $index_val, $elem_val := $filtered }}
-
+
{{ end }}
From 2d9ea74d0807168af6753165491f021439803022 Mon Sep 17 00:00:00 2001
From: Ian Cook <6866411+nai888@users.noreply.github.com>
Date: Tue, 21 Mar 2023 10:15:49 -0500
Subject: [PATCH 4/5] Fix erroneous CSS changes
---
assets/css/screen.css | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/assets/css/screen.css b/assets/css/screen.css
index 4425658..f3a3b4b 100644
--- a/assets/css/screen.css
+++ b/assets/css/screen.css
@@ -356,13 +356,13 @@ table table table {
background-color: #fff;
}
-table tbody > tr:nth-child(dark) > td,
-table tbody > tr:nth-child(dark) > th {
+table tbody > tr:nth-child(odd) > td,
+table tbody > tr:nth-child(odd) > th {
background-color: #f6f6f6;
}
-table.plain tbody > tr:nth-child(dark) > td,
-table.plain tbody > tr:nth-child(dark) > th {
+table.plain tbody > tr:nth-child(odd) > td,
+table.plain tbody > tr:nth-child(odd) > th {
background: transparent;
}
From 480fceea3a7c2e9124bb28a3eb9f6be69cf31db3 Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Tue, 21 Mar 2023 16:07:32 +0000
Subject: [PATCH 5/5] chore(deps-dev): bump prettier from 2.8.5 to 2.8.6
Bumps [prettier](https://github.com/prettier/prettier) from 2.8.5 to 2.8.6.
- [Release notes](https://github.com/prettier/prettier/releases)
- [Changelog](https://github.com/prettier/prettier/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prettier/prettier/compare/2.8.5...2.8.6)
---
updated-dependencies:
- dependency-name: prettier
dependency-type: direct:development
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot]
---
package-lock.json | 6 +++---
package.json | 2 +-
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/package-lock.json b/package-lock.json
index d465935..fbf1e8b 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -5,9 +5,9 @@
"requires": true,
"dependencies": {
"prettier": {
- "version": "2.8.5",
- "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.8.5.tgz",
- "integrity": "sha512-3gzuxrHbKUePRBB4ZeU08VNkUcqEHaUaouNt0m7LGP4Hti/NuB07C7PPTM/LkWqXoJYJn2McEo5+kxPNrtQkLQ==",
+ "version": "2.8.6",
+ "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.8.6.tgz",
+ "integrity": "sha512-mtuzdiBbHwPEgl7NxWlqOkithPyp4VN93V7VeHVWBF+ad3I5avc0RVDT4oImXQy9H/AqxA2NSQH8pSxHW6FYbQ==",
"dev": true
},
"prettier-plugin-go-template": {
diff --git a/package.json b/package.json
index 529c2db..45d6c4b 100644
--- a/package.json
+++ b/package.json
@@ -23,7 +23,7 @@
},
"homepage": "https://github.com/zjedi/hugo-scroll#readme",
"devDependencies": {
- "prettier": "^2.8.5",
+ "prettier": "^2.8.6",
"prettier-plugin-go-template": "0.0.13"
}
}