al_folio_cv 1.0.1 → 1.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 735f4f1219fb50c22009f42027dd424035eff20e82146b91f0f94670a3df1951
4
- data.tar.gz: '0428b2b70e9be220422a77c22f6fa84f1b84e0bbdc1bf0e01628f03ab26aa948'
3
+ metadata.gz: 3cead7bc9a05a081de11d4bd0b62ac19ca18833025fc81f64815d0a6ef202ce5
4
+ data.tar.gz: fc8bc915b837f1c35322a0ccda8e10477c6ee924fd0daff74dc9eb2cc8604f41
5
5
  SHA512:
6
- metadata.gz: 7c6b922f64ad0b897b5f3664b27cbe88517007fdc0760cdf246e297dc70b206e8ac52581097316c63fc4703c19b6471b430210b328f9a9f7ec528ab50fe0d1ac
7
- data.tar.gz: 5dd93c83a958cc31996e325b2f0d40cca98de5c1f708bb5314870dc723d51cbbf7801461fa8bd60c6b717d05d0547f99ba0c6c0fb657a24a6d89e7bd2854df40
6
+ metadata.gz: 6e3de176b7a1d3601ec9beeddf6a26d94baf4994bdd2bae22dd1ae0ad1e0ce99f48b7e6b9c5bbf1bf5e017ef9f604daaf7effbed71a2308929a9efcab56b1a26
7
+ data.tar.gz: 74d66603d87eabd077dafa318bfe72125754f984eee3a47bdd006c0fee3c4c21a09b621da15df17c90dd5c5e8d2956efb94feaa15f9d8a54d0f8440bf50c5196
data/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.0.2
4
+
5
+ - Render a date badge for CV entries that carry a single point-in-time `date` instead of a `start_date`/`end_date` pair (ports `alshedivat/al-folio#3339`). `al_cv_sort_by_date` has understood a bare `date` since 1.0.1, so such entries were already being ordered by it while the templates dropped the badge without any warning. The experience and education templates now fall back to `date` (and the JSONResume `releaseDate`) when no start date is set, rendering it as a single year — a standalone date is a point in time, so it is never labelled `Present`. An explicit `start_date`/`startDate` still wins, and closed ranges render exactly as before.
6
+ - Render dates in the projects section, which previously rendered none at all (`alshedivat/al-folio#3339`). Projects now accept the same inputs as the other sections — a `start_date`/`end_date` pair, its `startDate`/`endDate` camelCase equivalent, or a bare `date` — and gain a date badge column when any of them is set. Undated projects keep their existing full-width markup.
7
+ - Strip the captured date in the awards and publications templates, so an entry with no date no longer renders an empty badge and no longer leaves stray whitespace inside a populated one. This is the same `capture`-keeps-its-whitespace bug fixed for experience and education in 1.0.1.
8
+
3
9
  ## 1.0.1
4
10
 
5
11
  - Sort experience, volunteering, and education entries by date instead of rendering them in source order, so volunteering is no longer always appended after work history (#3, ports `alshedivat/al-folio#3272`). Ordering is handled by the new `al_cv_sort_by_date` Liquid filter, which understands both RenderCV and JSONResume key names, partial dates (`2020`, `2020-06`), YAML date objects, textual `present` end dates, and undated entries.
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module AlFolioCv
4
- VERSION = "1.0.1"
4
+ VERSION = "1.0.2"
5
5
  end
@@ -6,9 +6,11 @@
6
6
  {% for entry in entries %}
7
7
  <li class="list-group-item">
8
8
  <div class="row">
9
+ {% comment %} `capture` keeps the surrounding whitespace, so strip before testing for emptiness {% endcomment %}
9
10
  {% capture start_date %}
10
11
  {% if entry.date %}{{ entry.date }}{% endif %}
11
12
  {% endcapture %}
13
+ {% assign start_date = start_date | strip %}
12
14
 
13
15
  {% if start_date != '' %}
14
16
  <div class="col-xs-2 col-sm-2 col-md-2 text-center">
@@ -19,12 +19,23 @@
19
19
  {% if entry.end_date %}{{ entry.end_date }}{% elsif entry.endDate %}{{ entry.endDate }}{% endif %}
20
20
  {% endcapture %}
21
21
  {% assign end_date = end_date | strip %}
22
+ {% comment %}
23
+ An entry may carry a single point-in-time `date` instead of a start/end pair. `al_cv_sort_by_date` already
24
+ orders on it, so render it too rather than silently dropping the badge.
25
+ {% endcomment %}
26
+ {% capture point_date %}
27
+ {% if entry.date %}{{ entry.date }}{% elsif entry.releaseDate %}{{ entry.releaseDate }}{% endif %}
28
+ {% endcapture %}
29
+ {% assign point_date = point_date | strip %}
22
30
 
23
31
  {% if start_date != '' %}
24
32
  {% comment %} Extract year only from dates like "1933-01-01" or just use "1933" as is {% endcomment %}
25
33
  {% assign startDate = start_date | split: '-' | first %}
26
34
  {% assign endDate = end_date | split: '-' | first | default: 'Present' %}
27
35
  {% assign date = startDate | append: ' - ' | append: endDate %}
36
+ {% elsif point_date != '' %}
37
+ {% comment %} A standalone date is a point in time, never an open-ended range, so it renders as a single year {% endcomment %}
38
+ {% assign date = point_date | split: '-' | first %}
28
39
  {% else %}
29
40
  {% assign date = null %}
30
41
  {% endif %}
@@ -19,12 +19,23 @@
19
19
  {% if entry.end_date %}{{ entry.end_date }}{% elsif entry.endDate %}{{ entry.endDate }}{% endif %}
20
20
  {% endcapture %}
21
21
  {% assign end_date = end_date | strip %}
22
+ {% comment %}
23
+ An entry may carry a single point-in-time `date` instead of a start/end pair. `al_cv_sort_by_date` already
24
+ orders on it, so render it too rather than silently dropping the badge.
25
+ {% endcomment %}
26
+ {% capture point_date %}
27
+ {% if entry.date %}{{ entry.date }}{% elsif entry.releaseDate %}{{ entry.releaseDate }}{% endif %}
28
+ {% endcapture %}
29
+ {% assign point_date = point_date | strip %}
22
30
 
23
31
  {% if start_date != '' %}
24
32
  {% comment %} Extract year only from dates like "1933-01-01" or just use "1933" as is {% endcomment %}
25
33
  {% assign startDate = start_date | split: '-' | first %}
26
34
  {% assign endDate = end_date | split: '-' | first | default: 'Present' %}
27
35
  {% assign date = startDate | append: ' - ' | append: endDate %}
36
+ {% elsif point_date != '' %}
37
+ {% comment %} A standalone date is a point in time, never an open-ended range, so it renders as a single year {% endcomment %}
38
+ {% assign date = point_date | split: '-' | first %}
28
39
  {% else %}
29
40
  {% assign date = null %}
30
41
  {% endif %}
@@ -1,30 +1,84 @@
1
1
  {% comment %}
2
2
  Unified projects entry renderer for both formats
3
+ Handles both:
4
+ - RenderCV: name, date (or start_date/end_date), url, summary, highlights
5
+ - JSONResume: name, startDate/endDate, url, summary, highlights
3
6
  {% endcomment %}
4
7
 
5
8
  <ul class="card-text font-weight-light list-group list-group-flush">
6
9
  {% for entry in entries %}
7
10
  <li class="list-group-item">
8
- {% if entry.url %}
9
- <h6 class="title font-weight-bold">
10
- <a href="{{ entry.url }}" target="_blank">{{ entry.name }}</a>
11
- </h6>
11
+ {% comment %} `capture` keeps the surrounding whitespace, so strip before testing for emptiness {% endcomment %}
12
+ {% capture start_date %}
13
+ {% if entry.start_date %}{{ entry.start_date }}{% elsif entry.startDate %}{{ entry.startDate }}{% endif %}
14
+ {% endcapture %}
15
+ {% assign start_date = start_date | strip %}
16
+ {% capture end_date %}
17
+ {% if entry.end_date %}{{ entry.end_date }}{% elsif entry.endDate %}{{ entry.endDate }}{% endif %}
18
+ {% endcapture %}
19
+ {% assign end_date = end_date | strip %}
20
+ {% comment %}
21
+ A project usually carries a single point-in-time `date` rather than a start/end pair. `al_cv_sort_by_date`
22
+ already orders on it, so render it too rather than silently dropping the badge.
23
+ {% endcomment %}
24
+ {% capture point_date %}
25
+ {% if entry.date %}{{ entry.date }}{% elsif entry.releaseDate %}{{ entry.releaseDate }}{% endif %}
26
+ {% endcapture %}
27
+ {% assign point_date = point_date | strip %}
28
+
29
+ {% if start_date != '' %}
30
+ {% comment %} Extract year only from dates like "1933-01-01" or just use "1933" as is {% endcomment %}
31
+ {% assign startDate = start_date | split: '-' | first %}
32
+ {% assign endDate = end_date | split: '-' | first | default: 'Present' %}
33
+ {% assign date = startDate | append: ' - ' | append: endDate %}
34
+ {% elsif point_date != '' %}
35
+ {% comment %} A standalone date is a point in time, never an open-ended range, so it renders as a single year {% endcomment %}
36
+ {% assign date = point_date | split: '-' | first %}
12
37
  {% else %}
13
- <h6 class="title font-weight-bold">{{ entry.name }}</h6>
38
+ {% assign date = null %}
14
39
  {% endif %}
15
40
 
16
- {% if entry.summary %}
17
- <p>{{ entry.summary | markdownify | remove: '<p>' | remove: '</p>' }}</p>
18
- {% endif %}
41
+ {% capture entry_body %}
42
+ {% if entry.url %}
43
+ <h6 class="title font-weight-bold">
44
+ <a href="{{ entry.url }}" target="_blank">{{ entry.name }}</a>
45
+ </h6>
46
+ {% else %}
47
+ <h6 class="title font-weight-bold">{{ entry.name }}</h6>
48
+ {% endif %}
49
+
50
+ {% if entry.summary %}
51
+ <p>{{ entry.summary | markdownify | remove: '<p>' | remove: '</p>' }}</p>
52
+ {% endif %}
19
53
 
20
- {% if entry.highlights %}
21
- <ul class="items">
22
- {% for item in entry.highlights %}
23
- <li>
24
- <span class="item">{{ item | markdownify | remove: '<p>' | remove: '</p>' }}</span>
25
- </li>
26
- {% endfor %}
27
- </ul>
54
+ {% if entry.highlights %}
55
+ <ul class="items">
56
+ {% for item in entry.highlights %}
57
+ <li>
58
+ <span class="item">{{ item | markdownify | remove: '<p>' | remove: '</p>' }}</span>
59
+ </li>
60
+ {% endfor %}
61
+ </ul>
62
+ {% endif %}
63
+ {% endcapture %}
64
+
65
+ {% if date %}
66
+ <div class="row">
67
+ <div class="col-xs-2 col-sm-2 col-md-2 text-center date-column">
68
+ <table class="table-cv">
69
+ <tbody>
70
+ <tr>
71
+ <td>
72
+ <span class="badge font-weight-bold danger-color-dark text-uppercase align-middle" style="min-width: 75px">{{ date }}</span>
73
+ </td>
74
+ </tr>
75
+ </tbody>
76
+ </table>
77
+ </div>
78
+ <div class="col-xs-10 col-sm-10 col-md-10 mt-2 mt-md-0">{{ entry_body }}</div>
79
+ </div>
80
+ {% else %}
81
+ {{ entry_body }}
28
82
  {% endif %}
29
83
  </li>
30
84
  {% endfor %}
@@ -6,9 +6,11 @@
6
6
  {% for entry in entries %}
7
7
  <li class="list-group-item">
8
8
  <div class="row">
9
+ {% comment %} `capture` keeps the surrounding whitespace, so strip before testing for emptiness {% endcomment %}
9
10
  {% capture pub_date %}
10
11
  {% if entry.releaseDate %}{{ entry.releaseDate }}{% elsif entry.date %}{{ entry.date }}{% endif %}
11
12
  {% endcapture %}
13
+ {% assign pub_date = pub_date | strip %}
12
14
 
13
15
  {% if pub_date != '' %}
14
16
  <div class="col-xs-2 col-sm-2 col-md-2 text-center">
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: al_folio_cv
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - al-folio maintainers