ultimate-jekyll-manager 0.0.190 → 0.0.193
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/dist/assets/css/core/_verts.scss +14 -0
- package/dist/assets/css/ultimate-jekyll-manager.scss +1 -0
- package/dist/assets/js/core/exit-popup.js +3 -3
- package/dist/config/_config_default.yml +6 -0
- package/dist/defaults/.github/workflows/build.yml +3 -0
- package/dist/defaults/Gemfile +6 -0
- package/dist/gulp/tasks/distribute.js +110 -0
- package/dist/gulp/tasks/jekyll.js +2 -0
- package/package.json +2 -2
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
// Core Verts Styles
|
|
2
|
+
// Styles for ad units (verts) and print visibility
|
|
3
|
+
|
|
4
|
+
// ============================================
|
|
5
|
+
// Print Styles
|
|
6
|
+
// ============================================
|
|
7
|
+
|
|
8
|
+
// Hide all vert units when printing
|
|
9
|
+
@media print {
|
|
10
|
+
vert-unit,
|
|
11
|
+
.uj-vert-unit {
|
|
12
|
+
display: none !important;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
@@ -28,9 +28,9 @@ export default function (Manager, options) {
|
|
|
28
28
|
|
|
29
29
|
// Register showExitPopup on the UJ library for programmatic access
|
|
30
30
|
// Usage: webManager.uj().showExitPopup()
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
31
|
+
console.log('---1');
|
|
32
|
+
|
|
33
|
+
webManager._ujLibrary.showExitPopup = showExitPopup;
|
|
34
34
|
|
|
35
35
|
function updateModalContent($modal, effectiveConfig) {
|
|
36
36
|
// Update title
|
|
@@ -56,6 +56,12 @@ plugins:
|
|
|
56
56
|
- jekyll-uj-powertools
|
|
57
57
|
# - jekyll-truthyfalsy
|
|
58
58
|
|
|
59
|
+
# Parallel
|
|
60
|
+
parallel_build:
|
|
61
|
+
enabled: true # Enable/disable parallel builds (default: true)
|
|
62
|
+
threads: 8 # Number of threads (default: number of CPU cores)
|
|
63
|
+
min_items: 1 # Minimum items before parallelizing (default: 10)
|
|
64
|
+
|
|
59
65
|
# Exclude from processing
|
|
60
66
|
exclude:
|
|
61
67
|
- Gemfile
|
|
@@ -51,6 +51,9 @@ jobs:
|
|
|
51
51
|
# - name: Run bundle install # TODO: [DEPRECATED] MIGRATE TO: bundle config set --local path 'vendor/bundle'
|
|
52
52
|
# run: |
|
|
53
53
|
# bundle install --path vendor/bundle
|
|
54
|
+
- name: Ensure Gemfile uses published gem (not local path)
|
|
55
|
+
run: |
|
|
56
|
+
sed -i 's|gem "jekyll-uj-powertools", path:.*|gem "jekyll-uj-powertools", "~> 1.0"|g' Gemfile
|
|
54
57
|
- name: Run bundle install
|
|
55
58
|
run: |
|
|
56
59
|
bundle install
|
package/dist/defaults/Gemfile
CHANGED
|
@@ -30,6 +30,12 @@ gem "wdm", "~> 0.1.0" if Gem.win_platform?
|
|
|
30
30
|
# Required for Apple silicon
|
|
31
31
|
# gem "webrick", "= 1.7.0"
|
|
32
32
|
|
|
33
|
+
# Required for Ruby 4.0+ (logger was removed from stdlib)
|
|
34
|
+
gem "logger"
|
|
35
|
+
|
|
36
|
+
# Parallel processing for faster builds
|
|
37
|
+
gem 'parallel'
|
|
38
|
+
|
|
33
39
|
# Fix x86_64 / arm64e error
|
|
34
40
|
# /Users/ian/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/redcarpet-3.6.0/lib/redcarpet.rb:1:in `require': dlopen(/Users/ian/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/redcarpet-3.6.0/lib/redcarpet.bundle, 0x0009): tried: '/Users/ian/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/redcarpet-3.6.0/lib/redcarpet.bundle' (mach-o file, but is an incompatible architecture (have (x86_64), need (arm64e))) - /Users/ian/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/redcarpet-3.6.0/lib/redcarpet.bundle (LoadError)
|
|
35
41
|
gem "redcarpet", "= 3.5.1"
|
|
@@ -4,6 +4,8 @@ const logger = Manager.logger('distribute');
|
|
|
4
4
|
const { src, dest, watch, series } = require('gulp');
|
|
5
5
|
const through2 = require('through2');
|
|
6
6
|
const path = require('path');
|
|
7
|
+
const jetpack = require('fs-jetpack');
|
|
8
|
+
const { template } = require('node-powertools');
|
|
7
9
|
const createTemplateTransform = require('./utils/template-transform');
|
|
8
10
|
|
|
9
11
|
// Load package
|
|
@@ -15,6 +17,7 @@ const rootPathProject = Manager.getRootPath('project');
|
|
|
15
17
|
|
|
16
18
|
// Constants
|
|
17
19
|
const LOUD = process.env.UJ_LOUD_LOGS === 'true';
|
|
20
|
+
const FALLBACK_THEME = 'classy';
|
|
18
21
|
|
|
19
22
|
// Glob
|
|
20
23
|
const input = [
|
|
@@ -58,6 +61,9 @@ function distribute() {
|
|
|
58
61
|
.pipe(createTemplateTransform({site: config}))
|
|
59
62
|
.pipe(dest(output, { encoding: false }))
|
|
60
63
|
.on('finish', () => {
|
|
64
|
+
// Copy missing theme files (layouts and includes) from classy fallback
|
|
65
|
+
copyFallbackThemeFiles();
|
|
66
|
+
|
|
61
67
|
// Log
|
|
62
68
|
logger.log('Finished!');
|
|
63
69
|
|
|
@@ -67,6 +73,110 @@ function distribute() {
|
|
|
67
73
|
});
|
|
68
74
|
}
|
|
69
75
|
|
|
76
|
+
/**
|
|
77
|
+
* Copy missing theme files (layouts and includes) from classy to current theme
|
|
78
|
+
* This ensures all themes have access to default files without needing to create them
|
|
79
|
+
*/
|
|
80
|
+
function copyFallbackThemeFiles() {
|
|
81
|
+
const currentTheme = config.theme?.id;
|
|
82
|
+
|
|
83
|
+
// Skip if no theme or already using classy
|
|
84
|
+
if (!currentTheme || currentTheme === FALLBACK_THEME) {
|
|
85
|
+
return;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
// Define folders to check for fallback (both _layouts and _includes)
|
|
89
|
+
const folders = [
|
|
90
|
+
{ type: '_layouts', srcFolder: 'src/_layouts/themes', distFolder: 'dist/_layouts/themes' },
|
|
91
|
+
{ type: '_includes', srcFolder: 'src/_includes/themes', distFolder: 'dist/_includes/themes' },
|
|
92
|
+
];
|
|
93
|
+
|
|
94
|
+
let totalCopied = 0;
|
|
95
|
+
|
|
96
|
+
for (const folder of folders) {
|
|
97
|
+
// Paths to check for classy files
|
|
98
|
+
const classyInPackage = path.join(rootPathPackage, `dist/defaults/${folder.distFolder}`, FALLBACK_THEME);
|
|
99
|
+
const classyInProject = path.join(rootPathProject, folder.distFolder, FALLBACK_THEME);
|
|
100
|
+
|
|
101
|
+
// Target path for current theme
|
|
102
|
+
const targetThemeFolder = path.join(rootPathProject, folder.distFolder, currentTheme);
|
|
103
|
+
|
|
104
|
+
// Get all classy files from both locations
|
|
105
|
+
const classyFiles = [
|
|
106
|
+
...getFilesRecursive(classyInPackage),
|
|
107
|
+
...getFilesRecursive(classyInProject),
|
|
108
|
+
];
|
|
109
|
+
|
|
110
|
+
for (const classyFile of classyFiles) {
|
|
111
|
+
// Get relative path from classy theme folder
|
|
112
|
+
const relativePath = classyFile.includes(classyInPackage)
|
|
113
|
+
? path.relative(classyInPackage, classyFile)
|
|
114
|
+
: path.relative(classyInProject, classyFile);
|
|
115
|
+
|
|
116
|
+
// Target path in current theme
|
|
117
|
+
const targetPath = path.join(targetThemeFolder, relativePath);
|
|
118
|
+
|
|
119
|
+
// Check if file already exists in current theme (in src or dist)
|
|
120
|
+
const existsInSrc = jetpack.exists(path.join(rootPathProject, folder.srcFolder, currentTheme, relativePath));
|
|
121
|
+
const existsInDist = jetpack.exists(targetPath);
|
|
122
|
+
|
|
123
|
+
// Skip if already exists
|
|
124
|
+
if (existsInSrc || existsInDist) {
|
|
125
|
+
continue;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
// Read the file content and replace theme references with current theme
|
|
129
|
+
let content = jetpack.read(classyFile);
|
|
130
|
+
|
|
131
|
+
// Replace hardcoded classy references
|
|
132
|
+
content = content.replace(
|
|
133
|
+
new RegExp(`themes/${FALLBACK_THEME}/`, 'g'),
|
|
134
|
+
`themes/${currentTheme}/`
|
|
135
|
+
);
|
|
136
|
+
|
|
137
|
+
// Replace template variable references (e.g., [ site.theme.id ])
|
|
138
|
+
content = template(content, { site: config }, { brackets: ['[', ']'] });
|
|
139
|
+
|
|
140
|
+
// Write the transformed content to the target path
|
|
141
|
+
jetpack.write(targetPath, content);
|
|
142
|
+
totalCopied++;
|
|
143
|
+
|
|
144
|
+
if (LOUD) {
|
|
145
|
+
logger.log(` Fallback ${folder.type}: themes/${FALLBACK_THEME}/${relativePath} -> themes/${currentTheme}/${relativePath}`);
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
if (totalCopied > 0) {
|
|
151
|
+
logger.log(`Copied ${totalCopied} fallback files from '${FALLBACK_THEME}' to '${currentTheme}' theme`);
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
/**
|
|
156
|
+
* Recursively get all files in a directory
|
|
157
|
+
*/
|
|
158
|
+
function getFilesRecursive(dir) {
|
|
159
|
+
if (!jetpack.exists(dir)) {
|
|
160
|
+
return [];
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
const files = [];
|
|
164
|
+
const items = jetpack.list(dir) || [];
|
|
165
|
+
|
|
166
|
+
for (const item of items) {
|
|
167
|
+
const itemPath = path.join(dir, item);
|
|
168
|
+
const stat = jetpack.inspect(itemPath);
|
|
169
|
+
|
|
170
|
+
if (stat?.type === 'dir') {
|
|
171
|
+
files.push(...getFilesRecursive(itemPath));
|
|
172
|
+
} else if (stat?.type === 'file') {
|
|
173
|
+
files.push(itemPath);
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
return files;
|
|
178
|
+
}
|
|
179
|
+
|
|
70
180
|
function customTransform() {
|
|
71
181
|
return through2.obj(function (file, _, callback) {
|
|
72
182
|
// Skip if it's a directory
|
|
@@ -81,6 +81,8 @@ async function jekyll(complete) {
|
|
|
81
81
|
|
|
82
82
|
// Build Jekyll
|
|
83
83
|
const command = [
|
|
84
|
+
// Enable Ruby YJIT for faster builds
|
|
85
|
+
'RUBY_YJIT_ENABLE=1',
|
|
84
86
|
// Set JEKYLL_ENV to production when in build mode
|
|
85
87
|
Manager.isBuildMode() ? 'JEKYLL_ENV=production' : '',
|
|
86
88
|
// Jekyll command
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ultimate-jekyll-manager",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.193",
|
|
4
4
|
"description": "Ultimate Jekyll dependency manager",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"exports": {
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"engines": {
|
|
33
33
|
"node": "22",
|
|
34
34
|
"bundler": "2.4.21",
|
|
35
|
-
"ruby": "
|
|
35
|
+
"ruby": "4.0.0"
|
|
36
36
|
},
|
|
37
37
|
"repository": {
|
|
38
38
|
"type": "git",
|