@gaulatti/giorgia 0.1.60 → 0.1.62

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.
@@ -7,7 +7,6 @@ import liveStoryLayoutHbs from './templates/layouts/live-story.hbs?raw';
7
7
  import linkInBioLayoutHbs from './templates/layouts/link-in-bio.hbs?raw';
8
8
  import mediaPageLayoutHbs from './templates/layouts/media-page.hbs?raw';
9
9
  import headerMainHbs from './templates/partials/headers/header-main.hbs?raw';
10
- import headerMinimalHbs from './templates/partials/headers/header-minimal.hbs?raw';
11
10
  import footerFullHbs from './templates/partials/footers/footer-full.hbs?raw';
12
11
  import footerMinimalHbs from './templates/partials/footers/footer-minimal.hbs?raw';
13
12
  import navCategoriesHbs from './templates/partials/nav/nav-categories.hbs?raw';
@@ -74,7 +73,6 @@ const assets = {
74
73
  },
75
74
  partials: {
76
75
  'headers/header-main': headerMainHbs,
77
- 'headers/header-minimal': headerMinimalHbs,
78
76
  'footers/footer-full': footerFullHbs,
79
77
  'footers/footer-minimal': footerMinimalHbs,
80
78
  'nav/nav-categories': navCategoriesHbs,
@@ -1,5 +1,5 @@
1
- export { render, liveProgramPageHtml, liveProgramPageAsset, liveProgramPageFiles, fontFiles } from './renderer.node.js';
2
- export type { LiveProgramFileEntry, FontFileEntry } from './renderer.node.js';
1
+ export { assetFiles, render, liveProgramPageHtml, liveProgramPageAsset, liveProgramPageFiles, fontFiles } from './renderer.node.js';
2
+ export type { AssetFileEntry, LiveProgramFileEntry, FontFileEntry } from './renderer.node.js';
3
3
  export { buildInstagramImageHtml, registerInstagramImageHelpers, type InstagramImageTemplateParams } from './instagram-image-template.js';
4
4
  export { outletConfig } from './outlet-config.js';
5
5
  export { version } from './version.js';
package/dist/renderer.js CHANGED
@@ -1,4 +1,4 @@
1
- export { render, liveProgramPageHtml, liveProgramPageAsset, liveProgramPageFiles, fontFiles } from './renderer.node.js';
1
+ export { assetFiles, render, liveProgramPageHtml, liveProgramPageAsset, liveProgramPageFiles, fontFiles } from './renderer.node.js';
2
2
  export { buildInstagramImageHtml, registerInstagramImageHelpers } from './instagram-image-template.js';
3
3
  export { outletConfig } from './outlet-config.js';
4
4
  export { version } from './version.js';
@@ -7,6 +7,12 @@ export type FontFileEntry = {
7
7
  contentType: string;
8
8
  };
9
9
  export declare function fontFiles(): FontFileEntry[];
10
+ export type AssetFileEntry = {
11
+ key: string;
12
+ body: Buffer;
13
+ contentType: string;
14
+ };
15
+ export declare function assetFiles(): AssetFileEntry[];
10
16
  export declare function liveProgramPageAsset(filename: string): string;
11
17
  export type LiveProgramFileEntry = {
12
18
  key: string;
@@ -88,6 +88,11 @@ function fontsDir() {
88
88
  const currentDir = path.dirname(currentFile);
89
89
  return path.join(currentDir, 'fonts');
90
90
  }
91
+ function assetsDir() {
92
+ const currentFile = fileURLToPath(import.meta.url);
93
+ const currentDir = path.dirname(currentFile);
94
+ return path.join(currentDir, 'assets');
95
+ }
91
96
  export function fontFiles() {
92
97
  const dir = fontsDir();
93
98
  if (!fs.existsSync(dir)) {
@@ -115,6 +120,22 @@ export function fontFiles() {
115
120
  }
116
121
  return entries;
117
122
  }
123
+ export function assetFiles() {
124
+ const dir = assetsDir();
125
+ if (!fs.existsSync(dir)) {
126
+ throw new Error(`assets directory not found at ${dir} — run npm run build first`);
127
+ }
128
+ return fs.readdirSync(dir, { withFileTypes: true })
129
+ .filter((item) => item.isFile())
130
+ .map((item) => {
131
+ const fullPath = path.join(dir, item.name);
132
+ return {
133
+ key: `assets/${item.name}`,
134
+ body: fs.readFileSync(fullPath),
135
+ contentType: contentTypeForFile(item.name),
136
+ };
137
+ });
138
+ }
118
139
  export function liveProgramPageAsset(filename) {
119
140
  const pageDir = liveProgramPageDir();
120
141
  const assetPath = path.join(pageDir, filename);
@@ -130,6 +151,7 @@ const CONTENT_TYPE_MAP = {
130
151
  '.jpg': 'image/jpeg',
131
152
  '.jpeg': 'image/jpeg',
132
153
  '.png': 'image/png',
154
+ '.svg': 'image/svg+xml',
133
155
  '.woff2': 'font/woff2',
134
156
  '.woff': 'font/woff',
135
157
  '.ogg': 'audio/ogg',
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@gaulatti/giorgia",
3
3
  "description": "Server-side Handlebars renderer and templates for ModoItaliano pages.",
4
- "version": "0.1.60",
4
+ "version": "0.1.62",
5
5
  "license": "MIT",
6
6
  "author": "ModoItaliano",
7
7
  "repository": {
@@ -1,5 +1,5 @@
1
1
  {{> shell/doc-start-404}}
2
- {{> headers/header-minimal}}
2
+ {{> headers/header-main}}
3
3
  {{> components/not-found/main}}
4
4
  {{> footers/footer-minimal}}
5
5
  {{> shell/doc-end}}
@@ -1,16 +0,0 @@
1
- <header class='border-b border-slate-200 dark:border-slate-700 relative z-[60] bg-white dark:bg-slate-900 transition-colors' style='view-transition-name: site-header;'>
2
- <div class='container mx-auto px-4'>
3
- <nav class='flex items-center justify-center h-16'>
4
- <div class='{{#if mourningMode}}bg-black{{else}}bg-[#b21100]{{/if}} text-white p-3'>
5
- <a href='{{logoLink}}' aria-label='fifthbell - Home'>
6
- <svg class='w-7 h-7' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'>
7
- <path d='M10.268 21a2 2 0 0 0 3.464 0'></path>
8
- <path d='M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326'></path>
9
- <path d='M4 2C2.8 3.7 2 5.7 2 8'></path>
10
- <path d='M22 8a10 10 0 0 0-2-6'></path>
11
- </svg>
12
- </a>
13
- </div>
14
- </nav>
15
- </div>
16
- </header>