Ghost/core/test/unit
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
..
api 💄 🐷 Test consistency (#8199) 2017-03-21 09:24:11 +01:00
auth 🐛 subscriber: sanitize email vol. 2 (#8280) 2017-04-05 22:02:16 +01:00
config 😱 🎨 Refactor storage adapter (#8229) 2017-04-05 15:10:34 +01:00
controllers/frontend 💄 🐷 Test consistency (#8199) 2017-03-21 09:24:11 +01:00
mail 💄 🐷 Test consistency (#8199) 2017-03-21 09:24:11 +01:00
metadata 🙇 Blog icon utils and publisher.logo for JSON-LD (#8297) 2017-04-11 18:32:06 +02:00
middleware 🙇 Blog icon utils and publisher.logo for JSON-LD (#8297) 2017-04-11 18:32:06 +02:00
models/base 🎨 change last_login to last_seen (#8259) 2017-04-05 20:45:55 +01:00
models_plugins 💄 🐷 Test consistency (#8199) 2017-03-21 09:24:11 +01:00
scheduling 🐛 subscriber: sanitize email vol. 2 (#8280) 2017-04-05 22:02:16 +01:00
server_helpers 🐛 Blog icon improvements (#8298) 2017-04-10 12:04:46 +01:00
sitemap 💄 🐷 Test consistency (#8199) 2017-03-21 09:24:11 +01:00
storage 😱 🎨 Refactor storage adapter (#8229) 2017-04-05 15:10:34 +01:00
themes Helper Proxy & single express-hbs instance (#8225) 2017-04-04 18:07:35 +02:00
utils 🙇 Blog icon utils and publisher.logo for JSON-LD (#8297) 2017-04-11 18:32:06 +02:00
admin_spec.js 💄 🐷 Test consistency (#8199) 2017-03-21 09:24:11 +01:00
api_utils_spec.js 💄 🐷 Test consistency (#8199) 2017-03-21 09:24:11 +01:00
apps_filters_spec.js 💄 🐷 Test consistency (#8199) 2017-03-21 09:24:11 +01:00
apps_spec.js Helper Proxy & single express-hbs instance (#8225) 2017-04-04 18:07:35 +02:00
errors_spec.js 💄 🐷 Test consistency (#8199) 2017-03-21 09:24:11 +01:00
exporter_spec.js 💄 🐷 Test consistency (#8199) 2017-03-21 09:24:11 +01:00
filters_spec.js 💄 🐷 Test consistency (#8199) 2017-03-21 09:24:11 +01:00
ghost_url_spec.js 💁🏻 Moveshared/ to server/public (#8273) 2017-04-07 13:21:41 +01:00
importer_spec.js 😱 🎨 Refactor storage adapter (#8229) 2017-04-05 15:10:34 +01:00
migration_fixture_utils_spec.js 💄 🐷 Test consistency (#8199) 2017-03-21 09:24:11 +01:00
migration_spec.js add issued_by column to access token (#8284) 2017-04-11 13:12:14 +01:00
permissions_spec.js 💄 🐷 Test consistency (#8199) 2017-03-21 09:24:11 +01:00
rss_spec.js 🐝 Add image property to rss (#8289) 2017-04-11 13:54:52 +02:00
server_helpers_index_spec.js Helper Proxy & single express-hbs instance (#8225) 2017-04-04 18:07:35 +02:00
server_helpers_template_spec.js Helper Proxy & single express-hbs instance (#8225) 2017-04-04 18:07:35 +02:00
server_utils_spec.js 💄 🐷 Test consistency (#8199) 2017-03-21 09:24:11 +01:00
showdown_client_integrated_spec.js 💄 🐷 Test consistency (#8199) 2017-03-21 09:24:11 +01:00
slack_spec.js 👋🏼 Don't use ghosticon.jpg from admin assets (#8285) 2017-04-07 14:07:47 +01:00
social-urls_spec.js improvement: jshint/jscs 2016-06-17 22:59:47 +02:00
utils_pipeline_spec.js 💄 🐷 Test consistency (#8199) 2017-03-21 09:24:11 +01:00
validation_spec.js 💄 🐷 Test consistency (#8199) 2017-03-21 09:24:11 +01:00
xmlrpc_spec.js 💄 🐷 Test consistency (#8199) 2017-03-21 09:24:11 +01:00