@@ -335,23 +335,15 @@ public function getPageFilePath($filename)
335
335
// Find without controller parameter as sub directory
336
336
if (is_file ($ filePath = $ pageDirectory . $ filename . '.mobile ' . $ pageExtension )) {
337
337
return realpath ($ filePath );
338
- break ; // break extension
339
- break ; // break directory
340
338
} elseif (is_file ($ filePath = $ pageDirectory . $ filename . DIRECTORY_SEPARATOR . 'index.mobile ' . $ pageExtension )) {
341
339
return realpath ($ filePath );
342
- break ; // break extension
343
- break ; // break directory
344
340
}
345
341
}
346
342
347
343
if (is_file ($ filePath = $ pageDirectory . $ filename . $ pageExtension )) {
348
344
return realpath ($ filePath );
349
- break ; // break extension
350
- break ; // break directory
351
345
} elseif (is_file ($ filePath = $ pageDirectory . $ filename . DIRECTORY_SEPARATOR . 'index ' . $ pageExtension )) {
352
346
return realpath ($ filePath );
353
- break ; // break extension
354
- break ; // break directory
355
347
}
356
348
}
357
349
}
@@ -804,6 +796,9 @@ public function render(array $options = [])
804
796
}
805
797
}
806
798
799
+ // Microsoft TileImage
800
+ presenter ()->meta ->offsetSet ('msapplication-TileImage ' , images_url (pathinfo (presenter ()->favicon , PATHINFO_DIRNAME ) . '/144x144/ ' . pathinfo (presenter ()->favicon , PATHINFO_BASENAME )));
801
+
807
802
if (presenter ()->meta ->count ()) {
808
803
$ meta = presenter ()->meta ->getArrayCopy ();
809
804
@@ -841,9 +836,49 @@ public function render(array $options = [])
841
836
*/
842
837
$ this ->document ->linkNodes ->createElement ([
843
838
'rel ' => 'manifest ' ,
844
- 'href ' => '/manifest.json ' ,
839
+ 'href ' => base_url () . '/manifest.json ' ,
840
+ ]);
841
+
842
+ /**
843
+ * Injecting Favicons
844
+ */
845
+ $ this ->document ->linkNodes ->createElement ([
846
+ 'rel ' => 'icon ' ,
847
+ 'type ' => 'image/jpg ' ,
848
+ 'href ' => images_url (pathinfo (presenter ()->favicon , PATHINFO_DIRNAME ) . '/ ' . pathinfo (presenter ()->favicon , PATHINFO_BASENAME )),
845
849
]);
846
850
851
+ $ appleFavicons = [
852
+ '57x57 ' ,
853
+ '60x60 ' ,
854
+ '72x72 ' ,
855
+ '76x76 ' ,
856
+ '114x114 ' ,
857
+ '120x120 ' ,
858
+ '144x144 ' ,
859
+ '152x152 ' ,
860
+ '180x180 '
861
+ ];
862
+ foreach ($ appleFavicons as $ appleFavicon ) {
863
+ $ this ->document ->linkNodes ->createElement ([
864
+ 'rel ' => 'apple-touch-icon ' ,
865
+ 'href ' => images_url (pathinfo (presenter ()->favicon , PATHINFO_DIRNAME ) . '/ ' . $ appleFavicon . '/ ' . pathinfo (presenter ()->favicon , PATHINFO_BASENAME )),
866
+ ]);
867
+ }
868
+
869
+ $ androidFavicons = [
870
+ '192x192 ' ,
871
+ '32x32 ' ,
872
+ '96x96 ' ,
873
+ '16x16 '
874
+ ];
875
+ foreach ($ androidFavicons as $ andoidFavicon ) {
876
+ $ this ->document ->linkNodes ->createElement ([
877
+ 'rel ' => 'icon ' ,
878
+ 'href ' => images_url (pathinfo (presenter ()->favicon , PATHINFO_DIRNAME ) . '/ ' . $ andoidFavicon . '/ ' . pathinfo (presenter ()->favicon , PATHINFO_BASENAME )),
879
+ ]);
880
+ }
881
+
847
882
if (controller ()->getReflection ()->hasMethod ('output ' )) {
848
883
controller ()->getInstance ()->output ($ this ->document );
849
884
}
0 commit comments