mirror of https://github.com/theNewDynamic/gohugo-theme-ananke.git

budparr
09.08.2018 2dd4f21c27c0ca29ab69284590107e3d19ae129d
Update header/scripts to accommodate hashed assets
3 files modified
19 ■■■■ changed files
layouts/_default/baseof.html 8 ●●●● patch | view | raw | blame | history
layouts/partials/site-scripts.html 7 ●●●● patch | view | raw | blame | history
src/webpack.config.js 4 ●●●● patch | view | raw | blame | history
layouts/_default/baseof.html
@@ -17,7 +17,13 @@
      <META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW">
    {{ end }}
    <link href='{{ "dist/main.css" | absURL }}' rel='stylesheet' type="text/css" />
    {{ $css_path := $.Param "dev.css_path" | default "themes/gohugo-theme-ananke/static/dist/css" }}
    {{ with $css_path }}
      {{ range readDir . }}
        <link href='/dist/css/{{ .Name }}' rel='stylesheet' type="text/css" data-turbolinks-track="reload" />
      {{ end }}
    {{ end }}
    {{ block "favicon" . }}
      {{ partial "site-favicon.html" . }}
    {{ end }}
layouts/partials/site-scripts.html
@@ -1 +1,6 @@
<script src="{{ "dist/app.bundle.js" | absURL }}" async></script>
{{ $css_path := $.Param "dev.js_path" | default "themes/gohugo-theme-ananke/static/dist/js" }}
{{ with $css_path }}
  {{ range readDir . }}
    <link href='/dist/js/{{ .Name }}' rel='stylesheet' type="text/css" data-turbolinks-track="reload" />
  {{ end }}
{{ end }}
src/webpack.config.js
@@ -30,7 +30,7 @@
    output: {
        path: path.join(__dirname, './../static/dist'),
        filename: '[name].[chunkhash].js'
        filename: 'js/[name].[chunkhash].js'
    },
    resolve: {
@@ -40,7 +40,7 @@
    plugins: [
        new ExtractTextPlugin({
            filename: getPath => {
                return getPath('[name].[contenthash].css');
                return getPath('css/[name].[contenthash].css');
            },
            allChunks: true
        })