diff --git a/README.md b/README.md index faf5e82..a084e50 100644 --- a/README.md +++ b/README.md @@ -1,24 +1,13 @@ -# ʕ •ᴥ•ʔつ🗳️ Voting Bear Cub +# ᕦʕ •ᴥ•ʔᕤ Bear Cub -[](https://forge.alexselimov.com/aselimov/hugo-bearcub/src/branch/main/LICENSE) +[](https://github.com/clente/hugo-bearcub/actions/workflows/gh-pages.yml) +[](https://github.com/clente/hugo-bearcub/blob/main/LICENSE) ## Overview -This is a fork of [Bear Cub](https://github.com/clente/hugo-bearcub) with the -following additions: - -- **Anonymous post upvoting**: each post can display an upvote button backed by - a configurable API endpoint. Votes are tracked anonymously via cookies so - readers can toggle their vote without creating an account. Enable with - `upvotes = true` and set `upvoteApi` to your API base URL. -- **Redesigned header**: the site header now uses a mesh SVG background for a - more distinctive look. -- **GitHub light/dark color scheme**: the syntax highlighting palette has been - replaced with colors matching the GitHub light and dark themes. -- **Herman CSS upvote styles**: upvote button styles are bundled into the Herman - CSS variant so the button integrates cleanly with the existing theme. -- **Configurable index post count**: use `postsToShowOnIndex` in `[params]` to - control how many posts appear on the home page (defaults to 3). +🐻 A lightweight [Hugo](https://gohugo.io/) theme based on [Bear +Blog](https://bearblog.dev) and [Hugo Bear +Blog](https://github.com/janraasch/hugo-bearblog). **Bear Cub** takes care of speed and optimization, so you can focus on writing good content. It is free, multilingual, optimized for search engines, @@ -40,11 +29,6 @@ To finish off, append a line to the site configuration file: echo 'theme = "hugo-bearcub"' >> hugo.toml ``` -### Anonymous voting - -To easily setup the anonymous voting you need to run an [upvoters](https://forge.alexselimov.com/aselimov/upvoters) server. -You should be able to ship your own solution as well. - ## Features Like [Bear Blog](https://bearblog.dev), this theme: diff --git a/assets/auto-theme.css b/assets/auto-theme.css index 276e937..dce83e8 100644 --- a/assets/auto-theme.css +++ b/assets/auto-theme.css @@ -55,7 +55,7 @@ footer { } .mesh-image { - color: #EF9F27; + color: #61ABDA; } .footer-copy { @@ -104,17 +104,13 @@ li { } @media (prefers-color-scheme: light) { - #upvote-btn[voted] { - color: #EF9F27; - } - body { - background-color: #fffdf8; - color: #201e1b; + background-color: #ffffff; + color: #1f2328; } .mesh-image { - color: #EF9F27; + color: #61ABDA; } h1, @@ -129,12 +125,12 @@ li { } a { - color: #EF9F27; + color: #61ABDA; } a:visited, ul.blog-posts li a:visited { - color: #EF9F27; + color: #61ABDA; } header a, @@ -182,7 +178,7 @@ li { a, a:visited, ul.blog-posts li a:visited { - color: #EF9F27; + color: #61ABDA; } header a, diff --git a/assets/herman.css b/assets/herman.css index e2dfc11..f2573c3 100644 --- a/assets/herman.css +++ b/assets/herman.css @@ -1,8 +1,8 @@ :root { font-size: 62.5%; /* 10px */ - --color-dark: #1a1a1a; - --color-light: #faf8f4; - --color-primary: #EF9F27; + --color-dark: #181a20; + --color-light: #fafafa; + --color-primary: #1a8fe3; --size: 1rem; --spacing: calc(var(--size) * 2.4); } @@ -190,51 +190,6 @@ td { transform: translateY(0%); } -.upvote { - display: flex; - flex-direction: column; - align-items: center; - width: fit-content; - gap: 0.2rem; - margin-block: var(--spacing); -} - -#upvote-btn { - background: none; - border: none; - cursor: pointer; - color: currentColor; - font-size: calc(var(--size) * 4); - line-height: 0.8; - padding: 0; - display: flex; - flex-direction: column; - align-items: center; - gap: 0; - opacity: 0.4; - transition: opacity 0.15s, color 0.15s; -} - -#upvote-btn:hover { - opacity: 0.8; -} - -#upvote-btn[voted] { - color: var(--color-primary); - opacity: 1; -} - -#upvote-chevron { - display: block; - line-height: 1; - margin-bottom: -0.3em; -} - -#upvote-count { - font-size: calc(var(--size) * 1.6); - line-height: 1; -} - figure { margin-inline-start: 0em; margin-inline-end: 0em; diff --git a/exampleSite/hugo.toml b/exampleSite/hugo.toml index 939c13d..04690c0 100644 --- a/exampleSite/hugo.toml +++ b/exampleSite/hugo.toml @@ -75,17 +75,6 @@ enableRobotsTXT = true # information see layouts/partials/social_card.html generateSocialCard = true - # The number of posts to show on the index page. Defaults to 3 if not set. - postsToShowOnIndex = 3 - - # Enable upvoting on posts. When set to true, each post will display an upvote - # button that calls the API endpoint specified by `upvoteApi`. - upvotes = false - - # The base URL of the upvote API. Only used when `upvotes = true`. - # The API is expected to handle GET and POST requests at {upvoteApi}/{post-path}. - upvoteApi = "https://example.com/api" - # Social media. Delete any item you aren't using to make sure it won't show up # in your website's metadata. [params.social] diff --git a/go.mod b/go.mod new file mode 100644 index 0000000..1008b40 --- /dev/null +++ b/go.mod @@ -0,0 +1,3 @@ +module hugo-bearcub + +go 1.26.2 diff --git a/layouts/_default/single.html b/layouts/_default/single.html index 5f5d4db..0c85516 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -27,14 +27,4 @@
{{ end }} {{ end }} -{{ if and .Site.Params.upvotes (not .Params.hideUpvotes) }} -