diff --git a/themes/beautifulhugo/layouts/_default/single.html b/themes/beautifulhugo/layouts/_default/single.html index d17c80e33f21b5f96acb9caea7f9fe7c64b24dbe..4f6901ce7e2092d897a019d1d4fcc9286c1e5b51 100644 --- a/themes/beautifulhugo/layouts/_default/single.html +++ b/themes/beautifulhugo/layouts/_default/single.html @@ -2,6 +2,12 @@ <div class="container"> <div class="row"> <div class="col-lg-8 col-lg-offset-2 col-md-10 col-md-offset-1"> + {{ $name := .File.BaseFileName }} + {{ with .OutputFormats.Get "pdf-in" }} + <div class="pdflink"> + <a href="{{ $name }}.pdf">Also available in PDF format</a> + </div> + {{ end }} <article role="main" class="blog-post"> {{ .Content }} </article> diff --git a/themes/beautifulhugo/static/css/main.css b/themes/beautifulhugo/static/css/main.css index 0a6fd2ee3fa7d2919ee2af0d517576c0b99c7129..4358884e8f49e73c9296b21bd5bfcee88c0588de 100644 --- a/themes/beautifulhugo/static/css/main.css +++ b/themes/beautifulhugo/static/css/main.css @@ -872,3 +872,34 @@ div.notices.tip p:first-child:after { font-size: 14px; } +/* --- PDF Note --- */ + +div.pdflink { + text-align: right; +} + +.pdflink a { + color: inherit; + display: inline-block; + padding: 0 8px; + border-width: 1px; + border-style: solid; + border-color: #bebebe; + border-radius: 4px; + background: #FFF; + font-size: 75%; +} + +.pdflink a:before { + position: relative; + font-family: "Font Awesome 5 Free"; + font-weight: 800; + content: "\f1c1"; + color: #bebebe; + padding-right: 5px; +} + +.pdflink a:hover { + text-decoration: none; + border-color: #e67d1e; +}