Skip to content

Commit

Permalink
update: simpler builder
Browse files Browse the repository at this point in the history
  • Loading branch information
Rooyca committed Mar 13, 2024
1 parent 58c5f14 commit 7581dfc
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions builder/builder.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,19 +35,19 @@ for (let index = 0; index < sequentialNumbers.length; index++) {
const fs = require('fs');

// Read data from current.json
const data = JSON.parse(movieToday);
// const data = JSON.parse(movieToday);

// Read the HTML template
let html = fs.readFileSync('./src/index.html', 'utf8');

// Replace placeholders with actual data
html = html.replace('__POSTER__', data.img);
html = html.replace('__TITLE__', data.title);
html = html.replace('__DIRECTOR__', data.director);
html = html.replace('__DESCRIPTION__', data.desc);
html = html.replace('__YEAR__', data.year);
html = html.replace('__TAGS__', data.tags);
html = html.replace('__LENGTH__', data.length);
html = html.replace('__POSTER__', movieToday.img);
html = html.replace('__TITLE__', movieToday.title);
html = html.replace('__DIRECTOR__', movieToday.director);
html = html.replace('__DESCRIPTION__', movieToday.desc);
html = html.replace('__YEAR__', movieToday.year);
html = html.replace('__TAGS__', movieToday.tags);
html = html.replace('__LENGTH__', movieToday.length);
html = html.replace('__DATE__', new Date().toDateString());

// Write the populated HTML to a new file
Expand Down

0 comments on commit 7581dfc

Please sign in to comment.