Skip to content

Commit

Permalink
full
Browse files Browse the repository at this point in the history
  • Loading branch information
wooorm committed Oct 16, 2023
1 parent 7699532 commit 1bece34
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 14 deletions.
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"devDependencies": {
"@babel/core": "^7.0.0",
"@node-loader/core": "^2.0.0",
"@sparticuz/chromium-min": "^117.0.0",
"@sparticuz/chromium": "^117.0.0",
"@types/babel__core": "^7.0.0",
"@types/dlv": "^1.0.0",
"@types/mdx": "^2.0.0",
Expand Down
15 changes: 6 additions & 9 deletions website/post.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import rehypeParse from 'rehype-parse'
import rehypeSanitize, {defaultSchema} from 'rehype-sanitize'
import rehypeStringify from 'rehype-stringify'
import puppeteer from 'puppeteer'
import chromium from '@sparticuz/chromium-min'
import chromium from '@sparticuz/chromium'
import {config} from '../docs/_config.js'
import {schema} from './schema-description.js'

Expand Down Expand Up @@ -172,9 +172,7 @@ const browser = await puppeteer.launch(
? {
args: chromium.args,
defaultViewport: chromium.defaultViewport,
executablePath: await chromium.executablePath(
'https://github.com/Sparticuz/chromium/releases/download/v117.0.0/chromium-v117.0.0-pack.tar'
),
executablePath: await chromium.executablePath(),
headless: chromium.headless
}
: {headless: 'new'}
Expand Down Expand Up @@ -392,16 +390,15 @@ await pAll(

await fs.mkdir(path.dirname(filePath), {recursive: true})

await fs.writeFile(filePath, screenshot, {
flag: 'wx'
})
await fs.writeFile(filePath, screenshot, {flag: 'wx'})

console.log('catured:', filePath)
await page.close()

console.log('OG image `%s`', info.meta.title)
}),
{concurrency: 1}
})
)

await browser.close()

console.log('✔ OG images')

0 comments on commit 1bece34

Please sign in to comment.