提交 c86fb12c 编写于 作者: Y yyexplore

base url of pdf

上级 21858b1e
......@@ -3,13 +3,23 @@
<div id="embed-pdf-view">
</div>
{{ $url1 := .Get "url" | path.Join .Site.BaseURL }}
{{ $url := .Get "url" }}
{{ $base_url := .Site.BaseURL | urls.Parse}}
{{ $base_path := $base_url.Path}}
{{ $url_pdf := path.Join $base_path $url}}
<!--
<p> url_is: {{ $url }} </p>
<p> baseurl_is: {{.Site.BaseURL}} </p>
<p> basepath_is: {{ $base_path }} </p>
<p> url_pdf_is: {{ $url_pdf }} </p>
-->
<script type="text/javascript">
window.onload = function() {
var pdf_div = document.getElementById('embed-pdf-view');
pdf_div.innerHTML = '<iframe src="js/pdf-js/web/viewer.html?file={{$url1}}" width="100%" with="800px" height="600px" style="border: none;" />' ;
pdf_div.innerHTML = '<iframe src="js/pdf-js/web/viewer.html?file={{$url_pdf}}" width="100%" with="800px" height="600px" style="border: none;" />' ;
};
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册