thibaud frere commited on
Commit
0951bdd
·
1 Parent(s): 150ca32

update thumb handling

Browse files
app/scripts/export-pdf.mjs CHANGED
@@ -323,13 +323,13 @@ async function main() {
323
  const cssHandle = await page.addStyleTag({ content: `
324
  .hero .points { mix-blend-mode: normal !important; }
325
  ` });
326
- const thumbPath = resolve(cwd, 'dist', 'thumb.jpg');
327
  await page.screenshot({ path: thumbPath, type: 'jpeg', quality: 85, fullPage: false });
328
  // Also emit PNG for compatibility if needed
329
- const thumbPngPath = resolve(cwd, 'dist', 'thumb.png');
330
  await page.screenshot({ path: thumbPngPath, type: 'png', fullPage: false });
331
- const publicThumb = resolve(cwd, 'public', 'thumb.jpg');
332
- const publicThumbPng = resolve(cwd, 'public', 'thumb.png');
333
  try { await fs.copyFile(thumbPath, publicThumb); } catch {}
334
  try { await fs.copyFile(thumbPngPath, publicThumbPng); } catch {}
335
  // Remove temporary style so PDF is unaffected
 
323
  const cssHandle = await page.addStyleTag({ content: `
324
  .hero .points { mix-blend-mode: normal !important; }
325
  ` });
326
+ const thumbPath = resolve(cwd, 'dist', 'thumb.auto.jpg');
327
  await page.screenshot({ path: thumbPath, type: 'jpeg', quality: 85, fullPage: false });
328
  // Also emit PNG for compatibility if needed
329
+ const thumbPngPath = resolve(cwd, 'dist', 'thumb.auto.png');
330
  await page.screenshot({ path: thumbPngPath, type: 'png', fullPage: false });
331
+ const publicThumb = resolve(cwd, 'public', 'thumb.auto.jpg');
332
+ const publicThumbPng = resolve(cwd, 'public', 'thumb.auto.png');
333
  try { await fs.copyFile(thumbPath, publicThumb); } catch {}
334
  try { await fs.copyFile(thumbPngPath, publicThumbPng); } catch {}
335
  // Remove temporary style so PDF is unaffected
app/src/content/article.mdx CHANGED
@@ -29,7 +29,7 @@ tags:
29
  - research
30
  - vision-language models
31
  - dataset
32
- ogImage: "/thumb.jpg"
33
  tableOfContentsAutoCollapse: true
34
  ---
35
 
 
29
  - research
30
  - vision-language models
31
  - dataset
32
+ ogImage: "/thumb.png"
33
  tableOfContentsAutoCollapse: true
34
  ---
35
 
app/src/content/chapters/getting-started.mdx CHANGED
@@ -30,7 +30,7 @@ npm run build
30
  ```
31
  <small className="muted">- Serving the `dist/` directory on any static host is enough to deliver the site.</small>
32
  <br/>
33
- <small className="muted">- A [slug-title].pdf and thumb.jpg are also generated at build time. You can find them in the public folder.</small>
34
 
35
 
36
  ### Deploy
 
30
  ```
31
  <small className="muted">- Serving the `dist/` directory on any static host is enough to deliver the site.</small>
32
  <br/>
33
+ <small className="muted">- A [slug-title].pdf and thumb.auto.jpg are also generated at build time. You can find them in the public folder.</small>
34
 
35
 
36
  ### Deploy
app/src/pages/index.astro CHANGED
@@ -6,7 +6,7 @@ import ThemeToggle from '../components/ThemeToggle.astro';
6
  import Seo from '../components/Seo.astro';
7
  import TableOfContents from '../components/TableOfContents.astro';
8
  // Default OG image served from public/
9
- const ogDefaultUrl = '/thumb.jpg';
10
  import 'katex/dist/katex.min.css';
11
  import '../styles/global.css';
12
  const articleFM = (ArticleMod as any).frontmatter ?? {};
 
6
  import Seo from '../components/Seo.astro';
7
  import TableOfContents from '../components/TableOfContents.astro';
8
  // Default OG image served from public/
9
+ const ogDefaultUrl = '/thumb.auto.jpg';
10
  import 'katex/dist/katex.min.css';
11
  import '../styles/global.css';
12
  const articleFM = (ArticleMod as any).frontmatter ?? {};
app/src/styles/_layout.css CHANGED
@@ -69,9 +69,9 @@
69
  }
70
 
71
  .wide {
72
- /* Target up to ~1400px while staying within viewport minus page gutters */
73
- width: min(1400px, 100vw - 32px);
74
- margin-left: 50%;
75
  transform: translateX(-50%);
76
  }
77
 
 
69
  }
70
 
71
  .wide {
72
+ /* Target up to ~1100px while staying within viewport minus page gutters */
73
+ width: min(1100px, 100vw - 32px);
74
+ margin-left: calc(50% + var(--content-padding-x) * 2);
75
  transform: translateX(-50%);
76
  }
77