bilingual-jekyll-resume-theme 0.2.0 → 0.3.0

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.
@@ -0,0 +1,482 @@
1
+ # _includes Guide
2
+
3
+ A contributor- and user-friendly deep dive into how the theme’s `_includes/` directory works, how it connects to the rest of the theme, and how to extend or customize it safely.
4
+
5
+ This guide assumes basic familiarity with Jekyll and Liquid, but includes examples you can copy/paste.
6
+
7
+ ---
8
+
9
+ ## Table of Contents
10
+
11
+ - [What are Jekyll includes?](#what-are-jekyll-includes)
12
+ - [How includes fit into this theme](#how-includes-fit-into-this-theme)
13
+ - [Layouts that use includes](#layouts-that-use-includes)
14
+ - [Data flow and configuration](#data-flow-and-configuration)
15
+ - [Include inventory (what each file does)](#include-inventory-what-each-file-does)
16
+ - [shared-head.html](#1-shared-headhtml)
17
+ - [main-head.html](#2-main-headhtml)
18
+ - [resume-head-en.html](#3-resume-head-enhtml)
19
+ - [resume-head-ar.html](#4-resume-head-arhtml)
20
+ - [analytics-head.html](#5-analytics-headhtml)
21
+ - [analytics-body.html](#6-analytics-bodyhtml)
22
+ - [hreflang.html](#7-hreflanghtml)
23
+ - [ar-date.html](#8-ar-datehtml)
24
+ - [social-links.html](#9-social-linkshtml)
25
+ - [print-social-links.html](#10-print-social-linkshtml)
26
+ - [vendors/ (SVG icon packs)](#11-vendors-svg-icon-packs)
27
+ - [Dynamic section rendering (resume-section-*.html)](#dynamic-section-rendering-resume-section-html)
28
+ - [How it works](#how-it-works)
29
+ - [Section list and flags](#section-list-and-flags)
30
+ - [Changing section order](#changing-section-order)
31
+ - [Adding a new section (step-by-step)](#adding-a-new-section-step-by-step)
32
+ - [Multilingual SEO with hreflang](#multilingual-seo-with-hreflang)
33
+ - [Analytics configuration](#analytics-configuration)
34
+ - [Social links and icons](#social-links-and-icons)
35
+ - [Customization recipes](#customization-recipes)
36
+ - [Swap fonts or CSS per language](#swap-fonts-or-css-per-language)
37
+ - [Add a new social network](#add-a-new-social-network)
38
+ - [Show languages in header vs its own section](#show-languages-in-header-vs-its-own-section)
39
+ - [Customize date formats (EN/AR)](#customize-date-formats-enar)
40
+ - [Best practices](#best-practices)
41
+
42
+ ---
43
+
44
+ ## What are Jekyll includes?
45
+
46
+ Jekyll includes are reusable partial templates you can insert into pages or layouts with `{% include file.html %}`. They help keep layouts clean, avoid duplication, and provide configurable building blocks.
47
+
48
+ In this theme, includes are used for:
49
+ - Shared `<head>` tags and assets
50
+ - Analytics snippets
51
+ - Language SEO tags
52
+ - Social icons
53
+ - Fine-grained rendering of resume sections in English and Arabic
54
+
55
+ ---
56
+
57
+ ## How includes fit into this theme
58
+
59
+ ### Layouts that use includes
60
+
61
+ Key layouts are in `_layouts/`:
62
+ - `default.html` — Base wrapper for general pages (profile/landing, docs). Pulls in shared head, `main.css`, SEO, and analytics.
63
+ - `resume-en.html` — English resume layout (LTR). Pulls in resume-specific head assets, SEO, analytics, and renders sections via `resume-section-en.html`.
64
+ - `resume-ar.html` — Arabic resume layout (RTL). Similar to EN but with Arabic assets, RTL direction, and `resume-section-ar.html` for localized labels and dates.
65
+
66
+ Typical include usage inside layouts:
67
+
68
+ ```
69
+ {% include shared-head.html %}
70
+ {% include main-head.html %}
71
+ {% include resume-head-en.html %}
72
+ {% include resume-head-ar.html %}
73
+ {% include analytics-head.html %}
74
+ {% include analytics-body.html %}
75
+ {% include hreflang.html %}
76
+ {% include social-links.html %}
77
+ {% include print-social-links.html %}
78
+ ```
79
+
80
+ ### Data flow and configuration
81
+
82
+ The resume layouts compute a `resume_data` object that points to the active data subtree in `_data/`, based on `active_resume_path` configured in your site’s `_config.yml`. This lets you organize multiple datasets (e.g., different roles/versions) and switch without editing templates.
83
+
84
+ Examples:
85
+ - No path (empty or nil): `resume_data == site.data`
86
+ - `active_resume_path: en`: `resume_data == site.data.en`
87
+ - Nested path with dots: `active_resume_path: 2025-06.20250621-PM` → `resume_data == site.data['2025-06']['20250621-PM']`
88
+
89
+ Most resume includes read from `resume_data.<section>` (e.g., `experience`, `skills`, `languages`). Feature flags and ordering live in `_config.yml` (see “Dynamic section rendering” below).
90
+
91
+ ---
92
+
93
+ ## Include inventory (what each file does)
94
+
95
+ ### 1) shared-head.html
96
+ Purpose: Common `<head>` tags used by all layouts.
97
+ - Charset, IE compatibility, viewport
98
+ - Favicon fallbacks
99
+ - Canonical URL: `{{ page.url | replace:'index.html','' | prepend: site.baseurl | prepend: site.url }}`
100
+ - Robots meta: respects `page.noindex: true`
101
+
102
+ When to edit: rarely. Safe place to add global meta tags that apply across the site.
103
+
104
+ ---
105
+
106
+ ### 2) main-head.html
107
+ Purpose: CSS for non-resume pages.
108
+ - Loads `assets/css/main.css`
109
+
110
+ Used by: `default.html`.
111
+
112
+ ---
113
+
114
+ ### 3) resume-head-en.html
115
+ Purpose: Head assets for the English resume.
116
+ - Google Fonts (Lora / Open Sans)
117
+ - `assets/css/cv.css`
118
+ - Resume favicons
119
+ - `{% include hreflang.html %}` to output alternate language links
120
+
121
+ Used by: `resume-en.html`.
122
+
123
+ ---
124
+
125
+ ### 4) resume-head-ar.html
126
+ Purpose: Head assets for the Arabic resume.
127
+ - Cairo font (good Arabic legibility) when `site.resume_theme == 'default'`
128
+ - `assets/css/cv-ar.css` (RTL-aware CSS)
129
+ - Resume favicons
130
+ - `{% include hreflang.html %}`
131
+
132
+ Used by: `resume-ar.html`.
133
+
134
+ ---
135
+
136
+ ### 5) analytics-head.html
137
+ Purpose: Add Google Tag Manager (GTM) or Google Analytics gtag to the head.
138
+
139
+ Configuration options in `_config.yml`:
140
+
141
+ ```yaml
142
+ # Use GTM (preferred if you already have a container)
143
+ analytics:
144
+ gtm: GTM-XXXXXXX
145
+
146
+ # Or use GA4 via gtag.js
147
+ analytics:
148
+ ga: true # enables the gtag block
149
+ gtag: G-XXXXXXXXXX # your GA measurement ID
150
+ ```
151
+
152
+ Behavior:
153
+ - If `site.analytics.gtm` is set → injects GTM head snippet.
154
+ - Else if `site.analytics.ga` is true → injects GA4 gtag.js using `site.analytics.gtag`.
155
+
156
+ ---
157
+
158
+ ### 6) analytics-body.html
159
+ Purpose: Body-side analytics snippet.
160
+ - If GTM is configured, outputs the `<noscript><iframe …></noscript>` fallback for users with JS disabled.
161
+ - If GA-only, no body markup is needed (and this include produces no output).
162
+
163
+ Used by: `default.html` (and can be added to other layouts if needed) right after `<body>`.
164
+
165
+ ---
166
+
167
+ ### 7) hreflang.html
168
+ Purpose: Alternate language `<link rel="alternate" hreflang="…">` tags for multilingual SEO.
169
+
170
+ Requirements per page:
171
+ ```yaml
172
+ # In page front matter
173
+ lang: en # or ar, etc.
174
+ t_id: resume # any string that identifies the translation group
175
+ ```
176
+
177
+ Behavior:
178
+ - If `page.t_id` exists, it finds all pages with the same `t_id` and outputs an alternate link for each.
179
+ - It also emits an `x-default` pointing to the English page if found, as a default fallback.
180
+
181
+ Place: Already included by both resume head includes; can be used elsewhere if you have multilingual pages.
182
+
183
+ ---
184
+
185
+ ### 8) ar-date.html
186
+ Purpose: Arabic month name formatting for dates.
187
+
188
+ Usage in templates:
189
+ ```liquid
190
+ {% include ar-date.html date=object.startdate style="MY" %}
191
+ {% include ar-date.html date=object.issue_date style="MDY" %}
192
+ ```
193
+
194
+ - Parameters:
195
+ - `date`: the Date/Time value
196
+ - `style`: `MDY` → “Month Day, Year”; anything else → “Month Year”
197
+ - Looks up the Arabic month name via `site.data.ar.months[m]`.
198
+
199
+ Data requirement in your `_data/` (one of these structures):
200
+ ```yaml
201
+ # Option A: _data/ar.yml
202
+ months:
203
+ "1": يناير
204
+ "2": فبراير
205
+ "3": مارس
206
+ "4": أبريل
207
+ "5": مايو
208
+ "6": يونيو
209
+ "7": يوليو
210
+ "8": أغسطس
211
+ "9": سبتمبر
212
+ "10": أكتوبر
213
+ "11": نوفمبر
214
+ "12": ديسمبر
215
+ ```
216
+ or
217
+ ```yaml
218
+ # Option B: _data/ar/months.yml
219
+ "1": يناير
220
+ "2": فبراير
221
+ # ...
222
+ ```
223
+
224
+ ---
225
+
226
+ ### 9) social-links.html
227
+ Purpose: Renders icon links (as `<li>` items) for social profiles, only if configured in `_config.yml` under `social_links`.
228
+
229
+ Example config:
230
+ ```yaml
231
+ social_links:
232
+ github: https://github.com/your-username
233
+ linkedin: https://www.linkedin.com/in/your-handle/
234
+ telegram: https://t.me/your-handle
235
+ twitter: https://twitter.com/your-handle
236
+ medium: https://medium.com/@your-handle
237
+ # ... others supported by default
238
+ ```
239
+
240
+ - Each supported key emits a list item with an inline SVG icon from `vendors/lineicons-v5.0/`.
241
+ - Safe for screen readers and printing; external links are `rel="noopener nofollow noreferrer"`.
242
+
243
+ Used by: both resume layouts in the header’s social bar.
244
+
245
+ ---
246
+
247
+ ### 10) print-social-links.html
248
+ Purpose: Text-only list of social links for print/PDF.
249
+ - Controlled by `_config.yml` flag `resume_print_social_links: true`.
250
+ - Emits readable lines like “Github: https://github.com/…”.
251
+
252
+ Used by: both resume layouts inside a print-only section at the end.
253
+
254
+ ---
255
+
256
+ ### 11) vendors/ (SVG icon packs)
257
+ Purpose: Namespaced, vendored icons used across the theme.
258
+ - `vendors/lineicons-v4.0/` — Used for small header contact icons (e.g., phone, envelope, postcard)
259
+ - `vendors/lineicons-v5.0/` — Used for social icons
260
+
261
+ To add a new icon:
262
+ 1. Drop a proper, minimal SVG (no script, no external refs) into the correct subfolder.
263
+ 2. Reference it from an include with `{% include vendors/lineicons-v5.0/<name>.svg %}`.
264
+
265
+ ---
266
+
267
+ ## Dynamic section rendering (resume-section-*.html)
268
+
269
+ Two includes power all resume content:
270
+ - `resume-section-en.html` — English labels and EN date formats
271
+ - `resume-section-ar.html` — Arabic labels, RTL-aware, and Arabic date/“Present” logic
272
+
273
+ ### How it works
274
+
275
+ Both files receive a parameter `section_name` and render the matching section if it’s enabled in `_config.yml`.
276
+
277
+ ```liquid
278
+ {% include resume-section-en.html section_name="experience" %}
279
+ ```
280
+
281
+ The resume layouts loop over `site.resume_section_order` and call the include once per item, so you only need to control ordering and flags in config.
282
+
283
+ ### Section list and flags
284
+
285
+ Supported `section_name` values (and their flags under `resume_section`):
286
+ - `experience` → `resume_section.experience`
287
+ - `education` → `resume_section.education`
288
+ - `certifications` → `resume_section.certifications`
289
+ - `courses` → `resume_section.courses`
290
+ - `volunteering` → `resume_section.volunteering`
291
+ - `projects` → `resume_section.projects`
292
+ - `skills` → `resume_section.skills`
293
+ - `recognition` → `resume_section.recognition`
294
+ - `associations` → `resume_section.associations`
295
+ - `interests` → `resume_section.interests`
296
+ - `languages` → `resume_section.languages` (plus `resume_section.lang_header` controls header display)
297
+ - `links` → `resume_section.links`
298
+
299
+ Global behavior:
300
+ - Items are filtered by `active: true` in your data.
301
+ - Experience/Volunteering are grouped by `company` and sorted by `startdate` desc.
302
+ - “Present” handling: EN prints “Present”; AR prints “حتى الآن”. Array-based `durations` is also supported.
303
+
304
+ ### Changing section order
305
+
306
+ In `_config.yml`:
307
+ ```yaml
308
+ resume_section_order:
309
+ - experience
310
+ - education
311
+ - projects
312
+ - skills
313
+ - languages
314
+ - links
315
+ ```
316
+ The layout loops this array and includes the matching block.
317
+
318
+ ### Adding a new section (step-by-step)
319
+
320
+ Example: Add “publications”.
321
+
322
+ 1) Data: create `_data/publications.yml` (or inside your active subtree) like:
323
+ ```yaml
324
+ - active: true
325
+ title: Building Scalable Systems
326
+ venue: Journal of Systems
327
+ year: 2024
328
+ url: https://example.com/paper
329
+ summary: A brief sentence about the publication.
330
+ ```
331
+
332
+ 2) Enable and order it in `_config.yml`:
333
+ ```yaml
334
+ resume_section:
335
+ publications: true
336
+ resume_section_order:
337
+ - experience
338
+ - education
339
+ - publications
340
+ - skills
341
+ ```
342
+
343
+ 3) Render logic in EN include (`_includes/resume-section-en.html`): add a new branch, for example right before the closing `{% endif %}`:
344
+ ```liquid
345
+ {% elsif include.section_name == "publications" and site.resume_section.publications %}
346
+ <section class="content-section">
347
+ <header class="section-header">
348
+ <h2>Publications</h2>
349
+ </header>
350
+ {% for pub in resume_data.publications %}
351
+ {% if pub.active %}
352
+ <div class="resume-item">
353
+ <h3 class="resume-item-title" itemprop="headline">
354
+ {% if pub.url %}<a href="{{ pub.url }}" target="_blank" rel="noopener nofollow noreferrer">{{ pub.title }}</a>{% else %}{{ pub.title }}{% endif %}
355
+ </h3>
356
+ <h4 class="resume-item-details">{{ pub.venue }} &bull; {{ pub.year }}</h4>
357
+ {% if pub.summary %}<p class="resume-item-copy">{{ pub.summary }}</p>{% endif %}
358
+ </div>
359
+ {% endif %}
360
+ {% endfor %}
361
+ </section>
362
+ ```
363
+
364
+ 4) Arabic include (`_includes/resume-section-ar.html`): add the mirrored branch with localized labels.
365
+
366
+ That’s it—no layout changes needed. Your new section will render where you placed it in `resume_section_order`.
367
+
368
+ ---
369
+
370
+ ## Multilingual SEO with hreflang
371
+
372
+ Set `lang` and a shared `t_id` in both language pages (e.g., EN and AR resume pages):
373
+ ```yaml
374
+ ---
375
+ layout: resume-en
376
+ permalink: /resume/en/
377
+ lang: en
378
+ t_id: resume
379
+ ---
380
+ ```
381
+ ```yaml
382
+ ---
383
+ layout: resume-ar
384
+ permalink: /resume/ar/
385
+ lang: ar
386
+ t_id: resume
387
+ ---
388
+ ```
389
+ The `hreflang.html` include emits alternate links for all pages sharing the same `t_id`, and an `x-default` pointing to the English page if present.
390
+
391
+ ---
392
+
393
+ ## Analytics configuration
394
+
395
+ Pick one of the two:
396
+
397
+ - Google Tag Manager (recommended if you already use GTM)
398
+ ```yaml
399
+ analytics:
400
+ gtm: GTM-XXXXXXX
401
+ ```
402
+ - Google Analytics 4 (gtag.js)
403
+ ```yaml
404
+ analytics:
405
+ ga: true
406
+ gtag: G-XXXXXXXXXX
407
+ ```
408
+ `analytics-head.html` injects the head snippet; `analytics-body.html` adds the GTM `<noscript>` fallback in the body.
409
+
410
+ ---
411
+
412
+ ## Social links and icons
413
+
414
+ Configure in `_config.yml`:
415
+ ```yaml
416
+ social_links:
417
+ github: https://github.com/your-username
418
+ linkedin: https://www.linkedin.com/in/your-handle/
419
+ telegram: https://t.me/your-handle
420
+ twitter: https://twitter.com/your-handle
421
+ medium: https://medium.com/@your-handle
422
+ instagram: https://instagram.com/your-handle
423
+ website: https://yourdomain.tld
424
+ whatsapp: https://wa.me/123456789
425
+ devto: https://dev.to/your-handle
426
+ flickr: https://flickr.com/people/your-handle
427
+ pinterest: https://pinterest.com/your-handle
428
+ youtube: https://youtube.com/@your-handle
429
+ ```
430
+ Only keys you set are rendered. Icons are included from `vendors/lineicons-v5.0/`.
431
+
432
+ To add a network not yet supported (e.g., Mastodon):
433
+ 1. Add an SVG to `vendors/lineicons-v5.0/mastodon.svg`.
434
+ 2. Add a block to `social-links.html`:
435
+ ```liquid
436
+ {% if site.social_links.mastodon %}
437
+ <li class="icon-link-item">
438
+ <a href="{{ site.social_links.mastodon }}" class="icon-link" itemprop="sameAs" target="_blank" rel="noopener nofollow noreferrer">
439
+ {% include vendors/lineicons-v5.0/mastodon.svg %}
440
+ </a>
441
+ </li>
442
+ {% endif %}
443
+ ```
444
+ 3. Optionally add a print-only line in `print-social-links.html`.
445
+
446
+ ---
447
+
448
+ ## Customization recipes
449
+
450
+ ### Swap fonts or CSS per language
451
+ - Edit `resume-head-en.html` to change the EN font stack or CSS file.
452
+ - Edit `resume-head-ar.html` to change the AR font (Cairo by default) or CSS file.
453
+ - Keep RTL-specific styles in `cv-ar.css` (it imports RTL overrides through SCSS).
454
+
455
+ ### Add a new social network
456
+ - See steps above under “Social links and icons”.
457
+
458
+ ### Show languages in header vs its own section
459
+ - Header display uses `resume_section.lang_header` and reads active languages from `resume_data.languages`.
460
+ - If you set `resume_section.lang_header: true`, the header prints a compact “Languages: EN (Fluent), …”.
461
+ - If you also want a full “Languages” section, ensure `resume_section.languages: true`. If you only want it in the header, set the section flag to false or omit it from `resume_section_order`.
462
+
463
+ ### Customize date formats (EN/AR)
464
+ - EN formatting uses Liquid date filters inside `resume-section-en.html` (e.g., `'%b %Y'`, `'%b %d, %Y'`). Adjust those if needed.
465
+ - AR dates use `ar-date.html` which converts month names via `site.data.ar.months`. Ensure your Arabic months are defined (see “ar-date.html”).
466
+
467
+ ---
468
+
469
+ ## Best practices
470
+
471
+ - Prefer adding new functionality in `_includes/` rather than inlining complex markup in layouts.
472
+ - Keep includes small and focused (one job per include).
473
+ - Avoid hard-coding URLs; use `relative_url` and `absolute_url` filters.
474
+ - Respect configuration-driven behavior:
475
+ - Feature flags under `resume_section.*`
476
+ - Section order via `resume_section_order`
477
+ - Data path via `active_resume_path`
478
+ - Localize: if you add a section in EN, consider adding the AR counterpart with translated labels and RTL visual checks.
479
+ - SVG hygiene: strip unnecessary attributes/metadata; keep icons lightweight.
480
+ - Printing: if something is important for PDF/print, add a print-only variant similar to `print-social-links.html`.
481
+
482
+ ---