Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/742 all categories page #765

Merged
merged 7 commits into from
Oct 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .cz.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
"schema": "<type>(<scope>): <subject>\n \n<body>\n \n(BREAKING CHANGE: )<footer>",
"schema_pattern": "^(build|chore|ci|docs|feat|fix|perf|refactor|revert|style|test){1}(\\([\\w\\-\\.]+\\))?(!)?: ([\\w \\-'])+([\\s\\S]*)",
"commit_parser": "^((?P<change_type>chore|build|ci|docs|feat|fix|perf|refactor|revert|style|test|BREAKING CHANGE)(?:\\((?P<scope>[^()\r\n]*)\\)|\\()?(?P<breaking>!)?|\\w+!):\\s(?P<message>.*)?",
"changelog_pattern": "^(.+!|BREAKING CHANGE|chore|build|ci|docs|feat|fix|perf|refactor|revert|style|test):",
"bump_pattern": "^(.+!|BREAKING CHANGE|chore|docs|feat|fix|perf|refactor|revert|style|test):",
"changelog_pattern": "^(BREAKING CHANGE|chore|build|ci|docs|feat|fix|perf|refactor|revert|style|test)",
"bump_pattern": "^(BREAKING CHANGE|chore|docs|feat|fix|perf|refactor|revert|style|test)",
"bump_map": {
".+!": "MAJOR",
"BREAKING CHANGE": "MAJOR",
Expand Down Expand Up @@ -191,4 +191,4 @@
]
}
}
}
}
1 change: 1 addition & 0 deletions _ci/spell/dict.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ ohhhhh
ongoingly
pageviews
pinboard
precompress
provideth
psbl
psxl
Expand Down
8 changes: 4 additions & 4 deletions _utils/_scripts/bump.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,9 @@ config="_utils/_cliff/config.toml"
file="CHANGELOG.md"
str=$(cz bump --dry-run | awk '/tag to create: /')
ver=${str//tag to create: /}
branch=$(git branch --show-current)
[[ $branch != release* ]] && git checkout -b release/$ver
branch=$(git branch --show-current)
git cliff -c $config --unreleased --tag $ver --prepend ${file}
git ls-files --modified
read -p $'\e[31mWould you like to stage the changelog updates for commit?\e[0m: ' -n 1 -r
read -p $'\e[31mWould you like to cut the release branch and stage changelog updates?\e[0m: ' -n 1 -r
echo # newline
if [[ ! $REPLY =~ ^[Yy]$ ]]; then
read -p $'\e[31mWould you like to undo the changelog updates?\e[0m: ' -n 1 -r
Expand All @@ -22,6 +19,9 @@ if [[ ! $REPLY =~ ^[Yy]$ ]]; then
git restore CHANGELOG.md
exit 1
fi
branch=$(git branch --show-current)
[[ $branch != release* ]] && git checkout -b release/$ver
branch=$(git branch --show-current)
git add CHANGELOG.md
git status
read -p $'\e[31mDouble check the staged files. Would you like to commit these changes?\e[0m: ' -n 1 -r
Expand Down
6 changes: 3 additions & 3 deletions front/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@
"preview": "vite --config vite.config.js preview",
"preview.local": "vite --config vite.local.config.js preview",
"postinstall": "patch-package",
"postbuild.l": "npx svelte-sitemap -i '404' -i 'shingle' -t --attribution=false --domain https://local.dgrebb.com",
"postbuild.s": "npx svelte-sitemap -i '404' -i 'shingle' -t --attribution=false --domain https://stg.dgrebb.com",
"postbuild": "npx svelte-sitemap -i '404' -i 'shingle' -t --attribution=false --domain https://www.dgrebb.com"
"postbuild.l": "npx svelte-sitemap -i '404.html' -i '/404/index.html' -i 'shingle.html' -i '/shingle/index.html' -i '/posts/category/index.html' -t --attribution=false --domain https://local.dgrebb.com",
"postbuild.s": "npx svelte-sitemap -i '404.html' -i '/404/index.html' -i 'shingle.html' -i '/shingle/index.html' -i '/posts/category/index.html' -t --attribution=false --domain https://stg.dgrebb.com",
"postbuild": "npx svelte-sitemap -i '404.html' -i '/404/index.html' -i 'shingle.html' -i '/shingle/index.html' -i '/posts/category/index.html' -t --attribution=false --domain https://www.dgrebb.com"
},
"devDependencies": {
"@accuser/svelte-plausible-analytics": "github:dgrebb/svelte-plausible-analytics#release/v0.6.0",
Expand Down
17 changes: 17 additions & 0 deletions front/src/lib/components/PageNav.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
export let mini = false;
export let top = false;
export let setActiveLink = null;
export let category = null;

function activeLink(node) {
const link = node.attributes.href.value;
Expand Down Expand Up @@ -56,6 +57,21 @@
{#if categories && categories.length}
<h2>Categories</h2>
<ul class="page-navigation-list">
<li class="page-navigation-category-all">
<a
on:click={(e) => {
categoryClick(pathname, name);
setActiveLink(e);
if (mini) pageFenceClickHandler();
}}
href="/posts/category/all/"
class="transition-link"
class:active={category === 'all'}
use:activeLink
>
All
</a>
</li>
{#each categories as { attributes: { name, slug } }, i}
<li>
<a
Expand All @@ -66,6 +82,7 @@
}}
href="/posts/category/{slug}/"
class="transition-link"
class:active={category === slug}
use:activeLink
>
{name}
Expand Down
11 changes: 11 additions & 0 deletions front/src/lib/components/icons/Tag.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<svg
xmlns="http://www.w3.org/2000/svg"
width="11"
height="11"
viewBox="0 0 16 16"
class="category-tag-icon"
><path
fill="currentColor"
d="M2.587 7.314a1.988 1.988 0 0 0 0 2.822l3.296 3.28a2.013 2.013 0 0 0 2.836 0l4.67-4.647a1.99 1.99 0 0 0 .587-1.397L14 4.01A2 2 0 0 0 11.987 2l-3.25.014a2.01 2.01 0 0 0-1.41.584l-4.74 4.716ZM11 6a1 1 0 1 1 0-2a1 1 0 0 1 0 2Z"
/></svg
>
2 changes: 2 additions & 0 deletions front/src/lib/styles/base/colors-light.css
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,10 @@
--lemon-50-a30: #fdfdee4c;
--lemon-50-a75: #fdfdeebf;
--jasper: #cd533bff;
--jasper-a50: #cd533b7f;
--darkred: #8c1c13ff;
--sand: #fc9f5bff;
--sand-a50: #fc9f5b7f;
--green: #5aff15ff;
--darkgreen: #5e6319ff;
--blue: #4062bbff;
Expand Down
80 changes: 39 additions & 41 deletions front/src/lib/styles/base/theme.css
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,8 @@
--link-clr: var(--violet-a75);
--link-clr--hover: var(--jasper);
--highlight-clr: var(--jasper);
--tag-clr: var(--sand-a50);
--tag-border-clr: var(--jasper-a50);

--rim-light-bg: linear-gradient(
10deg,
Expand Down Expand Up @@ -438,16 +440,6 @@
p {
color: var(--violet-a75);
}
&:hover,
&:focus,
&:focus-within {
.post-item-image {
opacity: 1;
}
a .post-title {
color: var(--jasper);
}
}
}
}

Expand All @@ -460,28 +452,36 @@
color: var(--violet);
}
}
~ label {
~ .page-navigation-toggle {
background-color: var(--lemon-50-a75);
color: var(--violet-a50);
&:hover,
&:focus,
&:focus-visible {
background-color: var(--sun-50);
color: var(--violet);
}
& + .page-navigation-list {
background-color: var(--lemon-50-a75);
}
}
&:checked {
~ label,
label.bottom {
~ .page-navigation-toggle {
background-color: transparent;
}
& + .page-navigation-list {
background-color: var(--lemon-50-a75);
& label.bottom {
color: var(--violet-a50);
&:hover,
&:focus,
&:focus-visible {
background-color: transparent;
color: var(--violet);
}
& + .page-navigation-list {
background-color: var(--lemon-50-a75);
label.bottom {
background-color: transparent;
color: var(--violet-a50);
&:hover,
&:focus,
&:focus-visible {
color: var(--violet);
}
}
}
}
}
Expand All @@ -493,7 +493,7 @@
transition-duration: var(--transition-duration);
transition-property: color;
transition-timing-function: var(--transition-timing-function);
color: var(--fg-clr);
color: var(--violet-a75);
&:hover,
&:focus,
&:focus-visible {
Expand Down Expand Up @@ -524,6 +524,8 @@
--link-clr: var(--celestial-a75);
--link-clr--hover: var(--celestial);
--highlight-clr: var(--orange);
--tag-clr: var(--grape);
--tag-border-clr: var(--celestial-a30);

--rim-light-bg: linear-gradient(
10deg,
Expand Down Expand Up @@ -838,16 +840,6 @@
p {
color: var(--fg-clr);
}
&:hover,
&:focus,
&:focus-within {
.post-item-image {
opacity: 1;
}
a .post-title {
color: var(--orange);
}
}
}
}

Expand Down Expand Up @@ -876,26 +868,32 @@
color: var(--celestial);
}
}
~ label {
~ .page-navigation-toggle {
background-color: var(--oxford-blue-a50);
&:hover,
&:focus,
&:focus-visible {
background-color: var(--grape);
color: var(--celestial);
}
& + .page-navigation-list {
background-color: var(--rich-black-a75);
}
&:checked {
~ label,
label.bottom {
}
&:checked {
~ .page-navigation-toggle {
background-color: transparent;
&:hover,
&:focus,
&:focus-visible {
background-color: transparent;
color: var(--celestial);
}
& + .page-navigation-list {
background-color: var(--rich-black-a75);
& label.bottom {
background-color: transparent;
label.bottom {
&:hover,
&:focus,
&:focus-visible {
color: var(--celestial);
}
}
}
}
Expand Down
37 changes: 23 additions & 14 deletions front/src/lib/styles/components/page-nav.css
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
cursor: default;
padding-right: 1rem;
&:after {
top: calc(50% - 0.75rem);
top: calc(50% - 0.7rem);
right: 0;
padding-left: 0.5rem;
content: '•';
Expand All @@ -54,7 +54,7 @@
@media screen and (min-width: 640px) {
display: none;
}
label {
.page-navigation-toggle {
display: inline-block;
position: relative;
vertical-align: middle;
Expand All @@ -65,7 +65,6 @@
cursor: pointer;
box-shadow: var(--shadow-elevation-low);
border-radius: 0.33rem;
padding: 0.33rem 0.33rem 0.36rem 0.36rem;
}
input#page-navigation-checkbox {
position: absolute;
Expand All @@ -83,15 +82,7 @@
outline-offset: 1px;
}
}
&:checked {
&:focus,
&:focus-visible {
~ label {
mix-blend-mode: normal;
}
}
}
~ label {
~ .page-navigation-toggle {
.page-navigation-open {
display: block;
}
Expand Down Expand Up @@ -130,8 +121,20 @@
}
}
&:checked {
~ label {
&:focus,
&:focus-visible {
~ .page-navigation-toggle {
mix-blend-mode: normal;
}
}
~ .page-navigation-toggle {
box-shadow: none;
background-color: transparent;
&:hover,
&:focus,
&:focus-visible {
background-color: transparent;
}
.page-navigation-open {
display: none;
}
Expand All @@ -143,8 +146,14 @@
visibility: visible;
opacity: 1;
max-height: 100%;
& label.bottom {
label.bottom {
box-shadow: none;
background-color: transparent;
&:hover,
&:focus,
&:focus-visible {
background-color: transparent;
}
.page-navigation-open {
display: none;
}
Expand Down
Loading
Loading