Browse Source

feat(modules): add fractal forest module for bpg image format support

closes #8
Josh Habdas 1 year ago
parent
commit
8aa35b21f4
Signed by: Josh Habdas <jhabdas@protonmail.com> GPG Key ID: B148B31154C75A74

+ 7
- 7
archetypes/post.md View File

@@ -13,17 +13,17 @@ images = [
13 13
 
14 14
 Before you continue, please take a moment to configure your archetypes.
15 15
 
16
-Archetypes are located in the `archetypes` directory in the source of your site. To learn more about archetypes, visit [Archetypes](https://gohugo.io/content-management/archetypes/) on the Hugo website. And when you're ready, check out the [Customizing](https://comfusion.github.io/after-dark/#customizing) section of the After Dark documentation for additional options.
17
-
18
-To see this message again run `hugo serve` with the `--buildDrafts` flag. For help run `hugo --help`.
16
+Archetypes are located in the `archetypes` directory in the source of your site. To learn more about archetypes, visit [Archetypes](https://gohugo.io/content-management/archetypes/) on the Hugo website. And when you're ready, check out the [Customizing](https://git.habd.as/comfusion/after-dark#customizing) section of the After Dark documentation for additional options.
19 17
 
20 18
 <!--more-->
21 19
 This information appears below the [Summary Split](https://gohugo.io/content-management/summaries/).
22 20
 
23
-After Dark supports the `bpg` image format without any additional configuration necessary. Here's an example BPG image animation:
21
+After Dark ships with a custom module system and provides a number of prebuilt modules. Shown here, an animation made possible by the `Fractal Forest` module:
22
+
23
+<img width="494" height="371" src="/bpg/cinemagraph-6.bpg" alt="BPG file format example">
24 24
 
25
-<img src="/bpg/cinemagraph-6.bpg" alt="BPG file format example">
25
+The Fractal Forest module gives After Dark the special ability to render images encoded using Fabrice Bellard's [BPG Image format](https://bellard.org/bpg/) and comes preinstalled for sites set-up using the installation script located in the `bin` directory.
26 26
 
27
-BPG compresses the above animation to `48KB`, about **97% smaller** than what would be possible with GIF. In addition to animation BPG handles still images as well. Head to the [side-by-side comparisons](http://xooyoozoo.github.io/yolo-octo-bugfixes/#vallee-de-colca&jpg=s&bpg=s) to see BPG stacked up against JPEG. Create your own BPG images using the [BPG web encoder](https://webencoder.libbpg.org/) for use on your After Dark site.
27
+To learn more about Fractal Forest and see a list of other available modules please see the [After Dark `README`](https://git.habd.as/comfusion/after-dark#after-dark) once you've configured your `archetypes`.
28 28
 
29
-See the <a href="https://git.habd.as/comfusion/after-dark/src/branch/master/README.md" target="_blank" rel="noopener">After Dark `README`</a> for more info.
29
+To see this message again run `hugo serve` with the `--buildDrafts` flag. For help running `hugo` commands run `hugo --help` in a terminal emulator.

+ 10
- 5
bin/install.sh View File

@@ -28,8 +28,9 @@ fi
28 28
 
29 29
 echo "Installing After Dark ..."
30 30
 
31
-# Clone repo
32
-(cd themes; git clone -q --depth 1 https://git.habd.as/comfusion/after-dark || { echo "cloning failed :/"; exit 1; })
31
+# Clone theme and bpg image format module
32
+git clone -q --depth 1 https://git.habd.as/comfusion/after-dark themes/after-dark || { echo "failed to clone theme"; exit 1; }
33
+git clone -q --depth 1 https://git.habd.as/comfusion/fractal-forest themes/fractal-forest || { echo "failed to theme module"; exit 1; }
33 34
 
34 35
 # Copy archetypes
35 36
 cp themes/after-dark/archetypes/* ./archetypes
@@ -48,6 +49,7 @@ paginate = 11 # Number of posts to show before paginating
48 49
 
49 50
 # Controls default theme and theme components
50 51
 theme = [
52
+  "fractal-forest",
51 53
   "after-dark"
52 54
 ]
53 55
 
@@ -60,7 +62,7 @@ footnoteReturnLinkContents = "↩" # Provides a nicer footnote return link
60 62
 [params]
61 63
   description = "" # Suggested, controls default description meta
62 64
   author = "" # Optional, controls author name display on posts
63
-  hide_author = false # Optional, set true to hide author name on posts
65
+  hide_author = true # Optional, set true to hide author name on posts
64 66
   show_menu = false # Optional, set true to enable section menu
65 67
   powered_by = true # Optional, set false to disable credits
66 68
   images = [
@@ -71,6 +73,9 @@ footnoteReturnLinkContents = "↩" # Provides a nicer footnote return link
71 73
   disabled = false # Optional, set `true` to disable hackcss
72 74
   mode = "hack" # Optional, choose from `standard` or `hack` display modes
73 75
   palette = "dark" # Optional, choose `dark`, `dark-grey` or `solarized-dark`
76
+
77
+[params.modules.fractal_forest]
78
+  decoders = ["bpgdec8a"]
74 79
 TOML
75 80
 
76 81
 echo "Creating an example post to get you started ..."
@@ -83,10 +88,10 @@ echo "Serving your After Dark site ..."
83 88
 # Serve site backgrounded over Docker-friendly loopback
84 89
 hugo serve --buildDrafts --port 1337 --bind "0.0.0.0" &
85 90
 
86
-# Wait a second for Hugo server to fire up
91
+# Wait for Hugo to start
87 92
 sleep 1
88 93
 
89
-# Pop the site in terminal browser, if installed
94
+# Open site in elinks, if installed
90 95
 if [[ "elinks" != "" ]]; then
91 96
   elinks http://0.0.0.0:1337/
92 97
 fi

+ 0
- 5
layouts/partials/async-scripts.html View File

@@ -1,6 +1 @@
1 1
 <script async src={{ "/js/lazysizes.min.js" | relURL }}></script>
2
-{{ if ne .Site.Params.seo.disable_bpg true }}
3
-  <script async src={{ "/js/bpgdec8a.js" | relURL }}></script>
4
-  <script async src={{ "/js/bpgdec8.js" | relURL }}></script>
5
-  <script async src={{ "/js/bpgdec.js" | relURL }}></script>
6
-{{ end }}

+ 3
- 0
layouts/partials/modules.html View File

@@ -1,4 +1,7 @@
1 1
 {{ with .Site.Params.modules }}
2
+  {{ with .fractal_forest }}
3
+    {{ partial "modules/fractal-forest/index.html" . }}
4
+  {{ end }}
2 5
   {{ with .voyeur }}
3 6
     {{ partial "modules/voyeur/index.html" . }}
4 7
   {{ end }}

BIN
static/bpg/cinemagraph-6.bpg View File


+ 0
- 23
static/js/bpgdec.js
File diff suppressed because it is too large
View File


+ 0
- 23
static/js/bpgdec8.js
File diff suppressed because it is too large
View File


+ 0
- 27
static/js/bpgdec8a.js
File diff suppressed because it is too large
View File


Loading…
Cancel
Save