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,
|
"forcerandom": Config.forceRandomFilename,
|
||||||
"lines": lines,
|
"lines": lines,
|
||||||
"files": metadata.ArchiveFiles,
|
"files": metadata.ArchiveFiles,
|
||||||
|
"siteurl": strings.TrimSuffix(getSiteURL(r), "/"),
|
||||||
}, r, w)
|
}, r, w)
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
|
@ -1,9 +1,12 @@
|
||||||
{% extends "base.html" %}
|
{% extends "base.html" %}
|
||||||
|
|
||||||
|
{% block head %}
|
||||||
|
<meta property="og:audio" content="{{ siteurl }}{{ sitepath }}{{ selifpath }}{{ filename }}" />
|
||||||
|
{% endblock %}
|
||||||
|
|
||||||
{% block main %}
|
{% block main %}
|
||||||
<audio class="display-audio" controls preload='auto'>
|
<audio class="display-audio" controls preload='auto'>
|
||||||
<source src='{{ sitepath }}{{ selifpath }}{{ filename }}'>
|
<source src='{{ sitepath }}{{ selifpath }}{{ filename }}'>
|
||||||
<a href='{{ sitepath }}{{ selifpath }}{{ filename }}'>Download it instead</a>
|
<a href='{{ sitepath }}{{ selifpath }}{{ filename }}'>Download it instead</a>
|
||||||
</audio>
|
</audio>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
|
@ -1,7 +1,11 @@
|
||||||
{% extends "base.html" %}
|
{% extends "base.html" %}
|
||||||
|
|
||||||
|
{% block head %}
|
||||||
|
<meta property="og:image" content="{{ siteurl }}{{ sitepath }}{{ selifpath }}{{ filename }}" />
|
||||||
|
{% endblock %}
|
||||||
|
|
||||||
{% block main %}
|
{% block main %}
|
||||||
<a href="{{ sitepath }}{{ selifpath }}{{ filename }}">
|
<a href="{{ sitepath }}{{ selifpath }}{{ filename }}">
|
||||||
<img class="display-image" src="{{ sitepath }}{{ selifpath }}{{ filename }}" />
|
<img class="display-image" src="{{ sitepath }}{{ selifpath }}{{ filename }}" />
|
||||||
</a>
|
</a>
|
||||||
{% endblock %}
|
{% endblock %}
|
|
@ -1,8 +1,12 @@
|
||||||
{% extends "base.html" %}
|
{% extends "base.html" %}
|
||||||
|
|
||||||
|
{% block head %}
|
||||||
|
<meta property="og:video" content="{{ siteurl }}{{ sitepath }}{{ selifpath }}{{ filename }}" />
|
||||||
|
{% endblock %}
|
||||||
|
|
||||||
{% block main %}
|
{% block main %}
|
||||||
<video class="display-video" controls autoplay>
|
<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>
|
<a href='{{ sitepath }}{{ selifpath }}{{ filename }}'>Download it instead</a>
|
||||||
</video>
|
</video>
|
||||||
{% endblock %}
|
{% endblock %}
|
Loading…
Reference in New Issue