Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
17 lines (16 sloc) 2.03 KB
<!-- only show if downloadRmd is set and this is a post-->
{{ if and ($.Param "downloadRmd") (in .File.Path "post/")}}
<div style = "display: flex; justify-content: right;">
{{ $modFname := print .File.TranslationBaseName "-datascienceblog.Rmd" }}
{{ $modPath := replace .File.Path (print "." .File.Ext) ".Rmd"}}
{{ $gitHubPath := print (.Param "contentPath") $modPath }}
<a class="button" href={{ $gitHubPath }} download={{ $modFname }}>
<svg class = "svg-icon" width="20" height="20" viewBox="0 0 20 20">
<path style = "fill:rgb(255,255,255)" fill="none" d="M15.608,6.262h-2.338v0.935h2.338c0.516,0,0.934,0.418,0.934,0.935v8.879c0,0.517-0.418,0.935-0.934,0.935H4.392c-0.516,0-0.935-0.418-0.935-0.935V8.131c0-0.516,0.419-0.935,0.935-0.935h2.336V6.262H4.392c-1.032,0-1.869,0.837-1.869,1.869v8.879c0,1.031,0.837,1.869,1.869,1.869h11.216c1.031,0,1.869-0.838,1.869-1.869V8.131C17.478,7.099,16.64,6.262,15.608,6.262z M9.513,11.973c0.017,0.082,0.047,0.162,0.109,0.226c0.104,0.106,0.243,0.143,0.378,0.126c0.135,0.017,0.274-0.02,0.377-0.126c0.064-0.065,0.097-0.147,0.115-0.231l1.708-1.751c0.178-0.183,0.178-0.479,0-0.662c-0.178-0.182-0.467-0.182-0.645,0l-1.101,1.129V1.588c0-0.258-0.204-0.467-0.456-0.467c-0.252,0-0.456,0.209-0.456,0.467v9.094L8.443,9.553c-0.178-0.182-0.467-0.182-0.645,0c-0.178,0.184-0.178,0.479,0,0.662L9.513,11.973z"></path></svg> Download Markdown</a>
<button class = "button" id = "copyButton" onclick="copyToClipboard()">
<span style = "text-align: center;">
<svg id = "copy-icon" class="svg-icon" viewBox="0 0 20 20">
<path style = "fill:rgb(255,255,255)" d="M17.391,2.406H7.266c-0.232,0-0.422,0.19-0.422,0.422v3.797H3.047c-0.232,0-0.422,0.19-0.422,0.422v10.125c0,0.232,0.19,0.422,0.422,0.422h10.125c0.231,0,0.422-0.189,0.422-0.422v-3.797h3.797c0.232,0,0.422-0.19,0.422-0.422V2.828C17.812,2.596,17.623,2.406,17.391,2.406 M12.749,16.75h-9.28V7.469h3.375v5.484c0,0.231,0.19,0.422,0.422,0.422h5.483V16.75zM16.969,12.531H7.688V3.25h9.281V12.531z"></path>
</svg>Copy Code</span></button>
</div>
{{ end }}
You can’t perform that action at this time.