<script type="text/javascript" src="/js/pdf-js/build/pdf.js"></script> <div id="embed-pdf-view"> </div>
{{ $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={{$url_pdf}}" width="100%" with="800px" style="border: none;min-height:75vh;" />' ;
}; </script>