From c1449d0a5b1bb90b722056f52517043a90c56e99 Mon Sep 17 00:00:00 2001 From: TheThomaas Date: Mon, 9 Jun 2025 18:32:52 +0200 Subject: [PATCH] Update pdf template and styles --- .../partials/components/pdf/section.liquid | 95 ++++++++++++++----- src/css/pdf.css | 20 ++-- 2 files changed, 83 insertions(+), 32 deletions(-) diff --git a/src/_includes/partials/components/pdf/section.liquid b/src/_includes/partials/components/pdf/section.liquid index 3110d92..b569aef 100644 --- a/src/_includes/partials/components/pdf/section.liquid +++ b/src/_includes/partials/components/pdf/section.liquid @@ -1,31 +1,80 @@ +{% assign showTitle = true %} +{% if section.data.showTitle == true or section.data.showTitle == false %} + {% assign showTitle = section.data.showTitle %} +{% endif %} +{% if section.data.pdf.showTitle == true or section.data.pdf.showTitle == false %} + {% assign showTitle = section.data.pdf.showTitle %} +{% endif %} + +{% assign title = section.data.title %} +{% if section.data.pdf.title %} + {% assign title = section.data.pdf.title %} +{% endif %}
- {% if section.data.showTitle != false %} + {% if showTitle %}
-

- {% if section.data.displayedTitle %} - {{ section.data.displayedTitle }} - {% else %} - {{ section.data.title }} - {% endif %} -

+

{{ title }}


{% endif %} - {% for item in items %} -
-

{{ item.data.title }}

-

- {{ item.data.role }} -

- {% if item.data.dates %} -
- {{ item.data.location }} - {{ item.data.dates.start }} - {{ item.data.dates.end }} -
- {% endif %} -
+ {% if items %} + {% for item in items %} +
+

{{ item.data.title }}

+ {% if item.data.role %} +

+ {{ item.data.role }} +

+ {% else %} + + {% endif %} + {% if item.data.dates %} +
+ {{ item.data.location }} + {{ item.data.dates.start }} - {{ item.data.dates.end }} +
+ {% endif %} + {% if item.data.links %} +
    - {{ item.templateContent }} - {% endfor %} + {% for link in item.data.links %} + {% assign linkHref = link %} + {% if link.link %} + {% assign linkHref = link.link %} + {% endif %} + + {% assign linkTitle = "Voir sur " | append: linkHref %} + {% if linkHref contains "codeberg.org" or linkHref contains "github.com" %} + {% assign linkTitle = "Source" %} + {% endif %} + + {% if linkHref contains "npmjs.com" %} + {% assign linkTitle = "Demo" %} + {% endif %} + + {% if link.title %} + {% assign linkTitle = link.title %} + {% endif %} + +
  • + {% link linkHref, "_blank" %}{{ linkTitle }}{% endlink %} +
  • + {% endfor %} +
+ + {% endif %} +
+ + {{ item.templateContent }} + {% endfor %} + {% else %} + + {% endif %} + +
\ No newline at end of file diff --git a/src/css/pdf.css b/src/css/pdf.css index ef80223..9c1d925 100644 --- a/src/css/pdf.css +++ b/src/css/pdf.css @@ -1,11 +1,10 @@ :root { - --accent-color: blue; - --font-body: Arial, sans-serif; - --font-display: 'Times New Roman', Times, serif; + --accent-color: #1155CC; + --font-body: Helvetica, Arial, sans-serif; } html { - font-family: var(--font-body, Arial, sans-serif); + font-family: var(--font-body, Helvetica, Arial, sans-serif); margin: 0; } body { @@ -19,14 +18,13 @@ body { } h1 { - text-align:center; - font-family: var(--font-display, 'Times New Roman', Times, serif); - font-size: 2rem; + text-align: center; + font-size: 1.8rem; margin: 0; line-height: 1.6; } h2 { - color : var(--accent-color, blue); + color : var(--accent-color, #1155CC); } p { margin: 0; @@ -37,6 +35,7 @@ ul { li::marker { color: var(--accent-color, blue); } +a { color : var(--accent-color, #1155CC); } section {margin-bottom: 1.2rem;} .justify-center { @@ -56,7 +55,7 @@ section {margin-bottom: 1.2rem;} display: contents; } .list-inline li + li::before { - content: '|'; + content: var(--item-separator, '|'); } .title { @@ -82,9 +81,12 @@ section ul {padding: 0;margin-left: 1.2rem;} margin-inline: 1rem; margin-bottom: .4rem; } +.subtitle .list-inline { --item-separator: "•"; gap: .4rem; } .subtitle .timeSection { font-size: .9rem; } .subtitle h3, +.subtitle h4, .subtitle p { margin: 0; } +.subtitle a { font-size: .9em; } .subtitle > :first-child {justify-self: start;} .subtitle > :last-child {justify-self: end;} .subtitle ~ ul {font-size: .9rem;}