mirror of
https://github.com/nunocoracao/blowfish.git
synced 2026-01-30 16:31:52 +01:00
Compare commits
15 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
952d259602 | ||
|
|
fc7e02a6fb | ||
|
|
9f0f603f15 | ||
|
|
24ee8b12ef | ||
|
|
82ae111d35 | ||
|
|
cc1720c282 | ||
|
|
2152d37467 | ||
|
|
890958d6c8 | ||
|
|
fe5d9b0246 | ||
|
|
7087e71d9a | ||
|
|
539cfd6443 | ||
|
|
4b45ff114f | ||
|
|
0253344873 | ||
|
|
c64eac525a | ||
|
|
03cf3aec76 |
32
README.md
32
README.md
@@ -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,34 @@ 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.
|
||||
|
||||
> **Note:** Do not overwrite the `module.toml` file you created above!
|
||||
|
||||
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 +94,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.
|
||||
|
||||
@@ -1670,14 +1670,14 @@ select {
|
||||
width: 3rem;
|
||||
}
|
||||
|
||||
.w-36 {
|
||||
width: 9rem;
|
||||
}
|
||||
|
||||
.w-full {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.w-36 {
|
||||
width: 9rem;
|
||||
}
|
||||
|
||||
.w-24 {
|
||||
width: 6rem;
|
||||
}
|
||||
@@ -3073,10 +3073,6 @@ body:has(#menu-controller:checked) {
|
||||
}
|
||||
}
|
||||
|
||||
.max-w-prose {
|
||||
max-width: 75ch;
|
||||
}
|
||||
|
||||
.first\:mt-8:first-child {
|
||||
margin-top: 2rem;
|
||||
}
|
||||
@@ -3523,6 +3519,10 @@ body:has(#menu-controller:checked) {
|
||||
width: 50%;
|
||||
}
|
||||
|
||||
.sm\:max-w-prose {
|
||||
max-width: 65ch;
|
||||
}
|
||||
|
||||
.sm\:flex-row {
|
||||
flex-direction: row;
|
||||
}
|
||||
@@ -3676,6 +3676,10 @@ body:has(#menu-controller:checked) {
|
||||
margin-right: 0px;
|
||||
}
|
||||
|
||||
.lg\:ml-auto {
|
||||
margin-left: auto;
|
||||
}
|
||||
|
||||
.lg\:mt-0 {
|
||||
margin-top: 0px;
|
||||
}
|
||||
|
||||
@@ -395,8 +395,4 @@ body:has(#menu-controller:checked) {
|
||||
.article {
|
||||
flex-wrap: nowrap;
|
||||
}
|
||||
}
|
||||
|
||||
.max-w-prose {
|
||||
max-width: 75ch;
|
||||
}
|
||||
|
Before Width: | Height: | Size: 4.8 MiB After Width: | Height: | Size: 4.8 MiB |
@@ -23,7 +23,7 @@ mainSections = ["docs"]
|
||||
|
||||
[homepage]
|
||||
layout = "custom" # valid options: page, profile, hero, card, background, custom
|
||||
homepageImage = "iceland.jpg" # used in: hero, and card
|
||||
homepageImage = "/img/iceland.jpg" # used in: hero, and card
|
||||
showRecent = true
|
||||
showRecentItems = 5
|
||||
showMoreLink = true
|
||||
@@ -57,7 +57,7 @@ mainSections = ["docs"]
|
||||
[list]
|
||||
showBreadcrumbs = false
|
||||
showSummary = true
|
||||
showTableOfContents = false
|
||||
showTableOfContents = true
|
||||
showCards = true
|
||||
groupByYear = false
|
||||
|
||||
|
||||
@@ -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.
|
||||
|
||||
|
||||
@@ -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`.
|
||||
|
||||
@@ -67,26 +81,12 @@ This method is the quickest and easiest for keeping the theme up-to-date. Hugo u
|
||||
|
||||
```toml
|
||||
[[imports]]
|
||||
path = "github.com/nunocoracao/blowfish"
|
||||
path = "github.com/nunocoracao/blowfish/v2"
|
||||
```
|
||||
|
||||
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.
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
</div>
|
||||
</section>
|
||||
{{ if gt .Pages 0 }}
|
||||
<section class="space-y-10 max-w-prose">
|
||||
<section class="space-y-10 w-full">
|
||||
{{ range (.Paginate (.Pages.GroupByDate "2006")).PageGroups }}
|
||||
{{ if $.Params.groupByYear | default ($.Site.Params.list.groupByYear | default true) }}
|
||||
<h2 class="mt-12 text-2xl font-bold text-neutral-700 first:mt-8 dark:text-neutral-300">
|
||||
|
||||
@@ -21,7 +21,8 @@
|
||||
</header>
|
||||
<section class="flex flex-col max-w-full mt-0 prose dark:prose-invert lg:flex-row">
|
||||
{{ if and (.Params.showTableOfContents | default (.Site.Params.article.showTableOfContents | default false)) (in
|
||||
.TableOfContents "<ul") }} <div class="order-first px-0 lg:order-last lg:max-w-xs ltr:lg:pl-8 rtl:lg:pr-8">
|
||||
.TableOfContents "<ul") }}
|
||||
<div class="order-first sm:max-w-prose lg:ml-auto px-0 lg:order-last lg:max-w-xs ltr:lg:pl-8 rtl:lg:pr-8">
|
||||
<div class="toc ltr:pl-5 rtl:pr-5 print:hidden lg:sticky lg:top-10">
|
||||
{{ partial "toc.html" . }}
|
||||
</div>
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
</div>
|
||||
</section>
|
||||
{{ end }}
|
||||
<section class="mt-5 space-y-10 max-w-prose">
|
||||
<section class="mt-5 space-y-10 w-full">
|
||||
{{ range (.Paginate (.Pages.GroupByDate "2006")).PageGroups }}
|
||||
{{ if $.Params.groupByYear | default ($.Site.Params.list.groupByYear | default true) }}
|
||||
<h2 class="mt-12 text-2xl font-bold text-neutral-700 first:mt-8 dark:text-neutral-300">
|
||||
|
||||
@@ -4,13 +4,18 @@
|
||||
<div class="mx-auto max-w-7xl p-0">
|
||||
<div class="relative sm:overflow-hidden">
|
||||
<div class="absolute inset-0">
|
||||
<img class="h-full w-full object-cover m-0 nozoom" src="{{ .Site.Params.homepage.homepageImage }}">
|
||||
{{ with .Site.Params.homepage.homepageImage }}
|
||||
{{ $homepageImage := resources.Get . }}
|
||||
{{ if $homepageImage }}
|
||||
<img class="h-full w-full object-cover m-0 nozoom" src="{{ $homepageImage.RelPermalink }}">
|
||||
<div
|
||||
class="absolute inset-0 bg-gradient-to-t from-neutral-100 dark:from-neutral-800 to-transparent dark:to-neutral-300 mix-blend-normal dark:mix-blend-multiply">
|
||||
</div>
|
||||
<div
|
||||
class="absolute inset-0 bg-gradient-to-t from-neutral dark:from-neutral-800 to-transparent mix-blend-normal">
|
||||
</div>
|
||||
{{ 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">
|
||||
{{ with .Site.Author.image }}
|
||||
|
||||
@@ -14,8 +14,13 @@
|
||||
</div>
|
||||
<div class="mt-6 sm:mt-16 lg:mt-0">
|
||||
<div class="-mr-48 pl-4 sm:pl-6 md:-mr-16 lg:relative lg:m-0 lg:h-full lg:px-0">
|
||||
{{ with .Site.Params.homepage.homepageImage }}
|
||||
{{ $homepageImage := resources.Get . }}
|
||||
{{ if $homepageImage }}
|
||||
<img class="w-full rounded-xl shadow-xl lg:absolute lg:left-0 lg:h-full lg:w-auto lg:max-w-none"
|
||||
src="{{ .Site.Params.homepage.homepageImage }}">
|
||||
src="{{ $homepageImage.RelPermalink }}">
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -4,10 +4,15 @@
|
||||
<div class="mx-auto max-w-7xl p-0">
|
||||
<div class="relative shadow-xl sm:overflow-hidden rounded-2xl">
|
||||
<div class="absolute inset-0">
|
||||
<img class="h-full w-full object-cover m-0 nozoom" src="{{ .Site.Params.homepage.homepageImage }}">
|
||||
{{ with .Site.Params.homepage.homepageImage }}
|
||||
{{ $homepageImage := resources.Get . }}
|
||||
{{ if $homepageImage }}
|
||||
<img class="h-full w-full object-cover m-0 nozoom" src="{{ $homepageImage.RelPermalink }}">
|
||||
<div
|
||||
class="absolute inset-0 bg-gradient-to-r from-primary-500 to-secondary-700 dark:from-primary-600 dark:to-secondary-800 mix-blend-multiply">
|
||||
</div>
|
||||
{{ 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">
|
||||
{{ with .Site.Author.image }}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "hugo-blowfish-theme",
|
||||
"version": "2.4.0",
|
||||
"version": "2.4.4",
|
||||
"description": "Blowfish theme for Hugo",
|
||||
"scripts": {
|
||||
"preinstall": "rimraf assets/vendor",
|
||||
|
||||
Reference in New Issue
Block a user