@rettangoli/sites 0.2.2 → 0.2.3

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rettangoli/sites",
3
- "version": "0.2.2",
3
+ "version": "0.2.3",
4
4
  "description": "Generate static sites using Markdown and YAML. Straightforward, zero-complexity. Complete toolkit for landing pages, blogs, documentation, admin dashboards, and more.git remote add origin git@github.com:yuusoft-org/sitic.git",
5
5
  "author": {
6
6
  "name": "Luciano Hanyon Wu",
package/src/cli/build.js CHANGED
@@ -8,9 +8,10 @@ import { loadSiteConfig } from '../utils/loadSiteConfig.js';
8
8
  * @param {string} options.rootDir - Root directory of the site (defaults to cwd)
9
9
  * @param {Object} options.md - Optional markdown renderer
10
10
  * @param {boolean} options.quiet - Suppress build output logs
11
+ * @param {boolean} options.isScreenshotMode - Whether building for screenshot capture
11
12
  */
12
13
  export const buildSite = async (options = {}) => {
13
- const { rootDir = process.cwd(), md, functions, quiet = false } = options;
14
+ const { rootDir = process.cwd(), md, functions, quiet = false, isScreenshotMode = false } = options;
14
15
 
15
16
  // Load config file if needed
16
17
  let config = {};
@@ -23,7 +24,8 @@ export const buildSite = async (options = {}) => {
23
24
  rootDir,
24
25
  md: md || config.mdRender,
25
26
  functions: functions || config.functions || {},
26
- quiet
27
+ quiet,
28
+ isScreenshotMode
27
29
  });
28
30
 
29
31
  await build();
@@ -31,7 +31,7 @@ function isObject(item) {
31
31
  return item && typeof item === 'object' && !Array.isArray(item);
32
32
  }
33
33
 
34
- export function createSiteBuilder({ fs, rootDir = '.', md, functions = {}, quiet = false }) {
34
+ export function createSiteBuilder({ fs, rootDir = '.', md, functions = {}, quiet = false, isScreenshotMode = false }) {
35
35
  return async function build() {
36
36
  // Use provided md or default to rtglMarkdown
37
37
  const mdInstance = md || rtglMarkdown(MarkdownIt);
@@ -249,6 +249,7 @@ export function createSiteBuilder({ fs, rootDir = '.', md, functions = {}, quiet
249
249
  const pageData = deepMerge(globalData, frontmatter);
250
250
  pageData.collections = collections;
251
251
  pageData.page = { url };
252
+ pageData.build = { isScreenshotMode };
252
253
 
253
254
  let processedPageContent;
254
255
 
@@ -141,9 +141,9 @@ const screenshotCommand = async (options = {}) => {
141
141
  console.log('📋 Ignore patterns:', ignorePatterns);
142
142
  }
143
143
 
144
- // Build the site first
144
+ // Build the site first (with screenshot mode enabled)
145
145
  console.log('Building site...');
146
- await buildSite({ rootDir });
146
+ await buildSite({ rootDir, isScreenshotMode: true });
147
147
  console.log('Build complete');
148
148
 
149
149
  // Start temporary server