diff --git a/themes/hugo-bearcub/.github/workflows/gh-pages.yml b/themes/hugo-bearcub/.github/workflows/gh-pages.yml new file mode 100644 index 0000000..f7f133d --- /dev/null +++ b/themes/hugo-bearcub/.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/.gitignore b/themes/hugo-bearcub/.gitignore new file mode 100644 index 0000000..305d231 --- /dev/null +++ b/themes/hugo-bearcub/.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/LICENSE b/themes/hugo-bearcub/LICENSE new file mode 100644 index 0000000..5c93582 --- /dev/null +++ b/themes/hugo-bearcub/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/README.md b/themes/hugo-bearcub/README.md new file mode 100644 index 0000000..0636c04 --- /dev/null +++ b/themes/hugo-bearcub/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/assets/images/social_card_bg.png b/themes/hugo-bearcub/assets/images/social_card_bg.png new file mode 100644 index 0000000..ad1d528 Binary files /dev/null and b/themes/hugo-bearcub/assets/images/social_card_bg.png differ diff --git a/themes/hugo-bearcub/assets/images/social_card_fg.png b/themes/hugo-bearcub/assets/images/social_card_fg.png new file mode 100644 index 0000000..01b207c Binary files /dev/null and b/themes/hugo-bearcub/assets/images/social_card_fg.png differ diff --git a/themes/hugo-bearcub/assets/style.css b/themes/hugo-bearcub/assets/style.css new file mode 100644 index 0000000..0173a36 --- /dev/null +++ b/themes/hugo-bearcub/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/assets/syntax.css b/themes/hugo-bearcub/assets/syntax.css new file mode 100644 index 0000000..5f15788 --- /dev/null +++ b/themes/hugo-bearcub/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/exampleSite/config.toml b/themes/hugo-bearcub/exampleSite/config.toml new file mode 100644 index 0000000..6fe641f --- /dev/null +++ b/themes/hugo-bearcub/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/exampleSite/content.pt/_index.md b/themes/hugo-bearcub/exampleSite/content.pt/_index.md new file mode 100644 index 0000000..4cf0d7e --- /dev/null +++ b/themes/hugo-bearcub/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/exampleSite/content.pt/blog/_index.md b/themes/hugo-bearcub/exampleSite/content.pt/blog/_index.md new file mode 100644 index 0000000..7588ac1 --- /dev/null +++ b/themes/hugo-bearcub/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/exampleSite/content/_index.md b/themes/hugo-bearcub/exampleSite/content/_index.md new file mode 100644 index 0000000..10c388f --- /dev/null +++ b/themes/hugo-bearcub/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/exampleSite/content/blog/_index.md b/themes/hugo-bearcub/exampleSite/content/blog/_index.md new file mode 100644 index 0000000..7588ac1 --- /dev/null +++ b/themes/hugo-bearcub/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/exampleSite/content/blog/emoji-support.md b/themes/hugo-bearcub/exampleSite/content/blog/emoji-support.md new file mode 100644 index 0000000..f17f49a --- /dev/null +++ b/themes/hugo-bearcub/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:
Test
+ + +``` + +#### Code block indented with four spaces + + + + + +Test
+ + + +#### Code block with Hugo's internal highlight shortcode +{{< highlight html >}} + + + + +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/exampleSite/content/blog/math-typesetting.md b/themes/hugo-bearcub/exampleSite/content/blog/math-typesetting.md new file mode 100644 index 0000000..62831a9 --- /dev/null +++ b/themes/hugo-bearcub/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 }} +{{ math.inline >}} + +### Examples + +{{< math.inline >}} ++Inline math: \(\varphi = \dfrac{1+\sqrt5}{2}= 1.6180339887…\) +
+{{ math.inline >}} + +Block math: +$$ + \varphi = 1+\frac{1} {1+\frac{1} {1+\frac{1} {1+\cdots} } } +$$ diff --git a/themes/hugo-bearcub/exampleSite/content/blog/placeholder-text.md b/themes/hugo-bearcub/exampleSite/content/blog/placeholder-text.md new file mode 100644 index 0000000..9ed5f69 --- /dev/null +++ b/themes/hugo-bearcub/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/exampleSite/content/blog/rich-content.md b/themes/hugo-bearcub/exampleSite/content/blog/rich-content.md new file mode 100644 index 0000000..bf7e101 --- /dev/null +++ b/themes/hugo-bearcub/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 >}} + ++ {{ range (.GetTerms "tags") }} + #{{ .LinkTitle }} + {{ end }} +
+{{ with .Site.Params.social.email }} ++ + {{ i18n "email-reply" }} ↪ + +
+{{ end }} +{{ end }} diff --git a/themes/hugo-bearcub/layouts/index.html b/themes/hugo-bearcub/layouts/index.html new file mode 100644 index 0000000..9983b08 --- /dev/null +++ b/themes/hugo-bearcub/layouts/index.html @@ -0,0 +1,3 @@ +{{ define "main" }} +{{ .Content }} +{{ end }} diff --git a/themes/hugo-bearcub/layouts/partials/custom_body.html b/themes/hugo-bearcub/layouts/partials/custom_body.html new file mode 100644 index 0000000..951fb15 --- /dev/null +++ b/themes/hugo-bearcub/layouts/partials/custom_body.html @@ -0,0 +1,3 @@ + diff --git a/themes/hugo-bearcub/layouts/partials/custom_head.html b/themes/hugo-bearcub/layouts/partials/custom_head.html new file mode 100644 index 0000000..4c53c40 --- /dev/null +++ b/themes/hugo-bearcub/layouts/partials/custom_head.html @@ -0,0 +1,3 @@ + diff --git a/themes/hugo-bearcub/layouts/partials/favicon.html b/themes/hugo-bearcub/layouts/partials/favicon.html new file mode 100644 index 0000000..d391a86 --- /dev/null +++ b/themes/hugo-bearcub/layouts/partials/favicon.html @@ -0,0 +1,2 @@ +{{ with .Site.Params.favicon }} +{{ end }} diff --git a/themes/hugo-bearcub/layouts/partials/footer.html b/themes/hugo-bearcub/layouts/partials/footer.html new file mode 100644 index 0000000..9290715 --- /dev/null +++ b/themes/hugo-bearcub/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/layouts/partials/header.html b/themes/hugo-bearcub/layouts/partials/header.html new file mode 100644 index 0000000..5a66907 --- /dev/null +++ b/themes/hugo-bearcub/layouts/partials/header.html @@ -0,0 +1,4 @@ +{{ i18n "skip-link" }} + +