Repository: acl-org/acl-anthology

Issue:
Open Graph protocol features in header
This is a request to add [Open Graph protocol (OGP)](http://ogp.me/) tags in the header of each paper page. 
Some websites that supports OGP can show users richer information, such as Slack with arXiv:
![Screenshot from 2019-06-10 16-05-52](https://user-images.githubusercontent.com/1023695/59178501-1b414e80-8b9a-11e9-8731-58748331f8c2.png)



Discussion:
This is a good idea. Do you have any interest in adding it? The script you'd modify is [create_hugo_pages.py](https://github.com/acl-org/acl-anthology/blob/master/bin/create_hugo_pages.py), which generates all the template files that Hugo then fills. I imagine this should be pretty simple. 
Also the template is here: [hugo/layouts/papers/single.html](https://github.com/acl-org/acl-anthology/blob/master/hugo/layouts/papers/single.html).
It's pretty simple and should only require additions to the template, nothing else.

I started adding something like this when I looked into customizing the Google Custom Search results, but never finished it when I noticed GCS didn't offer the features I thought it did.
Thanks! As long as I checked arXiv's source, it contains at least following tags:
* `og:title`
* `og:site_name`
* `og:url`
* `og:description`

Maybe we can also provide `og:type` as `article` and [relevant metadata](http://ogp.me/#type_article) such as `published_time` and `author`.
@odashi, would you be willing to add these to [the template listed above](https://github.com/acl-org/acl-anthology/blob/master/hugo/layouts/papers/single.html) and submit a PR? We'd love to have this in the Anthology but may not have time to do this for a while. We'd have a PR live within a day or so of acceptance!

Resolving patch:
diff --git a/bin/anthology/papers.py b/bin/anthology/papers.py
--- a/bin/anthology/papers.py
+++ b/bin/anthology/papers.py
@@ -93,8 +93,7 @@ def from_xml(xml_element, *args):
                 "url": data.ANTHOLOGY_URL.format( "{}v1".format(paper.full_id)) } )
 
         paper.attrib["title"] = paper.get_title("plain")
-        if "booktitle" in paper.attrib:
-            paper.attrib["booktitle"] = paper.get_booktitle("plain")
+        paper.attrib["booktitle"] = paper.get_booktitle("plain")
 
         if "editor" in paper.attrib:
             if paper.is_volume:
@@ -118,6 +117,12 @@ def from_xml(xml_element, *args):
                 paper._interpret_pages()
             else:
                 del paper.attrib["pages"]
+
+        if 'author' in paper.attrib:
+            # for x in paper.attrib['author']:
+            #     print('X', x[0].full)
+            paper.attrib["author_string"] = ', '.join([x[0].full for x in paper.attrib["author"]])
+
         return paper
 
     def _interpret_pages(self):
@@ -218,12 +223,17 @@ def get_abstract(self, form="xml"):
         """
         return self.formatter(self.get("xml_abstract"), form, allow_url=True)
 
-    def get_booktitle(self, form="xml"):
+    def get_booktitle(self, form="xml", default=''):
         """Returns the booktitle, optionally formatting it.
 
         See `get_title()` for details.
         """
-        return self.formatter(self.get("xml_booktitle"), form)
+        if 'xml_booktitle' in self.attrib:
+            return self.formatter(self.get("xml_booktitle"), form)
+        elif self.parent_volume is not None:
+            return self.parent_volume.get('title')
+        else:
+            return default
 
     def as_bibtex(self):
         """Return the BibTeX entry for this paper."""


Test patch: