From 1dbd3e9c118ab18e9308dcfcf77c4d7f20206a92 Mon Sep 17 00:00:00 2001 From: Eric Jinks Date: Tue, 23 Jan 2018 11:04:04 +1000 Subject: [PATCH 1/9] Update getImageUrl with additional conditionals --- src/util/getImageUrl.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/util/getImageUrl.js b/src/util/getImageUrl.js index 52e4de6..bda795f 100644 --- a/src/util/getImageUrl.js +++ b/src/util/getImageUrl.js @@ -11,7 +11,7 @@ const parseFilename = filename => { } const getImageSrcset = path => { - if (path.match(/^http/) || path.match(/svg$/)) return null + if (!path || path.match(/^http/) || path.match(/svg$/) || window.CMS) { return null } const { filename, extname } = parseFilename(path) const pathname = encodeURI(filename.replace(outputDir, resizedDir)) @@ -22,7 +22,7 @@ const getImageSrcset = path => { } const getImageSrc = (path, sizeRequested) => { - if (path.match(/^http/) || path.match(/svg$/)) return path + if (!path || path.match(/^http/) || path.match(/svg$/) || window.CMS) { return path } sizeRequested = parseInt(sizeRequested, 10) let size if (sizeRequested) { From d03e6e5dbe75474a6cddf7463e12061f57a44159 Mon Sep 17 00:00:00 2001 From: Eric Jinks Date: Tue, 23 Jan 2018 11:07:39 +1000 Subject: [PATCH 2/9] Update sw-precache --- sw-precache-config.js | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/sw-precache-config.js b/sw-precache-config.js index caf4c37..0f714a1 100644 --- a/sw-precache-config.js +++ b/sw-precache-config.js @@ -3,11 +3,9 @@ module.exports = { stripPrefix: 'build/', staticFileGlobs: [ 'build/**/*.html', - 'build/**/*.svg', - 'build/images/*.jpg', - 'build/images/uploads/resized/*.jpg', - 'build/**/*.png', - 'build/**/*.gif', + 'build/**/*.svg', // all svgs + 'build/images/*.+(jpg|png|gif)', + 'build/images/uploads/**/*10.+(jpg|png|gif)', // 10px resized images 'build/**/*.ico', 'build/**/*.json', 'build/static/**/!(*map*)', From 71266f7d87be03483f196bb2ded78886feaf6d25 Mon Sep 17 00:00:00 2001 From: Eric Jinks Date: Tue, 23 Jan 2018 11:10:21 +1000 Subject: [PATCH 3/9] Update netlify-cms@1.03 --- public/admin/admin.css | 37 ++++++++++++++++++++++++++++++++++++- public/admin/index.html | 4 ++-- 2 files changed, 38 insertions(+), 3 deletions(-) diff --git a/public/admin/admin.css b/public/admin/admin.css index ecc8c53..c2233ca 100644 --- a/public/admin/admin.css +++ b/public/admin/admin.css @@ -1,4 +1,4 @@ -/* Admin tweaks 1.0.2 */ +/* Admin tweaks 1.0.3 */ .nc-mediaLibrary-cardImage { object-fit: contain; height: auto; @@ -33,6 +33,11 @@ width: auto; } +.nc-entryListing-cardImage { + background-size: contain; + background-color: whitesmoke; +} + .nc-mediaLibrary-cardText { margin: 0; } @@ -41,3 +46,33 @@ display: flex; flex-direction: column; } + +/* Custom logo */ + +/* .nc-githubAuthenticationPage-logo { + background-image: url(/images/teeth-on-ferry-logo@2x.png); + background-position: center; + background-repeat: no-repeat; + background-size: 200px; +} + +.nc-githubAuthenticationPage-logo svg { + display: none; +} + +.nc-githubAuthenticationPage-button { + text-indent: -1000px; + overflow: hidden; + width: 8rem; +} + +.nc-githubAuthenticationPage-button:after { + content: 'Login'; + display: block; + position: absolute; + left: 50%; + top: 50%; + transform: translate(-50%, -50%); + width: auto; + text-indent: 0; +} */ diff --git a/public/admin/index.html b/public/admin/index.html index 8823f34..1fc9876 100644 --- a/public/admin/index.html +++ b/public/admin/index.html @@ -6,14 +6,14 @@ Content Manager - + - +