mirror of
https://github.com/nunocoracao/blowfish.git
synced 2026-10-16 16:56:24 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a4817aa442 | ||
|
|
03443c989f |
No files matched your search
+1620
-9
File diff suppressed because it is too large.
Load diff
@@ -58,6 +58,27 @@ Blowfish was built so it would be easy to add visual support to your articles. I
|
||||
|
||||
Blowfish is optimised for full multilingual websites and theme assets are translated into several languages out of the box. The language configuration allows you to generate multiple versions of your content to provide a customised experience to your visitors in their native language.
|
||||
|
||||
### 404 page quotes
|
||||
|
||||
The 404 page displays a random movie quote in the active site language. You can replace the bundled quotes by adding a `data/quotes404.json` file to your site. Each item needs a `line` and `source`; use `lang` to target a language. Language codes may be full codes such as `pt-PT` or base codes such as `pt`. Quotes without `lang` are treated as English for backwards compatibility.
|
||||
|
||||
```json
|
||||
[
|
||||
{
|
||||
"lang": "en",
|
||||
"line": "You shall not pass!",
|
||||
"source": "The Fellowship of the Ring (2001)"
|
||||
},
|
||||
{
|
||||
"lang": "pt-PT",
|
||||
"line": "Não passarás!",
|
||||
"source": "The Fellowship of the Ring (2001)"
|
||||
}
|
||||
]
|
||||
```
|
||||
|
||||
Blowfish tries an exact language match, then the base language, then English. If none are available, it selects from any configured quote.
|
||||
|
||||
The theme currently supports the following languages by default:
|
||||
|
||||
| Language | Code |
|
||||
|
||||
+20
-1
@@ -29,7 +29,26 @@
|
||||
</div>
|
||||
|
||||
{{ with hugo.Data.quotes404 }}
|
||||
{{ $json := . | jsonify }}
|
||||
{{/* Pick the current language's quotes at build time: exact locale
|
||||
first, then base language, then English. Quotes without a lang are
|
||||
treated as English to preserve existing custom overrides. */}}
|
||||
{{ $lang := lower site.Language.Lang }}
|
||||
{{ $base := index (split $lang "-") 0 }}
|
||||
{{ $localized := slice }}
|
||||
{{ $english := slice }}
|
||||
{{ range . }}
|
||||
{{ $qlang := lower (.lang | default "en") }}
|
||||
{{ if or (eq $qlang $lang) (eq $qlang $base) }}
|
||||
{{ $localized = $localized | append . }}
|
||||
{{ end }}
|
||||
{{ if eq $qlang "en" }}
|
||||
{{ $english = $english | append . }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{ $quotes := $localized }}
|
||||
{{ if not $quotes }}{{ $quotes = $english }}{{ end }}
|
||||
{{ if not $quotes }}{{ $quotes = . }}{{ end }}
|
||||
{{ $json := $quotes | jsonify }}
|
||||
<script>
|
||||
(function () {
|
||||
var quotes = JSON.parse({{ $json }});
|
||||
|
||||
Generated
+10
-10
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "hugo-blowfish-theme",
|
||||
"version": "3.0.0",
|
||||
"version": "3.1.0",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "hugo-blowfish-theme",
|
||||
"version": "3.0.0",
|
||||
"version": "3.1.0",
|
||||
"hasInstallScript": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
@@ -1558,7 +1558,7 @@
|
||||
}
|
||||
},
|
||||
"node_modules/cssesc": {
|
||||
"version": "3.0.0",
|
||||
"version": "3.1.0",
|
||||
"resolved": "https://registry.npmjs.org/cssesc/-/cssesc-3.0.0.tgz",
|
||||
"integrity": "sha512-/Tb/JcjK111nNScGob5MNtsntNM1aCNUDipB/TkwZFhyDrrE47SOx/18wF2bbjgc3ZzCSKW1T5nt5EbFoAz/Vg==",
|
||||
"dev": true,
|
||||
@@ -1679,7 +1679,7 @@
|
||||
}
|
||||
},
|
||||
"node_modules/d3-axis": {
|
||||
"version": "3.0.0",
|
||||
"version": "3.1.0",
|
||||
"resolved": "https://registry.npmjs.org/d3-axis/-/d3-axis-3.0.0.tgz",
|
||||
"integrity": "sha512-IH5tgjV4jE/GhHkRV0HiVYPDtvfjHQlQfJHs0usq7M30XcSBvOotpmH1IgkcXsO/5gEQZD43B//fc7SRT5S+xw==",
|
||||
"dev": true,
|
||||
@@ -1689,7 +1689,7 @@
|
||||
}
|
||||
},
|
||||
"node_modules/d3-brush": {
|
||||
"version": "3.0.0",
|
||||
"version": "3.1.0",
|
||||
"resolved": "https://registry.npmjs.org/d3-brush/-/d3-brush-3.0.0.tgz",
|
||||
"integrity": "sha512-ALnjWlVYkXsVIGlOsuWH1+3udkYFI48Ljihfnh8FZPF2QS9o+PzGLBslO0PjzVoHLZ2KCVgAM8NVkXPJB2aNnQ==",
|
||||
"dev": true,
|
||||
@@ -1765,7 +1765,7 @@
|
||||
}
|
||||
},
|
||||
"node_modules/d3-drag": {
|
||||
"version": "3.0.0",
|
||||
"version": "3.1.0",
|
||||
"resolved": "https://registry.npmjs.org/d3-drag/-/d3-drag-3.0.0.tgz",
|
||||
"integrity": "sha512-pWbUJLdETVA8lQNJecMxoXfH6x+mO2UQo8rSmZ+QqxcbyA3hfeprFgIT//HW2nlHChWeIIMwS2Fq+gEARkhTkg==",
|
||||
"dev": true,
|
||||
@@ -1838,7 +1838,7 @@
|
||||
}
|
||||
},
|
||||
"node_modules/d3-force": {
|
||||
"version": "3.0.0",
|
||||
"version": "3.1.0",
|
||||
"resolved": "https://registry.npmjs.org/d3-force/-/d3-force-3.0.0.tgz",
|
||||
"integrity": "sha512-zxV/SsA+U4yte8051P4ECydjD/S+qeYtnaIyAs9tgHCqfguma/aAQDjo85A9Z6EKhBirHRJHXIgJUlffT4wdLg==",
|
||||
"dev": true,
|
||||
@@ -2015,7 +2015,7 @@
|
||||
}
|
||||
},
|
||||
"node_modules/d3-selection": {
|
||||
"version": "3.0.0",
|
||||
"version": "3.1.0",
|
||||
"resolved": "https://registry.npmjs.org/d3-selection/-/d3-selection-3.0.0.tgz",
|
||||
"integrity": "sha512-fmTRWbNMmsmWq6xJV8D19U/gw/bwrHfNXxrIN+HfZgnzqTHp9jOmKMhsTUjXOJnZOdZY9Q28y4yebKzqDKlxlQ==",
|
||||
"dev": true,
|
||||
@@ -2094,7 +2094,7 @@
|
||||
}
|
||||
},
|
||||
"node_modules/d3-zoom": {
|
||||
"version": "3.0.0",
|
||||
"version": "3.1.0",
|
||||
"resolved": "https://registry.npmjs.org/d3-zoom/-/d3-zoom-3.0.0.tgz",
|
||||
"integrity": "sha512-b8AmV3kfQaqWAuacbPuNbL6vahnOJflOhexLzMMNLga62+/nh0JzvJ0aO/5a5MVgUFGS7Hu1P9P03o3fJkDCyw==",
|
||||
"dev": true,
|
||||
@@ -2968,7 +2968,7 @@
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/packery": {
|
||||
"version": "3.0.0",
|
||||
"version": "3.1.0",
|
||||
"resolved": "https://registry.npmjs.org/packery/-/packery-3.0.0.tgz",
|
||||
"integrity": "sha512-mTaE43T4kJCxkln4/lSFMjfI+19cZaFcg3Z64JO4XHlCxUgwhHWne+KeYAsBrHCaNJ1/8gyjormp3G5Uh1rNIA==",
|
||||
"dev": true,
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "hugo-blowfish-theme",
|
||||
"version": "3.0.0",
|
||||
"version": "3.1.0",
|
||||
"description": "Blowfish theme for Hugo.",
|
||||
"scripts": {
|
||||
"postinstall": "vendor-copy",
|
||||
|
||||
Reference in new issue
Block a user