Dynamically locate bootswatch directory, mount to /_theme
The previous implementation using symlinks does not work on npm (which doesn't allow symlinks)
This commit is contained in:
parent
1237c24bfe
commit
abf9282155
|
@ -1,3 +1,4 @@
|
||||||
|
import path from 'path'
|
||||||
import { pwrap, pick, fcurrency, fmsat, pngPixel } from './lib/util'
|
import { pwrap, pick, fcurrency, fmsat, pngPixel } from './lib/util'
|
||||||
|
|
||||||
// Setup
|
// Setup
|
||||||
|
@ -40,6 +41,7 @@ app.use(require('csurf')({ cookie: true }))
|
||||||
// Static assets
|
// Static assets
|
||||||
app.use('/_assets', require('stylus').middleware({ src: conf.static_dir, serve: true }))
|
app.use('/_assets', require('stylus').middleware({ src: conf.static_dir, serve: true }))
|
||||||
app.use('/_assets', require('express').static(conf.static_dir))
|
app.use('/_assets', require('express').static(conf.static_dir))
|
||||||
|
app.use('/_themes', require('express').static(path.resolve(require.resolve('bootswatch/package'), '..', 'dist')))
|
||||||
|
|
||||||
// Create invoice
|
// Create invoice
|
||||||
app.post('/_invoice', pwrap(async (req, res) => {
|
app.post('/_invoice', pwrap(async (req, res) => {
|
||||||
|
|
|
@ -1 +0,0 @@
|
||||||
../node_modules/bootswatch/dist
|
|
|
@ -10,7 +10,7 @@ block head
|
||||||
|
|
||||||
title= title
|
title= title
|
||||||
|
|
||||||
link(rel='stylesheet', href='_assets/bootswatch/'+conf.theme+'/bootstrap.min.css')
|
link(rel='stylesheet', href='_themes/'+conf.theme+'/bootstrap.min.css')
|
||||||
link(rel='stylesheet', href='_assets/style.css')
|
link(rel='stylesheet', href='_assets/style.css')
|
||||||
noscript: style .yesscript{display:none}
|
noscript: style .yesscript{display:none}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue