Skip to content

Commit 3b8ee0a

Browse files
committed
feat: improve processor performance and Lume debug bar visibility
- Add named function expressions to all processors for Lume debug bar - Cache DOMParser instance in deferPagefind to reduce object allocation - Replace per-page console logging with summary statistics - Add type annotations to cssBannerProcessor - Bump version to 1.1.0
1 parent 85000b1 commit 3b8ee0a

24 files changed

+5448
-511
lines changed

CHANGELOG.md

Lines changed: 28 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,35 @@
1-
## [1.0.18] - 2025-06-15
2-
### Added
3-
- Auto-generated changelog entry
4-
- Uploaded zipped docs as GitHub release asset
1+
# Changelog
52

6-
## [v1.0.19] - 2025-06-15
7-
[Full Changelog](https://github.com/RickCogley/hibana/compare/v1.0.18...v1.0.19)
3+
All notable changes to this project will be documented in this file.
84

9-
### Added
10-
- Feature: Automatically zip the `/docs` folder and upload it to GitHub release.
11-
- Feature: Append changelog entry to `CHANGELOG.md` with version and date.
5+
The format is based on [Keep a Changelog](https://keepachangelog.com/) and this
6+
project adheres to [Semantic Versioning](https://semver.org/).
7+
8+
## [Unreleased]
9+
10+
## [1.1.0] - 2025-11-08
1211

1312
### Changed
14-
- Improved: Release script now includes semantic changelog formatting and comparison links.
13+
14+
- **Performance**: Reduced console logging in processors - now logs summary statistics instead of per-page messages
15+
- **Performance**: Cached `DOMParser` instance in `defer_pagefind` processor to avoid creating new instances for every page
16+
- **Debugging**: Added named function expressions to all processors (`deferPagefindProcessor`, `externalLinksIconProcessor`, `cssBannerProcessor`) so they appear correctly in Lume debug bar instead of showing as "unknown"
1517

1618
### Fixed
17-
- N/A
1819

20+
- Type annotations added to `cssBannerProcessor` for better type safety
21+
22+
## [0.5.0] - 2024-11-20
23+
24+
### Added
25+
26+
- Initial commit
27+
- Acknowledgements in readme
28+
29+
### Fixed
30+
31+
- Removed redundant name in shuffle.ts
32+
33+
[Unreleased]: https://github.com/RickCogley/hibana/compare/v1.1.0...HEAD
34+
[1.1.0]: https://github.com/RickCogley/hibana/compare/v0.5.0...v1.1.0
35+
[0.5.0]: https://github.com/RickCogley/hibana/releases/tag/v0.5.0

README.md

Lines changed: 42 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,44 @@
11
# Hibana Lume Helpers
22

3-
The `hibana` library re-exports various Lume helper plugins and utility functions designed to enhance Lume static site generation projects.
3+
The `hibana` library re-exports various Lume helper plugins and utility
4+
functions designed to enhance Lume static site generation projects.
45

5-
| Hibana | Specifications |
6-
| ------- | ------- |
7-
| **Version** | 1.0.18 |
6+
| Hibana | Specifications |
7+
| -------------- | ---------------------------------------------------------------------------- |
8+
| **Version** | 1.0.18 |
89
| **Repository** | [https://github.com/RickCogley/hibana](https://github.com/RickCogley/hibana) |
9-
| **License** | MIT |
10-
| **Author** | Rick Cogley |
10+
| **License** | MIT |
11+
| **Author** | Rick Cogley |
1112

1213
It provides:
13-
- [cssBanner](https://github.com/RickCogley/hibana/blob/main/./plugins/css_banner.ts#cssBanner) - A plugin to add a comment banner to CSS files.
14-
- [shuffle](https://github.com/RickCogley/hibana/blob/main/./plugins/shuffle.ts#shuffle) - A plugin to add a shuffle filter for arrays.
15-
- [deferPagefind](https://github.com/RickCogley/hibana/blob/main/./processors/defer_pagefind.ts#deferPagefind) - A processor to defer Pagefind CSS and JS loading.
16-
- [externalLinksIcon](https://github.com/RickCogley/hibana/blob/main/./processors/external_links_icon.ts#externalLinksIcon) - A processor to add external link icons to `target="_blank"` links.
17-
- [loadVendorScript](https://github.com/RickCogley/hibana/blob/main/./utils/dom_utils.ts#loadVendorScript), [trapFocus](https://github.com/RickCogley/hibana/blob/main/./utils/dom_utils.ts#trapFocus) - General DOM utility functions.
18-
1914

15+
- [cssBanner](https://github.com/RickCogley/hibana/blob/main/./plugins/css_banner.ts#cssBanner) -
16+
A plugin to add a comment banner to CSS files.
17+
- [shuffle](https://github.com/RickCogley/hibana/blob/main/./plugins/shuffle.ts#shuffle) -
18+
A plugin to add a shuffle filter for arrays.
19+
- [deferPagefind](https://github.com/RickCogley/hibana/blob/main/./processors/defer_pagefind.ts#deferPagefind) -
20+
A processor to defer Pagefind CSS and JS loading.
21+
- [externalLinksIcon](https://github.com/RickCogley/hibana/blob/main/./processors/external_links_icon.ts#externalLinksIcon) -
22+
A processor to add external link icons to `target="_blank"` links.
23+
- [loadVendorScript](https://github.com/RickCogley/hibana/blob/main/./utils/dom_utils.ts#loadVendorScript),
24+
[trapFocus](https://github.com/RickCogley/hibana/blob/main/./utils/dom_utils.ts#trapFocus) -
25+
General DOM utility functions.
2026

2127
## API
2228

2329
### `cssBanner`
2430

2531
A Lume plugin that prepends a CSS comment banner to all .css files.
2632

27-
This is useful for adding copyright information, build details, or
28-
other metadata to the top of your generated CSS files.
29-
33+
This is useful for adding copyright information, build details, or other
34+
metadata to the top of your generated CSS files.
3035

3136
**Parameters:**
3237

33-
- `options` : `CssBannerOptions` -
38+
- `options` : `CssBannerOptions` -
3439

3540
**Example:**
41+
3642
```ts
3743
// In your Lume _config.ts:
3844
import lume from "lume/mod.ts";
@@ -41,7 +47,7 @@ import { cssBanner, shuffle } from "hibana/mod.ts";
4147
const site = lume();
4248

4349
site.use(cssBanner({
44-
message: "===css jokes are always in style===",
50+
message: "===css jokes are always in style===",
4551
}));
4652

4753
export default site;
@@ -51,15 +57,15 @@ export default site;
5157

5258
A Lume plugin to register the filter "shuffle" that shuffles an array.
5359

54-
This plugin adds a new filter named "shuffle" (by default) that can be used
55-
in your Lume templates to randomly reorder elements in an array.
56-
60+
This plugin adds a new filter named "shuffle" (by default) that can be used in
61+
your Lume templates to randomly reorder elements in an array.
5762

5863
**Parameters:**
5964

60-
- `userOptions` : `Options` -
65+
- `userOptions` : `Options` -
6166

6267
**Example:**
68+
6369
```ts
6470
// In your Lume _config.ts:
6571
import lume from "lume/mod.ts";
@@ -81,17 +87,16 @@ export default site;
8187

8288
Lume plugin to defer the loading of Pagefind CSS and JS.
8389

84-
This plugin modifies the Pagefind CSS link and JS script tags
85-
to ensure they are loaded asynchronously, improving page load performance.
86-
87-
It sets `media="print"` and `onload="this.media='all'"` on the CSS link
88-
and adds the `defer` attribute to the JS script.
90+
This plugin modifies the Pagefind CSS link and JS script tags to ensure they are
91+
loaded asynchronously, improving page load performance.
8992

93+
It sets `media="print"` and `onload="this.media='all'"` on the CSS link and adds
94+
the `defer` attribute to the JS script.
9095

9196
**Parameters:**
9297

93-
9498
**Example:**
99+
95100
```ts
96101
// In your Lume _config.ts:
97102
import lume from "lume/mod.ts";
@@ -109,15 +114,15 @@ export default site;
109114

110115
### `externalLinksIcon`
111116

112-
Adds an external link icon to `<a>` anchor elements that point to external sites.
113-
Skips links inside elements with the class `.no-external-icon`.
114-
117+
Adds an external link icon to `<a>` anchor elements that point to external
118+
sites. Skips links inside elements with the class `.no-external-icon`.
115119

116120
**Parameters:**
117121

118-
- `siteUrlInput` : `` -
122+
- `siteUrlInput` : `` -
119123

120124
**Example:**
125+
121126
```ts
122127
// In your Lume _config.ts:
123128
import lume from "lume/mod.ts";
@@ -139,16 +144,15 @@ Utility function to load an external vendor script.
139144

140145
**Parameters:**
141146

142-
- `src` : `string` -
143-
- `undefined` -
144-
- `callback` : `` -
147+
- `src` : `string` -
148+
- `undefined` -
149+
- `callback` : `` -
145150

146151
### `trapFocus`
147152

148-
Traps focus within a given container element.
149-
Useful for modal dialogs to prevent users from tabbing outside the modal.
153+
Traps focus within a given container element. Useful for modal dialogs to
154+
prevent users from tabbing outside the modal.
150155

151156
**Parameters:**
152157

153-
- `container` : `HTMLElement` -
154-
158+
- `container` : `HTMLElement` -

deno.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@rick/hibana",
3-
"version": "1.0.18",
3+
"version": "1.1.0",
44
"license": "MIT",
55
"exports": "./mod.ts",
66
"tasks": {

docs.zip

71.3 KB
Binary file not shown.

0 commit comments

Comments
 (0)