add Open Graph meta tags (fancy TG, FB etc. previews)
This commit is contained in:
parent
ce4e43f78a
commit
ba55dd5470
2 changed files with 23 additions and 0 deletions
|
@ -10,6 +10,25 @@
|
||||||
<link rel="stylesheet" type="text/css" href="assets/main.css">
|
<link rel="stylesheet" type="text/css" href="assets/main.css">
|
||||||
<link rel="icon" type="image/png" href="/favicon.png">
|
<link rel="icon" type="image/png" href="/favicon.png">
|
||||||
|
|
||||||
|
<?php if ($selected_doc): ?>
|
||||||
|
<meta property="og:title" content="The /-\ Pile: <?= $selected_doc['Title'] ?>"/>
|
||||||
|
<meta property="og:url" content="https://pile.sdbs.cz/?item=<?= $selected_doc['ID'] ?>"/>
|
||||||
|
<meta property="og:description" content="<?= $selected_doc['Description'] ?>"/>
|
||||||
|
<meta property="og:type" content="article"/>
|
||||||
|
<?php elseif ($selected_tag): ?>
|
||||||
|
<meta property="og:title" content="The /-\ Pile: Documents under '<?= $selected_tag['Name'] ?>'"/>
|
||||||
|
<meta property="og:url" content="https://pile.sdbs.cz/?tag=<?= $selected_tag['ID'] ?>"/>
|
||||||
|
<meta property="og:description" content="<?= $selected_tag['Description'] ?>"/>
|
||||||
|
<meta property="og:type" content="website"/>
|
||||||
|
<?php else: ?>
|
||||||
|
<meta property="og:title" content="The /-\ Pile"/>
|
||||||
|
<meta property="og:type" content="website"/>
|
||||||
|
<meta property="og:url" content="https://pile.sdbs.cz/"/>
|
||||||
|
<meta property="og:description"
|
||||||
|
content="This is where we upload the stuff we consider important to the larger conceptual and thematic landscape of what we do: confronting apathy, inter-subjectivity, the human right to self-determination, counter-culture and such..."/>
|
||||||
|
<?php endif; ?>
|
||||||
|
<meta property="og:image" content="https://pile.sdbs.cz/favicon.png"/>
|
||||||
|
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
|
||||||
|
|
|
@ -13,6 +13,7 @@ if (isset($_GET["item"])) {
|
||||||
|
|
||||||
$doc_template = new Template();
|
$doc_template = new Template();
|
||||||
$doc_template->doc = $doc;
|
$doc_template->doc = $doc;
|
||||||
|
$selected_doc = $doc;
|
||||||
$content = $doc_template->render('front_doc_overview.php');
|
$content = $doc_template->render('front_doc_overview.php');
|
||||||
} elseif (isset($_GET["tag"])) {
|
} elseif (isset($_GET["tag"])) {
|
||||||
$doc_list_template = new Template();
|
$doc_list_template = new Template();
|
||||||
|
@ -27,6 +28,7 @@ if (isset($_GET["item"])) {
|
||||||
}
|
}
|
||||||
$docs = $db->listDocs($tag["ID"]);
|
$docs = $db->listDocs($tag["ID"]);
|
||||||
$tag["Description"] = $pd->text($tag["Description"]);
|
$tag["Description"] = $pd->text($tag["Description"]);
|
||||||
|
$selected_tag = $tag;
|
||||||
$doc_list_template->tag = $tag;
|
$doc_list_template->tag = $tag;
|
||||||
}
|
}
|
||||||
$doc_list_template->docs = $docs;
|
$doc_list_template->docs = $docs;
|
||||||
|
@ -43,5 +45,7 @@ $page->none_count = $db->getUntaggedDocCount();
|
||||||
$page->tags = $db->getTags();
|
$page->tags = $db->getTags();
|
||||||
$page->content = $content;
|
$page->content = $content;
|
||||||
$page->logged = isset($_SESSION["ID"]);
|
$page->logged = isset($_SESSION["ID"]);
|
||||||
|
$page->selected_doc = $selected_doc;
|
||||||
|
$page->selected_tag = $selected_tag;
|
||||||
echo $page->render('front_wrap.php');
|
echo $page->render('front_wrap.php');
|
||||||
?>
|
?>
|
||||||
|
|
Loading…
Reference in a new issue