diff --git a/2016/includes/class-Header.php b/2016/includes/class-Header.php index 2479f3b..1876909 100644 --- a/2016/includes/class-Header.php +++ b/2016/includes/class-Header.php @@ -1,200 +1,205 @@ . /** * Header of the website */ class Header { /** * Spawn the header * * @param $menu_uid string Menu entry UID (if any) or page title * @param $args array Header arguments */ static function spawn( $menu_uid = null, $args = [] ) { $menu = $menu_uid ? menu_entry( $menu_uid ) : null; $args = array_replace( [ 'show-title' => true, 'nav-title' => SITE_NAME_SHORT, 'head-title' => null, 'title' => $menu ? $menu->name : null, - 'url' => $menu ? $menu->url : null, + 'url' => $menu ? keep_url_in_language( $menu->url ) : null, 'not-found' => false, 'user-navbar' => true, 'container' => true, 'alert' => null, 'alert.type' => null, 'noindex' => NOINDEX ], $args ); if( ! isset( $args['og'] ) ) { $args['og'] = []; } $args['og'] = array_replace( [ 'image' => STATIC_URL . '/ld-2016-logo-purple.png', // It's better an absolute URL here 'type' => 'website', 'url' => $args['url'], 'title' => $args['title'] ], $args['og'] ); if( $args['head-title'] === null ) { $args['head-title'] = sprintf( __("%s - %s"), $args['title'], $args['nav-title'] ); } + // force the permalink to this URL + if( $args['url'] && FORCE_PERMALINK ) { + force_permalink( $args['url'] ); + } + header('Content-Type: text/html; charset=' . CHARSET); if( $args['not-found'] ) { header('HTTP/1.1 404 Not Found'); } enqueue_css('materialize'); enqueue_css('materialize.custom'); enqueue_css('materialize.icons'); enqueue_js('jquery'); enqueue_js('materialize'); // Close header - Start $args['container'] && inject_in_module('footer', function() { ?> getISO(); ?>
">