jekyll-theme-zer0 0.6.0 → 0.7.1

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,176 @@
1
+ <!--
2
+ ===================================================================
3
+ POST CARD COMPONENT - Reusable blog post card
4
+ ===================================================================
5
+
6
+ File: post-card.html
7
+ Path: _includes/components/post-card.html
8
+ Purpose: Consistent post card display across blog, category, and archive pages
9
+
10
+ Parameters:
11
+ - post (required): The post object to display
12
+ - show_category (optional): Show category badge (default: true)
13
+ - show_excerpt (optional): Show post excerpt (default: true)
14
+ - show_author (optional): Show author name (default: true)
15
+ - show_reading_time (optional): Show reading time (default: true)
16
+ - card_class (optional): Additional CSS classes for the card
17
+
18
+ Usage:
19
+ {% include components/post-card.html post=post %}
20
+ {% include components/post-card.html post=post show_category=false %}
21
+ {% include components/post-card.html post=post card_class="shadow-lg" %}
22
+
23
+ Features:
24
+ - Breaking news badge (red, top-left)
25
+ - Featured badge (gold star, top-right)
26
+ - Preview image with fallback
27
+ - Category badge
28
+ - Reading time calculation
29
+ - Author attribution
30
+ - Publication date
31
+ - Responsive design
32
+
33
+ Dependencies:
34
+ - Bootstrap 5 card components
35
+ - Bootstrap Icons
36
+ - site.public_folder for image paths
37
+ - site.teaser for fallback image
38
+ ===================================================================
39
+ -->
40
+
41
+ {% comment %} Parameter defaults {% endcomment %}
42
+ {% assign show_category = include.show_category | default: true %}
43
+ {% assign show_excerpt = include.show_excerpt | default: true %}
44
+ {% assign show_author = include.show_author | default: true %}
45
+ {% assign show_reading_time = include.show_reading_time | default: true %}
46
+ {% assign card_class = include.card_class | default: "" %}
47
+
48
+ {% comment %}
49
+ Reading time: Use estimated_reading_time from front matter if available,
50
+ otherwise skip to avoid accessing post.content which causes nesting issues
51
+ {% endcomment %}
52
+ {% if include.post.estimated_reading_time %}
53
+ {% assign reading_time = include.post.estimated_reading_time %}
54
+ {% else %}
55
+ {% assign reading_time = "2 min" %}
56
+ {% endif %}
57
+
58
+ <div class="col">
59
+ <div class="card h-100 post-card border-0 shadow-sm {{ card_class }}">
60
+
61
+ <!-- ====================== -->
62
+ <!-- CARD IMAGE & BADGES -->
63
+ <!-- ====================== -->
64
+ <div class="position-relative">
65
+ <!-- Breaking News Badge -->
66
+ {% if include.post.breaking %}
67
+ <span class="badge bg-danger position-absolute top-0 start-0 m-2 z-1">
68
+ <i class="bi bi-lightning-fill me-1"></i>Breaking
69
+ </span>
70
+ {% endif %}
71
+
72
+ <!-- Featured Badge -->
73
+ {% if include.post.featured %}
74
+ <span class="badge bg-warning text-dark position-absolute top-0 end-0 m-2 z-1">
75
+ <i class="bi bi-star-fill me-1"></i>Featured
76
+ </span>
77
+ {% endif %}
78
+
79
+ <!-- Preview Image -->
80
+ <a href="{{ include.post.url | relative_url }}" class="text-decoration-none">
81
+ {% if include.post.preview %}
82
+ <img src="{{ site.baseurl }}/{{ site.public_folder }}/{{ include.post.preview }}"
83
+ class="card-img-top"
84
+ alt="Preview image for {{ include.post.title }}"
85
+ loading="lazy">
86
+ {% else %}
87
+ <img src="{{ site.baseurl }}/{{ site.public_folder }}/{{ site.teaser }}"
88
+ class="card-img-top"
89
+ alt="Default preview image"
90
+ loading="lazy">
91
+ {% endif %}
92
+ </a>
93
+ </div>
94
+
95
+ <!-- ====================== -->
96
+ <!-- CARD BODY -->
97
+ <!-- ====================== -->
98
+ <div class="card-body d-flex flex-column">
99
+
100
+ <!-- Category Badge -->
101
+ {% if show_category and include.post.categories.size > 0 %}
102
+ <div class="mb-2">
103
+ {% assign primary_category = include.post.categories | first %}
104
+ <a href="{{ site.baseurl }}/posts/{{ primary_category | slugify }}/"
105
+ class="badge bg-primary text-decoration-none">
106
+ {{ primary_category }}
107
+ </a>
108
+ </div>
109
+ {% endif %}
110
+
111
+ <!-- Post Title -->
112
+ <h5 class="card-title mb-2">
113
+ <a href="{{ include.post.url | relative_url }}"
114
+ class="text-decoration-none text-body-emphasis stretched-link">
115
+ {{ include.post.title }}
116
+ </a>
117
+ </h5>
118
+
119
+ <!-- Subtitle if available -->
120
+ {% if include.post.sub-title %}
121
+ <p class="card-subtitle text-muted small mb-2">
122
+ {{ include.post.sub-title }}
123
+ </p>
124
+ {% endif %}
125
+
126
+ <!-- Post Excerpt -->
127
+ {% if show_excerpt %}
128
+ <p class="card-text text-muted small flex-grow-1">
129
+ {{ include.post.excerpt | strip_html | truncate: 120 }}
130
+ </p>
131
+ {% endif %}
132
+
133
+ </div>
134
+
135
+ <!-- ====================== -->
136
+ <!-- CARD FOOTER -->
137
+ <!-- ====================== -->
138
+ <div class="card-footer bg-transparent border-top-0">
139
+ <div class="d-flex justify-content-between align-items-center small text-muted">
140
+
141
+ <!-- Left: Author & Date -->
142
+ <div>
143
+ {% if show_author and include.post.author %}
144
+ <span class="me-2">
145
+ <i class="bi bi-person me-1"></i>{{ include.post.author }}
146
+ </span>
147
+ {% endif %}
148
+ <span>
149
+ <i class="bi bi-calendar me-1"></i>{{ include.post.date | date: "%b %d, %Y" }}
150
+ </span>
151
+ </div>
152
+
153
+ <!-- Right: Reading Time -->
154
+ {% if show_reading_time %}
155
+ <span>
156
+ <i class="bi bi-clock me-1"></i>{{ reading_time }}
157
+ </span>
158
+ {% endif %}
159
+
160
+ </div>
161
+
162
+ <!-- Tags (compact) -->
163
+ {% if include.post.tags.size > 0 %}
164
+ <div class="mt-2">
165
+ {% for tag in include.post.tags limit: 3 %}
166
+ <span class="badge bg-light text-dark border me-1">{{ tag }}</span>
167
+ {% endfor %}
168
+ {% if include.post.tags.size > 3 %}
169
+ <span class="badge bg-light text-muted border">+{{ include.post.tags.size | minus: 3 }}</span>
170
+ {% endif %}
171
+ </div>
172
+ {% endif %}
173
+ </div>
174
+
175
+ </div>
176
+ </div>
@@ -1,8 +1,19 @@
1
- <!--
2
- file: banding.html
3
- path: _includes/branding.html
4
- inclues: none
5
- description:
1
+ <!--
2
+ ===================================================================
3
+ BRANDING - Site Title and Subtitle Display
4
+ ===================================================================
5
+
6
+ File: branding.html
7
+ Path: _includes/core/branding.html
8
+ Purpose: Display site title and optional subtitle in navbar
9
+
10
+ Dependencies:
11
+ - site.title: Main site title from _config.yml
12
+ - site.subtitle: Optional subtitle from _config.yml
13
+ - site.default_icon: Icon framework class (e.g., 'bi')
14
+ - site.title_icon: Icon for title display
15
+ - site.subtitle_icon: Icon for subtitle display
16
+ ===================================================================
6
17
  -->
7
18
  <!-- Color Schema Override
8
19
  TODO: Add a poline plug-in to generate color scheme
@@ -22,19 +33,20 @@
22
33
  <!-- Title Section -->
23
34
 
24
35
  <div class="navbar-brand">
25
- <a class="nav-link" href="{{ site.domain_url}}{{ page.url }}">
26
- <i class="d-sm-inline d-md-none {{ site.default_icon }} {{ site .default_icon }}-{{ site.title_icon | default: site.powered_by.default }}" aria-hidden="true"></i>
27
- <!-- display name if there's enough space, else icon only -->
36
+ <a class="nav-link" href="{{ page.url | relative_url }}">
37
+ <i class="d-sm-inline d-md-none {{ site.default_icon }} {{ site.default_icon }}-{{ site.title_icon | default: 'house' }}" aria-hidden="true"></i>
38
+ <!-- Display name if there's enough space, else icon only -->
28
39
  <span class="d-none d-md-inline">
29
- {{ site.title | default: site.title }}
40
+ {{ site.title }}
30
41
  </span>
42
+ </a>
31
43
  </div>
32
44
 
33
45
  <div class="navbar-brand">
34
- <!-- If a subtitle exsits -->
46
+ <!-- If a subtitle exists -->
35
47
  {%- if site.subtitle -%}
36
- <a class="nav-link" href="http://localhost:{{ site.port }}{{ site.baseurl}}{{ page.url }}">
37
- <i class="d-sm-inline d-md-none {{ site.default_icon }} {{ site.default_icon }}-{{ site.subtitle_icon | default: site.powered_by.default }}" aria-hidden="true"></i>
48
+ <a class="nav-link" href="{{ page.url | relative_url }}">
49
+ <i class="d-sm-inline d-md-none {{ site.default_icon }} {{ site.default_icon }}-{{ site.subtitle_icon | default: 'journal' }}" aria-hidden="true"></i>
38
50
  <span class="d-none d-md-inline">
39
51
  {{ site.subtitle }}
40
52
  </span>
@@ -35,13 +35,13 @@
35
35
  <!-- ================================ -->
36
36
  <!-- JAVASCRIPT LIBRARIES -->
37
37
  <!-- ================================ -->
38
- <!-- Custom theme JavaScript - Loaded early for UI functionality -->
39
- <script src="{{ '/assets/js/myScript.js' | relative_url }}"></script>
40
- <script src="{{ '/assets/js/auto-hide-nav.js' | relative_url }}"></script>
41
- <script src="{{ '/assets/js/back-to-top.js' | relative_url }}"></script>
42
- <script src="{{ '/assets/js/halfmoon.js' | relative_url }}"></script>
43
- <script src="{{ '/assets/js/side-bar-folders.js' | relative_url }}"></script>
44
- <script src="{{ '/assets/js/code-copy.js' | relative_url }}"></script>
38
+ <!-- Custom theme JavaScript - Deferred for performance -->
39
+ <script defer src="{{ '/assets/js/myScript.js' | relative_url }}"></script>
40
+ <script defer src="{{ '/assets/js/auto-hide-nav.js' | relative_url }}"></script>
41
+ <script defer src="{{ '/assets/js/back-to-top.js' | relative_url }}"></script>
42
+ <script defer src="{{ '/assets/js/halfmoon.js' | relative_url }}"></script>
43
+ <script defer src="{{ '/assets/js/side-bar-folders.js' | relative_url }}"></script>
44
+ <script defer src="{{ '/assets/js/code-copy.js' | relative_url }}"></script>
45
45
 
46
46
  <!-- ================================ -->
47
47
  <!-- THIRD PARTY INTEGRATIONS -->
@@ -53,7 +53,7 @@
53
53
  {% endif %}
54
54
 
55
55
  <!-- Nano Progress Bar - Visual loading indicator -->
56
- <script src="{{'/assets/js/nanobar.min.js' | relative_url }}"></script>
56
+ <script defer src="{{'/assets/js/nanobar.min.js' | relative_url }}"></script>
57
57
 
58
58
  <!-- Progress Bar Initialization - Creates visual loading feedback -->
59
59
  <script>
@@ -1,107 +1,67 @@
1
- <!--
2
- file: sidebar-folders.html
3
- title: Folder Structured Sidebar
4
- -->
1
+ <!--
2
+ ===================================================================
3
+ SIDEBAR FOLDERS - Collection Document Folder Structure
4
+ ===================================================================
5
+
6
+ File: sidebar-folders.html
7
+ Path: _includes/navigation/sidebar-folders.html
8
+ Purpose: Display collection documents organized by folder structure
9
+
10
+ Template Logic:
11
+ - Gets the current page's collection
12
+ - Sorts documents by path to maintain folder hierarchy
13
+ - Displays folder names and document links
14
+ - Uses Bootstrap list-group for styling
15
+
16
+ Dependencies:
17
+ - page.collection: Current collection name from page front matter
18
+ - site.collections: Jekyll collections configuration
19
+ - Bootstrap 5 list-group component
20
+
21
+ Usage:
22
+ - Include in sidebar when page.sidebar.nav == "dynamic"
23
+ - Requires page to be part of a Jekyll collection
24
+ ===================================================================
25
+ -->
5
26
 
6
- {% assign root_folder = site.collections | where: "label", page.collection | first %}
7
- <h2>{{ root_folder.label }}</h2>
8
- {% assign docs = root_folder.docs | sort: 'path' %}
9
- {% assign prev_path = "" %}
10
- <ul class="list-group list-group-flush">
11
- {% for doc in docs %}
12
- {% assign current_path = doc.path | split: '/' | pop %}
13
- {% if current_path != prev_path %}
14
- {% for folder in current_path %}
15
- {% if forloop.index != 1 %}
16
- <li class="folder ">{{ folder }}</li>
17
- {% endif %}
18
- {% endfor %}
19
- {% assign prev_path = current_path %}
20
- {% endif %}
21
- <li class="file list-group-item list-group-item-action"><a href="{{ doc.url | relative_url }}">{{ doc.title }}</a></li>
22
- {% endfor %}
23
- </ul>
27
+ {% assign root_folder = site.collections | where: "label", page.collection | first %}
24
28
 
25
- <!-- {% assign collection = site.collections | where: "label", page.collection | first %}
26
-
27
- <div class="d-flex">
28
- <ul class="list-group list-group-flush ">
29
- {% assign folders = "" | split: '/' %}
30
- {% for doc in collection.docs %}
31
- {% assign doc_folders = doc.path | split: '/' %}
32
- {% for doc_folder in doc_folders %}
33
- {% unless folders contains doc_folder %}
34
- {% assign folders = folders | push: doc_folder %}
35
- <button class="btn btn-toggle d-inline-flex align-items-center rounded border-0" data-bs-toggle="collapse" data-bs-target="#{{ doc_folder }}-collapse" aria-expanded="true">
36
- {{ doc_folder }}
37
- </button>
38
- <div class="collapse show" id="{{ doc_folder }}-collapse" style="">
39
- <ul class="btn-toggle-nav list-unstyled fw-normal pb-1 small">
40
- {% for doc in collection.docs %}
41
- {% if doc.path contains doc_folder %}
42
- <li><a href="{{ doc.url }}" class="link-body-emphasis d-inline-flex text-decoration-none rounded">{{ doc.title }}</a></li>
43
- {% endif %}
44
- {% endfor %}
45
- </ul>
46
- </div>
47
- {% endunless %}
29
+ {% if root_folder %}
30
+ <h2 class="h5 mb-3">
31
+ <i class="bi bi-folder me-2"></i>
32
+ {{ root_folder.label | capitalize }}
33
+ </h2>
34
+
35
+ {% assign docs = root_folder.docs | sort: 'path' %}
36
+ {% assign prev_path = "" %}
37
+
38
+ <ul class="list-group list-group-flush">
39
+ {% for doc in docs %}
40
+ {% assign current_path = doc.path | split: '/' | pop %}
41
+
42
+ {% if current_path != prev_path %}
43
+ {% for folder in current_path %}
44
+ {% if forloop.index != 1 %}
45
+ <li class="folder list-group-item bg-body-tertiary fw-semibold">
46
+ <i class="bi bi-folder2 me-1"></i>
47
+ {{ folder }}
48
+ </li>
49
+ {% endif %}
48
50
  {% endfor %}
49
- {% endfor %}
50
- </ul>
51
- </div> -->
52
-
53
-
54
- <!-- <ul class="list-unstyled ps-0">
55
- <li class="mb-1">
56
- <button class="btn btn-toggle d-inline-flex align-items-center rounded border-0" data-bs-toggle="collapse" data-bs-target="#home-collapse" aria-expanded="true">
57
- Home
58
- </button>
59
- <div class="collapse show" id="home-collapse" style="">
60
- <ul class="btn-toggle-nav list-unstyled fw-normal pb-1 small">
61
- <li><a href="#" class="link-body-emphasis d-inline-flex text-decoration-none rounded">Overview</a></li>
62
- <li><a href="#" class="link-body-emphasis d-inline-flex text-decoration-none rounded">Updates</a></li>
63
- <li><a href="#" class="link-body-emphasis d-inline-flex text-decoration-none rounded">Reports</a></li>
64
- </ul>
65
- </div>
66
- </li>
67
- <li class="mb-1">
68
- <button class="btn btn-toggle d-inline-flex align-items-center rounded border-0 collapsed" data-bs-toggle="collapse" data-bs-target="#dashboard-collapse" aria-expanded="false">
69
- Dashboard
70
- </button>
71
- <div class="collapse" id="dashboard-collapse" style="">
72
- <ul class="btn-toggle-nav list-unstyled fw-normal pb-1 small">
73
- <li><a href="#" class="link-body-emphasis d-inline-flex text-decoration-none rounded">Overview</a></li>
74
- <li><a href="#" class="link-body-emphasis d-inline-flex text-decoration-none rounded">Weekly</a></li>
75
- <li><a href="#" class="link-body-emphasis d-inline-flex text-decoration-none rounded">Monthly</a></li>
76
- <li><a href="#" class="link-body-emphasis d-inline-flex text-decoration-none rounded">Annually</a></li>
77
- </ul>
78
- </div>
79
- </li>
80
- <li class="mb-1">
81
- <button class="btn btn-toggle d-inline-flex align-items-center rounded border-0 collapsed" data-bs-toggle="collapse" data-bs-target="#orders-collapse" aria-expanded="false">
82
- Orders
83
- </button>
84
- <div class="collapse" id="orders-collapse" style="">
85
- <ul class="btn-toggle-nav list-unstyled fw-normal pb-1 small">
86
- <li><a href="#" class="link-body-emphasis d-inline-flex text-decoration-none rounded">New</a></li>
87
- <li><a href="#" class="link-body-emphasis d-inline-flex text-decoration-none rounded">Processed</a></li>
88
- <li><a href="#" class="link-body-emphasis d-inline-flex text-decoration-none rounded">Shipped</a></li>
89
- <li><a href="#" class="link-body-emphasis d-inline-flex text-decoration-none rounded">Returned</a></li>
90
- </ul>
91
- </div>
92
- </li>
93
- <li class="border-top my-3"></li>
94
- <li class="mb-1">
95
- <button class="btn btn-toggle d-inline-flex align-items-center rounded border-0 collapsed" data-bs-toggle="collapse" data-bs-target="#account-collapse" aria-expanded="false">
96
- Account
97
- </button>
98
- <div class="collapse" id="account-collapse">
99
- <ul class="btn-toggle-nav list-unstyled fw-normal pb-1 small">
100
- <li><a href="#" class="link-body-emphasis d-inline-flex text-decoration-none rounded">New...</a></li>
101
- <li><a href="#" class="link-body-emphasis d-inline-flex text-decoration-none rounded">Profile</a></li>
102
- <li><a href="#" class="link-body-emphasis d-inline-flex text-decoration-none rounded">Settings</a></li>
103
- <li><a href="#" class="link-body-emphasis d-inline-flex text-decoration-none rounded">Sign out</a></li>
104
- </ul>
105
- </div>
51
+ {% assign prev_path = current_path %}
52
+ {% endif %}
53
+
54
+ <li class="file list-group-item list-group-item-action{% if page.url == doc.url %} active{% endif %}">
55
+ <a href="{{ doc.url | relative_url }}" class="text-decoration-none">
56
+ <i class="bi bi-file-text me-1"></i>
57
+ {{ doc.title }}
58
+ </a>
106
59
  </li>
107
- </ul> -->
60
+ {% endfor %}
61
+ </ul>
62
+ {% else %}
63
+ <p class="text-muted small">
64
+ <i class="bi bi-info-circle me-1"></i>
65
+ No collection found for this page.
66
+ </p>
67
+ {% endif %}