@@ -45,23 +45,24 @@ protected function renderHeader() {
4545 }
4646
4747 protected function renderMeta () {
48- $ rc = '<meta charset="utf-8"> ' .
49- '<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> ' .
50- '<meta name="pageclass" content=" ' .get_class ($ this ->page ).'"> ' ;
51- // keywords
52- $ keywords = $ this ->page ->getMetaKeywords ();
53- if ($ keywords != NULL ) {
54- if (is_array ($ keywords )) $ keywords = implode (', ' , $ keywords );
55- $ rc .= '<meta name="keywords" content=" ' .htmlentities ($ keywords ).'"> ' ;
48+ $ rc = '<meta charset="utf-8"> ' ;
49+
50+ // Meta
51+ $ meta = $ this ->page ->getMeta ();
52+
53+ // Some specifics
54+ if (!isset ($ meta ['viewport ' ])) $ meta ['viewport ' ] = 'width=device-width, initial-scale=1, shrink-to-fit=no ' ;
55+ if (!isset ($ meta ['pageclass ' ])) $ meta ['pageclass ' ] = get_class ($ this ->page );
56+ if (!isset ($ meta ['canonical ' ])) {
57+ $ params = $ this ->app ->request ->params ? '? ' .$ this ->app ->request ->params : '' ;
58+ $ meta ['canonical ' ] = $ this ->app ->router ->getCanonicalPath ().$ params ;
5659 }
57- // descriptions
58- $ description = $ this -> page -> getMetaDescription ();
59- if ( $ description != NULL ) {
60- $ rc .= '<meta name="description " content=" ' .htmlentities ($ description ).'"> ' ;
60+
61+ foreach ( $ meta AS $ name => $ content ) {
62+ $ s = is_array ( $ content ) ? implode ( ' , ' , $ content ) : $ content ;
63+ $ rc .= '<meta name=" ' . $ name . ' " content=" ' .htmlentities ($ s ).'"> ' ;
6164 }
62- // canonical
63- $ params = $ this ->app ->request ->params ? '? ' .$ this ->app ->request ->params : '' ;
64- $ rc .= '<meta name="canonical" content=" ' .htmlentities ($ this ->app ->router ->getCanonicalPath ().$ params ).'"> ' ;
65+
6566 // Alternates
6667 foreach ($ this ->app ->router ->getLanguages () AS $ key => $ label ) {
6768 if ($ key != $ this ->app ->request ->language ) {
0 commit comments