]> git.bts.cx Git - cx.git/blobdiff - cx/templates/public/base.php
Don't break when there's no hero image
[cx.git] / cx / templates / public / base.php
index 83fef3d3b3f21218afb2a7f852a2f97366c22c98..f5e96705717a3affa791166a1675b54b0d9b3213 100644 (file)
@@ -5,18 +5,31 @@
        <meta charset="UTF-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <meta charset="UTF-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
+
+       <?php if (isset($cx_post_title)): ?>
+       <title><?= cx_site_name(); ?> - <?= $cx_post_title; ?></title>
+       <?php else: ?>
        <title><?= cx_site_name(); ?></title>
        <title><?= cx_site_name(); ?></title>
+       <?php endif; ?>
+
        <link rel="stylesheet" href="<?= cx_url('/design/css/style.css') ?>">
        <link rel="alternate" type="application/rss+xml" title="bts.cx" href="<?= cx_url('/feed/') ?>" />
 
        <?php if (isset($cx_post_meta)): ?>
        
        <link rel="stylesheet" href="<?= cx_url('/design/css/style.css') ?>">
        <link rel="alternate" type="application/rss+xml" title="bts.cx" href="<?= cx_url('/feed/') ?>" />
 
        <?php if (isset($cx_post_meta)): ?>
        
-       <meta property="og:title" content="<?= cx_site_name(); ?>">
+       <meta property="og:title" content="<?= cx_site_name(); ?> - <?= $cx_post_title; ?>">
        <meta property="og:type" content="article" />
        <meta property="og:type" content="article" />
+
+       <?php if (isset($cx_post_meta->hero_image)): ?>
        <meta property="og:image" content="<?= $cx_post_meta->hero_image; ?>">
        <meta property="og:image" content="<?= $cx_post_meta->hero_image; ?>">
+       <?php endif; ?>
+
        <meta property="og:url" content="<?= cx_url_site($cx_post_permalink); ?>">
        <meta name="twitter:card" content="summary_large_image">
        <meta property="og:url" content="<?= cx_url_site($cx_post_permalink); ?>">
        <meta name="twitter:card" content="summary_large_image">
+
+       <?php if (isset($cx_post_meta->hero_image_alt)): ?>
        <meta name="twitter:image:alt" content="<?= $cx_post_meta->hero_image_alt; ?>">
        <meta name="twitter:image:alt" content="<?= $cx_post_meta->hero_image_alt; ?>">
+       <?php endif; ?>
 
        <?php /*<meta property="og:description" content="Offering tour packages for individuals or groups.">
        <meta property="og:site_name" content="<?= cx_site_name(); ?>">
 
        <?php /*<meta property="og:description" content="Offering tour packages for individuals or groups.">
        <meta property="og:site_name" content="<?= cx_site_name(); ?>">