Display pages: Add OpenGraph tags for media
This commit is contained in:
parent
e2a65a5b62
commit
6ce2bd6b9f
|
@ -122,6 +122,7 @@ func fileDisplayHandler(c web.C, w http.ResponseWriter, r *http.Request, fileNam
|
|||
"forcerandom": Config.forceRandomFilename,
|
||||
"lines": lines,
|
||||
"files": metadata.ArchiveFiles,
|
||||
"siteurl": strings.TrimSuffix(getSiteURL(r), "/"),
|
||||
}, r, w)
|
||||
|
||||
if err != nil {
|
||||
|
|
|
@ -1,9 +1,12 @@
|
|||
{% extends "base.html" %}
|
||||
|
||||
{% block head %}
|
||||
<meta property="og:audio" content="{{ siteurl }}{{ sitepath }}{{ selifpath }}{{ filename }}" />
|
||||
{% endblock %}
|
||||
|
||||
{% block main %}
|
||||
<audio class="display-audio" controls preload='auto'>
|
||||
<source src='{{ sitepath }}{{ selifpath }}{{ filename }}'>
|
||||
<a href='{{ sitepath }}{{ selifpath }}{{ filename }}'>Download it instead</a>
|
||||
</audio>
|
||||
{% endblock %}
|
||||
|
||||
|
|
|
@ -1,5 +1,9 @@
|
|||
{% extends "base.html" %}
|
||||
|
||||
{% block head %}
|
||||
<meta property="og:image" content="{{ siteurl }}{{ sitepath }}{{ selifpath }}{{ filename }}" />
|
||||
{% endblock %}
|
||||
|
||||
{% block main %}
|
||||
<a href="{{ sitepath }}{{ selifpath }}{{ filename }}">
|
||||
<img class="display-image" src="{{ sitepath }}{{ selifpath }}{{ filename }}" />
|
||||
|
|
|
@ -1,8 +1,12 @@
|
|||
{% extends "base.html" %}
|
||||
|
||||
{% block head %}
|
||||
<meta property="og:video" content="{{ siteurl }}{{ sitepath }}{{ selifpath }}{{ filename }}" />
|
||||
{% endblock %}
|
||||
|
||||
{% block main %}
|
||||
<video class="display-video" controls autoplay>
|
||||
<source src="{{ sitepath }}{{ selifpath }}{{ filename }}"/>
|
||||
<source src="{{ sitepath }}{{ selifpath }}{{ filename }}" />
|
||||
<a href='{{ sitepath }}{{ selifpath }}{{ filename }}'>Download it instead</a>
|
||||
</video>
|
||||
{% endblock %}
|
Loading…
Reference in New Issue