Add hugo-bearcub theme
32
themes/hugo-bearcub/hugo/.github/workflows/gh-pages.yml
vendored
Normal file
|
@ -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
|
4
themes/hugo-bearcub/hugo/.gitignore
vendored
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
.hugo_build.lock
|
||||||
|
.DS_Store
|
||||||
|
resources/
|
||||||
|
todo.md
|
21
themes/hugo-bearcub/hugo/LICENSE
Normal file
|
@ -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.
|
227
themes/hugo-bearcub/hugo/README.md
Normal file
|
@ -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).
|
BIN
themes/hugo-bearcub/hugo/assets/images/social_card_bg.png
Normal file
After Width: | Height: | Size: 636 KiB |
BIN
themes/hugo-bearcub/hugo/assets/images/social_card_fg.png
Normal file
After Width: | Height: | Size: 359 KiB |
177
themes/hugo-bearcub/hugo/assets/style.css
Normal file
|
@ -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;
|
||||||
|
}
|
91
themes/hugo-bearcub/hugo/assets/syntax.css
Normal file
|
@ -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 { } */
|
82
themes/hugo-bearcub/hugo/exampleSite/config.toml
Normal file
|
@ -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
|
35
themes/hugo-bearcub/hugo/exampleSite/content.pt/_index.md
Normal file
|
@ -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).
|
|
@ -0,0 +1,5 @@
|
||||||
|
---
|
||||||
|
title: "Blog"
|
||||||
|
menu: "main"
|
||||||
|
weight: 2
|
||||||
|
---
|
35
themes/hugo-bearcub/hugo/exampleSite/content/_index.md
Normal file
|
@ -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).
|
|
@ -0,0 +1,5 @@
|
||||||
|
---
|
||||||
|
title: "Blog"
|
||||||
|
menu: "main"
|
||||||
|
weight: 2
|
||||||
|
---
|
|
@ -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.
|
||||||
|
<!--more-->
|
||||||
|
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.
|
||||||
|
|
||||||
|
<p><span class="nowrap"><span class="emojify">🙈</span> <code>:see_no_evil:</code></span> <span class="nowrap"><span class="emojify">🙉</span> <code>:hear_no_evil:</code></span> <span class="nowrap"><span class="emojify">🙊</span> <code>:speak_no_evil:</code></span></p>
|
||||||
|
<br>
|
||||||
|
|
||||||
|
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 >}}
|
||||||
|
<style>
|
||||||
|
.emojify {
|
||||||
|
font-family: Apple Color Emoji, Segoe UI Emoji, NotoColorEmoji, Segoe UI Symbol, Android Emoji, EmojiSymbols;
|
||||||
|
font-size: 2rem;
|
||||||
|
vertical-align: middle;
|
||||||
|
}
|
||||||
|
@media screen and (max-width:650px) {
|
||||||
|
.nowrap {
|
||||||
|
display: block;
|
||||||
|
margin: 25px 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
{{< /css.inline >}}
|
|
@ -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.
|
||||||
|
<!--more-->
|
||||||
|
|
||||||
|
## Headings
|
||||||
|
|
||||||
|
The following HTML `<h1>`—`<h6>` elements represent six levels of section headings. `<h1>` is the highest section level while `<h6>` 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.<br>
|
||||||
|
> — <cite>Rob Pike[^1]</cite>
|
||||||
|
|
||||||
|
[^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
|
||||||
|
<!doctype html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<title>Example HTML5 Document</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<p>Test</p>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Code block indented with four spaces
|
||||||
|
|
||||||
|
<!doctype html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<title>Example HTML5 Document</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<p>Test</p>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
|
||||||
|
#### Code block with Hugo's internal highlight shortcode
|
||||||
|
{{< highlight html >}}
|
||||||
|
<!doctype html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<title>Example HTML5 Document</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<p>Test</p>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
{{< /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
|
||||||
|
|
||||||
|
<abbr title="Graphics Interchange Format">GIF</abbr> is a bitmap image format.
|
||||||
|
|
||||||
|
H<sub>2</sub>O
|
||||||
|
|
||||||
|
X<sup>n</sup> + Y<sup>n</sup> = Z<sup>n</sup>
|
||||||
|
|
||||||
|
Press <kbd><kbd>CTRL</kbd>+<kbd>ALT</kbd>+<kbd>Delete</kbd></kbd> to end the session.
|
||||||
|
|
||||||
|
Most <mark>salamanders</mark> are nocturnal, and hunt for insects, worms, and other small creatures.
|
|
@ -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.
|
||||||
|
<!--more-->
|
||||||
|
|
||||||
|
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 }}
|
||||||
|
<!-- KaTeX -->
|
||||||
|
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.11.1/dist/katex.min.css" integrity="sha384-zB1R0rpPzHqg7Kpt0Aljp8JPLqbXI3bhnPWROx27a9N0Ll6ZP/+DiW/UqRcLbRjq" crossorigin="anonymous">
|
||||||
|
<script defer src="https://cdn.jsdelivr.net/npm/katex@0.11.1/dist/katex.min.js" integrity="sha384-y23I5Q6l+B6vatafAwxRu/0oK/79VlbSz7Q9aiSZUvyWYIYsd+qj+o24G5ZU2zJz" crossorigin="anonymous"></script>
|
||||||
|
<script defer src="https://cdn.jsdelivr.net/npm/katex@0.11.1/dist/contrib/auto-render.min.js" integrity="sha384-kWPLUVMOks5AQFrykwIup5lo0m3iMkkHrD0uJ4H5cjeGihAutqP0yW0J6dpFiVkI" crossorigin="anonymous" onload="renderMathInElement(document.body);"></script>
|
||||||
|
{{ end }}
|
||||||
|
{{</ math.inline >}}
|
||||||
|
|
||||||
|
### Examples
|
||||||
|
|
||||||
|
{{< math.inline >}}
|
||||||
|
<p>
|
||||||
|
Inline math: \(\varphi = \dfrac{1+\sqrt5}{2}= 1.6180339887…\)
|
||||||
|
</p>
|
||||||
|
{{</ math.inline >}}
|
||||||
|
|
||||||
|
Block math:
|
||||||
|
$$
|
||||||
|
\varphi = 1+\frac{1} {1+\frac{1} {1+\frac{1} {1+\cdots} } }
|
||||||
|
$$
|
|
@ -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. <!--more-->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
|
||||||
|
|
||||||
|
<svg class="canon" xmlns="http://www.w3.org/2000/svg" overflow="visible" viewBox="0 0 496 373" height="373" width="496"><g fill="none"><path stroke="#000" stroke-width=".75" d="M.599 372.348L495.263 1.206M.312.633l494.95 370.853M.312 372.633L247.643.92M248.502.92l246.76 370.566M330.828 123.869V1.134M330.396 1.134L165.104 124.515"></path><path stroke="#ED1C24" stroke-width=".75" d="M275.73 41.616h166.224v249.05H275.73zM54.478 41.616h166.225v249.052H54.478z"></path><path stroke="#000" stroke-width=".75" d="M.479.375h495v372h-495zM247.979.875v372"></path><ellipse cx="498.729" cy="177.625" rx=".75" ry="1.25"></ellipse><ellipse cx="247.229" cy="377.375" rx=".75" ry="1.25"></ellipse></g></svg>
|
||||||
|
|
||||||
|
[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 >}}
|
||||||
|
<style>
|
||||||
|
.canon { background: white; width: 100%; height: auto; }
|
||||||
|
</style>
|
||||||
|
{{< /css.inline >}}
|
|
@ -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.
|
||||||
|
<!--more-->
|
||||||
|
---
|
||||||
|
|
||||||
|
## YouTube Privacy Enhanced Shortcode
|
||||||
|
|
||||||
|
{{< youtube ZJthWmvUzzc >}}
|
||||||
|
|
||||||
|
<br>
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Twitter Simple Shortcode
|
||||||
|
|
||||||
|
{{< tweet user="DesignReviewed" id="1085870671291310081" >}}
|
||||||
|
|
||||||
|
<br>
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Vimeo Simple Shortcode
|
||||||
|
|
||||||
|
{{< vimeo_simple 48912912 >}}
|
BIN
themes/hugo-bearcub/hugo/exampleSite/static/images/favicon.png
Normal file
After Width: | Height: | Size: 126 B |
BIN
themes/hugo-bearcub/hugo/exampleSite/static/images/share.webp
Normal file
After Width: | Height: | Size: 7.3 KiB |
14
themes/hugo-bearcub/hugo/i18n/en.toml
Normal file
|
@ -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"
|
14
themes/hugo-bearcub/hugo/i18n/pt.toml
Normal file
|
@ -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"
|
BIN
themes/hugo-bearcub/hugo/images/pagespeed.webp
Normal file
After Width: | Height: | Size: 12 KiB |
BIN
themes/hugo-bearcub/hugo/images/screenshot.png
Normal file
After Width: | Height: | Size: 243 KiB |
BIN
themes/hugo-bearcub/hugo/images/social_card.webp
Normal file
After Width: | Height: | Size: 34 KiB |
BIN
themes/hugo-bearcub/hugo/images/tn.png
Normal file
After Width: | Height: | Size: 132 KiB |
6
themes/hugo-bearcub/hugo/layouts/404.html
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
{{ define "title" }}404{{ end }}
|
||||||
|
|
||||||
|
{{ define "main" }}
|
||||||
|
<h1>404</h1>
|
||||||
|
<h2>ʕノ•ᴥ•ʔノ ︵ ┻━┻</h2>
|
||||||
|
{{ end }}
|
|
@ -0,0 +1,6 @@
|
||||||
|
<!-- https://github.com/jmooring/hugo-testing/blob/hugo-forum-topic-40998/layouts/_default/_markup/render-codeblock-katex.html -->
|
||||||
|
{{ .Page.Store.Set "hasCodeBlock" true }}
|
||||||
|
|
||||||
|
<!-- https://www.veriphor.com/articles/code-block-render-hooks/ -->
|
||||||
|
{{ $result := transform.HighlightCodeBlock . }}
|
||||||
|
{{ $result.Wrapped }}
|
54
themes/hugo-bearcub/hugo/layouts/_default/baseof.html
Normal file
|
@ -0,0 +1,54 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="{{ with .Site.LanguageCode }}{{ . }}{{ else }}en-US{{ end }}">
|
||||||
|
|
||||||
|
<head>
|
||||||
|
<meta http-equiv="X-Clacks-Overhead" content="GNU Terry Pratchett" />
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||||
|
{{- partial "favicon.html" . -}}
|
||||||
|
<title>{{- block "title" . }}{{ with .Title }}{{ . }} | {{ end }}{{ .Site.Title }}{{- end }}</title>
|
||||||
|
|
||||||
|
{{- partial "seo_tags.html" . -}}
|
||||||
|
<meta name="referrer" content="no-referrer-when-downgrade" />
|
||||||
|
|
||||||
|
{{ $style := resources.Get "style.css" | minify }}
|
||||||
|
<link href="{{ $style.RelPermalink }}" rel="stylesheet">
|
||||||
|
|
||||||
|
{{ if (.Page.Store.Get "hasCodeBlock") }}
|
||||||
|
{{ $syntax := resources.Get "syntax.css" | minify }}
|
||||||
|
<link href="{{ $syntax.RelPermalink }}" rel="stylesheet">
|
||||||
|
{{ end }}
|
||||||
|
|
||||||
|
{{ with .Params.style }}
|
||||||
|
{{ $extra := resources.Get . | minify }}
|
||||||
|
<link href="{{ $extra.RelPermalink }}" rel="stylesheet">
|
||||||
|
{{ end }}
|
||||||
|
|
||||||
|
{{ with .OutputFormats.Get "rss" -}}
|
||||||
|
{{ printf `<link rel="%s" type="%s" href="%s" title="%s" />` .Rel .MediaType.Type .Permalink $.Site.Title | safeHTML }}
|
||||||
|
{{ end -}}
|
||||||
|
|
||||||
|
<!-- A partial to be overwritten by the user.
|
||||||
|
Simply place a custom_head.html into
|
||||||
|
your local /layouts/partials-directory -->
|
||||||
|
{{- partial "custom_head.html" . -}}
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body>
|
||||||
|
<header>
|
||||||
|
{{- partial "header.html" . -}}
|
||||||
|
</header>
|
||||||
|
<main id="main-content">
|
||||||
|
{{- block "main" . }}{{- end }}
|
||||||
|
</main>
|
||||||
|
<footer>
|
||||||
|
{{- partial "footer.html" . -}}
|
||||||
|
</footer>
|
||||||
|
|
||||||
|
<!-- A partial to be overwritten by the user.
|
||||||
|
Simply place a custom_body.html into
|
||||||
|
your local /layouts/partials-directory -->
|
||||||
|
{{- partial "custom_body.html" . -}}
|
||||||
|
</body>
|
||||||
|
|
||||||
|
</html>
|
36
themes/hugo-bearcub/hugo/layouts/_default/list.html
Normal file
|
@ -0,0 +1,36 @@
|
||||||
|
{{ define "main" }}
|
||||||
|
<content>
|
||||||
|
{{ if .Data.Singular }}
|
||||||
|
<h3 class="blog-filter">{{ i18n "filtering-for" }} "{{ .Title }}"</h3>
|
||||||
|
{{ end }}
|
||||||
|
<ul class="blog-posts">
|
||||||
|
{{ range .Pages }}
|
||||||
|
<li>
|
||||||
|
<span>
|
||||||
|
<i>
|
||||||
|
<time datetime='{{ .Date.Format "2006-01-02" }}' pubdate>
|
||||||
|
{{ .Date.Format (default "2006-01-02" .Site.Params.dateFormat) }}
|
||||||
|
</time>
|
||||||
|
</i>
|
||||||
|
</span>
|
||||||
|
{{ if .Params.link }}
|
||||||
|
<a href="{{ .Params.link }}" target="_blank">{{ .Title }} ↪</a>
|
||||||
|
{{ else }}
|
||||||
|
<a href="{{ .Permalink }}">{{ .Title }}</a>
|
||||||
|
{{ end }}
|
||||||
|
</li>
|
||||||
|
{{ else }}
|
||||||
|
<li>
|
||||||
|
{{ i18n "no-posts" }}
|
||||||
|
</li>
|
||||||
|
{{ end }}
|
||||||
|
</ul>
|
||||||
|
{{ if not .Data.Singular }}
|
||||||
|
<div>
|
||||||
|
{{ range .Site.Taxonomies.tags }}
|
||||||
|
<a class="blog-tags" href="{{ .Page.Permalink }}">#{{ .Page.Title }}</a>
|
||||||
|
{{ end }}
|
||||||
|
</div>
|
||||||
|
{{ end }}
|
||||||
|
</content>
|
||||||
|
{{ end }}
|
72
themes/hugo-bearcub/hugo/layouts/_default/rss.xml
Normal file
|
@ -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 "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"yes\"?>" | safeHTML }}
|
||||||
|
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/">
|
||||||
|
<channel>
|
||||||
|
<title>{{ if .IsHome }}{{ .Site.Title }}{{ else }}{{ with .Title }}{{ . }} on {{ end }}{{ .Site.Title }}{{ end }}</title>
|
||||||
|
<link>{{ .Permalink }}</link>
|
||||||
|
<description>Recent content {{ if not .IsHome }}{{ with .Title }}in {{ . }} {{ end }}{{ end }}on {{ .Site.Title }}</description>
|
||||||
|
<generator>Hugo -- gohugo.io</generator>
|
||||||
|
<language>{{ site.Language.LanguageCode }}</language>{{ with $authorEmail }}
|
||||||
|
<managingEditor>{{.}}{{ with $authorName }} ({{ . }}){{ end }}</managingEditor>{{ end }}{{ with $authorEmail }}
|
||||||
|
<webMaster>{{ . }}{{ with $authorName }} ({{ . }}){{ end }}</webMaster>{{ end }}{{ with .Site.Copyright }}
|
||||||
|
<copyright>{{ . }}</copyright>{{ end }}{{ if not .Date.IsZero }}
|
||||||
|
<lastBuildDate>{{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</lastBuildDate>{{ end }}
|
||||||
|
{{- with .OutputFormats.Get "RSS" }}
|
||||||
|
{{ printf "<atom:link href=%q rel=\"self\" type=%q />" .Permalink .MediaType | safeHTML }}
|
||||||
|
{{- end }}
|
||||||
|
{{- range $pages }}
|
||||||
|
<item>
|
||||||
|
<title>{{ .Title }}</title>
|
||||||
|
<link>{{ .Permalink }}</link>
|
||||||
|
<pubDate>{{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</pubDate>
|
||||||
|
{{- with $authorEmail }}<author>{{ . }}{{ with $authorName }} ({{ . }}){{ end }}</author>{{ end }}
|
||||||
|
<guid>{{ .Permalink }}</guid>
|
||||||
|
<description>{{ .Summary | transform.XMLEscape | safeHTML }}</description>
|
||||||
|
<content:encoded>{{ `<![CDATA[` | safeHTML }}{{ .Content | safeHTML }}{{ `]]>` | safeHTML }}</content:encoded>
|
||||||
|
</item>
|
||||||
|
{{- end }}
|
||||||
|
</channel>
|
||||||
|
</rss>
|
26
themes/hugo-bearcub/hugo/layouts/_default/single.html
Normal file
|
@ -0,0 +1,26 @@
|
||||||
|
{{ define "main" }}
|
||||||
|
{{ if not .Params.menu }}
|
||||||
|
<h1>{{ .Title }}</h1>
|
||||||
|
<p class="byline">
|
||||||
|
<time datetime='{{ .Date.Format "2006-01-02" }}' pubdate>
|
||||||
|
{{ .Date.Format (default "2006-01-02" .Site.Params.dateFormat) }}
|
||||||
|
</time>
|
||||||
|
{{ with .Params.author }}· {{.}}{{ end }}
|
||||||
|
</p>
|
||||||
|
{{ end }}
|
||||||
|
<content>
|
||||||
|
{{ .Content }}
|
||||||
|
</content>
|
||||||
|
<p>
|
||||||
|
{{ range (.GetTerms "tags") }}
|
||||||
|
<a class="blog-tags" href="{{ .Permalink }}">#{{ .LinkTitle }}</a>
|
||||||
|
{{ end }}
|
||||||
|
</p>
|
||||||
|
{{ with .Site.Params.social.email }}
|
||||||
|
<p>
|
||||||
|
<a href='mailto:{{ . }}?subject={{ i18n "email-subject" }}"{{ default $.Site.Title $.Page.Title }}"'>
|
||||||
|
{{ i18n "email-reply" }} ↪
|
||||||
|
</a>
|
||||||
|
</p>
|
||||||
|
{{ end }}
|
||||||
|
{{ end }}
|
3
themes/hugo-bearcub/hugo/layouts/index.html
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
{{ define "main" }}
|
||||||
|
{{ .Content }}
|
||||||
|
{{ end }}
|
|
@ -0,0 +1,3 @@
|
||||||
|
<!-- A partial to be overwritten by the user.
|
||||||
|
Simply place a custom_body.html into
|
||||||
|
your local /layouts/partials-directory -->
|
|
@ -0,0 +1,3 @@
|
||||||
|
<!-- A partial to be overwritten by the user.
|
||||||
|
Simply place a custom_head.html into
|
||||||
|
your local /layouts/partials-directory -->
|
2
themes/hugo-bearcub/hugo/layouts/partials/favicon.html
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
{{ with .Site.Params.favicon }}
|
||||||
|
<link rel="shortcut icon" href="{{ absURL . }}" />{{ end }}
|
3
themes/hugo-bearcub/hugo/layouts/partials/footer.html
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
<small>
|
||||||
|
{{ .Site.Copyright }} | {{ markdownify .Site.Params.madeWith }}
|
||||||
|
</small>
|
4
themes/hugo-bearcub/hugo/layouts/partials/header.html
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
<a class="skip-link" href="#main-content">{{ i18n "skip-link" }}</a>
|
||||||
|
|
||||||
|
<a href="{{ relURL .Site.Home.Permalink }}" class="title"><h1>{{ .Site.Title }}</h1></a>
|
||||||
|
<nav>{{- partial "nav.html" . -}}</nav>
|
22
themes/hugo-bearcub/hugo/layouts/partials/nav.html
Normal file
|
@ -0,0 +1,22 @@
|
||||||
|
{{ range .Site.Menus.main.ByWeight }}
|
||||||
|
<a href="{{ .URL }}">{{ .Name }}</a>
|
||||||
|
{{ end }}
|
||||||
|
<a href='{{ absURL "index.xml" }}'>RSS</a>
|
||||||
|
|
||||||
|
<!-- Convert this page's translations into a dict -->
|
||||||
|
{{ $translations := dict }}
|
||||||
|
{{ range .Translations }}
|
||||||
|
{{ $translations = merge $translations (dict .Language.Lang .) }}
|
||||||
|
{{ end }}
|
||||||
|
|
||||||
|
<!-- Create a link to every translation -->
|
||||||
|
{{ range where .Site.Languages "Lang" "!=" .Page.Lang }}
|
||||||
|
{{ with (index $translations .Lang) }}
|
||||||
|
<a href="{{ .Permalink }}">{{ .Language.LanguageName }}</a>
|
||||||
|
{{ else }}
|
||||||
|
<!-- The complicated setup was necessary to make a grayed out link -->
|
||||||
|
{{ if not .Params.hideUntranslated }}
|
||||||
|
<a class="disabled" role="link" aria-disabled="true">{{ .LanguageName }}</a>
|
||||||
|
{{ end }}
|
||||||
|
{{ end }}
|
||||||
|
{{ end }}
|
21
themes/hugo-bearcub/hugo/layouts/partials/seo_tags.html
Normal file
|
@ -0,0 +1,21 @@
|
||||||
|
<!-- Primary Meta Tags -->
|
||||||
|
<meta name="title" content="{{ with .Title }}{{ . }}{{ else }}{{ .Site.Title }}{{ end }}" />
|
||||||
|
<meta name="description" content="{{ with .Description }}{{ . }}{{ else }}{{if .IsPage}}{{ .Summary }}{{ else }}{{ with .Site.Params.description }}{{ . }}{{ end }}{{ end }}{{ end }}" />
|
||||||
|
<meta name="keywords" content="{{ if .IsPage}}{{ range $index, $tag := .Params.tags }}{{ $tag }},{{ end }}{{ else }}{{ range $plural, $terms := .Site.Taxonomies }}{{ range $term, $val := $terms }}{{ printf "%s," $term }}{{ end }}{{ end }}{{ end }}" />
|
||||||
|
|
||||||
|
<!-- Only generate social card if: -->
|
||||||
|
<!-- - generateSocialCard = true -->
|
||||||
|
<!-- - there aren't images set in frontmatter -->
|
||||||
|
<!-- - page is of .Kind "page" -->
|
||||||
|
{{ if and (and (default false .Site.Params.generateSocialCard) (not (isset .Params "images"))) (eq .Kind "page") }}
|
||||||
|
{{ partial "social_card.html" . }}
|
||||||
|
{{ else }}
|
||||||
|
<!-- Open Graph / Facebook -->
|
||||||
|
{{ template "_internal/opengraph.html" . }}
|
||||||
|
|
||||||
|
<!-- Twitter -->
|
||||||
|
{{ template "_internal/twitter_cards.html" . }}
|
||||||
|
|
||||||
|
<!-- Microdata -->
|
||||||
|
{{ template "_internal/schema.html" . }}
|
||||||
|
{{ end }}
|
125
themes/hugo-bearcub/hugo/layouts/partials/social_card.html
Normal file
|
@ -0,0 +1,125 @@
|
||||||
|
<!-- Dynamic social card generation -->
|
||||||
|
{{ $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" }}
|
||||||
|
|
||||||
|
<!-- Open Graph / Facebook -->
|
||||||
|
<!-- Source: https://github.com/gohugoio/hugo/blob/master/tpl/tplimpl/embedded/templates/opengraph.html -->
|
||||||
|
<meta property="og:title" content="{{ .Title }}" />
|
||||||
|
<meta property="og:description" content="{{ with .Description }}{{ . }}{{ else }}{{if .IsPage}}{{ .Summary }}{{ else }}{{ with .Site.Params.description }}{{ . }}{{ end }}{{ end }}{{ end }}" />
|
||||||
|
<meta property="og:type" content="{{ if .IsPage }}article{{ else }}website{{ end }}" />
|
||||||
|
<meta property="og:url" content="{{ .Permalink }}" />
|
||||||
|
|
||||||
|
<meta property="og:image" content="{{ $card.Permalink | absURL }}"/>
|
||||||
|
|
||||||
|
{{- if .IsPage }}
|
||||||
|
{{- $iso8601 := "2006-01-02T15:04:05-07:00" -}}
|
||||||
|
<meta property="article:section" content="{{ .Section }}" />
|
||||||
|
{{ with .PublishDate }}<meta property="article:published_time" {{ .Format $iso8601 | printf "content=%q" | safeHTMLAttr }} />{{ end }}
|
||||||
|
{{ with .Lastmod }}<meta property="article:modified_time" {{ .Format $iso8601 | printf "content=%q" | safeHTMLAttr }} />{{ end }}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{- with .Params.audio }}<meta property="og:audio" content="{{ . }}" />{{ end }}
|
||||||
|
{{- with .Params.locale }}<meta property="og:locale" content="{{ . }}" />{{ end }}
|
||||||
|
{{- with .Site.Params.title }}<meta property="og:site_name" content="{{ . }}" />{{ end }}
|
||||||
|
{{- with .Params.videos }}{{- range . }}
|
||||||
|
<meta property="og:video" content="{{ . | absURL }}" />
|
||||||
|
{{ 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 }}<meta property="og:see_also" content="{{ $page.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 }}<meta property="fb:admins" content="{{ . }}" />{{ end }}
|
||||||
|
|
||||||
|
<!-- Twitter -->
|
||||||
|
<!-- Source: https://github.com/gohugoio/hugo/blob/master/tpl/tplimpl/embedded/templates/twitter_cards.html -->
|
||||||
|
<meta name="twitter:card" content="summary_large_image"/>
|
||||||
|
<meta name="twitter:image" content="{{ $card.Permalink | absURL }}"/>
|
||||||
|
<meta name="twitter:title" content="{{ .Title }}"/>
|
||||||
|
<meta name="twitter:description" content="{{ with .Description }}{{ . }}{{ else }}{{if .IsPage}}{{ .Summary }}{{ else }}{{ with .Site.Params.description }}{{ . }}{{ end }}{{ end }}{{ 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 }}
|
||||||
|
<meta name="twitter:site" content="{{ $content }}"/>
|
||||||
|
{{- end }}
|
||||||
|
|
||||||
|
<!-- Microdata -->
|
||||||
|
<!-- Source: https://github.com/gohugoio/hugo/blob/master/tpl/tplimpl/embedded/templates/schema.html -->
|
||||||
|
<meta itemprop="name" content="{{ .Title }}">
|
||||||
|
<meta itemprop="description" content="{{ with .Description }}{{ . }}{{ else }}{{if .IsPage}}{{ .Summary }}{{ else }}{{ with .Site.Params.description }}{{ . }}{{ end }}{{ end }}{{ end }}">
|
||||||
|
|
||||||
|
{{- if .IsPage -}}
|
||||||
|
{{- $iso8601 := "2006-01-02T15:04:05-07:00" -}}
|
||||||
|
{{ with .PublishDate }}<meta itemprop="datePublished" {{ .Format $iso8601 | printf "content=%q" | safeHTMLAttr }} />{{ end}}
|
||||||
|
{{ with .Lastmod }}<meta itemprop="dateModified" {{ .Format $iso8601 | printf "content=%q" | safeHTMLAttr }} />{{ end}}
|
||||||
|
<meta itemprop="wordCount" content="{{ .WordCount }}">
|
||||||
|
|
||||||
|
<meta itemprop="image" content="{{ $card.Permalink | absURL }}"/>
|
||||||
|
|
||||||
|
<!-- Output all taxonomies as schema.org keywords -->
|
||||||
|
<meta itemprop="keywords" content="{{ if .IsPage}}{{ range $index, $tag := .Params.tags }}{{ $tag }},{{ end }}{{ else }}{{ range $plural, $terms := .Site.Taxonomies }}{{ range $term, $val := $terms }}{{ printf "%s," $term }}{{ end }}{{ end }}{{ end }}" />
|
||||||
|
{{- end -}}
|
3
themes/hugo-bearcub/hugo/layouts/robots.txt
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
User-agent: *
|
||||||
|
Allow: /
|
||||||
|
Sitemap: {{ "sitemap.xml" | absURL }}
|
|
@ -0,0 +1,5 @@
|
||||||
|
<!-- https://github.com/jmooring/hugo-testing/blob/hugo-forum-topic-40998/layouts/_default/_markup/render-codeblock-katex.html -->
|
||||||
|
{{ .Page.Store.Set "hasCodeBlock" true }}
|
||||||
|
|
||||||
|
<!-- https://github.com/gohugoio/hugo/blob/master/tpl/tplimpl/embedded/templates/shortcodes/highlight.html -->
|
||||||
|
{{ if len .Params | eq 2 }}{{ highlight (trim .InnerDeindent "\n\r") (.Get 0) (.Get 1) }}{{ else }}{{ highlight (trim .InnerDeindent "\n\r") (.Get 0) "" }}{{ end }}
|
2
themes/hugo-bearcub/hugo/layouts/shortcodes/rawhtml.html
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
<!-- raw html -->
|
||||||
|
{{.Inner}}
|
29
themes/hugo-bearcub/hugo/theme.toml
Normal file
|
@ -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"
|