1
0
forked from ti-nuage/site

Support du calendrier NextCloud (fix #7).

This commit is contained in:
David Soulayrol
2023-01-14 15:21:03 +01:00
parent 4d71bbe764
commit d0f95cdecf
15 changed files with 3275 additions and 24 deletions

View File

@@ -1,5 +1,6 @@
/* This is the actual metalsmith configuration script. */
const assets = require('metalsmith-assets')
const browserify = require('metalsmith-browserify')
const cleanCSS = require('metalsmith-clean-css')
const config = require('./config.js')
const collections = require('@metalsmith/collections')
@@ -9,7 +10,6 @@ const layouts = require('@metalsmith/layouts')
const Metalsmith = require('metalsmith')
const markdown = require('@metalsmith/markdown')
const marked = require('marked')
const moment = require('moment')
const permalinks = require('@metalsmith/permalinks')
const rename = require('metalsmith-rename')
const services = require('./metalsmith-tinuage-services')
@@ -35,12 +35,16 @@ markdownRenderer.link = function (href, title, text) {
return out
}
moment.locale('fr')
module.exports = new Metalsmith(config.paths.projectRoot)
.clean(__PROD__)
.metadata({
moment: moment,
date_format: function (date, withHours) {
const options = { dateStyle: 'long' }
if (withHours) {
options.push('timeStyle', 'short')
}
return Intl.DateTimeFormat('fr', options).format(date)
},
production: __PROD__,
remove_diatrics: function (e) { return slug(e, { mode: 'rfc3986' }) },
site: {
@@ -55,6 +59,14 @@ module.exports = new Metalsmith(config.paths.projectRoot)
rebase: true
}
}))
.use(browserify({
browserifyOptions: {
standalone: 'Calendar'
},
entries: [
'js/calendar.js'
]
}))
.use(assets({
source: './assets/' + (process.env.NODE_ENV || 'dev'),
destination: './'