From 2dd4f21c27c0ca29ab69284590107e3d19ae129d Mon Sep 17 00:00:00 2001 From: budparr Date: Mon, 9 Apr 2018 12:08:59 -0400 Subject: [PATCH] Update header/scripts to accommodate hashed assets --- layouts/_default/baseof.html | 8 +++++++- layouts/partials/site-scripts.html | 7 ++++++- src/webpack.config.js | 4 ++-- 3 files changed, 15 insertions(+), 4 deletions(-) diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html index cf7f6eb..0aa5018 100755 --- a/layouts/_default/baseof.html +++ b/layouts/_default/baseof.html @@ -17,7 +17,13 @@ {{ end }} - + {{ $css_path := $.Param "dev.css_path" | default "themes/gohugo-theme-ananke/static/dist/css" }} + {{ with $css_path }} + {{ range readDir . }} + + {{ end }} + {{ end }} + {{ block "favicon" . }} {{ partial "site-favicon.html" . }} {{ end }} diff --git a/layouts/partials/site-scripts.html b/layouts/partials/site-scripts.html index 2b34d1f..7508f27 100644 --- a/layouts/partials/site-scripts.html +++ b/layouts/partials/site-scripts.html @@ -1 +1,6 @@ - +{{ $css_path := $.Param "dev.js_path" | default "themes/gohugo-theme-ananke/static/dist/js" }} +{{ with $css_path }} + {{ range readDir . }} + + {{ end }} +{{ end }} diff --git a/src/webpack.config.js b/src/webpack.config.js index f0af7ae..04da73f 100644 --- a/src/webpack.config.js +++ b/src/webpack.config.js @@ -30,7 +30,7 @@ module.exports = { output: { path: path.join(__dirname, './../static/dist'), - filename: '[name].[chunkhash].js' + filename: 'js/[name].[chunkhash].js' }, resolve: { @@ -40,7 +40,7 @@ module.exports = { plugins: [ new ExtractTextPlugin({ filename: getPath => { - return getPath('[name].[contenthash].css'); + return getPath('css/[name].[contenthash].css'); }, allChunks: true })