Skip to content

Instantly share code, notes, and snippets.

@good
Created March 20, 2014 17:02
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save good/9668709 to your computer and use it in GitHub Desktop.
Save good/9668709 to your computer and use it in GitHub Desktop.
Custom meta description based on page content for Kirby
<?php snippet('header', array('section' => 'journal', 'title' => $page->title(), 'customdesc' => $page->text())); ?>
<meta name="description" content="<?php if(isset($customdesc)) { echo html($customdesc); } else { echo html($site->description()); } ?>" />
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment