From cd3aa54a12e937b3f4b4dc2849b73cc5dd5377a0 Mon Sep 17 00:00:00 2001 From: Flavio Copes Date: Thu, 3 Sep 2015 13:20:15 +0200 Subject: [PATCH 1/2] Focus on frontmatter in expert mode --- system/blueprints/pages/raw.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/system/blueprints/pages/raw.yaml b/system/blueprints/pages/raw.yaml index 55d06e72d..c880fb674 100644 --- a/system/blueprints/pages/raw.yaml +++ b/system/blueprints/pages/raw.yaml @@ -21,6 +21,7 @@ form: frontmatter: type: frontmatter label: PLUGIN_ADMIN.FRONTMATTER + autofocus: true content: type: markdown From 0ae486737f7117242612b8bb2ee217f75faa9556 Mon Sep 17 00:00:00 2001 From: Flavio Copes Date: Thu, 3 Sep 2015 15:12:02 +0200 Subject: [PATCH 2/2] Correctly generate 2x image too and make it available to srcset, fixes #133 --- system/src/Grav/Common/Page/Media.php | 4 ++-- system/src/Grav/Common/Page/Medium/MediumFactory.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/system/src/Grav/Common/Page/Media.php b/system/src/Grav/Common/Page/Media.php index 1b7ac2f0b..415f3e19b 100644 --- a/system/src/Grav/Common/Page/Media.php +++ b/system/src/Grav/Common/Page/Media.php @@ -88,7 +88,7 @@ class Media extends Getters $altMedium = $altMedium['file']; - $medium = MediumFactory::scaledFromMedium($altMedium, $ratio, 1); + $medium = MediumFactory::scaledFromMedium($altMedium, $ratio, 1)['file']; } if (!$medium) { @@ -116,7 +116,7 @@ class Media extends Getters continue; } - $types['alternative'][$i] = MediumFactory::scaledFromMedium($alternatives[$max], $max, $i); + $types['alternative'][$i] = MediumFactory::scaledFromMedium($alternatives[$max]['file'], $max, $i); } foreach ($types['alternative'] as $ratio => $altMedium) { diff --git a/system/src/Grav/Common/Page/Medium/MediumFactory.php b/system/src/Grav/Common/Page/Medium/MediumFactory.php index ffa6b8f50..e15524e77 100644 --- a/system/src/Grav/Common/Page/Medium/MediumFactory.php +++ b/system/src/Grav/Common/Page/Medium/MediumFactory.php @@ -140,6 +140,6 @@ class MediumFactory $medium = self::fromFile($file); $medium->set('size', $size); - return $medium; + return ['file' => $medium, 'size' => $size]; } }