[calendar] move image generation to cron
Before Width: | Height: | Size: 732 KiB |
Before Width: | Height: | Size: 596 KiB |
Before Width: | Height: | Size: 990 KiB |
Before Width: | Height: | Size: 625 KiB |
Before Width: | Height: | Size: 1009 KiB |
Before Width: | Height: | Size: 634 KiB |
Before Width: | Height: | Size: 1.1 MiB |
Before Width: | Height: | Size: 648 KiB |
Before Width: | Height: | Size: 894 KiB |
Before Width: | Height: | Size: 645 KiB |
|
@ -34,11 +34,11 @@
|
|||
<T>calendar.image.header</T>:
|
||||
</p>
|
||||
<p class="mb-0">
|
||||
<a href="/img-local/calendar/overview.png" target="_blank" rel="noopener" class="btn btn-outline-primary m-1">
|
||||
<a href="/calendar/overview.png" target="_blank" rel="noopener" class="btn btn-outline-primary m-1">
|
||||
<Icon v="image"/>
|
||||
<T>calendar.image.overview</T>
|
||||
</a>
|
||||
<a href="/img-local/calendar/labels.png" target="_blank" rel="noopener" class="btn btn-outline-primary m-1">
|
||||
<a href="/calendar/labels.png" target="_blank" rel="noopener" class="btn btn-outline-primary m-1">
|
||||
<Icon v="image"/>
|
||||
<T>calendar.image.labels</T>
|
||||
</a>
|
||||
|
|
|
@ -10,7 +10,7 @@ const shoot = async (url, filename) => {
|
|||
});
|
||||
pr.src(process.env.BASE_URL + url, ['1500x300']);
|
||||
for (let buffer of await pr.run()) {
|
||||
const dir = `${__dirname}/../static/img-local/calendar`;
|
||||
const dir = `${__dirname}/../static/calendar`;
|
||||
fs.mkdirSync(dir, {recursive: true})
|
||||
const target = `${dir}/${filename}.png`;
|
||||
console.log(target);
|
||||
|
|