From ee283edfd98860b7ccf78126421f7ef31a440516 Mon Sep 17 00:00:00 2001 From: Jarno Rankinen Date: Sat, 10 Feb 2024 17:56:37 +0200 Subject: [PATCH] Print button, printing layout improvements. Summary is full width. --- static/css/base.css | 15 ++++++++++ static/css/base.scss | 20 +++++++++++++ static/css/light-style.css | 15 ++++++++++ strings.go | 2 ++ templates/githubCorner.html | 2 ++ templates/index.html | 56 ++++++++++++++++++++++++------------- 6 files changed, 91 insertions(+), 19 deletions(-) diff --git a/static/css/base.css b/static/css/base.css index 53b17b9..f9582dc 100644 --- a/static/css/base.css +++ b/static/css/base.css @@ -70,3 +70,18 @@ body { @media screen and (min-width: 768px) { .has-text-right-in-desktop { text-align: right; } } + +@media print { + body:not(.tag) { + font-size: 10pt; + padding: 20px; + max-width: 100%; + overflow: hidden !important; } + .tag { + font-size: 8pt !important; } + .noprint { + display: none; } + .item { + page-break-inside: avoid; } + html { + color-adjust: exact; } } diff --git a/static/css/base.scss b/static/css/base.scss index 601d651..0105da1 100644 --- a/static/css/base.scss +++ b/static/css/base.scss @@ -91,3 +91,23 @@ body { } } +@media print { + body:not(.tag) { + font-size: 10pt; + padding: 20px; + max-width: 100%; + overflow: hidden !important; + } + .tag { + font-size: 8pt !important; + } + .noprint { + display: none; + } + .item { + page-break-inside: avoid; + } + html { + color-adjust: exact; + } +} diff --git a/static/css/light-style.css b/static/css/light-style.css index 8df5254..6352990 100644 --- a/static/css/light-style.css +++ b/static/css/light-style.css @@ -75,3 +75,18 @@ body { @media screen and (min-width: 768px) { .has-text-right-in-desktop { text-align: right; } } + +@media print { + body:not(.tag) { + font-size: 10pt; + padding: 20px; + max-width: 100%; + overflow: hidden !important; } + .tag { + font-size: 8pt !important; } + .noprint { + display: none; } + .item { + page-break-inside: avoid; } + html { + color-adjust: exact; } } diff --git a/strings.go b/strings.go index f7ac568..d1ac90a 100644 --- a/strings.go +++ b/strings.go @@ -14,6 +14,7 @@ func loadStrings() { "see_dark": "See Dark Theme", "see_light": "See Light Theme", "all_rights_reserved": "All Rights Reserved.", + "print_dark": "For better results, please print the page using the light theme", "powered_by": "Powered by go-resume", } @@ -29,6 +30,7 @@ func loadStrings() { "see_dark": "Tumma teema", "see_light": "Vaalea teema", "all_rights_reserved": "Kaikki oikeudet pidätetään.", + "print_dark": "Paremman tuloksen varmistamiseksi tulosta sivu käyttäen vaaleaa teemaa", "powered_by": "Luotu käyttäen sovellusta go-resume", } } diff --git a/templates/githubCorner.html b/templates/githubCorner.html index ae47c2f..2e49330 100644 --- a/templates/githubCorner.html +++ b/templates/githubCorner.html @@ -1,4 +1,5 @@ {{ define "githubCorner" }} +
+
{{ end }} \ No newline at end of file diff --git a/templates/index.html b/templates/index.html index c22c9f3..86ee5bd 100644 --- a/templates/index.html +++ b/templates/index.html @@ -8,7 +8,6 @@ {{ template "meta" . }} - - + @@ -41,12 +46,12 @@

{{ .Profile.Name }}

{{ .Profile.Title }}

-
+
Profile photo
-
+

{{ .Profile.City }}

@@ -64,21 +69,32 @@ {{ end }}
+
+
+
+ +
+
+
+
+
+
+
+ {{ translate "summary" $lang | html }} +
+
{{ .Profile.Summary }}
+
+
-
-
- {{ translate "summary" $lang }} -
-
{{ .Profile.Summary }}
-
+ {{ with .Profile.Experience }}
@@ -207,7 +223,7 @@ {{ end }} {{ with .Profile.Certificates }} -
+
{{ translate "certificates" $lang }}
@@ -232,14 +248,16 @@