Ghost/core/server
Aileen Nowak e19e91044d 🙇 Blog icon utils and publisher.logo for JSON-LD (#8297)
refs #8221, closes #7688, refs #7558

🙇  Improve meta data publisher logo behaviour
This is a follow-up PR for #8285.

Reasons: The code changes of #8285 caused error messages when falling back to the default `favicon.ico`, as the `image-size` tool doesn't support `ico` files.

This PR takes the logic to decide which logo needs to be listed in our schema into a new fn `blog_logo.js`. There we have now three decisions:
1. If we have a publication **logo**, we'll take that one
2. If we have no publication logo, but an **icon** we'll use this one.
3. If we have none of the above things, we fall back to our default `favicon.ico`

Additional, we're hard coding image dimensions for whenever the logo is an `.ico` file and built and extra decision to not call `image-size` when the dimension are already given.

I will create another follow-up PR, which checks the extension type for the file and offers it as a util.

🛠  Blog icon util

refs #7688

Serve functionality around the blog icon in its own util:
- getIconDimensions -> async function that takes the filepath of on ico file and returns its dimensions
- isIcoImageType -> returns true if file has `.ico` extension
- getIconType -> returns icon-type (`x-icon` or `png`)
- getIconUrl -> returns the absolut or relativ URL for the favicon: `[subdirectory or not]favicon.[ico or png]`

📖  Get .ico sizes for meta data & logo improvement

refs #7558
refs #8221

Use the new `blogIconUtil` in meta data to fetch the dimensions of `.ico` files.

Improvements for `publisher.logo`: We're now returning a hard-coded 'faked' image dimensions value to render an `imageObject` and prevent error our schema (Google structured data). As soon as an image (`.ico` or non-`.ico`) is too large, but - in case of non-`.ico` - a square format, be set the image-dimensions to 60px width and height. This reduces the chances of getting constantly error messages from Googles' webmaster tools.

- add getIconPath util
2017-04-11 18:32:06 +02:00
..
admin grunt dev admin livereload (#8176) 2017-03-30 13:27:07 +01:00
api 🎨 delete all content: do not delete subscribers (#8282) 2017-04-05 21:57:41 +01:00
apps Asset amends (#8294) 2017-04-10 11:30:21 +02:00
auth add issued_by column to access token (#8284) 2017-04-11 13:12:14 +01:00
blog Asset amends (#8294) 2017-04-10 11:30:21 +02:00
config Asset amends (#8294) 2017-04-10 11:30:21 +02:00
controllers/frontend Posts per page as theme-config (#8149) 2017-03-14 18:03:36 +01:00
data 🙇 Blog icon utils and publisher.logo for JSON-LD (#8297) 2017-04-11 18:32:06 +02:00
events post-scheduling 2016-06-14 10:52:13 +02:00
helpers 🙇 Blog icon utils and publisher.logo for JSON-LD (#8297) 2017-04-11 18:32:06 +02:00
mail 🎨 Ghost bootstrap: optimise requires (#8121) 2017-03-13 20:07:12 +00:00
middleware 🙇 Blog icon utils and publisher.logo for JSON-LD (#8297) 2017-04-11 18:32:06 +02:00
models Autofill plaintext field on save (#8304) 2017-04-11 10:55:36 +02:00
permissions 🐛 fix invite permissions for editor (#7889) 2017-01-25 12:07:31 +00:00
public 🎨 Blog icon improvements (#8260) 2017-04-11 13:40:17 +02:00
scheduling Shows help message for broken require in scheduler adapter (#7706) 2017-01-16 21:49:41 +01:00
settings 🔥 🎨 No more updateSettingsCache (#8090) 2017-03-02 23:00:01 +01:00
storage 😱 🎨 Refactor storage adapter (#8229) 2017-04-05 15:10:34 +01:00
themes 😱 🎨 Refactor storage adapter (#8229) 2017-04-05 15:10:34 +01:00
translations 🙇 Blog icon utils and publisher.logo for JSON-LD (#8297) 2017-04-11 18:32:06 +02:00
utils 🙇 Blog icon utils and publisher.logo for JSON-LD (#8297) 2017-04-11 18:32:06 +02:00
views Asset amends (#8294) 2017-04-10 11:30:21 +02:00
app.js 🐛 Fix the config for compression (#8226) 2017-04-03 10:58:07 +02:00
errors.js 🛠 use Ignition for logging/errors (#7869) 2017-01-23 11:04:01 +00:00
filters.js Misc grunt /dev updates 2015-05-28 20:25:14 +01:00
ghost-server.js Theme loading part 1 (#7989) 2017-02-22 00:26:19 +01:00
i18n.js improvement: general fixes 2016-06-01 07:07:20 +02:00
index.js 🎨 deny auto switch (#8086) 2017-03-02 19:50:58 +00:00
logging.js 🐛 forward missing logging config: rotation 2017-02-17 18:24:14 +01:00
overrides.js 🛠 update lodash,knex and bookshelf to latest versions 2016-09-26 10:20:55 +02:00
update-check.js 🎨 send LTS parameter if requesting the update check service (#7954) 2017-02-07 19:51:19 +01:00