diff --git a/themes/hugo-bearcub/hugo/.github/workflows/gh-pages.yml b/themes/hugo-bearcub/hugo/.github/workflows/gh-pages.yml new file mode 100644 index 0000000..f7f133d --- /dev/null +++ b/themes/hugo-bearcub/hugo/.github/workflows/gh-pages.yml @@ -0,0 +1,32 @@ +name: github pages + +on: + push: + branches: + - main # Set a branch that will trigger a deployment + pull_request: + +jobs: + deploy: + runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@v3 + with: + submodules: true # Fetch Hugo themes (true OR recursive) + fetch-depth: 0 # Fetch all history for .GitInfo and .Lastmod + + - name: Setup Hugo + uses: peaceiris/actions-hugo@v2 + with: + hugo-version: 'latest' + extended: true + + - name: Build + run: hugo --minify --gc --destination ../public --source ./exampleSite --themesDir ../.. --baseURL https://clente.github.io/hugo-bearcub/ + + - name: Deploy + uses: peaceiris/actions-gh-pages@v3 + if: github.ref == 'refs/heads/main' + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: ./public diff --git a/themes/hugo-bearcub/hugo/.gitignore b/themes/hugo-bearcub/hugo/.gitignore new file mode 100644 index 0000000..305d231 --- /dev/null +++ b/themes/hugo-bearcub/hugo/.gitignore @@ -0,0 +1,4 @@ +.hugo_build.lock +.DS_Store +resources/ +todo.md \ No newline at end of file diff --git a/themes/hugo-bearcub/hugo/LICENSE b/themes/hugo-bearcub/hugo/LICENSE new file mode 100644 index 0000000..5c93582 --- /dev/null +++ b/themes/hugo-bearcub/hugo/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2020 Jan Raasch +Copyright (c) 2023 Caio Lente + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/themes/hugo-bearcub/hugo/README.md b/themes/hugo-bearcub/hugo/README.md new file mode 100644 index 0000000..0636c04 --- /dev/null +++ b/themes/hugo-bearcub/hugo/README.md @@ -0,0 +1,227 @@ +# ᕦʕ •ᴥ•ʔᕤ Bear Cub + +[![github pages](https://github.com/clente/hugo-bearcub/actions/workflows/gh-pages.yml/badge.svg)](https://github.com/clente/hugo-bearcub/actions/workflows/gh-pages.yml) +[![MIT license](https://img.shields.io/github/license/clente/hugo-bearcub)](https://github.com/clente/hugo-bearcub/blob/main/LICENSE) + +## Overview + +🐻 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, +no-nonsense, responsive, light, and fast. Really fast. + +## Installation + +Follow Hugo's [quick start](https://gohugo.io/getting-started/quick-start/) to +create an empty website and then clone **Bear Cub** into the themes directory as +a [Git submodule](https://git-scm.com/book/en/v2/Git-Tools-Submodules): + +```sh +git submodule add https://github.com/clente/hugo-bearcub themes/hugo-bearcub +``` + +To finish off, append a line to the site configuration file: + +```sh +echo 'theme = "hugo-bearcub"' >> config.toml +``` + +## Features + +Like [Bear Blog](https://bearblog.dev), this theme: +- Is free and open source +- Looks great on any device +- Makes tiny (~5kb), optimized, and awesome pages +- Has no trackers, ads, or scripts +- Automatically generates an RSS feed + +But that's not all! **Bear Cub** is also... + +### Accessible + +**Bear Cub** has a few accessibility upgrades when compared to its predecessors. +The color palette has been overhauled to make sure everything is +[readable](https://web.dev/color-and-contrast-accessibility/) for users with low +vision impairments or color deficiencies, and some interactive elements were +made bigger to facilitate [clicking](https://web.dev/accessible-tap-targets/) +for users with a motor impairment. + +These small changes mean that **Bear Cub** passes Google's [PageSpeed +test](https://pagespeed.web.dev/report?url=https%3A%2F%2Fclente.github.io%2Fhugo-bearcub%2F) +with flying colors. + +![PageSpeed score](https://raw.githubusercontent.com/clente/hugo-bearcub/main/images/pagespeed.webp) + +### Secure + +[**Bear Cub**'s demo](https://clente.github.io/hugo-bearcub/) is hosted on GitHub +and therefore I'm not in control of its [Content Security +Policy](https://infosec.mozilla.org/guidelines/web_security#content-security-policy). +However, the theme itself was made with security in mind: there are no inline +styles and it uses no JavaScript at all. + +If you want to improve your [Mozilla +Observatory](https://observatory.mozilla.org/) score even further, you should be +able to simply add a few headers to your hosting service's configuration (e.g. +[Netlify](https://docs.netlify.com/routing/headers/) or [Cloudflare +Pages](https://developers.cloudflare.com/pages/platform/headers/)) and never +have to think about it again. My `_headers` file, for example, looks like this: + +``` +/* + X-Content-Type-Options: nosniff + Strict-Transport-Security: "max-age=31536000; includeSubDomains; preload" env=HTTPS + Cache-Control: max-age=31536000, public + X-Frame-Options: deny + Referrer-Policy: no-referrer + Feature-Policy: microphone 'none'; payment 'none'; geolocation 'none'; midi 'none'; sync-xhr 'none'; camera 'none'; magnetometer 'none'; gyroscope 'none' + Content-Security-Policy: default-src 'none'; manifest-src 'self'; font-src 'self'; img-src 'self'; style-src 'self'; form-action 'none'; frame-ancestors 'none'; base-uri 'none' + X-XSS-Protection: 1; mode=block +``` + +### Multilingual + +If you need to write a blog that supports more than one language, **Bear Cub** +has you covered! Check out the demo's [`config.toml` +file](https://github.com/clente/hugo-bearcub/blob/main/exampleSite/config.toml) +for a sample of how you can setup multilingual support. + +By default, the theme creates a translation button that gets disabled when the +current page is only available in any other language. You can also choose to +hide this button (instead of disabling it) by setting `hideUntranslated = +false`. + +### More + +Every once in a while, as I keep using **Bear Cub**, I notice that there is some +functionality missing. Currently, these are the "advanced features" that I have +already implemented: + +- Full-text RSS feed: an enhanced RSS feed template that includes the (properly + encoded) full content of your posts in the feed itself. +- Static content: you can create empty blog entries that act as links to static + files by including `link: "{url}"` in a post's [front + matter](https://gohugo.io/content-management/front-matter/). You can also add + `render: false` to your [build + options](https://gohugo.io/content-management/build-options/#readout) to avoid + rendering blank posts. +- Skip link: a "skip to main content" link that is temporarily invisible, but + can be focused by people who need a keyboard to navigate the web (see [PR + #5](https://github.com/clente/hugo-bearcub/pull/5) by + [@2kool4idkwhat](https://github.com/2kool4idkwhat) for more information). +- Reply by email: if you supply an email address, the theme creates a "Reply to + this post by email" button at the end of every post (see Kev Quirk's [original + implementation](https://kevquirk.com/adding-the-post-title-to-my-reply-by-email-button)). +- Single-use CSS (EXPERIMENTAL): you can add some styles to a single page by + writing the CSS you need in `assets/{custom_css}.css` and then including + `style: "{custom_css}.css"` in the [front + matter](https://gohugo.io/content-management/front-matter/) of said page. +- Conditional CSS (EXPERIMENTAL): since **Bear Cub** does syntax highlighting + without inline styles (see `config.toml` for more information), it only load + its `syntax.css` if, and only if, a code block is actually present in the + current page. +- Dynamic social card generation (EXPERIMENTAL): if you don't add preview images + to a post, this template will generate one based on the title. You can see an + example below. + +![Social card example](https://raw.githubusercontent.com/clente/hugo-bearcub/main/images/social_card.webp) + +## Configuration + +**Bear Cub** can be customized with a `config.toml` file. Check out the +[configuration](https://github.com/clente/hugo-bearcub/blob/main/exampleSite/config.toml) +of the [demo](https://clente.github.io/hugo-bearcub/) for more information. + +```toml +# Basic config +baseURL = "https://example.com" +theme = "hugo-bearcub" +copyright = "John Doe (CC BY 4.0)" +defaultContentLanguage = "en" + +# Generate a nice robots.txt for SEO +enableRobotsTXT = true + +# Setup syntax highlighting without inline styles. For more information about +# why you'd want to avoid inline styles, see +# https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy/style-src#unsafe_inline_styles +[markup] + [markup.highlight] + lineNos = true + lineNumbersInTable = false + # This allows Bear Cub to use a variation of Dracula that is more accessible + # to people with poor eyesight. For more information about color contrast + # and accessibility, see https://web.dev/color-and-contrast-accessibility/ + noClasses = false + +# Multilingual mode config. More for information about how to setup translation, +# see https://gohugo.io/content-management/multilingual/ +[languages] + [languages.en] + title = "Bear Cub" + languageName = "en-US 🇺🇸" + LanguageCode = "en-US" + contentDir = "content" + [languages.en.params] + madeWith = "Made with [Bear Cub](https://github.com/clente/hugo-bearcub)" + [languages.pt] + title = "Bear Cub" + languageName = "pt-BR 🇧🇷" + LanguageCode = "pt-BR" + contentDir = "content.pt" + [languages.pt.params] + madeWith = "Feito com [Bear Cub](https://github.com/clente/hugo-bearcub)" + +[params] + # The description of your website + description = "Bear Cub Demo" + + # The path to your favicon + favicon = "images/favicon.png" + + # These images will show up when services want to generate a preview of a link + # to your site. Ignored if `generateSocialCard = true`. For more information + # about previews, see https://gohugo.io/templates/internal#twitter-cards and + # https://gohugo.io/templates/internal#open-graph + images = ["images/share.webp"] + + # This title is used as the site_name on the Hugo's internal opengraph + # structured data template + title = "Bear Cub" + + # Dates are displayed following the format below. For more information about + # formatting, see https://gohugo.io/functions/format/ + dateFormat = "2006-01-02" + + # If your blog is multilingual but you haven't translated a page, this theme + # will create a disabled link. By setting `hideUntranslated` to true, you can + # have the theme simply not show any link + hideUntranslated = false + + # (EXPERIMENTAL) This theme is capable of dynamically generating social cards + # for posts that don't have `images` defined in their front matter; By setting + # `generateSocialCard` to false, you can prevent this behavior. For more + # information see layouts/partials/seo_tags.html + generateSocialCard = true + + # Social media. Delete any item you aren't using to make sure it won't show up + # in your website's metadata. + [params.social] + twitter = "example" # Twitter handle (without '@') + facebook_admin = "0000000000" # Facebook Page Admin ID + + # Author metadata. This is mostly used for the RSS feed of your site, but the + # email is also added to the footer of each post + [params.author] + name = "John Doe" # Your name as shown in the RSS feed metadata + email = "me@example.com" # Added to the footer so readers can reply to posts +``` + +## Contributing + +If you come across any problems while using **Bear Cub**, you can file an +[issue](https://github.com/clente/hugo-bearcub/issues) or create a [pull +request](https://github.com/clente/hugo-bearcub/pulls). diff --git a/themes/hugo-bearcub/hugo/assets/images/social_card_bg.png b/themes/hugo-bearcub/hugo/assets/images/social_card_bg.png new file mode 100644 index 0000000..ad1d528 Binary files /dev/null and b/themes/hugo-bearcub/hugo/assets/images/social_card_bg.png differ diff --git a/themes/hugo-bearcub/hugo/assets/images/social_card_fg.png b/themes/hugo-bearcub/hugo/assets/images/social_card_fg.png new file mode 100644 index 0000000..01b207c Binary files /dev/null and b/themes/hugo-bearcub/hugo/assets/images/social_card_fg.png differ diff --git a/themes/hugo-bearcub/hugo/assets/style.css b/themes/hugo-bearcub/hugo/assets/style.css new file mode 100644 index 0000000..0173a36 --- /dev/null +++ b/themes/hugo-bearcub/hugo/assets/style.css @@ -0,0 +1,177 @@ +body { + font-family: Verdana, sans-serif; + margin: auto; + padding: 20px; + max-width: 720px; + text-align: left; + background-color: #1d1f27; + word-wrap: break-word; + overflow-wrap: break-word; + line-height: 1.5; + color: #c9d1d9; +} + +h1, +h2, +h3, +h4, +h5, +h6, +strong, +b { + color: #eee; +} + +a { + color: #8cc2dd; +} + +.title { + text-decoration: none; + border: 0; +} +.title h1 { + font-size: 24px; + margin: 19.92px 0 19.92px 0; +} + +.title span { + font-weight: 400; +} + +nav a { + margin-right: 10px; +} + +textarea { + background-color: #252525; + color: #ddd; + width: 100%; + font-size: 16px; +} + +input { + background-color: #252525; + color: #ddd; + font-size: 16px; +} + +content { + line-height: 1.6; +} + +table { + width: 100%; +} + +table, +th, +td { + border: 1px solid; + border-collapse: collapse; + border-color: #c9d1d9; + padding: 5px; +} + +img { + max-width: 100%; +} + +code { + padding: 2px 5px; + color: #f8f8f2; + background-color: #282a36; +} + +pre code { + display: block; + padding: 20px; + white-space: pre-wrap; + font-size: 14px; + overflow-x: auto; +} + +blockquote { + border-left: 1px solid #999; + color: #ccc; + padding-left: 20px; + font-style: italic; +} + +footer { + padding: 25px; + text-align: center; +} + +.helptext { + color: #aaa; + font-size: small; +} + +.errorlist { + color: #eba613; + font-size: small; +} + +/* blog posts */ +ul.blog-posts { + list-style-type: none; + padding: unset; +} + +ul.blog-posts li { + display: flex; + margin-bottom: 10px; +} + +ul.blog-posts li span { + flex: 0 0 130px; +} + +ul.blog-posts li a:visited { + color: #8b6fcb; +} + +a.blog-tags { + line-height: 2; +} + +h3.blog-filter { + margin-bottom: 0; +} + +.disabled { + color: currentColor; + cursor: not-allowed; + opacity: 0.7; +} + +p.byline { + font-style: italic; +} + +/* "Skip to main content" link */ +.skip-link { + position: absolute; + top: 5; + transform: translateY(-600%); + transition: transform 0.5s; + background-color: #1d1f27; + padding: 6px; +} + +.skip-link:focus { + transform: translateY(0%); +} + +figure { + margin-inline-start: 0em; + margin-inline-end: 0em; +} + +figcaption > p { + margin-block-start: 0px; + text-align: center; + font-style: italic; + color: #ccc; +} diff --git a/themes/hugo-bearcub/hugo/assets/syntax.css b/themes/hugo-bearcub/hugo/assets/syntax.css new file mode 100644 index 0000000..5f15788 --- /dev/null +++ b/themes/hugo-bearcub/hugo/assets/syntax.css @@ -0,0 +1,91 @@ +/* This style is a variant of Dracula that is more accessible to people with poor eyesight */ +/* See https://web.dev/color-and-contrast-accessibility/ */ +/* And https://xyproto.github.io/splash/docs/dracula.html */ +/* And https://github.com/alecthomas/chroma/blob/a40c95e447a577322e20eac58f2f7c0d026665b0/styles/dracula.xml */ + +/* Background */ .bg { color: #f8f8f2; background-color: #282a36; } +/* PreWrapper */ .chroma { color: #f8f8f2; background-color: #282a36; } +/* Other .chroma .x { } */ +/* Error .chroma .err { } */ +/* CodeLine .chroma .cl { } */ +/* LineLink */ .chroma .lnlinks { outline: none; text-decoration: none; color: inherit } +/* LineTableTD */ .chroma .lntd { vertical-align: top; padding: 0; margin: 0; border: 0; } +/* LineTable */ .chroma .lntable { border-spacing: 0; padding: 0; margin: 0; border: 0; } +/* LineHighlight */ .chroma .hl { background-color: #ffffcc } +/* LineNumbersTable */ .chroma .lnt { white-space: pre; user-select: none; margin-right: 0.4em; padding: 0 0.4em 0 0.4em;color: #929292 } +/* LineNumbers */ .chroma .ln { white-space: pre; user-select: none; margin-right: 0.4em; padding: 0 0.4em 0 0.4em;color: #929292 } +/* Line */ .chroma .line { display: flex; } +/* Keyword */ .chroma .k { color: #ff79c6 } +/* KeywordConstant */ .chroma .kc { color: #ff79c6 } +/* KeywordDeclaration */ .chroma .kd { color: #8be9fd; font-style: italic } +/* KeywordNamespace */ .chroma .kn { color: #ff79c6 } +/* KeywordPseudo */ .chroma .kp { color: #ff79c6 } +/* KeywordReserved */ .chroma .kr { color: #ff79c6 } +/* KeywordType */ .chroma .kt { color: #8be9fd } +/* Name .chroma .n { } */ +/* NameAttribute */ .chroma .na { color: #50fa7b } +/* NameBuiltin */ .chroma .nb { color: #8be9fd; font-style: italic } +/* NameBuiltinPseudo .chroma .bp { } */ +/* NameClass */ .chroma .nc { color: #50fa7b } +/* NameConstant .chroma .no { } */ +/* NameDecorator .chroma .nd { } */ +/* NameEntity .chroma .ni { } */ +/* NameException .chroma .ne { } */ +/* NameFunction */ .chroma .nf { color: #50fa7b } +/* NameFunctionMagic .chroma .fm { } */ +/* NameLabel */ .chroma .nl { color: #8be9fd; font-style: italic } +/* NameNamespace .chroma .nn { } */ +/* NameOther .chroma .nx { } */ +/* NameProperty .chroma .py { } */ +/* NameTag */ .chroma .nt { color: #ff79c6 } +/* NameVariable */ .chroma .nv { color: #8be9fd; font-style: italic } +/* NameVariableClass */ .chroma .vc { color: #8be9fd; font-style: italic } +/* NameVariableGlobal */ .chroma .vg { color: #8be9fd; font-style: italic } +/* NameVariableInstance */ .chroma .vi { color: #8be9fd; font-style: italic } +/* NameVariableMagic .chroma .vm { } */ +/* Literal .chroma .l { } */ +/* LiteralDate .chroma .ld { } */ +/* LiteralString */ .chroma .s { color: #f1fa8c } +/* LiteralStringAffix */ .chroma .sa { color: #f1fa8c } +/* LiteralStringBacktick */ .chroma .sb { color: #f1fa8c } +/* LiteralStringChar */ .chroma .sc { color: #f1fa8c } +/* LiteralStringDelimiter */ .chroma .dl { color: #f1fa8c } +/* LiteralStringDoc */ .chroma .sd { color: #f1fa8c } +/* LiteralStringDouble */ .chroma .s2 { color: #f1fa8c } +/* LiteralStringEscape */ .chroma .se { color: #f1fa8c } +/* LiteralStringHeredoc */ .chroma .sh { color: #f1fa8c } +/* LiteralStringInterpol */ .chroma .si { color: #f1fa8c } +/* LiteralStringOther */ .chroma .sx { color: #f1fa8c } +/* LiteralStringRegex */ .chroma .sr { color: #f1fa8c } +/* LiteralStringSingle */ .chroma .s1 { color: #f1fa8c } +/* LiteralStringSymbol */ .chroma .ss { color: #f1fa8c } +/* LiteralNumber */ .chroma .m { color: #bd93f9 } +/* LiteralNumberBin */ .chroma .mb { color: #bd93f9 } +/* LiteralNumberFloat */ .chroma .mf { color: #bd93f9 } +/* LiteralNumberHex */ .chroma .mh { color: #bd93f9 } +/* LiteralNumberInteger */ .chroma .mi { color: #bd93f9 } +/* LiteralNumberIntegerLong */ .chroma .il { color: #bd93f9 } +/* LiteralNumberOct */ .chroma .mo { color: #bd93f9 } +/* Operator */ .chroma .o { color: #ff79c6 } +/* OperatorWord */ .chroma .ow { color: #ff79c6 } +/* Punctuation .chroma .p { } */ +/* Comment */ .chroma .c { color: #7c90d0 } +/* CommentHashbang */ .chroma .ch { color: #7c90d0 } +/* CommentMultiline */ .chroma .cm { color: #7c90d0 } +/* CommentSingle */ .chroma .c1 { color: #7c90d0 } +/* CommentSpecial */ .chroma .cs { color: #7c90d0 } +/* CommentPreproc */ .chroma .cp { color: #ff79c6 } +/* CommentPreprocFile */ .chroma .cpf { color: #ff79c6 } +/* Generic .chroma .g { } */ +/* GenericDeleted */ .chroma .gd { color: #ff5555 } +/* GenericEmph */ .chroma .ge { text-decoration: underline } +/* GenericError .chroma .gr { } */ +/* GenericHeading */ .chroma .gh { font-weight: bold } +/* GenericInserted */ .chroma .gi { color: #50fa7b; font-weight: bold } +/* GenericOutput */ .chroma .go { color: #44475a } +/* GenericPrompt .chroma .gp { } */ +/* GenericStrong .chroma .gs { } */ +/* GenericSubheading */ .chroma .gu { font-weight: bold } +/* GenericTraceback .chroma .gt { } */ +/* GenericUnderline */ .chroma .gl { text-decoration: underline } +/* TextWhitespace .chroma .w { } */ diff --git a/themes/hugo-bearcub/hugo/exampleSite/config.toml b/themes/hugo-bearcub/hugo/exampleSite/config.toml new file mode 100644 index 0000000..6fe641f --- /dev/null +++ b/themes/hugo-bearcub/hugo/exampleSite/config.toml @@ -0,0 +1,82 @@ +# Basic config +baseURL = "https://example.com" +theme = "hugo-bearcub" +copyright = "John Doe (CC BY 4.0)" +defaultContentLanguage = "en" + +# Generate a nice robots.txt for SEO +enableRobotsTXT = true + +# Setup syntax highlighting without inline styles. For more information about +# why you'd want to avoid inline styles, see +# https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy/style-src#unsafe_inline_styles +[markup] + [markup.highlight] + lineNos = true + lineNumbersInTable = false + # This allows Bear Cub to use a variation of Dracula that is more accessible + # to people with poor eyesight. For more information about color contrast + # and accessibility, see https://web.dev/color-and-contrast-accessibility/ + noClasses = false + +# Multilingual mode config. More for information about how to setup translation, +# see https://gohugo.io/content-management/multilingual/ +[languages] + [languages.en] + title = "Bear Cub" + languageName = "en-US 🇺🇸" + LanguageCode = "en-US" + contentDir = "content" + [languages.en.params] + madeWith = "Made with [Bear Cub](https://github.com/clente/hugo-bearcub)" + [languages.pt] + title = "Bear Cub" + languageName = "pt-BR 🇧🇷" + LanguageCode = "pt-BR" + contentDir = "content.pt" + [languages.pt.params] + madeWith = "Feito com [Bear Cub](https://github.com/clente/hugo-bearcub)" + +[params] + # The description of your website + description = "Bear Cub Demo" + + # The path to your favicon + favicon = "images/favicon.png" + + # These images will show up when services want to generate a preview of a link + # to your site. Ignored if `generateSocialCard = true`. For more information + # about previews, see https://gohugo.io/templates/internal#twitter-cards and + # https://gohugo.io/templates/internal#open-graph + images = ["images/share.webp"] + + # This title is used as the site_name on the Hugo's internal opengraph + # structured data template + title = "Bear Cub" + + # Dates are displayed following the format below. For more information about + # formatting, see https://gohugo.io/functions/format/ + dateFormat = "2006-01-02" + + # If your blog is multilingual but you haven't translated a page, this theme + # will create a disabled link. By setting `hideUntranslated` to true, you can + # have the theme simply not show any link + hideUntranslated = false + + # (EXPERIMENTAL) This theme is capable of dynamically generating social cards + # for posts that don't have `images` defined in their front matter; By setting + # `generateSocialCard` to false, you can prevent this behavior. For more + # information see layouts/partials/seo_tags.html + generateSocialCard = true + + # Social media. Delete any item you aren't using to make sure it won't show up + # in your website's metadata. + [params.social] + twitter = "example" # Twitter handle (without '@') + facebook_admin = "0000000000" # Facebook Page Admin ID + + # Author metadata. This is mostly used for the RSS feed of your site, but the + # email is also added to the footer of each post + [params.author] + name = "John Doe" # Your name as shown in the RSS feed metadata + email = "me@example.com" # Added to the footer so readers can reply to posts diff --git a/themes/hugo-bearcub/hugo/exampleSite/content.pt/_index.md b/themes/hugo-bearcub/hugo/exampleSite/content.pt/_index.md new file mode 100644 index 0000000..4cf0d7e --- /dev/null +++ b/themes/hugo-bearcub/hugo/exampleSite/content.pt/_index.md @@ -0,0 +1,35 @@ +--- +title: "Início" +menu: "main" +weight: 1 +--- + +# ᕦʕ •ᴥ•ʔᕤ Bear Cub + +Os sites de hoje em dia são pesados, lentos e cheios de scripts, propagandas e +rastreadores. Isso ficou tão comum que nós perdemos toda a perspectiva, tanto +que achamos normal uma página web ter vários megabytes. + +> The internet has become a bloated mess. Huge JavaScript libraries, countless +> client-side queries and overly complex frontend frameworks are par for the +> course these days. +> +> --- [Kev Quirk](https://512kb.club/) + +Vamos mudar isso, um site de cada vez! **Bear Cub** é um tema +[Hugo](https://gohugo.io/) baseado no [Hugo +Bear](https://github.com/janraasch/hugo-bearblog/) que toma conta da velocidade +e otimização para que você possa focar em escrever bons textos. + +Ele é gratuito, multilíngue, otimizado para buscadores, simples, responsivo, +leve e rápido. Muito rápido. + +Quando comparado ao seu predecessor, o **Bear Cub** tem alguns upgrades de +[privacidade](https://themarkup.org/blacklight?url=clente.github.io/hugo-bearcub/) +e +[acessibilidade](https://pagespeed.web.dev/report?url=https%3A%2F%2Fclente.github.io%2Fhugo-bearcub%2F). +Ele também é compatível com as práticas mais modernas de +[segurança](https://github.com/clente/hugo-bearcub#secure) para que seus +usuários possam aproveitar seu site sem medo. + +Feito com 💟 por [Caio lente](https://lente.dev). diff --git a/themes/hugo-bearcub/hugo/exampleSite/content.pt/blog/_index.md b/themes/hugo-bearcub/hugo/exampleSite/content.pt/blog/_index.md new file mode 100644 index 0000000..7588ac1 --- /dev/null +++ b/themes/hugo-bearcub/hugo/exampleSite/content.pt/blog/_index.md @@ -0,0 +1,5 @@ +--- +title: "Blog" +menu: "main" +weight: 2 +--- \ No newline at end of file diff --git a/themes/hugo-bearcub/hugo/exampleSite/content/_index.md b/themes/hugo-bearcub/hugo/exampleSite/content/_index.md new file mode 100644 index 0000000..10c388f --- /dev/null +++ b/themes/hugo-bearcub/hugo/exampleSite/content/_index.md @@ -0,0 +1,35 @@ +--- +title: "Home" +menu: "main" +weight: 1 +--- + +# ᕦʕ •ᴥ•ʔᕤ Bear Cub + +Today's websites are bloated, slow, and full of scripts, ads, and trackers. This +became so commonplace that we lost all sense of perspective, to the point that +we now think multi-megabyte webpages are normal. + +> The internet has become a bloated mess. Huge JavaScript libraries, countless +> client-side queries and overly complex frontend frameworks are par for the +> course these days. +> +> --- [Kev Quirk](https://512kb.club/) + +Let's change this, one website at a time! **Bear Cub** is a +[Hugo](https://gohugo.io/) theme based on [Hugo +Bear](https://github.com/janraasch/hugo-bearblog/) that takes care of speed and +optimization, so you can focus on writing good content. + +It is free, multilingual, optimized for search engines, no-nonsense, responsive, +light, and fast. Really fast. + +When compared to its predecessor, **Bear Cub** has a few +[privacy](https://themarkup.org/blacklight?url=clente.github.io/hugo-bearcub/) +and +[accessibility](https://pagespeed.web.dev/report?url=https%3A%2F%2Fclente.github.io%2Fhugo-bearcub%2F) +upgrades. It's also compatible with modern +[security](https://github.com/clente/hugo-bearcub#secure) standards, so your +users don't have to worry about browsing your website. + +Made with 💟 by [Caio lente](https://lente.dev/en). diff --git a/themes/hugo-bearcub/hugo/exampleSite/content/blog/_index.md b/themes/hugo-bearcub/hugo/exampleSite/content/blog/_index.md new file mode 100644 index 0000000..7588ac1 --- /dev/null +++ b/themes/hugo-bearcub/hugo/exampleSite/content/blog/_index.md @@ -0,0 +1,5 @@ +--- +title: "Blog" +menu: "main" +weight: 2 +--- \ No newline at end of file diff --git a/themes/hugo-bearcub/hugo/exampleSite/content/blog/emoji-support.md b/themes/hugo-bearcub/hugo/exampleSite/content/blog/emoji-support.md new file mode 100644 index 0000000..f17f49a --- /dev/null +++ b/themes/hugo-bearcub/hugo/exampleSite/content/blog/emoji-support.md @@ -0,0 +1,46 @@ ++++ +author = "Hugo Authors" +title = "Emoji Support" +date = "2019-03-05" +description = "Guide to emoji usage in Hugo" +tags = [ + "emoji", +] ++++ + +Emoji can be enabled in a Hugo project in a number of ways. + +The [`emojify`](https://gohugo.io/functions/emojify/) function can be called directly in templates or [Inline Shortcodes](https://gohugo.io/templates/shortcode-templates/#inline-shortcodes). + +To enable emoji globally, set `enableEmoji` to `true` in your site's [configuration](https://gohugo.io/getting-started/configuration/) and then you can type emoji shorthand codes directly in content files; e.g. + +

🙈 :see_no_evil: 🙉 :hear_no_evil: 🙊 :speak_no_evil:

+
+ +The [Emoji cheat sheet](http://www.emoji-cheat-sheet.com/) is a useful reference for emoji shorthand codes. + +*** + +**N.B.** The above steps enable Unicode Standard emoji characters and sequences in Hugo, however the rendering of these glyphs depends on the browser and the platform. To style the emoji you can either use a third party emoji font or a font stack; e.g. + +{{< highlight html >}} +.emoji { + font-family: Apple Color Emoji, Segoe UI Emoji, NotoColorEmoji, Segoe UI Symbol, Android Emoji, EmojiSymbols; +} +{{< /highlight >}} + +{{< css.inline >}} + +{{< /css.inline >}} diff --git a/themes/hugo-bearcub/hugo/exampleSite/content/blog/markdown-syntax.md b/themes/hugo-bearcub/hugo/exampleSite/content/blog/markdown-syntax.md new file mode 100644 index 0000000..06990d7 --- /dev/null +++ b/themes/hugo-bearcub/hugo/exampleSite/content/blog/markdown-syntax.md @@ -0,0 +1,148 @@ ++++ +author = "Hugo Authors" +title = "Markdown Syntax Guide" +date = "2019-03-11" +description = "Sample article showcasing basic Markdown syntax and formatting for HTML elements." +tags = [ + "markdown", + "css", + "html", +] +categories = [ + "themes", + "syntax", +] +series = ["Themes Guide"] +aliases = ["migrate-from-jekyl"] ++++ + +This article offers a sample of basic Markdown syntax that can be used in Hugo content files, also it shows whether basic HTML elements are decorated with CSS in a Hugo theme. + + +## Headings + +The following HTML `

`—`

` elements represent six levels of section headings. `

` is the highest section level while `

` is the lowest. + +# H1 +## H2 +### H3 +#### H4 +##### H5 +###### H6 + +## Paragraph + +Xerum, quo qui aut unt expliquam qui dolut labo. Aque venitatiusda cum, voluptionse latur sitiae dolessi aut parist aut dollo enim qui voluptate ma dolestendit peritin re plis aut quas inctum laceat est volestemque commosa as cus endigna tectur, offic to cor sequas etum rerum idem sintibus eiur? Quianimin porecus evelectur, cum que nis nust voloribus ratem aut omnimi, sitatur? Quiatem. Nam, omnis sum am facea corem alique molestrunt et eos evelece arcillit ut aut eos eos nus, sin conecerem erum fuga. Ri oditatquam, ad quibus unda veliamenimin cusam et facea ipsamus es exerum sitate dolores editium rerore eost, temped molorro ratiae volorro te reribus dolorer sperchicium faceata tiustia prat. + +Itatur? Quiatae cullecum rem ent aut odis in re eossequodi nonsequ idebis ne sapicia is sinveli squiatum, core et que aut hariosam ex eat. + +## Blockquotes + +The blockquote element represents content that is quoted from another source, optionally with a citation which must be within a `footer` or `cite` element, and optionally with in-line changes such as annotations and abbreviations. + +#### Blockquote without attribution + +> Tiam, ad mint andaepu dandae nostion secatur sequo quae. +> **Note** that you can use *Markdown syntax* within a blockquote. + +#### Blockquote with attribution + +> Don't communicate by sharing memory, share memory by communicating.
+> — Rob Pike[^1] + +[^1]: The above quote is excerpted from Rob Pike's [talk](https://www.youtube.com/watch?v=PAAkCSZUG1c) during Gopherfest, November 18, 2015. + +## Tables + +Tables aren't part of the core Markdown spec, but Hugo supports supports them out-of-the-box. + + Name | Age +--------|------ + Bob | 27 + Alice | 23 + +#### Inline Markdown within tables + +| Italics | Bold | Code | +| -------- | -------- | ------ | +| *italics* | **bold** | `code` | + +## Code Blocks + +#### Code block with backticks + +```html + + + + + Example HTML5 Document + + +

Test

+ + +``` + +#### Code block indented with four spaces + + + + + + Example HTML5 Document + + +

Test

+ + + +#### Code block with Hugo's internal highlight shortcode +{{< highlight html >}} + + + + + Example HTML5 Document + + +

Test

+ + +{{< /highlight >}} + +## List Types + +#### Ordered List + +1. First item +2. Second item +3. Third item + +#### Unordered List + +* List item +* Another item +* And another item + +#### Nested list + +* Fruit + * Apple + * Orange + * Banana +* Dairy + * Milk + * Cheese + +## Other Elements — abbr, sub, sup, kbd, mark + +GIF is a bitmap image format. + +H2O + +Xn + Yn = Zn + +Press CTRL+ALT+Delete to end the session. + +Most salamanders are nocturnal, and hunt for insects, worms, and other small creatures. diff --git a/themes/hugo-bearcub/hugo/exampleSite/content/blog/math-typesetting.md b/themes/hugo-bearcub/hugo/exampleSite/content/blog/math-typesetting.md new file mode 100644 index 0000000..62831a9 --- /dev/null +++ b/themes/hugo-bearcub/hugo/exampleSite/content/blog/math-typesetting.md @@ -0,0 +1,49 @@ +--- +author: Hugo Authors +title: Math Typesetting +date: 2019-03-08 +description: A brief guide to setup KaTeX +math: true +--- + +Mathematical notation in a Hugo project can be enabled by using third party JavaScript libraries. + + +In this example we will be using [KaTeX](https://katex.org/) + +- Create a partial under `/layouts/partials/math.html` +- Within this partial reference the [Auto-render Extension](https://katex.org/docs/autorender.html) or host these scripts locally. +- Include the partial in your templates like so: + +```bash +{{ if or .Params.math .Site.Params.math }} +{{ partial "math.html" . }} +{{ end }} +``` + +- To enable KaTex globally set the parameter `math` to `true` in a project's configuration +- To enable KaTex on a per page basis include the parameter `math: true` in content files + +**Note:** Use the online reference of [Supported TeX Functions](https://katex.org/docs/supported.html) + +{{< math.inline >}} +{{ if or .Page.Params.math .Site.Params.math }} + + + + +{{ end }} +{{}} + +### Examples + +{{< math.inline >}} +

+Inline math: \(\varphi = \dfrac{1+\sqrt5}{2}= 1.6180339887…\) +

+{{}} + +Block math: +$$ + \varphi = 1+\frac{1} {1+\frac{1} {1+\frac{1} {1+\cdots} } } +$$ diff --git a/themes/hugo-bearcub/hugo/exampleSite/content/blog/placeholder-text.md b/themes/hugo-bearcub/hugo/exampleSite/content/blog/placeholder-text.md new file mode 100644 index 0000000..9ed5f69 --- /dev/null +++ b/themes/hugo-bearcub/hugo/exampleSite/content/blog/placeholder-text.md @@ -0,0 +1,45 @@ ++++ +author = "Hugo Authors" +title = "Placeholder Text" +date = "2019-03-09" +description = "Lorem Ipsum Dolor Si Amet" +tags = [ + "markdown", + "text", +] ++++ + +Lorem est tota propiore conpellat pectoribus de pectora summo. Redit teque digerit hominumque toris verebor lumina non cervice subde tollit usus habet Arctonque, furores quas nec ferunt. Quoque montibus nunc caluere tempus inhospita parcite confusaque translucet patri vestro qui optatis lumine cognoscere flos nubis! Fronde ipsamque patulos Dryopen deorum. + +1. Exierant elisi ambit vivere dedere +2. Duce pollice +3. Eris modo +4. Spargitque ferrea quos palude + +Rursus nulli murmur; hastile inridet ut ab gravi sententia! Nomine potitus silentia flumen, sustinet placuit petis in dilapsa erat sunt. Atria tractus malis. + +1. Comas hunc haec pietate fetum procerum dixit +2. Post torum vates letum Tiresia +3. Flumen querellas +4. Arcanaque montibus omnes +5. Quidem et + +# Vagus elidunt + + + +[The Van de Graaf Canon](https://en.wikipedia.org/wiki/Canons_of_page_construction#Van_de_Graaf_canon) + +## Mane refeci capiebant unda mulcebat + +Victa caducifer, malo vulnere contra dicere aurato, ludit regale, voca! Retorsit colit est profanae esse virescere furit nec; iaculi matertera et visa est, viribus. Divesque creatis, tecta novat collumque vulnus est, parvas. **Faces illo pepulere** tempus adest. Tendit flamma, ab opes virum sustinet, sidus sequendo urbis. + +Iubar proles corpore raptos vero auctor imperium; sed et huic: manus caeli Lelegas tu lux. Verbis obstitit intus oblectamina fixis linguisque ausus sperare Echionides cornuaque tenent clausit possit. Omnia putatur. Praeteritae refert ausus; ferebant e primus lora nutat, vici quae mea ipse. Et iter nil spectatae vulnus haerentia iuste et exercebat, sui et. + +Eurytus Hector, materna ipsumque ut Politen, nec, nate, ignari, vernum cohaesit sequitur. Vel **mitis temploque** vocatus, inque alis, *oculos nomen* non silvis corpore coniunx ne displicet illa. Crescunt non unus, vidit visa quantum inmiti flumina mortis facto sic: undique a alios vincula sunt iactata abdita! Suspenderat ego fuit tendit: luna, ante urbem Propoetides **parte**. + +{{< css.inline >}} + +{{< /css.inline >}} diff --git a/themes/hugo-bearcub/hugo/exampleSite/content/blog/rich-content.md b/themes/hugo-bearcub/hugo/exampleSite/content/blog/rich-content.md new file mode 100644 index 0000000..bf7e101 --- /dev/null +++ b/themes/hugo-bearcub/hugo/exampleSite/content/blog/rich-content.md @@ -0,0 +1,34 @@ ++++ +author = "Hugo Authors" +title = "Rich Content" +date = "2019-03-10" +description = "A brief description of Hugo Shortcodes" +tags = [ + "shortcodes", + "privacy", +] ++++ + +Hugo ships with several [Built-in Shortcodes](https://gohugo.io/content-management/shortcodes/#use-hugos-built-in-shortcodes) for rich content, along with a [Privacy Config](https://gohugo.io/about/hugo-and-gdpr/) and a set of Simple Shortcodes that enable static and no-JS versions of various social media embeds. + +--- + +## YouTube Privacy Enhanced Shortcode + +{{< youtube ZJthWmvUzzc >}} + +
+ +--- + +## Twitter Simple Shortcode + +{{< tweet user="DesignReviewed" id="1085870671291310081" >}} + +
+ +--- + +## Vimeo Simple Shortcode + +{{< vimeo_simple 48912912 >}} diff --git a/themes/hugo-bearcub/hugo/exampleSite/static/images/favicon.png b/themes/hugo-bearcub/hugo/exampleSite/static/images/favicon.png new file mode 100644 index 0000000..c3ab3b9 Binary files /dev/null and b/themes/hugo-bearcub/hugo/exampleSite/static/images/favicon.png differ diff --git a/themes/hugo-bearcub/hugo/exampleSite/static/images/share.webp b/themes/hugo-bearcub/hugo/exampleSite/static/images/share.webp new file mode 100644 index 0000000..e190239 Binary files /dev/null and b/themes/hugo-bearcub/hugo/exampleSite/static/images/share.webp differ diff --git a/themes/hugo-bearcub/hugo/i18n/en.toml b/themes/hugo-bearcub/hugo/i18n/en.toml new file mode 100644 index 0000000..15a8569 --- /dev/null +++ b/themes/hugo-bearcub/hugo/i18n/en.toml @@ -0,0 +1,14 @@ +[filtering-for] + other = "Filtering for" + +[no-posts] + other = "No posts yet" + +[email-subject] + other = "Reply to " + +[email-reply] + other = "Reply to this post by email" + +[skip-link] + other = "Skip to main content" \ No newline at end of file diff --git a/themes/hugo-bearcub/hugo/i18n/pt.toml b/themes/hugo-bearcub/hugo/i18n/pt.toml new file mode 100644 index 0000000..ad228ab --- /dev/null +++ b/themes/hugo-bearcub/hugo/i18n/pt.toml @@ -0,0 +1,14 @@ +[filtering-for] + other = "Filtrando para" + +[no-posts] + other = "Nenhum post ainda" + +[email-subject] + other = "Resposta a " + +[email-reply] + other = "Responda a este post por email" + +[skip-link] + other = "Pular para conteúdo principal" \ No newline at end of file diff --git a/themes/hugo-bearcub/hugo/images/pagespeed.webp b/themes/hugo-bearcub/hugo/images/pagespeed.webp new file mode 100644 index 0000000..fb87f05 Binary files /dev/null and b/themes/hugo-bearcub/hugo/images/pagespeed.webp differ diff --git a/themes/hugo-bearcub/hugo/images/screenshot.png b/themes/hugo-bearcub/hugo/images/screenshot.png new file mode 100644 index 0000000..8d4c404 Binary files /dev/null and b/themes/hugo-bearcub/hugo/images/screenshot.png differ diff --git a/themes/hugo-bearcub/hugo/images/social_card.webp b/themes/hugo-bearcub/hugo/images/social_card.webp new file mode 100644 index 0000000..43ae186 Binary files /dev/null and b/themes/hugo-bearcub/hugo/images/social_card.webp differ diff --git a/themes/hugo-bearcub/hugo/images/tn.png b/themes/hugo-bearcub/hugo/images/tn.png new file mode 100644 index 0000000..206e5bb Binary files /dev/null and b/themes/hugo-bearcub/hugo/images/tn.png differ diff --git a/themes/hugo-bearcub/hugo/layouts/404.html b/themes/hugo-bearcub/hugo/layouts/404.html new file mode 100644 index 0000000..c6b3dfd --- /dev/null +++ b/themes/hugo-bearcub/hugo/layouts/404.html @@ -0,0 +1,6 @@ +{{ define "title" }}404{{ end }} + +{{ define "main" }} +

404

+

ʕノ•ᴥ•ʔノ ︵ ┻━┻

+{{ end }} diff --git a/themes/hugo-bearcub/hugo/layouts/_default/_markup/render-codeblock.html b/themes/hugo-bearcub/hugo/layouts/_default/_markup/render-codeblock.html new file mode 100644 index 0000000..6e1a075 --- /dev/null +++ b/themes/hugo-bearcub/hugo/layouts/_default/_markup/render-codeblock.html @@ -0,0 +1,6 @@ + +{{ .Page.Store.Set "hasCodeBlock" true }} + + +{{ $result := transform.HighlightCodeBlock . }} +{{ $result.Wrapped }} \ No newline at end of file diff --git a/themes/hugo-bearcub/hugo/layouts/_default/baseof.html b/themes/hugo-bearcub/hugo/layouts/_default/baseof.html new file mode 100644 index 0000000..475d6f9 --- /dev/null +++ b/themes/hugo-bearcub/hugo/layouts/_default/baseof.html @@ -0,0 +1,54 @@ + + + + + + + + {{- partial "favicon.html" . -}} + {{- block "title" . }}{{ with .Title }}{{ . }} | {{ end }}{{ .Site.Title }}{{- end }} + + {{- partial "seo_tags.html" . -}} + + + {{ $style := resources.Get "style.css" | minify }} + + + {{ if (.Page.Store.Get "hasCodeBlock") }} + {{ $syntax := resources.Get "syntax.css" | minify }} + + {{ end }} + + {{ with .Params.style }} + {{ $extra := resources.Get . | minify }} + + {{ end }} + + {{ with .OutputFormats.Get "rss" -}} + {{ printf `` .Rel .MediaType.Type .Permalink $.Site.Title | safeHTML }} + {{ end -}} + + + {{- partial "custom_head.html" . -}} + + + +
+ {{- partial "header.html" . -}} +
+
+ {{- block "main" . }}{{- end }} +
+ + + + {{- partial "custom_body.html" . -}} + + + diff --git a/themes/hugo-bearcub/hugo/layouts/_default/list.html b/themes/hugo-bearcub/hugo/layouts/_default/list.html new file mode 100644 index 0000000..354bc9c --- /dev/null +++ b/themes/hugo-bearcub/hugo/layouts/_default/list.html @@ -0,0 +1,36 @@ +{{ define "main" }} + + {{ if .Data.Singular }} +

{{ i18n "filtering-for" }} "{{ .Title }}"

+ {{ end }} + + {{ if not .Data.Singular }} +
+ {{ range .Site.Taxonomies.tags }} + #{{ .Page.Title }}   + {{ end }} +
+ {{ end }} +
+{{ end }} diff --git a/themes/hugo-bearcub/hugo/layouts/_default/rss.xml b/themes/hugo-bearcub/hugo/layouts/_default/rss.xml new file mode 100644 index 0000000..70d1193 --- /dev/null +++ b/themes/hugo-bearcub/hugo/layouts/_default/rss.xml @@ -0,0 +1,72 @@ +{{- /* Deprecate site.Author.email in favor of site.Params.author.email */}} +{{- $authorEmail := "" }} +{{- with site.Params.author }} + {{- if reflect.IsMap . }} + {{- with .email }} + {{- $authorEmail = . }} + {{- end }} + {{- end }} +{{- else }} + {{- with site.Author.email }} + {{- $authorEmail = . }} + {{- warnf "The author key in site configuration is deprecated. Use params.author.email instead." }} + {{- end }} +{{- end }} + +{{- /* Deprecate site.Author.name in favor of site.Params.author.name */}} +{{- $authorName := "" }} +{{- with site.Params.author }} + {{- if reflect.IsMap . }} + {{- with .name }} + {{- $authorName = . }} + {{- end }} + {{- else }} + {{- $authorName = . }} + {{- end }} +{{- else }} + {{- with site.Author.name }} + {{- $authorName = . }} + {{- warnf "The author key in site configuration is deprecated. Use params.author.name instead." }} + {{- end }} +{{- end }} + +{{- $pctx := . }} +{{- if .IsHome }}{{ $pctx = .Site }}{{ end }} +{{- $pages := slice }} +{{- if or $.IsHome $.IsSection }} +{{- $pages = $pctx.RegularPages }} +{{- else }} +{{- $pages = $pctx.Pages }} +{{- end }} +{{- $limit := .Site.Config.Services.RSS.Limit }} +{{- if ge $limit 1 }} +{{- $pages = $pages | first $limit }} +{{- end }} +{{- printf "" | safeHTML }} + + + {{ if .IsHome }}{{ .Site.Title }}{{ else }}{{ with .Title }}{{ . }} on {{ end }}{{ .Site.Title }}{{ end }} + {{ .Permalink }} + Recent content {{ if not .IsHome }}{{ with .Title }}in {{ . }} {{ end }}{{ end }}on {{ .Site.Title }} + Hugo -- gohugo.io + {{ site.Language.LanguageCode }}{{ with $authorEmail }} + {{.}}{{ with $authorName }} ({{ . }}){{ end }}{{ end }}{{ with $authorEmail }} + {{ . }}{{ with $authorName }} ({{ . }}){{ end }}{{ end }}{{ with .Site.Copyright }} + {{ . }}{{ end }}{{ if not .Date.IsZero }} + {{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}{{ end }} + {{- with .OutputFormats.Get "RSS" }} + {{ printf "" .Permalink .MediaType | safeHTML }} + {{- end }} + {{- range $pages }} + + {{ .Title }} + {{ .Permalink }} + {{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }} + {{- with $authorEmail }}{{ . }}{{ with $authorName }} ({{ . }}){{ end }}{{ end }} + {{ .Permalink }} + {{ .Summary | transform.XMLEscape | safeHTML }} + {{ `` | safeHTML }} + + {{- end }} + + diff --git a/themes/hugo-bearcub/hugo/layouts/_default/single.html b/themes/hugo-bearcub/hugo/layouts/_default/single.html new file mode 100644 index 0000000..fb30bdf --- /dev/null +++ b/themes/hugo-bearcub/hugo/layouts/_default/single.html @@ -0,0 +1,26 @@ +{{ define "main" }} +{{ if not .Params.menu }} +

{{ .Title }}

+

+ + {{ with .Params.author }}· {{.}}{{ end }} +

+{{ end }} + + {{ .Content }} + +

+ {{ range (.GetTerms "tags") }} + #{{ .LinkTitle }}   + {{ end }} +

+{{ with .Site.Params.social.email }} +

+ + {{ i18n "email-reply" }} ↪ + +

+{{ end }} +{{ end }} diff --git a/themes/hugo-bearcub/hugo/layouts/index.html b/themes/hugo-bearcub/hugo/layouts/index.html new file mode 100644 index 0000000..9983b08 --- /dev/null +++ b/themes/hugo-bearcub/hugo/layouts/index.html @@ -0,0 +1,3 @@ +{{ define "main" }} +{{ .Content }} +{{ end }} diff --git a/themes/hugo-bearcub/hugo/layouts/partials/custom_body.html b/themes/hugo-bearcub/hugo/layouts/partials/custom_body.html new file mode 100644 index 0000000..951fb15 --- /dev/null +++ b/themes/hugo-bearcub/hugo/layouts/partials/custom_body.html @@ -0,0 +1,3 @@ + diff --git a/themes/hugo-bearcub/hugo/layouts/partials/custom_head.html b/themes/hugo-bearcub/hugo/layouts/partials/custom_head.html new file mode 100644 index 0000000..4c53c40 --- /dev/null +++ b/themes/hugo-bearcub/hugo/layouts/partials/custom_head.html @@ -0,0 +1,3 @@ + diff --git a/themes/hugo-bearcub/hugo/layouts/partials/favicon.html b/themes/hugo-bearcub/hugo/layouts/partials/favicon.html new file mode 100644 index 0000000..d391a86 --- /dev/null +++ b/themes/hugo-bearcub/hugo/layouts/partials/favicon.html @@ -0,0 +1,2 @@ +{{ with .Site.Params.favicon }} +{{ end }} diff --git a/themes/hugo-bearcub/hugo/layouts/partials/footer.html b/themes/hugo-bearcub/hugo/layouts/partials/footer.html new file mode 100644 index 0000000..9290715 --- /dev/null +++ b/themes/hugo-bearcub/hugo/layouts/partials/footer.html @@ -0,0 +1,3 @@ + + {{ .Site.Copyright }} | {{ markdownify .Site.Params.madeWith }} + \ No newline at end of file diff --git a/themes/hugo-bearcub/hugo/layouts/partials/header.html b/themes/hugo-bearcub/hugo/layouts/partials/header.html new file mode 100644 index 0000000..5a66907 --- /dev/null +++ b/themes/hugo-bearcub/hugo/layouts/partials/header.html @@ -0,0 +1,4 @@ + + +

{{ .Site.Title }}

+ diff --git a/themes/hugo-bearcub/hugo/layouts/partials/nav.html b/themes/hugo-bearcub/hugo/layouts/partials/nav.html new file mode 100644 index 0000000..5f40267 --- /dev/null +++ b/themes/hugo-bearcub/hugo/layouts/partials/nav.html @@ -0,0 +1,22 @@ +{{ range .Site.Menus.main.ByWeight }} + {{ .Name }} +{{ end }} +RSS + + +{{ $translations := dict }} +{{ range .Translations }} + {{ $translations = merge $translations (dict .Language.Lang .) }} +{{ end }} + + +{{ range where .Site.Languages "Lang" "!=" .Page.Lang }} + {{ with (index $translations .Lang) }} + {{ .Language.LanguageName }} + {{ else }} + + {{ if not .Params.hideUntranslated }} + {{ .LanguageName }} + {{ end }} + {{ end }} +{{ end }} diff --git a/themes/hugo-bearcub/hugo/layouts/partials/seo_tags.html b/themes/hugo-bearcub/hugo/layouts/partials/seo_tags.html new file mode 100644 index 0000000..81e498f --- /dev/null +++ b/themes/hugo-bearcub/hugo/layouts/partials/seo_tags.html @@ -0,0 +1,21 @@ + + + + + + + + + +{{ if and (and (default false .Site.Params.generateSocialCard) (not (isset .Params "images"))) (eq .Kind "page") }} + {{ partial "social_card.html" . }} +{{ else }} + + {{ template "_internal/opengraph.html" . }} + + + {{ template "_internal/twitter_cards.html" . }} + + + {{ template "_internal/schema.html" . }} +{{ end }} diff --git a/themes/hugo-bearcub/hugo/layouts/partials/social_card.html b/themes/hugo-bearcub/hugo/layouts/partials/social_card.html new file mode 100644 index 0000000..74f1b88 --- /dev/null +++ b/themes/hugo-bearcub/hugo/layouts/partials/social_card.html @@ -0,0 +1,125 @@ + +{{ $font := resources.GetRemote "https://github.com/google/fonts/raw/main/ofl/firamono/FiraMono-Bold.ttf" }} +{{ $fg := resources.Get "images/social_card_fg.png"}} +{{ $bg := resources.Get "images/social_card_bg.png"}} + +{{ $fg = $fg.Filter (images.Text .Title (dict + "font" $font + "color" "#f8f8f2" + "size" 130 + "linespacing" 20 + "x" 0 + "y" 0 +)) }} + +{{ $date := .Date.Format (default "2006-01-02" .Site.Params.dateFormat) }} +{{ $author := (default $.Site.Params.author.name ($.Param "author") ) }} +{{ $byline := (printf "%s | %s" $author $date) }} + +{{ $fg = $fg.Filter (images.Text $byline (dict + "font" $font + "color" "#c9d1d9" + "size" 60 + "linespacing" 30 + "x" 0 + "y" 425 +)) }} + +{{ $card := $bg.Filter (images.Overlay $fg 112 140 ) }} +{{ $card := $card.Resize "900x webp q100" }} + + + + + + + + + + +{{- if .IsPage }} +{{- $iso8601 := "2006-01-02T15:04:05-07:00" -}} + +{{ with .PublishDate }}{{ end }} +{{ with .Lastmod }}{{ end }} +{{- end -}} + +{{- with .Params.audio }}{{ end }} +{{- with .Params.locale }}{{ end }} +{{- with .Site.Params.title }}{{ end }} +{{- with .Params.videos }}{{- range . }} + +{{ end }}{{ end }} + +{{- /* If it is part of a series, link to related articles */}} +{{- $permalink := .Permalink }} +{{- $siteSeries := .Site.Taxonomies.series }} +{{- if $siteSeries }} +{{ with .Params.series }}{{- range $name := . }} + {{- $series := index $siteSeries ($name | urlize) }} + {{- range $page := first 6 $series.Pages }} + {{- if ne $page.Permalink $permalink }}{{ end }} + {{- end }} +{{ end }}{{ end }} +{{- end }} + +{{- /* Deprecate site.Social.facebook_admin in favor of site.Params.social.facebook_admin */}} +{{- $facebookAdmin := "" }} +{{- with site.Params.social }} + {{- if reflect.IsMap . }} + {{- $facebookAdmin = .facebook_admin }} + {{- end }} +{{- else }} + {{- with site.Social.facebook_admin }} + {{- $facebookAdmin = . }} + {{- warnf "The social key in site configuration is deprecated. Use params.social.facebook_admin instead." }} + {{- end }} +{{- end }} + +{{- /* Facebook Page Admin ID for Domain Insights */}} +{{ with $facebookAdmin }}{{ end }} + + + + + + + + +{{- /* Deprecate site.Social.twitter in favor of site.Params.social.twitter */}} +{{- $twitterSite := "" }} +{{- with site.Params.social }} + {{- if reflect.IsMap . }} + {{- $twitterSite = .twitter }} + {{- end }} +{{- else }} + {{- with site.Social.twitter }} + {{- $twitterSite = . }} + {{- warnf "The social key in site configuration is deprecated. Use params.social.twitter instead." }} + {{- end }} +{{- end }} + +{{- with $twitterSite }} + {{- $content := . }} + {{- if not (strings.HasPrefix . "@") }} + {{- $content = printf "@%v" $twitterSite }} + {{- end }} + +{{- end }} + + + + + + +{{- if .IsPage -}} +{{- $iso8601 := "2006-01-02T15:04:05-07:00" -}} +{{ with .PublishDate }}{{ end}} +{{ with .Lastmod }}{{ end}} + + + + + + +{{- end -}} diff --git a/themes/hugo-bearcub/hugo/layouts/robots.txt b/themes/hugo-bearcub/hugo/layouts/robots.txt new file mode 100644 index 0000000..4f4ca44 --- /dev/null +++ b/themes/hugo-bearcub/hugo/layouts/robots.txt @@ -0,0 +1,3 @@ +User-agent: * +Allow: / +Sitemap: {{ "sitemap.xml" | absURL }} diff --git a/themes/hugo-bearcub/hugo/layouts/shortcodes/highlight.html b/themes/hugo-bearcub/hugo/layouts/shortcodes/highlight.html new file mode 100644 index 0000000..6c86ca8 --- /dev/null +++ b/themes/hugo-bearcub/hugo/layouts/shortcodes/highlight.html @@ -0,0 +1,5 @@ + +{{ .Page.Store.Set "hasCodeBlock" true }} + + +{{ if len .Params | eq 2 }}{{ highlight (trim .InnerDeindent "\n\r") (.Get 0) (.Get 1) }}{{ else }}{{ highlight (trim .InnerDeindent "\n\r") (.Get 0) "" }}{{ end }} \ No newline at end of file diff --git a/themes/hugo-bearcub/hugo/layouts/shortcodes/rawhtml.html b/themes/hugo-bearcub/hugo/layouts/shortcodes/rawhtml.html new file mode 100644 index 0000000..520ec17 --- /dev/null +++ b/themes/hugo-bearcub/hugo/layouts/shortcodes/rawhtml.html @@ -0,0 +1,2 @@ + +{{.Inner}} \ No newline at end of file diff --git a/themes/hugo-bearcub/hugo/theme.toml b/themes/hugo-bearcub/hugo/theme.toml new file mode 100644 index 0000000..602a351 --- /dev/null +++ b/themes/hugo-bearcub/hugo/theme.toml @@ -0,0 +1,29 @@ +name = "Bear Cub" +license = "MIT" +licenselink = "https://github.com/clente/hugo-bearcub/blob/master/LICENSE" +description = "A lightweight Hugo theme based on Bear Blog and Hugo Bear Blog. It is free, multilingual, optimized for search engines, no-nonsense, responsive, light, and fast. Really fast." + +# The home page of the theme, where the source can be found. +homepage = "https://github.com/clente/hugo-bearcub" + +# If you have a running demo of the theme. +demosite = "https://clente.github.io/hugo-bearcub" + +tags = ["blog", "responsive", "minimal", "personal", "dark", "multilingual"] +features = ["favicon", "seo", "no javascript", "rss", "social cards"] + +# If the theme has a single author +[author] + name = "Caio Lente" + homepage = "https://lente.dev" + +# If porting an existing theme +[original] + author = "Jan Raasch" + homepage = "https://www.janraasch.com" + repo = "https://github.com/janraasch/hugo-bearblog" + +# Hugo versions the theme supports +[module] + [module.hugoVersion] + min = "0.90"