Skip to content

Commit

Permalink
Add a print button and print styling for articles
Browse files Browse the repository at this point in the history
Part 1 of #17
  • Loading branch information
themkat committed Aug 13, 2024
1 parent 209534d commit 812d61b
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 0 deletions.
1 change: 1 addition & 0 deletions _layouts/blogpost.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
-
<a href="https://www.linkedin.com/sharing/share-offsite/?url={{ page.url | absolute_url }}"><img src="{{ "assets/img/linkedinlogo.png" | relative_url }}" alt="LinkedIn icon" /></a>
</p>
<p class="printbutton" onclick="print()">:printer:</p>
<h2>{{page.title}}</h2>
<span class="timestamp">Published {{page.date | date: "%a %b %d %Y"}}</span>
<p class="tags">Tags:
Expand Down
40 changes: 40 additions & 0 deletions _sass/main.scss
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,10 @@ body {
padding-right: 0;
}

.printbutton {
display: none;
}

.tag-toggle {
display: inline-block;
font-weight: normal;
Expand Down Expand Up @@ -213,6 +217,12 @@ body {
}
}

.printbutton {
float: right;
display: inline-block;
cursor: pointer;
}

.content .tags {
font-size: medium;
}
Expand Down Expand Up @@ -382,3 +392,33 @@ body {
margin-bottom: 0.5vh;
}
}

// Experimental printing support
@media print {
.menu, .footer, .color-mode-toggle, .sharebuttons, .printbutton, .related_posts, #commento {
display: none;
margin: 0;
}

.content {
width: 95vw;
padding: 0;
margin: 0;
box-shadow: none;

hr {
display: none;
}
}

.banner {
width: auto;
height: 10vh;
margin: 0;
padding: 0;
}

.notebox {
width: 100%;
}
}

0 comments on commit 812d61b

Please sign in to comment.