Skip to content

Commit

Permalink
Simplified definition of REMARK_URL to templates in webpack config
Browse files Browse the repository at this point in the history
  • Loading branch information
sattellite authored and umputun committed Nov 10, 2020
1 parent abe3b0d commit 60f554f
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 16 deletions.
2 changes: 1 addition & 1 deletion frontend/comments.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
var remark_config = {
site_id: query.site_id,
host: '<%= REMARK_URL %>' ,
host: '<%= htmlWebpackPlugin.options.remarkUrl %>',
url: query.url
};
Expand Down
2 changes: 1 addition & 1 deletion frontend/counter.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
<script>
var remark_config = {
site_id: 'remark',
host: '<%= REMARK_URL %>',
host: '<%= htmlWebpackPlugin.options.remarkUrl %>',
url: 'https://remark42.com/demo/',
components: ['counter']
};
Expand Down
2 changes: 1 addition & 1 deletion frontend/index.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@
var remark_config = {
site_id: 'remark',
host: '<%= REMARK_URL %>',
host: '<%= htmlWebpackPlugin.options.remarkUrl %>',
url: 'https://remark42.com/demo/',
components: ['embed', 'counter'],
// __colors__: {
Expand Down
2 changes: 1 addition & 1 deletion frontend/last-comments.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
<script>
var remark_config = {
site_id: 'remark',
host: '<%= REMARK_URL %>',
host: '<%= htmlWebpackPlugin.options.remarkUrl %>',
components: ['last-comments']
};
Expand Down
16 changes: 4 additions & 12 deletions frontend/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -180,33 +180,25 @@ module.exports = () => ({
new Html({
template: path.resolve(__dirname, 'index.ejs'),
inject: false,
templateParameters: {
REMARK_URL: remarkUrl,
},
remarkUrl,
}),
new Html({
template: path.resolve(__dirname, 'counter.ejs'),
filename: 'counter.html',
inject: false,
templateParameters: {
REMARK_URL: remarkUrl,
},
remarkUrl,
}),
new Html({
template: path.resolve(__dirname, 'last-comments.ejs'),
filename: 'last-comments.html',
inject: false,
templateParameters: {
REMARK_URL: remarkUrl,
},
remarkUrl,
}),
new Html({
template: path.resolve(__dirname, 'comments.ejs'),
filename: 'comments.html',
inject: false,
templateParameters: {
REMARK_URL: remarkUrl,
},
remarkUrl,
}),
new MiniCssExtractPlugin({
filename: '[name].css',
Expand Down

0 comments on commit 60f554f

Please sign in to comment.