Skip to content

Instantly share code, notes, and snippets.

@cmbuckley
Last active October 27, 2019 15:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cmbuckley/baec821e1aac7061c88acd2eca393eb7 to your computer and use it in GitHub Desktop.
Save cmbuckley/baec821e1aac7061c88acd2eca393eb7 to your computer and use it in GitHub Desktop.

These snippets are to highlight a minor display discrepancy between desktop and mobile link unfurling in Slack.

The article:published_time OpenGraph tag can have an optional time component. When unfurling links, desktop always treats the tag as a date, and mobile always treats it as a datetime, regardless of the content of the tag.

The content can essily be passed into Slack using raw.githack.com:

<!DOCTYPE html>
<head>
<meta charset="utf-8">
<meta name="description" content="Meta Description">
<title>HTML Title</title>
<meta content="OG Site Name" property="og:site_name">
<meta content="OG Title" property="og:title">
<meta content="en_GB" property="og:locale">
<meta content="article" property="og:type">
<meta content="This page has a published time of 2010-10-26" property="og:description">
<meta content="https://i.imgflip.com/3eernj.jpg" property="og:image">
<meta content="OG Image Alt" property="og:image:alt">
<meta content="2010-10-26" property="article:published_time">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="Twitter Title">
<meta name="twitter:description" content="Twitter Description">
<meta name="twitter:image:src" content="https://i.imgflip.com/3eerou.jpg">
<meta name="twitter:image:alt" content="Twitter Image">
<meta name="twitter:label1" content="Twitter Label 1" />
<meta name="twitter:data1" content="Twitter Content 1" />
<meta name="twitter:label2" content="Twitter Label 2" />
<meta name="twitter:data2" content="Twitter Content 2" />
<link rel="shortcut icon" href="https://cmbuckley.co.uk/favicon.ico">
<link rel="icon" type="image/png" sizes="16x16" href="https://cmbuckley.co.uk/assets/img/icons/favicon-16.png">
<link rel="icon" type="image/png" sizes="32x32" href="https://cmbuckley.co.uk/assets/img/icons/favicon-32.png">
<link rel="apple-touch-icon" sizes="180x180" href="https://cmbuckley.co.uk/assets/img/icons/favicon-180.png">
</head>
<body>
<p>This page has a published time of 2010-10-26</p>
</body>
</html>
<!DOCTYPE html>
<head>
<meta charset="utf-8">
<meta name="description" content="Meta Description">
<title>HTML Title</title>
<meta content="OG Site Name" property="og:site_name">
<meta content="OG Title" property="og:title">
<meta content="en_GB" property="og:locale">
<meta content="article" property="og:type">
<meta content="This page has a published time of 2010-10-26T00:00:00+00:00" property="og:description">
<meta content="https://i.imgflip.com/3eernj.jpg" property="og:image">
<meta content="OG Image Alt" property="og:image:alt">
<meta content="2010-10-26T00:00:00+00:00" property="article:published_time">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="Twitter Title">
<meta name="twitter:description" content="Twitter Description">
<meta name="twitter:image:src" content="https://i.imgflip.com/3eerou.jpg">
<meta name="twitter:image:alt" content="Twitter Image">
<meta name="twitter:label1" content="Twitter Label 1" />
<meta name="twitter:data1" content="Twitter Content 1" />
<meta name="twitter:label2" content="Twitter Label 2" />
<meta name="twitter:data2" content="Twitter Content 2" />
<link rel="shortcut icon" href="https://cmbuckley.co.uk/favicon.ico">
<link rel="icon" type="image/png" sizes="16x16" href="https://cmbuckley.co.uk/assets/img/icons/favicon-16.png">
<link rel="icon" type="image/png" sizes="32x32" href="https://cmbuckley.co.uk/assets/img/icons/favicon-32.png">
<link rel="apple-touch-icon" sizes="180x180" href="https://cmbuckley.co.uk/assets/img/icons/favicon-180.png">
</head>
<body>
<p>This page has a published time of 2010-10-26T00:00:00+00:00</p>
</body>
</html>
<!DOCTYPE html>
<head>
<meta charset="utf-8">
<meta name="description" content="Meta Description">
<title>HTML Title</title>
<meta content="OG Site Name" property="og:site_name">
<meta content="OG Title" property="og:title">
<meta content="en_GB" property="og:locale">
<meta content="article" property="og:type">
<meta content="This page has a published time of 2010-10-26T12:34:56+00:00" property="og:description">
<meta content="https://i.imgflip.com/3eernj.jpg" property="og:image">
<meta content="OG Image Alt" property="og:image:alt">
<meta content="2010-10-26T12:34:56+00:00" property="article:published_time">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="Twitter Title">
<meta name="twitter:description" content="Twitter Description">
<meta name="twitter:image:src" content="https://i.imgflip.com/3eerou.jpg">
<meta name="twitter:image:alt" content="Twitter Image">
<meta name="twitter:label1" content="Twitter Label 1" />
<meta name="twitter:data1" content="Twitter Content 1" />
<meta name="twitter:label2" content="Twitter Label 2" />
<meta name="twitter:data2" content="Twitter Content 2" />
<link rel="shortcut icon" href="https://cmbuckley.co.uk/favicon.ico">
<link rel="icon" type="image/png" sizes="16x16" href="https://cmbuckley.co.uk/assets/img/icons/favicon-16.png">
<link rel="icon" type="image/png" sizes="32x32" href="https://cmbuckley.co.uk/assets/img/icons/favicon-32.png">
<link rel="apple-touch-icon" sizes="180x180" href="https://cmbuckley.co.uk/assets/img/icons/favicon-180.png">
</head>
<body>
<p>This page has a published time of 2010-10-26T12:34:56+00:00</p>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment