Skip to content

Instantly share code, notes, and snippets.

@mauricerenck
Last active September 6, 2019 08:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mauricerenck/bd36f656390e0c64bbe92d2a3ed6a3f6 to your computer and use it in GitHub Desktop.
Save mauricerenck/bd36f656390e0c64bbe92d2a3ed6a3f6 to your computer and use it in GitHub Desktop.
<!-- Dublin Core -->
<meta name="DC.Title" content="<?php echo $title ?>">
<meta name="DC.Creator" content="<?php echo $site->author() ?>">
<meta name="DC.Rights" content="<?php echo $site->author() ?>">
<meta name="DC.Publisher" content="<?php echo $site->author() ?>">
<meta name="DC.Description" content="<?php echo $page->seoDescription() ?>">
<meta name="DC.Language" content="<?php echo $kirby->language()->code(); ?>">
<meta name="DC.Subject" content="<?php echo $page->seoKeywords() ?>">
<meta name="DC.Type" content="Text">
<meta name="DC.Format" content="text/html">
<meta name="DC.Identifier" content="<?php echo $site->url(); ?>">
<!-- Open Graph Basics -->
<meta property="og:url" content="<?php echo $page->url(); ?>">
<meta property="og:title" content="<?php echo $title; ?>">
<meta property="og:description" content="<?php echo $page->seoDescription(); ?>">
<meta property="og:site_name" content="<?php echo $site->author(); ?>">
<meta property="og:locale" content="<?php echo $kirby->language()->code(); ?>">
<?php if ($page->pagetype()->isNotEmpty() && $page->pagetype() == 'article'): ?>
<meta property="og:type" content="article">
<meta name="article:published_date" content="<?php echo date('c', $page->date()->toDate()); ?>">
<meta property="article:section" content="<?php echo $page->category(); ?>">
<meta property="article:tag" content="<?php echo $page->seoKeywords(); ?>">
<meta property="article:author" content="<?php echo $site->author(); ?>">
<?php else: ?>
<meta property="og:type" content="website">
<?php endif; ?>
<?php if ($page->facebookimage()->isNotEmpty()): ?>
<meta property="og:image" content="<?php echo $page->facebookimage()->toFile()->crop(1200, 630)->url(); ?>">
<meta property="og:image:width" content="1200">
<meta property="og:image:height" content="630">
<?php endif; ?>
<!-- twitter -->
<?php if ($page->twitterimage()->isNotEmpty()): ?>
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:image" content="<?php echo $page->twitterimage()->toFile()->crop(1024, 512)->url(); ?>">
<?php else: ?>
<meta name="twitter:card" content="summary">
<?php endif; ?>
<?php if ($page->twittertitle()->isNotEmpty()): ?>
<meta name="twitter:title" content="<?php echo $page->twittertitle(); ?>">
<?php endif; ?>
<?php if ($page->twitterteaser()->isNotEmpty()): ?>
<meta name="twitter:text_description" content="<?php echo $page->twitterteaser(); ?>">
<?php endif; ?>
<meta name="twitter:creator" content="<?php echo $site->twitter(); ?>">
<meta name="twitter:site" content="<?php echo $site->twitter(); ?>">
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment