initial styling of the print stylesheet. Needs working.
authordanix <danix@danix.xyz>
Sun, 5 Mar 2023 07:34:55 +0000 (08:34 +0100)
committerdanix <danix@danix.xyz>
Sun, 5 Mar 2023 07:34:55 +0000 (08:34 +0100)
assets/sass/print.scss [new file with mode: 0644]
layouts/partials/head.html

diff --git a/assets/sass/print.scss b/assets/sass/print.scss
new file mode 100644 (file)
index 0000000..f625709
--- /dev/null
@@ -0,0 +1,72 @@
+@import 'libs/vars';
+@import 'libs/functions';
+@import 'libs/my-mixins';
+
+body {
+       margin: 0;
+       padding: 0;
+       font: 12pt Georgia, "Times New Roman", Times, serif;
+       line-height: 1.3;
+       background: #fff !important;
+       color: #000;
+}
+#wrapper {
+       width: 100%;
+       margin: 0;
+       float: none;
+}
+figure.image {
+       &.shadow {
+               img {
+                       box-shadow: none;
+               }
+       }
+       figcaption {
+               @include hide-visually;
+       }
+}
+header#header,
+#backtotop,
+footer#footer {
+       @include hide-visually;
+}
+div#main {
+       margin-left: 2cm;
+       margin-right: 1cm;
+}
+H3#danilo-macrì {
+       font-size: 24pt;
+}
+h2, h3, h4 {
+       font-size: 14pt;
+}
+/* Defining all page breaks */
+a {
+    page-break-inside:avoid
+}
+blockquote {
+    page-break-inside: avoid;
+}
+h1, h2, h3, h4, h5, h6 { 
+       page-break-after:avoid; 
+       page-break-inside:avoid
+ }
+img {
+       page-break-inside:avoid; 
+    page-break-after:avoid;
+}
+table, pre {
+       page-break-inside:avoid
+}
+p, ul, ol, dl  {
+       page-break-before:avoid;
+       page-break-inside: avoid;
+}
+div.col-8 {
+       h4 {
+               page-break-after: avoid;
+       }
+       strong {
+               page-break-before: avoid;
+       }
+}
index 0f5757b..15c517c 100644 (file)
@@ -4,16 +4,22 @@
        <meta name="color-scheme" content="light dark">
        <link rel="profile" href="https://gmpg.org/xfn/11">
 
-
        {{ $style_options := (dict "targetPath" "css/style.css" "outputStyle" "compressed" "transpiler" "dartsass" "enableSourceMap" (not hugo.IsProduction)) }}
-       {{ $style := resources.Get "sass/main.scss" | resources.ToCSS $style_options }}
+       {{ $style := resources.Get "sass/main.scss" | resources.ToCSS $style_options | fingerprint }}
 
        {{ $noscript_options := (dict "targetPath" "css/noscript.css" "outputStyle" "compressed" "transpiler" "dartsass" "enableSourceMap" (not hugo.IsProduction)) }}
-       {{ $noscript := resources.Get "sass/noscript.scss" | resources.ToCSS $noscript_options }}
+       {{ $noscript := resources.Get "sass/noscript.scss" | resources.ToCSS $noscript_options | fingerprint }}
 
        <link rel="stylesheet" href="{{ $style.RelPermalink }}">
        <link rel="stylesheet" href="{{ "css/syntax.css" |relURL }}">
        <noscript><link rel="stylesheet" href="{{ $noscript.RelPermalink }}" ></noscript>
+
+       {{ if eq "curriculum" .Type }}
+       {{ $print_style_options := (dict "targetPath" "css/print.css" "outputStyle" "compressed" "transpiler" "dartsass" "enableSourceMap" (not hugo.IsProduction)) }}
+       {{ $print_style := resources.Get "sass/print.scss" | resources.ToCSS $print_style_options | fingerprint }}
+       <link media="print" rel="stylesheet" href="{{ $print_style.RelPermalink }}">
+       {{ end }}
+
        {{ partial "funcs/favicon.html" . }}
        <link rel="canonical" href="{{ .Permalink }}">