Fix missing default avatar
This commit is contained in:
parent
be6a480232
commit
6bafac54bf
5 changed files with 16 additions and 2 deletions
|
@ -13,6 +13,7 @@ const LoaderOptionsPlugin = require('webpack/lib/LoaderOptionsPlugin')
|
||||||
const ScriptExtHtmlWebpackPlugin = require('script-ext-html-webpack-plugin')
|
const ScriptExtHtmlWebpackPlugin = require('script-ext-html-webpack-plugin')
|
||||||
const InlineManifestWebpackPlugin = require('inline-manifest-webpack-plugin')
|
const InlineManifestWebpackPlugin = require('inline-manifest-webpack-plugin')
|
||||||
const ngcWebpack = require('ngc-webpack')
|
const ngcWebpack = require('ngc-webpack')
|
||||||
|
const CopyWebpackPlugin = require('copy-webpack-plugin')
|
||||||
|
|
||||||
const WebpackNotifierPlugin = require('webpack-notifier')
|
const WebpackNotifierPlugin = require('webpack-notifier')
|
||||||
|
|
||||||
|
@ -267,6 +268,17 @@ module.exports = function (options) {
|
||||||
inject: 'body'
|
inject: 'body'
|
||||||
}),
|
}),
|
||||||
|
|
||||||
|
new CopyWebpackPlugin([
|
||||||
|
{
|
||||||
|
from: helpers.root('src/assets/images/favicon.png'),
|
||||||
|
to: 'assets/images/favicon.png'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
from: helpers.root('src/assets/images/default-avatar.png'),
|
||||||
|
to: 'assets/images/default-avatar.png'
|
||||||
|
}
|
||||||
|
]),
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Plugin: ScriptExtHtmlWebpackPlugin
|
* Plugin: ScriptExtHtmlWebpackPlugin
|
||||||
* Description: Enhances html-webpack-plugin functionality
|
* Description: Enhances html-webpack-plugin functionality
|
||||||
|
|
|
@ -54,6 +54,6 @@ export class User implements UserServerModel {
|
||||||
getAvatarPath () {
|
getAvatarPath () {
|
||||||
if (this.account && this.account.avatar) return this.account.avatar.path
|
if (this.account && this.account.avatar) return this.account.avatar.path
|
||||||
|
|
||||||
return '/assets/images/default-avatar.png'
|
return '/client/assets/images/default-avatar.png'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 2.3 KiB After Width: | Height: | Size: 539 B |
|
@ -11,7 +11,7 @@
|
||||||
<!-- open graph and oembed tags -->
|
<!-- open graph and oembed tags -->
|
||||||
<!-- Do not remove it! -->
|
<!-- Do not remove it! -->
|
||||||
|
|
||||||
<link rel="icon" type="image/png" href="/client/assets/favicon.png" />
|
<link rel="icon" type="image/png" href="/client/assets/images/favicon.png" />
|
||||||
|
|
||||||
<!-- base url -->
|
<!-- base url -->
|
||||||
<base href="<%= htmlWebpackPlugin.options.metadata.baseUrl %>">
|
<base href="<%= htmlWebpackPlugin.options.metadata.baseUrl %>">
|
||||||
|
|
|
@ -18,6 +18,7 @@ import { VideoInstance } from '../models'
|
||||||
const clientsRouter = express.Router()
|
const clientsRouter = express.Router()
|
||||||
|
|
||||||
const distPath = join(root(), 'client', 'dist')
|
const distPath = join(root(), 'client', 'dist')
|
||||||
|
const assetsImagesPath = join(root(), 'client', 'dist', 'assets', 'images')
|
||||||
const embedPath = join(distPath, 'standalone', 'videos', 'embed.html')
|
const embedPath = join(distPath, 'standalone', 'videos', 'embed.html')
|
||||||
const indexPath = join(distPath, 'index.html')
|
const indexPath = join(distPath, 'index.html')
|
||||||
|
|
||||||
|
@ -33,6 +34,7 @@ clientsRouter.use('/videos/embed', (req: express.Request, res: express.Response,
|
||||||
|
|
||||||
// Static HTML/CSS/JS client files
|
// Static HTML/CSS/JS client files
|
||||||
clientsRouter.use('/client', express.static(distPath, { maxAge: STATIC_MAX_AGE }))
|
clientsRouter.use('/client', express.static(distPath, { maxAge: STATIC_MAX_AGE }))
|
||||||
|
clientsRouter.use('/client/assets/images', express.static(assetsImagesPath, { maxAge: STATIC_MAX_AGE }))
|
||||||
|
|
||||||
// 404 for static files not found
|
// 404 for static files not found
|
||||||
clientsRouter.use('/client/*', (req: express.Request, res: express.Response, next: express.NextFunction) => {
|
clientsRouter.use('/client/*', (req: express.Request, res: express.Response, next: express.NextFunction) => {
|
||||||
|
|
Loading…
Reference in a new issue