Jeremy Newman : set title and open graph

Jeremy Newman jnewman at wine.codeweavers.com
Thu Oct 23 11:26:20 CDT 2014


Module: website
Branch: master
Commit: b6a5b8b769a84e5b3686d3c4d6e971016ef34b39
URL:    http://source.winehq.org/git/website.git/?a=commit;h=b6a5b8b769a84e5b3686d3c4d6e971016ef34b39

Author: Jeremy Newman <jnewman at codeweavers.com>
Date:   Thu Oct 23 11:18:01 2014 -0500

set title and open graph

---

 include/plugins/announce.php | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/include/plugins/announce.php b/include/plugins/announce.php
index 5000fc5..e14158a 100644
--- a/include/plugins/announce.php
+++ b/include/plugins/announce.php
@@ -14,12 +14,19 @@ $ver = PAGE_PARAMS;
 $tag = ($ver == "latest") ? "master" : "wine-" . urlencode($ver);
 $announce = $config->git_tree . "/wine.git/" . $tag . ":ANNOUNCE";
 
+// announce title
+$title = "";
+
 // load announce
 if ($arr = file($announce))
 {
     $in_header = 1;
+    $x = 0;
     while (list($c,$val) = each($arr))
     {
+        if ($c == 0)
+            $title = $html->encode(trim($arr[$c]));
+
         $arr[$c] = $html->urlify($arr[$c]);
 
         if (preg_match("/^--------------------/", $arr[$c])) $in_header = 0;
@@ -43,10 +50,14 @@ if ($arr = file($announce))
                                     "\\1<a href=\"".$config->bug_system."\\2\">\\2</a>",
                                     $arr[$c]);
         }
+
+        $x++;
     }
     $announce = join("",$arr);
 
     // display page
+    $html->meta_og['title'] = $title;
+    $html->page_title .= " - {$title}";
     echo $html->pre($announce);
 }
 else




More information about the wine-cvs mailing list