diff --git a/templates/main.js b/templates/main.js index 9273543a..266999e7 100755 --- a/templates/main.js +++ b/templates/main.js @@ -156,7 +156,14 @@ function changeStyle(styleName, link) { this.media = 'all'; mainStylesheetElement.media = 'none'; } - document.getElementById('stylesheet').href = styles[styleName]; + + let style = styles[styleName]; + if (style !== '') { + // Add the version of the resource if the style is not the embedded one. + style = style + '?v=' + resourceVersion; + } + + document.getElementById('stylesheet').href = style; selectedstyle = styleName; if (codestyles[styleName]) { @@ -571,6 +578,7 @@ function ready() { var post_date = "{{ config.post_date }}"; var max_images = {{ config.max_images }}; +var resourceVersion = document.currentScript.getAttribute('data-resource-version'); onReady(init);