diff --git a/2019/template/header.php b/2019/template/header.php index 8bd7b92..d1c7c9f 100644 --- a/2019/template/header.php +++ b/2019/template/header.php @@ -1,104 +1,121 @@ . /* * This is the header of the website */ /* * Args that should be passed: * + * $title (string) Page title * $conference (object) Current conference * $intro (true|undefined) If true, you want that damn splash screen * $og (array) OG meta tags * $canonical (string) Canonical link tag */ // do not visit directly defined( 'ABSPATH' ) or exit; +// site name +$sitename = $conference->getConferenceTitle(); + +// page title (if any) +$title = isset( $title ) ? $title : null; + +// page title +$title_dashed = $sitename; +if( isset( $title ) ) { + $title_dashed = sprintf( + __( "%s - %s" ), + $title, + $sitename + ); +} + // canonical URL $canonical = isset( $canonical ) ? $canonical : null; // if the canonical is specified, and we have to force the permalink, force that damn permalink if( $canonical && FORCE_PERMALINK ) { force_permalink( $canonical ); } // as default declare empty OG Meta tags if( ! isset( $args['og'] ) ) { $args['og'] = []; } // set default OG Meta tags $args['og'] = array_replace( [ 'url' => $canonical, 'image' => CURRENT_CONFERENCE_URL . '/images/linux-day-2019.png', // It's better an absolute URL here 'type' => 'website', - 'title' => $conference->getConferenceTitle(), + 'title' => $title, ], $args['og'] ); ?> -<?= esc_html( $conference->getConferenceTitle() ) ?> +<?= esc_html( $title_dashed ) ?> "> $value ): ?> $conference, 'top_nav_collapse' => !isset( $intro ), ] ); if( isset( $intro ) ) { template( 'intro' ); }