[calendar] update banners
|
@ -4,6 +4,7 @@
|
|||
/db.sqlite
|
||||
/db.sqlite-shm
|
||||
/db.sqlite-wal
|
||||
/db.sqlite-*
|
||||
|
||||
/daemonise.json
|
||||
/daemonise.log
|
||||
|
@ -14,7 +15,7 @@
|
|||
|
||||
/cache
|
||||
/static/card
|
||||
/static/img-local/
|
||||
/static/img-local
|
||||
|
||||
# Created by .ignore support plugin (hsz.mobi)
|
||||
### Node template
|
||||
|
|
After Width: | Height: | Size: 527 KiB |
After Width: | Height: | Size: 569 KiB |
After Width: | Height: | Size: 528 KiB |
After Width: | Height: | Size: 548 KiB |
After Width: | Height: | Size: 766 KiB |
Before Width: | Height: | Size: 587 KiB After Width: | Height: | Size: 589 KiB |
After Width: | Height: | Size: 507 KiB |
After Width: | Height: | Size: 545 KiB |
|
@ -3,7 +3,6 @@ require('../src/dotenv')();
|
|||
const Pageres = require('pageres');
|
||||
const fs = require('fs');
|
||||
const Suml = require('suml');
|
||||
const locale = new Suml().parse(fs.readFileSync(`./data/config.suml`).toString()).locale;
|
||||
|
||||
const shoot = async (url, filename) => {
|
||||
const pr = new Pageres({
|
||||
|
@ -12,13 +11,15 @@ const shoot = async (url, filename) => {
|
|||
});
|
||||
pr.src(process.env.BASE_URL + url, ['1500x300']);
|
||||
for (let buffer of await pr.run()) {
|
||||
const target = `${__dirname}/../static/calendar/${filename}.png`;
|
||||
const dir = `${__dirname}/../static/img-local/calendar`;
|
||||
fs.mkdirSync(dir, {recursive: true})
|
||||
const target = `${dir}/${filename}.png`;
|
||||
console.log(target);
|
||||
fs.writeFileSync(target, buffer);
|
||||
}
|
||||
}
|
||||
|
||||
(async () => {
|
||||
await shoot('/calendar-wide', `calendar-${locale}-overview`);
|
||||
await shoot('/calendar-wide?labels=true', `calendar-${locale}-labels`);
|
||||
await shoot('/calendar-wide', `overview`);
|
||||
await shoot('/calendar-wide?labels=true', `labels`);
|
||||
})();
|
||||
|
|
Before Width: | Height: | Size: 747 KiB |