mirror of
https://gitlab.com/PronounsPage/PronounsPage.git
synced 2025-09-29 16:04:38 -04:00
#246 [calendar] add banner
This commit is contained in:
parent
35664e84c2
commit
628d406c0c
@ -247,6 +247,7 @@ export default {
|
|||||||
|
|
||||||
if (config.calendar && config.calendar.enabled) {
|
if (config.calendar && config.calendar.enabled) {
|
||||||
routes.push({ path: '/' + config.calendar.route, component: resolve(__dirname, 'routes/calendar.vue') });
|
routes.push({ path: '/' + config.calendar.route, component: resolve(__dirname, 'routes/calendar.vue') });
|
||||||
|
routes.push({ path: '/calendar-wide', component: resolve(__dirname, 'routes/calendarWide.vue') });
|
||||||
}
|
}
|
||||||
|
|
||||||
if (config.api !== null) {
|
if (config.api !== null) {
|
||||||
|
@ -35,6 +35,7 @@
|
|||||||
head() {
|
head() {
|
||||||
return head({
|
return head({
|
||||||
title: this.$t('calendar.headerLong'),
|
title: this.$t('calendar.headerLong'),
|
||||||
|
banner: `calendar/calendar-${process.env.LOCALE}.png`,
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
41
routes/calendarWide.vue
Normal file
41
routes/calendarWide.vue
Normal file
@ -0,0 +1,41 @@
|
|||||||
|
<template>
|
||||||
|
<div>
|
||||||
|
<h2 class="d-flex justify-content-between">
|
||||||
|
<span>
|
||||||
|
<Icon v="calendar-star"/>
|
||||||
|
<T>calendar.headerLong</T> ({{year}})
|
||||||
|
</span>
|
||||||
|
<span class="h4 mt-2">
|
||||||
|
<nuxt-link to="/">
|
||||||
|
<Icon v="tags"/>
|
||||||
|
<T>title</T>
|
||||||
|
</nuxt-link>
|
||||||
|
</span>
|
||||||
|
</h2>
|
||||||
|
|
||||||
|
<section class="row pb-4">
|
||||||
|
<div v-for="i in 12" class="col-12 col-lg-3 py-3">
|
||||||
|
<h3 class="text-center"><T>calendar.months.{{i}}</T></h3>
|
||||||
|
<Calendar :year="year" :month="i"/>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import { head } from "../src/helpers";
|
||||||
|
|
||||||
|
export default {
|
||||||
|
layout: 'basic',
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
year: new Date().getFullYear(),
|
||||||
|
}
|
||||||
|
},
|
||||||
|
head() {
|
||||||
|
return head({
|
||||||
|
title: this.$t('calendar.headerLong'),
|
||||||
|
});
|
||||||
|
},
|
||||||
|
}
|
||||||
|
</script>
|
18
server/calendar.js
Normal file
18
server/calendar.js
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
require('dotenv').config({ path:__dirname + '/../.env' });
|
||||||
|
const Pageres = require('pageres');
|
||||||
|
const fs = require('fs');
|
||||||
|
const Suml = require('suml');
|
||||||
|
const locale = new Suml().parse(fs.readFileSync(`./data/config.suml`).toString()).locale;
|
||||||
|
|
||||||
|
(async () => {
|
||||||
|
const pr = new Pageres({
|
||||||
|
delay: 3,
|
||||||
|
});
|
||||||
|
pr.src(process.env.BASE_URL + '/calendar-wide', ['1500x300']);
|
||||||
|
|
||||||
|
for (let buffer of await pr.run()) {
|
||||||
|
const target = `${__dirname}/../static/calendar/calendar-${locale}.png`;
|
||||||
|
console.log(target);
|
||||||
|
fs.writeFileSync(target, buffer);
|
||||||
|
}
|
||||||
|
})();
|
BIN
static/calendar/calendar-pl.png
Normal file
BIN
static/calendar/calendar-pl.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 254 KiB |
Loading…
x
Reference in New Issue
Block a user