ultimate-jekyll-manager 0.0.117 → 0.0.118
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CLAUDE.md +330 -138
- package/README.md +108 -0
- package/TODO.md +1 -1
- package/dist/assets/js/core/auth.js +3 -7
- package/dist/assets/js/libs/prerendered-icons.js +27 -0
- package/dist/assets/js/pages/account/index.js +1 -1
- package/dist/assets/js/pages/account/sections/api-keys.js +2 -6
- package/dist/assets/js/pages/account/sections/connections.js +101 -59
- package/dist/assets/js/pages/account/sections/referrals.js +29 -29
- package/dist/assets/js/pages/account/sections/security.js +47 -70
- package/dist/assets/js/pages/payment/checkout/index.js +6 -6
- package/dist/assets/js/pages/payment/checkout/modules/processors-main.js +2 -2
- package/dist/assets/js/pages/payment/checkout/modules/session.js +4 -4
- package/dist/defaults/dist/_includes/core/body.html +23 -0
- package/dist/defaults/dist/_layouts/themes/classy/frontend/pages/account/index.html +41 -14
- package/dist/defaults/dist/pages/pricing.md +7 -0
- package/firebase-debug.log +126 -0
- package/package.json +5 -5
package/CLAUDE.md
CHANGED
|
@@ -1,41 +1,54 @@
|
|
|
1
|
-
#
|
|
2
|
-
This is Ultimate Jekyll, it is a template project that other "consuming" projects can use to build a Jekyll site. It comes installed as an NPM module and is helpful for setting up, configuring, and maintaining a Jekyll site with best practices in mind.
|
|
1
|
+
# Ultimate Jekyll Manager
|
|
3
2
|
|
|
4
|
-
|
|
5
|
-
* You cannot use `npm start` or `npm run build` in this project.
|
|
3
|
+
## Project Overview
|
|
6
4
|
|
|
7
|
-
|
|
8
|
-
Ultimate Jekll has the following structure:
|
|
9
|
-
src/gulp/tasks = Gulp tasks that are used to build the Jekyll site.
|
|
10
|
-
src/defaults/src = Default source files that can be used as a starting point for a Jekyll site and ARE meant to be edited by the user. They are copied to the consuming project's "src" directory.
|
|
11
|
-
src/defaults/dist = Default distribution files that can be used as a starting point for a Jekyll site and NOT meant to be edited by the user. They are copied to the consuming project's "dist" directory.
|
|
5
|
+
Ultimate Jekyll Manager is a template framework that consuming projects install as an NPM module to build Jekyll sites quickly and efficiently. It provides best-practice configurations, default components, themes, and build tools.
|
|
12
6
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
7
|
+
**Important:** This is NOT a standalone project. You cannot run `npm start` or `npm run build` directly in this repository.
|
|
8
|
+
|
|
9
|
+
## Project Structure
|
|
10
|
+
|
|
11
|
+
### Directory Organization
|
|
12
|
+
- `src/gulp/tasks` - Gulp tasks for building Jekyll sites
|
|
13
|
+
- `src/defaults/src` - Default source files (editable by users, copied to consuming project's `src/`)
|
|
14
|
+
- `src/defaults/dist` - Default distribution files (not editable by users, copied to consuming project's `dist/`)
|
|
15
|
+
- `src/assets/css` - Stylesheets (global, pages, themes)
|
|
16
|
+
- `src/assets/js` - JavaScript modules (core, pages, libraries)
|
|
17
|
+
- `src/assets/themes` - Theme SCSS and JS files
|
|
18
|
+
|
|
19
|
+
### Consuming Project Structure
|
|
20
|
+
- `src/` - Compiled to `dist/` via npm
|
|
21
|
+
- `dist/` - Compiled to `_site/` via Jekyll
|
|
16
22
|
|
|
17
23
|
## Local Development
|
|
18
|
-
When working with a consuming project, the local development server URL can be found in the `.temp/_config_browsersync.yml` file in the consuming project's root directory. You should read this file to determine the correct local URL for browsing and testing the site.
|
|
19
24
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
+
The local development server URL is stored in `.temp/_config_browsersync.yml` in the consuming project's root directory. Read this file to determine the correct URL for browsing and testing.
|
|
26
|
+
|
|
27
|
+
## Asset Organization
|
|
28
|
+
|
|
29
|
+
### CSS Architecture
|
|
30
|
+
- `src/assets/css/ultimate-jekyll-manager.scss` - Main UJ stylesheet
|
|
31
|
+
- `src/assets/css/main.scss` - Site-wide styles (runs on every page)
|
|
32
|
+
- `src/assets/css/global/` - Global UJ styles
|
|
33
|
+
- `src/assets/css/pages/` - Page-specific styles
|
|
34
|
+
- Format: `src/assets/css/pages/[page-name]/index.scss`
|
|
35
|
+
|
|
36
|
+
### JavaScript Architecture
|
|
37
|
+
- `src/assets/js/ultimate-jekyll-manager.js` - Main UJ JavaScript entry point
|
|
38
|
+
- `src/assets/js/main.js` - Site-wide JavaScript (runs on every page)
|
|
39
|
+
- `src/assets/js/core/` - Core UJ modules
|
|
40
|
+
- `src/assets/js/pages/` - Page-specific JavaScript
|
|
41
|
+
- Format: `src/assets/js/pages/[page-name]/index.js`
|
|
25
42
|
|
|
26
|
-
|
|
27
|
-
* This file runs on EVERY page and should be edited to contain site-wide CSS styles.
|
|
43
|
+
**Asset Loading:** Page-specific CSS/JS files are automatically included based on the page's canonical path. Override with `asset_path` frontmatter.
|
|
28
44
|
|
|
45
|
+
### Page Module Structure
|
|
29
46
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
* The page-specific JS and CSS files are automatically included in the page based on the page's canonical path.
|
|
34
|
-
* You need to use our standardized structure:
|
|
35
|
-
* Notice how how the helpers are outside the main export function.
|
|
36
|
-
```js
|
|
47
|
+
All page modules must follow this standardized pattern:
|
|
48
|
+
|
|
49
|
+
```javascript
|
|
37
50
|
/**
|
|
38
|
-
*
|
|
51
|
+
* [Page Name] Page JavaScript
|
|
39
52
|
*/
|
|
40
53
|
|
|
41
54
|
// Libraries
|
|
@@ -50,7 +63,7 @@ export default (Manager) => {
|
|
|
50
63
|
// Initialize when DOM is ready
|
|
51
64
|
await webManager.dom().ready();
|
|
52
65
|
|
|
53
|
-
//
|
|
66
|
+
// Page initialization logic
|
|
54
67
|
helper1();
|
|
55
68
|
|
|
56
69
|
// Resolve after initialization
|
|
@@ -60,155 +73,334 @@ export default (Manager) => {
|
|
|
60
73
|
|
|
61
74
|
// Helper functions
|
|
62
75
|
function helper1() {
|
|
63
|
-
//
|
|
76
|
+
// Helper implementation
|
|
64
77
|
}
|
|
65
78
|
```
|
|
66
79
|
|
|
67
|
-
|
|
68
|
-
|
|
80
|
+
**Key Points:**
|
|
81
|
+
- Helpers are defined outside the main export function
|
|
82
|
+
- Use `webManager` shortcuts for common operations
|
|
83
|
+
- Always wait for DOM ready before manipulating elements
|
|
84
|
+
|
|
85
|
+
## Layouts and Pages
|
|
86
|
+
|
|
87
|
+
### Page Types
|
|
88
|
+
- **One-off pages** (e.g., `/categories`, `/sitemap`) - Create as pages without custom layouts; use existing layouts
|
|
89
|
+
- **Repeating page types** (e.g., blog posts, category pages) - Create a dedicated layout (e.g., `_layouts/category.html`)
|
|
90
|
+
|
|
91
|
+
### Layout Requirements
|
|
92
|
+
All layouts and pages must eventually require a theme entry point:
|
|
93
|
+
```yaml
|
|
94
|
+
layout: themes/[ site.theme.id ]/frontend/core/base
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
**Note:** The `[ site.theme.id ]` syntax is correct and allows dynamic theme selection.
|
|
98
|
+
|
|
99
|
+
### Asset Path Configuration
|
|
100
|
+
|
|
101
|
+
For pages sharing the same assets, use the `asset_path` frontmatter variable:
|
|
102
|
+
|
|
103
|
+
```yaml
|
|
104
|
+
---
|
|
105
|
+
# Instead of deriving path from page.canonical.path
|
|
106
|
+
asset_path: categories/category
|
|
107
|
+
---
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
**Example:**
|
|
111
|
+
- One-off page: `pages/categories.html` → `src/assets/css/pages/categories/index.scss`
|
|
112
|
+
- Repeating layout: `_layouts/category.html` → `src/assets/css/pages/categories/category.scss` (set `asset_path: categories/category` in layout frontmatter)
|
|
113
|
+
|
|
114
|
+
## UJ Powertools (Jekyll Plugin)
|
|
115
|
+
|
|
116
|
+
Ultimate Jekyll uses the `jekyll-uj-powertools` gem for custom Liquid functionality.
|
|
117
|
+
|
|
118
|
+
**Documentation:** `/Users/ian/Developer/Repositories/ITW-Creative-works/jekyll-uj-powertools/README.md`
|
|
119
|
+
|
|
120
|
+
### Available Features
|
|
121
|
+
- **Filters:** `uj_strip_ads`, `uj_json_escape`, `uj_title_case`, `uj_content_format`
|
|
122
|
+
- **Tags:** `iftruthy`, `iffalsy`, `uj_icon`, `uj_logo`, `uj_image`, `uj_member`, `uj_post`, `uj_readtime`, `uj_social`, `uj_translation_url`, `uj_fake_comments`, `uj_language`
|
|
123
|
+
- **Global Variables:** `site.uj.cache_breaker`
|
|
124
|
+
- **Page Variables:** `page.random_id`, `page.extension`, `page.layout_data`, `page.resolved`
|
|
125
|
+
|
|
126
|
+
**Always check the README before assuming functionality.**
|
|
127
|
+
|
|
128
|
+
### Key Liquid Functions
|
|
129
|
+
|
|
130
|
+
#### `uj_content_format`
|
|
131
|
+
Formats content by first liquifying it, then markdownifying it (if markdown file).
|
|
132
|
+
|
|
133
|
+
#### `iftruthy` / `iffalsy`
|
|
134
|
+
Custom tags that check JavaScript truthiness (not null, undefined, or empty string).
|
|
135
|
+
|
|
136
|
+
```liquid
|
|
137
|
+
{% iftruthy variable %}
|
|
138
|
+
<!-- Content -->
|
|
139
|
+
{% endiftruthy %}
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
**Limitations:**
|
|
143
|
+
- Does NOT support logical operators
|
|
144
|
+
- Does NOT support `else` statements
|
|
145
|
+
- CAN contain nested sub-statements
|
|
146
|
+
|
|
147
|
+
#### `page.resolved`
|
|
148
|
+
A deeply merged object containing all site, layout, and page variables. Precedence: page > layout > site. Enables a system of defaults with progressive overrides.
|
|
149
|
+
|
|
150
|
+
#### `uj_icon`
|
|
151
|
+
Inserts Font Awesome icons:
|
|
152
|
+
|
|
153
|
+
```liquid
|
|
154
|
+
{% uj_icon icon-name, "fa-md" %}
|
|
155
|
+
{% uj_icon "rocket", "fa-3xl" %}
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
**Parameters:**
|
|
159
|
+
1. Icon name (string or variable, without "fa-" prefix)
|
|
160
|
+
2. CSS classes (optional, defaults to "fa-3xl")
|
|
161
|
+
|
|
162
|
+
#### `asset_path` Override
|
|
163
|
+
Override default page-specific CSS/JS path derivation:
|
|
164
|
+
|
|
165
|
+
```yaml
|
|
166
|
+
---
|
|
167
|
+
asset_path: blog/post
|
|
168
|
+
---
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
Uses `/assets/css/pages/{{ asset_path }}.bundle.css` instead of deriving from `page.canonical.path`. Useful when multiple pages share assets (e.g., all blog posts).
|
|
172
|
+
|
|
173
|
+
## Icon Pre-rendering System
|
|
174
|
+
|
|
175
|
+
Ultimate Jekyll includes a frontmatter-based icon pre-rendering system for optimal performance.
|
|
176
|
+
|
|
177
|
+
### How It Works
|
|
178
|
+
|
|
179
|
+
1. **Define icons in page frontmatter:**
|
|
180
|
+
```yaml
|
|
181
|
+
---
|
|
182
|
+
prerender_icons:
|
|
183
|
+
- name: "apple"
|
|
184
|
+
class: "fa-3xl"
|
|
185
|
+
- name: "android"
|
|
186
|
+
class: "fa-2xl"
|
|
187
|
+
- name: "chrome"
|
|
188
|
+
---
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
2. **Icons are rendered in HTML** via `src/defaults/dist/_includes/core/body.html`
|
|
192
|
+
|
|
193
|
+
3. **Access icons in JavaScript:**
|
|
194
|
+
```javascript
|
|
195
|
+
const iconHTML = webManager.utilities().getPrerenderedIcon('apple');
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
### Benefits
|
|
199
|
+
- Icons are rendered server-side with proper Font Awesome classes
|
|
200
|
+
- No client-side icon generation overhead
|
|
201
|
+
- Consistent icon styling across the application
|
|
202
|
+
- Easy to access via JavaScript utilities
|
|
203
|
+
|
|
204
|
+
## CSS Guidelines
|
|
69
205
|
|
|
70
|
-
|
|
206
|
+
### Theme-Adaptive Classes
|
|
71
207
|
|
|
72
|
-
|
|
73
|
-
Ultimate Jekyll uses the `jekyll-uj-powertools` gem which provides many custom Liquid filters, tags, and variables. You should review the full documentation to understand all available tools: `/Users/ian/Developer/Repositories/ITW-Creative-works/jekyll-uj-powertools/README.md`
|
|
208
|
+
**DO NOT USE:** `bg-light`, `bg-dark`, `text-light`, `text-dark`
|
|
74
209
|
|
|
75
|
-
|
|
76
|
-
* **Filters**: `uj_strip_ads`, `uj_json_escape`, `uj_title_case`, `uj_content_format`
|
|
77
|
-
* **Tags**: `iftruthy`, `iffalsy`, `uj_icon`, `uj_logo`, `uj_image`, `uj_member`, `uj_post`, `uj_readtime`, `uj_social`, `uj_translation_url`, `uj_fake_comments`, `uj_language`
|
|
78
|
-
* **Global Variables**: `site.uj.cache_breaker`
|
|
79
|
-
* **Page Variables**: `page.random_id`, `page.extension`, `page.layout_data`, `page.resolved`
|
|
210
|
+
Ultimate Jekyll supports both light and dark modes. Use adaptive classes instead:
|
|
80
211
|
|
|
81
|
-
|
|
212
|
+
**Backgrounds:**
|
|
213
|
+
- `bg-body` - Primary background
|
|
214
|
+
- `bg-body-secondary` - Secondary background
|
|
215
|
+
- `bg-body-tertiary` - Tertiary background
|
|
82
216
|
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
* iftruthy = a custom liquid tag that checks if a variable is truthy in JavaScript terms, meaning it checks if the variable is not null, undefined, or an empty string. Use it like this: `{% iftruthy variable %}`. But it DOES NOT SUPPORT any logical operators and does not support `else` statements. But you CAN put sub-statements inside it.
|
|
86
|
-
* iffalsy = same but opposite of iftruthy.
|
|
87
|
-
* page.resolved = a custom page object property of all site, layout, and page variables deeply merged together, with page variables taking precedence over layout, and layout variables taking precedence over site variables. This allows a system of site defaults, layout overrides, and page-specific overrides.
|
|
217
|
+
**Text:**
|
|
218
|
+
- `text-body` - Body text color
|
|
88
219
|
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
220
|
+
**Buttons:**
|
|
221
|
+
- `btn-adaptive` - Adaptive button
|
|
222
|
+
- `btn-outline-adaptive` - Adaptive outline button
|
|
92
223
|
|
|
93
|
-
|
|
94
|
-
When creating pages in the consuming project, follow these guidelines:
|
|
95
|
-
* **One-off pages** (like `/categories`, `/sitemap`, etc.) should be created directly as pages (e.g., `pages/categories.html`) WITHOUT their own custom layout. These pages should use an existing layout.
|
|
96
|
-
* **Repeating page types** (like individual category pages, individual blog posts, etc.) should have a dedicated layout that all instances use (e.g., `_layouts/category.html` used by all category pages).
|
|
97
|
-
* **All layouts and pages** must eventually require one of the theme entry points, such as `layout: themes/[ site.theme.id ]/frontend/core/base`. This ensures consistent theming across the site.
|
|
98
|
-
* YES, the "[[ site.theme.id ]]" syntax is correct here; it allows dynamic selection of the theme based on site configuration.
|
|
99
|
-
* This approach keeps the codebase maintainable by reusing layouts for similar pages while avoiding unnecessary layout files for unique pages.
|
|
100
|
-
* So you should put assets like CSS and JS for a one-off page like `categories.html` in `src/assets/css/pages/categories/index.scss` and `src/assets/js/pages/categories/index.js` respectively, and for repeating page types like an individual category that uses a LAYOUT, put them in `src/assets/css/pages/categories/category.scss` and `src/assets/js/pages/categories/category.js` (and you will of course set the `asset_path: categories/category` frontmatter variable on the layout so that the correct assets are loaded).
|
|
224
|
+
These classes automatically adapt to the current theme mode.
|
|
101
225
|
|
|
102
|
-
##
|
|
103
|
-
DO NOT USE `bg-light`, `bg-dark`, `text-light`, or `text-dark`. We support BOTH light and dark mode, so instead use `bg-body`, `bg-body-secondary`, `bg-body-tertiary`, `text-body` and for buttons you can use `btn-adaptive` or `btn-outline-adaptive`.
|
|
104
|
-
These classes adapt to light and dark mode automatically.
|
|
226
|
+
## Page Loading Protection System
|
|
105
227
|
|
|
106
|
-
|
|
107
|
-
Ultimate Jekyll implements a sophisticated system to prevent premature button clicks during page initialization. This prevents race conditions and ensures JavaScript is fully loaded before users can trigger actions.
|
|
228
|
+
Ultimate Jekyll prevents race conditions by disabling buttons during JavaScript initialization.
|
|
108
229
|
|
|
109
|
-
### How It Works
|
|
110
|
-
1.
|
|
111
|
-
2.
|
|
112
|
-
3.
|
|
230
|
+
### How It Works
|
|
231
|
+
1. HTML element starts with `data-page-loading="true"` and `aria-busy="true"` (`src/defaults/dist/_layouts/core/root.html`)
|
|
232
|
+
2. Protected elements are automatically disabled during this state
|
|
233
|
+
3. Attributes are removed when JavaScript completes (`src/assets/js/core/complete.js`)
|
|
113
234
|
|
|
114
|
-
###
|
|
115
|
-
|
|
235
|
+
### Protected Elements
|
|
236
|
+
- All form buttons (`<button>`, `<input type="submit">`, `<input type="button">`, `<input type="reset">`)
|
|
237
|
+
- Elements with `.btn` class (Bootstrap buttons)
|
|
238
|
+
- Elements with `.btn-action` class (custom action triggers)
|
|
116
239
|
|
|
117
|
-
|
|
118
|
-
- **Elements with `.btn` class**: Standard Bootstrap buttons
|
|
119
|
-
- **Elements with `.btn-action` class**: Custom action triggers (see below)
|
|
120
|
-
- **Always disabled**: Any element with `disabled` attribute, `.disabled` class, or `:disabled` state
|
|
240
|
+
### The `.btn-action` Class
|
|
121
241
|
|
|
122
|
-
|
|
123
|
-
Use the `.btn-action` class to selectively protect non-standard elements that trigger important actions:
|
|
242
|
+
Selectively protect non-standard elements that trigger important actions:
|
|
124
243
|
|
|
125
244
|
```html
|
|
126
|
-
<!--
|
|
245
|
+
<!-- Protected during page load -->
|
|
127
246
|
<a href="/api/delete" class="custom-link btn-action">Delete Item</a>
|
|
128
247
|
<div class="card-action btn-action" onclick="processData()">Process</div>
|
|
129
|
-
<span class="text-link btn-action" data-action="save">Save Changes</span>
|
|
130
248
|
|
|
131
|
-
<!--
|
|
249
|
+
<!-- NOT protected (regular navigation/UI) -->
|
|
132
250
|
<a href="/about" class="btn btn-primary">About Us</a>
|
|
133
251
|
<button data-bs-toggle="modal">Show Info</button>
|
|
134
|
-
<button data-bs-toggle="collapse">Toggle Details</button>
|
|
135
252
|
```
|
|
136
253
|
|
|
137
|
-
|
|
138
|
-
-
|
|
139
|
-
-
|
|
254
|
+
**Use `.btn-action` for:**
|
|
255
|
+
- API calls
|
|
256
|
+
- Form submissions
|
|
257
|
+
- Data modifications
|
|
258
|
+
- Payment processing
|
|
259
|
+
- Destructive actions
|
|
140
260
|
|
|
141
|
-
|
|
142
|
-
-
|
|
143
|
-
-
|
|
144
|
-
-
|
|
261
|
+
**Don't use for:**
|
|
262
|
+
- Navigation links
|
|
263
|
+
- UI toggles (modals, accordions, tabs)
|
|
264
|
+
- Harmless interactions
|
|
145
265
|
|
|
146
|
-
|
|
266
|
+
### Implementation
|
|
267
|
+
- **CSS:** `src/assets/css/core/utilities.scss` - Disabled styling
|
|
268
|
+
- **Click Prevention:** `src/defaults/dist/_includes/core/body.html` - Inline script
|
|
269
|
+
- **State Removal:** `src/assets/js/core/complete.js` - Removes loading state
|
|
147
270
|
|
|
148
|
-
## Lazy Loading
|
|
149
|
-
Ultimate Jekyll uses a custom lazy loading system powered by web-manager. Elements can be lazy-loaded using the `data-lazy` attribute with the following format:
|
|
271
|
+
## Lazy Loading System
|
|
150
272
|
|
|
273
|
+
Ultimate Jekyll uses a custom lazy loading system powered by web-manager.
|
|
274
|
+
|
|
275
|
+
### Syntax
|
|
151
276
|
```html
|
|
152
277
|
data-lazy="@type value"
|
|
153
278
|
```
|
|
154
279
|
|
|
155
|
-
### Supported Types
|
|
156
|
-
* `@src` - Lazy load the `src` attribute (for images, iframes, videos, source elements)
|
|
157
|
-
```html
|
|
158
|
-
<img data-lazy="@src /assets/images/hero.jpg" alt="Hero">
|
|
159
|
-
<iframe data-lazy="@src https://example.com/embed"></iframe>
|
|
160
|
-
```
|
|
280
|
+
### Supported Types
|
|
161
281
|
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
282
|
+
#### `@src` - Lazy load src attribute
|
|
283
|
+
```html
|
|
284
|
+
<img data-lazy="@src /assets/images/hero.jpg" alt="Hero">
|
|
285
|
+
<iframe data-lazy="@src https://example.com/embed"></iframe>
|
|
286
|
+
```
|
|
166
287
|
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
288
|
+
#### `@srcset` - Lazy load srcset attribute
|
|
289
|
+
```html
|
|
290
|
+
<img data-lazy="@srcset /img/small.jpg 480w, /img/large.jpg 1024w">
|
|
291
|
+
```
|
|
171
292
|
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
293
|
+
#### `@bg` - Lazy load background images
|
|
294
|
+
```html
|
|
295
|
+
<div data-lazy="@bg /assets/images/background.jpg"></div>
|
|
296
|
+
```
|
|
176
297
|
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
298
|
+
#### `@class` - Lazy add CSS classes
|
|
299
|
+
```html
|
|
300
|
+
<div data-lazy="@class animation-fade-in">Content</div>
|
|
301
|
+
```
|
|
181
302
|
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
303
|
+
#### `@html` - Lazy inject HTML content
|
|
304
|
+
```html
|
|
305
|
+
<div data-lazy="@html <p>Lazy loaded content</p>"></div>
|
|
306
|
+
```
|
|
186
307
|
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
308
|
+
#### `@script` - Lazy load external scripts
|
|
309
|
+
```html
|
|
310
|
+
<div data-lazy='@script {"src": "https://example.com/widget.js", "attributes": {"async": true}}'></div>
|
|
311
|
+
```
|
|
312
|
+
|
|
313
|
+
### Features
|
|
314
|
+
- Automatic cache busting via `buildTime`
|
|
315
|
+
- IntersectionObserver for performance (50px threshold)
|
|
316
|
+
- Loading state CSS classes: `lazy-loading`, `lazy-loaded`, `lazy-error`
|
|
317
|
+
- Intelligent handling of video/audio sources
|
|
318
|
+
- Automatic DOM re-scanning for dynamic elements
|
|
193
319
|
|
|
194
|
-
|
|
320
|
+
**Implementation:** `src/assets/js/core/lazy-loading.js`
|
|
195
321
|
|
|
196
|
-
## Libraries
|
|
197
|
-
I have some library preferences that I want you to follow:
|
|
322
|
+
## JavaScript Libraries
|
|
198
323
|
|
|
199
324
|
### WebManager
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
325
|
+
|
|
326
|
+
Custom library for site management functionality.
|
|
327
|
+
|
|
328
|
+
**Documentation:** `/Users/ian/Developer/Repositories/ITW-Creative-Works/web-manager/README.md`
|
|
329
|
+
|
|
330
|
+
**Available Utilities:**
|
|
331
|
+
- `webManager.auth()` - Authentication management
|
|
332
|
+
- `webManager.utilities()` - Utility functions
|
|
333
|
+
- `webManager.sentry()` - Error tracking
|
|
334
|
+
- `webManager.dom()` - DOM manipulation
|
|
335
|
+
|
|
336
|
+
**Important:** Always check the source code or README before assuming a function exists. Do not guess at API methods.
|
|
337
|
+
|
|
338
|
+
### Ultimate Jekyll Libraries
|
|
339
|
+
|
|
340
|
+
Ultimate Jekyll provides helper libraries in `src/assets/js/libs/` that can be imported as needed.
|
|
341
|
+
|
|
342
|
+
#### Prerendered Icons Library
|
|
343
|
+
|
|
344
|
+
Provides access to icons defined in page frontmatter and rendered server-side.
|
|
345
|
+
|
|
346
|
+
**Import:**
|
|
347
|
+
```javascript
|
|
348
|
+
import { getPrerenderedIcon } from '__main_assets__/js/libs/prerendered-icons.js';
|
|
349
|
+
```
|
|
350
|
+
|
|
351
|
+
**Usage:**
|
|
352
|
+
```javascript
|
|
353
|
+
const iconHTML = getPrerenderedIcon('apple');
|
|
354
|
+
```
|
|
355
|
+
|
|
356
|
+
**Reference:** `src/assets/js/libs/prerendered-icons.js`
|
|
357
|
+
|
|
358
|
+
#### Authorized Fetch Library
|
|
359
|
+
|
|
360
|
+
Simplifies authenticated API requests by automatically adding Firebase authentication tokens via Authorization Bearer header.
|
|
361
|
+
|
|
362
|
+
**Import:**
|
|
363
|
+
```javascript
|
|
364
|
+
import authorizedFetch from '__main_assets__/js/libs/authorized-fetch.js';
|
|
365
|
+
```
|
|
366
|
+
|
|
367
|
+
**Usage:**
|
|
368
|
+
```javascript
|
|
369
|
+
const response = await authorizedFetch(url, options);
|
|
370
|
+
```
|
|
371
|
+
|
|
372
|
+
**Key Benefits:**
|
|
373
|
+
- No need to manually call `webManager.auth().getIdToken()`
|
|
374
|
+
- Automatic token injection as Authorization Bearer header
|
|
375
|
+
- Centralized authentication handling
|
|
376
|
+
|
|
377
|
+
**Reference:** `src/assets/js/libs/authorized-fetch.js`
|
|
378
|
+
|
|
379
|
+
#### FormManager Library
|
|
380
|
+
|
|
381
|
+
Form handling library with built-in state management and validation.
|
|
382
|
+
|
|
383
|
+
**Import:**
|
|
384
|
+
```javascript
|
|
385
|
+
import { FormManager } from '__main_assets__/js/libs/form-manager.js';
|
|
386
|
+
```
|
|
387
|
+
|
|
388
|
+
**Usage:**
|
|
389
|
+
```javascript
|
|
390
|
+
const formManager = new FormManager('#my-form', options);
|
|
391
|
+
```
|
|
392
|
+
|
|
393
|
+
**Reference:** `src/assets/js/libs/form-manager.js`
|
|
394
|
+
**Example:** `src/assets/js/pages/contact/index.js`
|
|
395
|
+
|
|
396
|
+
## Audit Workflow
|
|
397
|
+
|
|
398
|
+
When fixing issues identified by the audit task (`src/gulp/tasks/audit.js`):
|
|
399
|
+
|
|
400
|
+
1. Review the audit file location provided
|
|
401
|
+
2. Create a TODO list for each audit category
|
|
402
|
+
3. Read the ENTIRE audit file and plan fixes for each category
|
|
403
|
+
4. Tackle issues incrementally - DO NOT attempt to fix everything at once
|
|
404
|
+
5. Work through one category at a time
|
|
405
|
+
|
|
406
|
+
**Remember:** Audit files are large. Systematic, incremental fixes prevent errors and ensure thoroughness.
|
package/README.md
CHANGED
|
@@ -282,6 +282,114 @@ Add the `.btn-action` class to protect custom elements that trigger important ac
|
|
|
282
282
|
- `_test_trialEligible=false`: User is not eligible for trial
|
|
283
283
|
* `_test_cardProcessor`: Force a specific payment processor for testing (e.g., `_test_cardProcessor=stripe` or `_test_cardProcessor=paypal`)
|
|
284
284
|
|
|
285
|
+
## JavaScript API
|
|
286
|
+
|
|
287
|
+
### Ultimate Jekyll Libraries
|
|
288
|
+
|
|
289
|
+
Ultimate Jekyll provides helper libraries in `src/assets/js/libs/` that can be imported as needed in your page modules.
|
|
290
|
+
|
|
291
|
+
#### Prerendered Icons Library
|
|
292
|
+
|
|
293
|
+
The prerendered icons library provides access to icons defined in page frontmatter. Icons are rendered server-side for optimal performance.
|
|
294
|
+
|
|
295
|
+
**Import:**
|
|
296
|
+
```javascript
|
|
297
|
+
import { getPrerenderedIcon } from '__main_assets__/js/libs/prerendered-icons.js';
|
|
298
|
+
```
|
|
299
|
+
|
|
300
|
+
**Function: `getPrerenderedIcon(iconName)`**
|
|
301
|
+
|
|
302
|
+
**Parameters:**
|
|
303
|
+
- `iconName` (string) - Name of the icon to retrieve (matches `data-icon` attribute in frontmatter)
|
|
304
|
+
|
|
305
|
+
**Returns:**
|
|
306
|
+
- (string) Icon HTML or empty string if not found
|
|
307
|
+
|
|
308
|
+
**Example:**
|
|
309
|
+
```javascript
|
|
310
|
+
import { getPrerenderedIcon } from '__main_assets__/js/libs/prerendered-icons.js';
|
|
311
|
+
|
|
312
|
+
// Get a pre-rendered icon
|
|
313
|
+
const appleIcon = getPrerenderedIcon('apple');
|
|
314
|
+
|
|
315
|
+
// Use in your page
|
|
316
|
+
document.querySelector('.device-icon').innerHTML = appleIcon;
|
|
317
|
+
```
|
|
318
|
+
|
|
319
|
+
**Setup:**
|
|
320
|
+
Define icons in your page frontmatter:
|
|
321
|
+
```yaml
|
|
322
|
+
---
|
|
323
|
+
prerender_icons:
|
|
324
|
+
- name: "apple"
|
|
325
|
+
class: "fa-3xl"
|
|
326
|
+
- name: "android"
|
|
327
|
+
class: "fa-2xl"
|
|
328
|
+
- name: "chrome"
|
|
329
|
+
class: "fa-lg"
|
|
330
|
+
---
|
|
331
|
+
```
|
|
332
|
+
|
|
333
|
+
Icons are automatically rendered in the page HTML and can be retrieved by importing the library function.
|
|
334
|
+
|
|
335
|
+
#### Authorized Fetch Library
|
|
336
|
+
|
|
337
|
+
The authorized fetch library simplifies authenticated API requests by automatically adding Firebase authentication tokens.
|
|
338
|
+
|
|
339
|
+
**Import:**
|
|
340
|
+
```javascript
|
|
341
|
+
import authorizedFetch from '__main_assets__/js/libs/authorized-fetch.js';
|
|
342
|
+
```
|
|
343
|
+
|
|
344
|
+
**Function: `authorizedFetch(url, options)`**
|
|
345
|
+
|
|
346
|
+
**Parameters:**
|
|
347
|
+
- `url` (string) - The API endpoint URL
|
|
348
|
+
- `options` (Object) - Request options for wonderful-fetch (method, body, timeout, etc.)
|
|
349
|
+
|
|
350
|
+
**Returns:**
|
|
351
|
+
- (Promise) - The response from the API
|
|
352
|
+
|
|
353
|
+
**Example:**
|
|
354
|
+
```javascript
|
|
355
|
+
import authorizedFetch from '__main_assets__/js/libs/authorized-fetch.js';
|
|
356
|
+
|
|
357
|
+
// Make an authenticated API call
|
|
358
|
+
const response = await authorizedFetch(serverApiURL, {
|
|
359
|
+
method: 'POST',
|
|
360
|
+
timeout: 30000,
|
|
361
|
+
response: 'json',
|
|
362
|
+
tries: 2,
|
|
363
|
+
body: {
|
|
364
|
+
command: 'user:get-data',
|
|
365
|
+
payload: { id: 'example' }
|
|
366
|
+
}
|
|
367
|
+
});
|
|
368
|
+
```
|
|
369
|
+
|
|
370
|
+
**How It Works:**
|
|
371
|
+
1. Retrieves the current Firebase user's ID token automatically
|
|
372
|
+
2. Adds the token to the request as an `Authorization: Bearer <token>` header
|
|
373
|
+
3. Makes the request using wonderful-fetch
|
|
374
|
+
4. Throws an error if no authenticated user is found
|
|
375
|
+
|
|
376
|
+
**Benefits:**
|
|
377
|
+
- No need to manually call `webManager.auth().getIdToken()`
|
|
378
|
+
- No need to add `authenticationToken` to request body
|
|
379
|
+
- Centralized authentication handling
|
|
380
|
+
- Consistent authentication across all API calls
|
|
381
|
+
|
|
382
|
+
#### FormManager Library
|
|
383
|
+
|
|
384
|
+
Custom library for form handling with built-in state management and validation.
|
|
385
|
+
|
|
386
|
+
**Import:**
|
|
387
|
+
```javascript
|
|
388
|
+
import { FormManager } from '__main_assets__/js/libs/form-manager.js';
|
|
389
|
+
```
|
|
390
|
+
|
|
391
|
+
**Documentation:** See [form-manager.js](src/assets/js/libs/form-manager.js) for full API and usage examples.
|
|
392
|
+
|
|
285
393
|
### Icons
|
|
286
394
|
* Fontawesome
|
|
287
395
|
* https://fontawesome.com/search
|
package/TODO.md
CHANGED
|
@@ -34,7 +34,7 @@ MAKE COMPONENTS? ASK CLAUDE HOW AND IF ITS POSSIBLE
|
|
|
34
34
|
|
|
35
35
|
FIX SIGNIN/SINGUP FORM
|
|
36
36
|
|
|
37
|
-
https://192.168.86.69:4000/payment/checkout?product=premium&
|
|
37
|
+
https://192.168.86.69:4000/payment/checkout?product=premium&_dev_trialEligible=true&_dev_appId=dev&_dev_cardProcessor=stripe
|
|
38
38
|
|
|
39
39
|
filter-adaptive-inverse
|
|
40
40
|
|