From c48f06702cde15bbf400888c230a246babcca119 Mon Sep 17 00:00:00 2001 From: Kevin Ansfield Date: Wed, 5 Apr 2017 14:08:15 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20fix=20broken=20assets=20(#616)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit closes https://github.com/TryGhost/Ghost/issues/8270 - add `.jpeg` to the list of asset extensions that get fingerprinted - remove the use of the `{{gh-path "asset" ...}}` helper - since switching to hash-location URLs all assets can now be referenced relatively and removing usage of the helper prevents it getting in the way of ember-cli's asset fingerprinting/rewriting mechanism --- ghost/admin/app/helpers/gh-path.js | 3 ++ ghost/admin/app/templates/-contributors.hbs | 40 +++++++++---------- ghost/admin/app/templates/about.hbs | 2 +- ghost/admin/app/templates/error.hbs | 2 +- .../admin/app/templates/settings/apps/amp.hbs | 2 +- .../app/templates/settings/apps/index.hbs | 4 +- .../app/templates/settings/apps/slack.hbs | 2 +- ghost/admin/app/templates/setup/one.hbs | 2 +- ghost/admin/app/templates/setup/three.hbs | 2 +- ghost/admin/ember-cli-build.js | 5 ++- 10 files changed, 35 insertions(+), 29 deletions(-) diff --git a/ghost/admin/app/helpers/gh-path.js b/ghost/admin/app/helpers/gh-path.js index 5f1a33ad3c..a9d1358eb4 100644 --- a/ghost/admin/app/helpers/gh-path.js +++ b/ghost/admin/app/helpers/gh-path.js @@ -7,6 +7,9 @@ import ghostPaths from 'ghost-admin/utils/ghost-paths'; // {{gh-path}} or {{gh-path 'blog'}} for Ghost's root (/myblog/) // {{gh-path 'admin'}} for Ghost's admin root (/myblog/ghost/) // {{gh-path 'api'}} for Ghost's api root (/myblog/ghost/api/v0.1/) +// +// DO NOT USE - admin asset paths are now relative because we are using hash urls +// and the gh-path helper can get in the way of asset rewriting // {{gh-path 'asset' '/img/hi.png'}} for resolved url (/myblog/ghost/assets/img/hi.png) export default helper(function (params) { diff --git a/ghost/admin/app/templates/-contributors.hbs b/ghost/admin/app/templates/-contributors.hbs index 1478916fa7..127ffd0cca 100644 --- a/ghost/admin/app/templates/-contributors.hbs +++ b/ghost/admin/app/templates/-contributors.hbs @@ -1,100 +1,100 @@
- JohnONolan + JohnONolan
- ErisDS + ErisDS
- sebgie + sebgie
- frantzypants + frantzypants
- cobbspur + cobbspur
- kevinansfield + kevinansfield
- GeorginaLusby + GeorginaLusby
- AileenCGN + AileenCGN
- kirrg001 + kirrg001
- disordinary + disordinary
- acburdine + acburdine
- dbalders + dbalders
- felixrieseberg + felixrieseberg
- jaswilli + jaswilli
- halfdan + halfdan
- kevinkucharczyk + kevinkucharczyk
- mixonic + mixonic
- rwjblue + rwjblue
- tgriesser + tgriesser
- bnookala + bnookala
diff --git a/ghost/admin/app/templates/about.hbs b/ghost/admin/app/templates/about.hbs index a175a4d224..46d6ec5584 100644 --- a/ghost/admin/app/templates/about.hbs +++ b/ghost/admin/app/templates/about.hbs @@ -4,7 +4,7 @@
- +
{{gh-upgrade-notification}} diff --git a/ghost/admin/app/templates/error.hbs b/ghost/admin/app/templates/error.hbs index 0fd7c65909..5e6b9c21fe 100644 --- a/ghost/admin/app/templates/error.hbs +++ b/ghost/admin/app/templates/error.hbs @@ -1,7 +1,7 @@
- +

{{code}}

{{message}}

diff --git a/ghost/admin/app/templates/settings/apps/amp.hbs b/ghost/admin/app/templates/settings/apps/amp.hbs index 75062fd22d..5f03c96527 100644 --- a/ghost/admin/app/templates/settings/apps/amp.hbs +++ b/ghost/admin/app/templates/settings/apps/amp.hbs @@ -8,7 +8,7 @@
- +

AMP

diff --git a/ghost/admin/app/templates/settings/apps/index.hbs b/ghost/admin/app/templates/settings/apps/index.hbs index 3925ddce67..dec8f69340 100644 --- a/ghost/admin/app/templates/settings/apps/index.hbs +++ b/ghost/admin/app/templates/settings/apps/index.hbs @@ -9,7 +9,7 @@ {{#link-to "settings.apps.slack" id="slack-link"}}
-
+

Slack

A team communication tool

@@ -33,7 +33,7 @@ {{#link-to "settings.apps.amp" id="amp-link"}}
-
+

AMP

Google Accelerated Mobile Pages

diff --git a/ghost/admin/app/templates/settings/apps/slack.hbs b/ghost/admin/app/templates/settings/apps/slack.hbs index 079783ffda..d59f35dada 100644 --- a/ghost/admin/app/templates/settings/apps/slack.hbs +++ b/ghost/admin/app/templates/settings/apps/slack.hbs @@ -8,7 +8,7 @@
- +

Slack

diff --git a/ghost/admin/app/templates/setup/one.hbs b/ghost/admin/app/templates/setup/one.hbs index bf5825c18e..8defc05273 100644 --- a/ghost/admin/app/templates/setup/one.hbs +++ b/ghost/admin/app/templates/setup/one.hbs @@ -4,7 +4,7 @@
- Ghost screenshot + Ghost screenshot
{{#link-to "setup.two" classNames="gh-btn gh-btn-green gh-btn-lg"}} diff --git a/ghost/admin/app/templates/setup/three.hbs b/ghost/admin/app/templates/setup/three.hbs index d330c807ec..1d5933d16f 100644 --- a/ghost/admin/app/templates/setup/three.hbs +++ b/ghost/admin/app/templates/setup/three.hbs @@ -3,7 +3,7 @@

Ghost works best when shared with others. Collaborate, get feedback on your posts & work together on ideas.

-
+
{{#gh-form-group errors=errors hasValidated=hasValidated property="users"}} diff --git a/ghost/admin/ember-cli-build.js b/ghost/admin/ember-cli-build.js index b6e301b2cc..71bd3eb370 100644 --- a/ghost/admin/ember-cli-build.js +++ b/ghost/admin/ember-cli-build.js @@ -120,7 +120,10 @@ module.exports = function (defaults) { plugins: postcssPlugins() } }, - fingerprint: {enabled: true}, + fingerprint: { + enabled: true, + extensions: ['js', 'css', 'png', 'jpg', 'jpeg', 'gif', 'map'] + }, nodeAssets: { 'blueimp-md5': { import: ['js/md5.js']