Compare commits

...

26 Commits

Author SHA1 Message Date
Nuno Coração
2c15da1273 Update package.json 2022-10-28 19:07:40 +01:00
Nuno Coração
e76cbb53ae added showMenu to configs to highlight feature 2022-10-28 18:39:36 +01:00
Nuno Coração
5a734c1a51 Merge pull request #129 from madoke/main
Optionally disable footer menu. Enabled by default
2022-10-28 18:36:18 +01:00
Nuno Coração
54a99f72e0 Update config/_default/params.toml
Co-authored-by: David Simão <madoke@users.noreply.github.com>
2022-10-28 18:34:39 +01:00
Nuno Coração
a366cab831 Merge branch 'main' into main 2022-10-28 18:34:13 +01:00
Nuno Coração
2c15750c9e Merge pull request #166 from nunocoracao/163-option-to-enabledisable-medium-zoom-image-in-paramstoml
added disableImageZoom parameter to disable image zoom
2022-10-28 18:32:14 +01:00
Nuno Coração
243267d281 added disableImageZoom parameter to disable image zoom 2022-10-28 18:31:56 +01:00
Nuno Coração
828f5cda23 Merge pull request #165 from nunocoracao/164-background-hero-layout-aligns-long-titles-to-the-left-on-mobile
fixed background/hero homepage layouts not centering on mobile
2022-10-28 18:03:01 +01:00
Nuno Coração
c26bae0cb7 fixed background/hero homepage layouts not centering on mobile 2022-10-28 18:02:37 +01:00
Nuno Coração
e354929549 updated version 2022-10-25 23:47:57 +01:00
Nuno Coração
3d7ac720ee Merge pull request #158 from nunocoracao/157-links-rendering-with-extra-white-space
removed extra whitespace from links
2022-10-25 23:47:23 +01:00
Nuno Coração
89ab364735 removed extra whitespace from links 2022-10-25 23:46:52 +01:00
Nuno Coração
9cb99c0ec7 added katex shortcode example 2022-10-25 19:55:53 +01:00
madoke
c049cec8df fix typo/markdown 2022-10-24 21:56:16 +01:00
madoke
4a8c23c9d5 showMenu defaults to enabled 2022-10-24 21:54:37 +01:00
madoke
2211ce50be Adds documentation to showMenu parameter 2022-10-24 21:54:22 +01:00
Nuno Coração
4517ae0f0f Update index.md 2022-10-24 14:00:36 +01:00
Nuno Coração
27098fab5f Update README.md 2022-10-23 22:31:50 +01:00
Nuno Coração
952d259602 Update package.json 2022-10-23 22:29:36 +01:00
Nuno Coração
fc7e02a6fb Merge pull request #155 from nunocoracao/138-update-the-preferred-installation-method-in-docs
changed preferred installation method
2022-10-23 22:28:53 +01:00
Nuno Coração
9f0f603f15 changed preferred installation method 2022-10-23 22:28:35 +01:00
Nuno Coração
24ee8b12ef Merge pull request #154 from nunocoracao/153-typo-in-the-blowfishs-documentation-on-homepage-layout-section
fixed errors in homepage layout docs
2022-10-23 22:12:18 +01:00
Nuno Coração
82ae111d35 fixed errors in lyout docs 2022-10-23 22:11:49 +01:00
Nuno Coração
cc1720c282 Update README.md 2022-10-21 09:36:18 +01:00
Nuno Coração
2152d37467 Update README.md 2022-10-21 09:34:37 +01:00
madoke
11120610fd Optionally disable footer menu. Enabled by default 2022-10-16 21:28:27 +01:00
13 changed files with 92 additions and 59 deletions

View File

@@ -22,6 +22,7 @@ Blowfish is designed to be a powerful, lightweight theme for [Hugo](https://gohu
- Views count & like mechanism
- Multiple homepage layouts
- Support for multiple authors
- Support for series of articles
- Flexible with any content types, taxonomies and menus
- Multilingual content support inlcuding support for RTL languages
- Ability to link to posts on third-party websites
@@ -50,9 +51,31 @@ Blowfish has [extensive documentation](https://nunocoracao.github.io/blowfish/do
## Installation
Blowfish supports several installation methods - as a Hugo Module (easiest), a git submodule, or as a completely manual install.
Blowfish supports several installation methods - as a git submodule, a Hugo Module, or as a completely manual install.
Detailed instructions for each method can be found in the [Installation](https://nunocoracao.github.io/blowfish/docs/installation) docs. You should consult the documentation for the simplest setup experience. Below is a quick start guide using Hugo modules if you're already confident installing Hugo themes.
Detailed instructions for each method can be found in the [Installation](https://nunocoracao.github.io/blowfish/docs/installation) docs. You should consult the documentation for the simplest setup experience. Below is a quick start guide using submodules if you are using git, or Hugo modules if you're already confident installing Hugo themes.
### Quick start using git submodules
> **Note:** Ensure you have **Git**, **Go**, and **Hugo** installed, and that you have created a new Hugo project before proceeding.
1. From your project directory, initialise git:
```shell
git init
```
2. Configure Blowfish as a git submodule:
```shell
git submodule add -b main https://github.com/nunocoracao/blowfish.git themes/blowfish
```
3. In the root folder of your website, delete the `config.toml` file that was generated by Hugo. Copy the `*.toml` config files from the theme into your `config/_default/` folder.
You will find these theme config files in the Hugo cache directory, or [download a copy](https://minhaskamal.github.io/DownGit/#/home?url=https://github.com/nunocoracao/blowfish/tree/main/config/_default) from GitHub.
4. Follow the [Getting Started](https://nunocoracao.github.io/blowfish/docs/getting-started/) instructions to configure your website.
### Quick start using Hugo
@@ -68,7 +91,7 @@ Detailed instructions for each method can be found in the [Installation](https:/
```toml
[[imports]]
path = "github.com/nunocoracao/blowfish"
path = "github.com/nunocoracao/blowfish/v2"
```
3. Start your server using `hugo server` and the theme will be downloaded automatically.

View File

@@ -16,6 +16,7 @@ enableCodeCopy = true
# robots = ""
[footer]
# showMenu = true
showCopyright = true
showThemeAttribution = true
showAppearanceSwitcher = true

View File

@@ -16,6 +16,7 @@ mainSections = ["docs"]
# robots = ""
[footer]
showMenu = true
showCopyright = true
showThemeAttribution = true
showAppearanceSwitcher = true

View File

@@ -133,6 +133,8 @@ Many of the article defaults here can be overridden on a per article basis by sp
|`logo`|_Not set_|The relative path to the site logo file within the `assets/` folder. The logo file should be provided at 2x resolution and supports any image dimensions.|
|`mainSections`|_Not set_|The sections that should be displayed in the recent articles list. If not provided the section with the greatest number of articles is used.|
|`robots`|_Not set_|String that indicates how robots should handle your site. If set, it will be output in the page head. Refer to [Google's docs](https://developers.google.com/search/docs/advanced/robots/robots_meta_tag#directives) for valid values.|
|`disableImageZoom`|`false`|Disables image zoom feature across all the images in the site.|
|`footer.showMenu`|`true`|Show/hide the footer menu, which can be configured in the `[[footer]]` section of the `config/_default/menus.en.toml` file.|
|`footer.showCopyright`|`true`|Whether or not to show the copyright string in the site footer. Note that the string itself can be customised using the `copyright` parameter in the [languages configuration](#language-and-i18n).|
|`footer.showThemeAttribution`|`true`|Whether or not to show the "powered by" theme attribution in the site footer. If you choose to disable this message, please consider attributing the theme somewhere else on your site (for example, on your about page).|
|`footer.showAppearanceSwitcher`|`false`|Whether or not to show the appearance switcher in the site footer. The browser's local storage is used to persist the visitor's preference.|
@@ -192,4 +194,4 @@ Many of the article defaults here can be overridden on a per article basis by sp
The theme also includes a `markup.toml` configuration file. This file contains some important parameters that ensure that Hugo is correctly configured to generate sites built with Blowfish.
Always ensure this file is present in the config directory and that the required values are set. Failure to do so may cause certain features to fucntion incorrectly and could result in unintended behaviour.
Always ensure this file is present in the config directory and that the required values are set. Failure to do so may cause certain features to function incorrectly and could result in unintended behaviour.

View File

@@ -23,7 +23,7 @@ The author information is provided in the languages configuration file. Refer to
Additionally, any Markdown content that is provided in the homepage content will be placed below the author profile. This allows extra flexibility for displaying a bio or other custom content using shortcodes.
To enable the profile layout, set `homepage.layout = "profile"` in the `params.toml` configuration file.
To enable the Profile layout, set `homepage.layout = "profile"` in the `params.toml` configuration file.
## Page layout
@@ -31,7 +31,7 @@ The page layout is simply a normal content page that displays your Markdown cont
<img class="thumbnailshadow" src="home-page.png"/>
To enable the page layout, set `homepage.layout = "page"` in the `params.toml` configuration file.
To enable the Page layout, set `homepage.layout = "page"` in the `params.toml` configuration file.
## Hero layout
@@ -39,7 +39,7 @@ The hero layout brings together ideas from the profile and card layouts. This on
<img class="thumbnailshadow" src="home-hero.png"/>
To enable the profile layout, set `homepage.layout = "profile"` and `homepage.homepageImage` in the `params.toml` configuration file.
To enable the Hero layout, set `homepage.layout = "hero"` and `homepage.homepageImage` in the `params.toml` configuration file.
## Background layout
@@ -47,7 +47,7 @@ The background layout is a more smooth version of the hero layout. As in the Her
<img class="thumbnailshadow" src="home-background.png"/>
To enable the profile layout, set `homepage.layout = "background"` and `homepage.homepageImage` in the `params.toml` configuration file.
To enable the Background layout, set `homepage.layout = "background"` and `homepage.homepageImage` in the `params.toml` configuration file.
## Card layout
@@ -55,14 +55,14 @@ The card layout is an extension of the page layout. It provides the same level o
<img class="thumbnailshadow" src="home-card.png"/>
To enable the profile layout, set `homepage.layout = "profile"` and `homepage.homepageImage` in the `params.toml` configuration file.
To enable the Card layout, set `homepage.layout = "card"` and `homepage.homepageImage` in the `params.toml` configuration file.
## Custom layout
If the built-in homepage layouts aren't sufficient for your needs, you have the option to provide your own custom layout. This allows you to have total control over the page content and essentially gives you a blank slate to work with.
To enable the custom layout, set `homepage.layout = "custom"` in the `params.toml` configuration file.
To enable the Custom layout, set `homepage.layout = "custom"` in the `params.toml` configuration file.
With the configuration value set, create a new `custom.html` file and place it in `layouts/partials/home/custom.html`. Now whatever is in the `custom.html` file will be placed in the content area of the site homepage. You may use whatever HTML, Tailwind, or Hugo templating functions you wish to define your layout.

View File

@@ -37,15 +37,29 @@ Note that you can name the project directory whatever you choose, but the instru
There several different ways to install the Blowfish theme into your Hugo website. From easiest to most difficult to install and maintain, they are:
- [Hugo module](#install-using-hugo) (recommended)
- [Git submodule](#install-using-git)
- [Git submodule](#install-using-git) (recommended)
- [Hugo module](#install-using-hugo)
- [Manual file copy](#install-manually)
If you're unsure, choose the Hugo module method.
If you're unsure, choose the Git submodule method.
#### Install using git
This method is the quickest and easiest for keeping the theme up-to-date. Besides **Hugo** and **Go**, you'll also need to ensure you have **Git** installed on your local machine.
Change into the directory for your Hugo website (that you created above), initialise a new `git` repository and add Blowfish as a submodule.
```bash
cd mywebsite
git init
git submodule add -b main https://github.com/nunocoracao/blowfish.git themes/blowfish
```
Then continue to [set up the theme configuration files](#set-up-theme-configuration-files).
#### Install using Hugo
This method is the quickest and easiest for keeping the theme up-to-date. Hugo uses **Go** to initialise and manage modules so you need to ensure you have `go` installed before proceeding.
For this method you'll use Hugo to manage your themes. Hugo uses **Go** to initialise and manage modules so you need to ensure you have `go` installed before proceeding.
1. [Download](https://golang.org/dl/) and install Go. You can check if it's already installed by using the command `go version`.
@@ -73,20 +87,6 @@ This method is the quickest and easiest for keeping the theme up-to-date. Hugo u
4. Start your server using `hugo server` and the theme will be downloaded automatically.
5. Continue to [set up the theme configuration files](#set-up-theme-configuration-files).
#### Install using git
For this method you'll need to ensure you have **Git** installed on your local machine.
Change into the directory for your Hugo website (that you created above), initialise a new `git` repository and add Blowfish as a submodule.
```bash
cd mywebsite
git init
git submodule add -b main https://github.com/nunocoracao/blowfish.git themes/blowfish
```
Then continue to [set up the theme configuration files](#set-up-theme-configuration-files).
#### Install manually
1. Download the latest release of the theme source code.
@@ -136,10 +136,20 @@ From time to time there will be [new releases](https://github.com/nunocoracao/bl
How you go about this will depend on the installation method you chose when the theme was originally installed. Instructions for each method can be found below.
- [Hugo module](#update-using-hugo)
- [Git submodule](#update-using-git)
- [Hugo module](#update-using-hugo)
- [Manual file copy](#update-manually)
### Update using git
Git submodules can be updated using the `git` command. Simply execute the following command and the latest version of the theme will be downloaded into your local repository:
```shell
git submodule update --remote --merge
```
Once the submodule has been updated, rebuild your site and check everything works as expected.
### Update using Hugo
Hugo makes updating modules super easy. Simply change into your project directory and execute the following command:
@@ -152,16 +162,6 @@ Hugo will automatically update any modules that are required for your project. I
Then simply rebuild your site and check everything works as expected.
### Update using git
Git submodules can be updated using the `git` command. Simply execute the following command and the latest version of the theme will be downloaded into your local repository:
```shell
git submodule update --remote --merge
```
Once the submodule has been updated, rebuild your site and check everything works as expected.
### Update manually
Updating Blowfish manually requires you to download the latest copy of the theme and replace the old version in your project.

View File

@@ -11,9 +11,12 @@ KaTeX can be used to render mathematical notation within articles.
{{< katex >}}
Blowfish will only bundle the KaTeX assets into your project if you make use of mathematical notation. In order for this to work, simply include the [`katex` shortcode]({{< ref "docs/shortcodes#katex" >}}) within the article. Any KaTeX syntax on that page will then be automatically rendered.
Blowfish will only bundle the KaTeX assets into your project if you make use of mathematical notation. In order for this to work, simply include the [`katex` shortcode]({{< ref "docs/shortcodes#katex" >}}) within the article. Example below:
Use the online reference of [supported TeX functions](https://katex.org/docs/supported.html) for the available syntax.
```md
{{</* katex */>}}
```
Any KaTeX syntax on that page will then be automatically rendered. Use the online reference of [supported TeX functions](https://katex.org/docs/supported.html) for the available syntax.
## Inline notation

View File

@@ -1,3 +1,2 @@
<a href="{{ .Destination | safeURL }}" {{ with .Title}} title="{{ . }}"{{ end }} {{ if or (strings.HasPrefix .Destination "http:") (strings.HasPrefix .Destination "https:") }} target="_blank"{{ end }}>
{{ .Text | safeHTML }}
</a>
{{ .Text | safeHTML }}</a>

View File

@@ -1,16 +1,18 @@
<footer class="py-10 print:hidden">
{{/* Footer menu */}}
{{ if .Site.Menus.footer }}
<nav class="pb-4 text-base font-medium text-neutral-500 dark:text-neutral-400">
<ul class="flex flex-col list-none sm:flex-row">
{{ range .Site.Menus.footer }}
<li class="mb-1 ltr:text-right rtl:text-left sm:mb-0 ltr:sm:mr-7 ltr:sm:last:mr-0 rtl:sm:ml-7 rtl:sm:last:ml-0">
<a class="decoration-primary-500 hover:underline hover:decoration-2 hover:underline-offset-2" href="{{ .URL }}"
title="{{ .Title }}">{{ .Name | markdownify | emojify }}</a>
</li>
{{ end }}
</ul>
</nav>
{{ if .Site.Params.footer.showMenu | default true }}
{{ if .Site.Menus.footer }}
<nav class="pb-4 text-base font-medium text-neutral-500 dark:text-neutral-400">
<ul class="flex flex-col list-none sm:flex-row">
{{ range .Site.Menus.footer }}
<li class="mb-1 ltr:text-right rtl:text-left sm:mb-0 ltr:sm:mr-7 ltr:sm:last:mr-0 rtl:sm:ml-7 rtl:sm:last:ml-0">
<a class="decoration-primary-500 hover:underline hover:decoration-2 hover:underline-offset-2" href="{{ .URL }}"
title="{{ .Title }}">{{ .Name | markdownify | emojify }}</a>
</li>
{{ end }}
</ul>
</nav>
{{ end }}
{{ end }}
<div class="flex items-center justify-between">
@@ -41,11 +43,13 @@
</div>
<script>
{{ if not .Site.Params.disableImageZoom | default true }}
mediumZoom(document.querySelectorAll("img:not(.nozoom)"), {
margin: 24,
background: 'rgba(0,0,0,0.5)',
scrollOffset: 0,
})
{{ end }}
</script>
{{ $jsProcess := resources.Get "js/process.js" }}
{{ $jsProcess = $jsProcess | resources.Minify | resources.Fingerprint "sha512" }}

View File

@@ -17,7 +17,7 @@
{{ end }}
{{ end }}
</div>
<div class="relative px-4 py-16 sm:px-6 sm:py-24 lg:py-32 lg:px-8 flex flex-col items-center">
<div class="relative px-4 py-16 sm:px-6 sm:py-24 lg:py-32 lg:px-8 flex flex-col items-center justify-center text-center">
{{ with .Site.Author.image }}
{{ $authorImage := resources.Get . }}
{{ if $authorImage }}

View File

@@ -14,7 +14,7 @@
{{ end }}
{{ end }}
</div>
<div class="relative px-4 py-16 sm:px-6 sm:py-24 lg:py-32 lg:px-8 flex flex-col items-center">
<div class="relative px-4 py-16 sm:px-6 sm:py-24 lg:py-32 lg:px-8 flex flex-col items-center justify-center text-center">
{{ with .Site.Author.image }}
{{ $authorImage := resources.Get . }}
{{ if $authorImage }}

4
package-lock.json generated
View File

@@ -1,12 +1,12 @@
{
"name": "hugo-blowfish-theme",
"version": "2.3.1",
"version": "2.4.5",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "hugo-blowfish-theme",
"version": "2.3.1",
"version": "2.4.5",
"hasInstallScript": true,
"license": "MIT",
"dependencies": {

View File

@@ -1,6 +1,6 @@
{
"name": "hugo-blowfish-theme",
"version": "2.4.3",
"version": "2.5.0",
"description": "Blowfish theme for Hugo",
"scripts": {
"preinstall": "rimraf assets/vendor",