feat: 그날 코디는 포스트 하나에 스타일 하나 — --style 로 스타일 태그(꾸안꾸·오피스룩…) 붙은 스냅만 고르고 제목 통일
This commit is contained in:
1 parent
814e64931d
commit
a6251db762
6 files changed
+45
-21
No files matched your search
@@ -34,6 +34,7 @@ let copy = flag('--copy')
|
||||
const topic = flag('--topic')
|
||||
const feedback = flag('--feedback')
|
||||
const color = flag('--color')
|
||||
const styleArg = flag('--style')
|
||||
const outArg = flag('--out')
|
||||
const take = (name) => args.includes(name) && args.splice(args.indexOf(name), 1).length > 0
|
||||
let noImages = take('--no-images')
|
||||
@@ -80,8 +81,10 @@ const outDir = resolve(outArg ?? `out/${day}`)
|
||||
if (daily) {
|
||||
if (template !== 'ootd') fail('--daily 는 ootd 템플릿에서만 써요.')
|
||||
const { runDailyOotd, toCardOutfits } = await import('./daily-ootd.mjs')
|
||||
const { outfits } = await runDailyOotd({ outDir })
|
||||
copy = Buffer.from(JSON.stringify({ ...decode(copy), outfits: JSON.stringify(toCardOutfits(outfits)) })).toString('base64url')
|
||||
// 포스트 하나는 스타일 하나: --style <casual|semi|formal|street|minimal>, 없으면 --copy 의 style, 그것도 없으면 꾸안꾸
|
||||
const style = styleArg ?? decode(copy).style ?? 'minimal'
|
||||
const { outfits } = await runDailyOotd({ outDir, style })
|
||||
copy = Buffer.from(JSON.stringify({ ...decode(copy), style, outfits: JSON.stringify(toCardOutfits(outfits)) })).toString('base64url')
|
||||
noImages = true
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user