Commit 847b3e6c authored by Pablo Rauzy's avatar Pablo Rauzy
Browse files

add meta tags for social networks

parent 24ea08a2
......@@ -182,7 +182,7 @@ function render ($file, $mode='edit', $entry_dt='NEW') {
$page_entries = array_filter($entries, function ($e) use ($file) { return $e['page'] == $file; });
$relroot = str_repeat('../', substr_count($file, '/'));
$title_head = str_replace(array('%site%', '%group%', '%page%'),
array($settings['title'], strip_tags($groups[$group]['name']), $page['title']),
array($settings['title'], $groups[$group]['name'], $page['title']),
$settings['title_hformat']);
$title_body = str_replace(array('%site%', '%group%', '%page%'),
array($settings['title'], $groups[$group]['name'], $page['title']),
......@@ -194,7 +194,7 @@ function render ($file, $mode='edit', $entry_dt='NEW') {
?><!doctype HTML>
<html>
<head>
<title><?php echo $title_head; ?></title>
<title><?php echo strip_tags($title_head); ?></title>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width" />
<?php if ($mode != 'publish'): ?>
......@@ -204,6 +204,11 @@ function render ($file, $mode='edit', $entry_dt='NEW') {
<link rel="stylesheet" href="<?php echo ((strpos($settings['css'], '//') === false) ? $relroot : ''),$settings['css']; ?>" type="text/css" media="screen" />
<?php endif; ?>
<link rel="alternate" type="application/rss+xml" href="<?php echo $relroot; ?>updates.rss" title="Updates from <?php echo $settings['title']; ?>" />
<meta property="og:title" content="<?php echo strip_tags($title_head); ?>" />
<meta property="og:description" content="<?php echo strip_tags($settings['title']); ?>" />
<meta property="og:image" content="<?php echo ((strpos($settings['logo'], '//') === false) ? $settings['url'] : ''),$settings['logo']; ?>" />
<meta property="og:url" content="<?php echo $settings['url'],preg_replace('/\/?index\.html$/', '/', $file); ?>" />
<meta name="twitter:card" content="summary" />
</head>
<body class="<?php echo str_replace('/', ' ', substr($file, 0, -5)); ?>">
<div id="head">
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment