jekyll-theme-zer0 0.1.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.
Files changed (70) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE +21 -0
  3. data/README.md +499 -0
  4. data/_includes/branding.html +43 -0
  5. data/_includes/breadcrumbs.html +31 -0
  6. data/_includes/dev-shortcuts.html +57 -0
  7. data/_includes/footer.html +57 -0
  8. data/_includes/giscus.html +16 -0
  9. data/_includes/google-analytics.html +9 -0
  10. data/_includes/google-tag-manager-body.html +8 -0
  11. data/_includes/google-tag-manager-head.html +10 -0
  12. data/_includes/halfmoon.html +35 -0
  13. data/_includes/head.html +95 -0
  14. data/_includes/header.html +79 -0
  15. data/_includes/info-section.html +33 -0
  16. data/_includes/intro.html +27 -0
  17. data/_includes/js-cdn.html +24 -0
  18. data/_includes/nav_list.html +63 -0
  19. data/_includes/navbar.html +34 -0
  20. data/_includes/powered-by.html +22 -0
  21. data/_includes/quick-index.html +17 -0
  22. data/_includes/searchbar.html +10 -0
  23. data/_includes/seo.html +131 -0
  24. data/_includes/sidebar-categories.html +21 -0
  25. data/_includes/sidebar-folders.html +107 -0
  26. data/_includes/sidebar-left.html +41 -0
  27. data/_includes/sidebar-right.html +47 -0
  28. data/_includes/sitemap.html +123 -0
  29. data/_includes/style.html +1574 -0
  30. data/_includes/svg.html +81 -0
  31. data/_includes/toc +7 -0
  32. data/_includes/toc.html +182 -0
  33. data/_includes/zer0-env-var.html +88 -0
  34. data/_layouts/collection.html +42 -0
  35. data/_layouts/default.html +37 -0
  36. data/_layouts/home.html +16 -0
  37. data/_layouts/index.html +8 -0
  38. data/_layouts/javascript.html +8 -0
  39. data/_layouts/journals.html +41 -0
  40. data/_layouts/root.html +54 -0
  41. data/_sass/custom.scss +331 -0
  42. data/_sass/it-journey/_docs.scss +3219 -0
  43. data/_sass/it-journey/_syntax.scss +342 -0
  44. data/_sass/it-journey/_theme.scss +247 -0
  45. data/_sass/it-journey/_variables.scss +521 -0
  46. data/_sass/it-journey/code-copy.scss +105 -0
  47. data/assets/.DS_Store +0 -0
  48. data/assets/css/custom.css +120 -0
  49. data/assets/css/main.scss +22 -0
  50. data/assets/images/favicon_gpt_computer_retro.png +0 -0
  51. data/assets/images/gravatar-small.png +0 -0
  52. data/assets/images/gravatar.png +0 -0
  53. data/assets/images/info-banner-mountain-wizard.png +0 -0
  54. data/assets/images/wizard-on-journey.png +0 -0
  55. data/assets/images/zer0-checkpoint-1.png +0 -0
  56. data/assets/images/zer0-checkpoint-2.png +0 -0
  57. data/assets/js/auto-hide-nav.js +18 -0
  58. data/assets/js/back-to-top.js +24 -0
  59. data/assets/js/cheetsheet.js +73 -0
  60. data/assets/js/code-copy.js +27 -0
  61. data/assets/js/color-modes.js +80 -0
  62. data/assets/js/docs.min.js +1 -0
  63. data/assets/js/halfmoon.js +80 -0
  64. data/assets/js/myScript.js +12 -0
  65. data/assets/js/nanobar.min.js +1 -0
  66. data/assets/js/particles-source.js +888 -0
  67. data/assets/js/particles.js +133 -0
  68. data/assets/js/side-bar-folders.js +12 -0
  69. data/assets/particles.json +110 -0
  70. metadata +153 -0
@@ -0,0 +1,131 @@
1
+ <!--
2
+ file: seo.html
3
+ path: _includes/seo.html
4
+ includes: none
5
+ description: SEO meta tags for the site
6
+ purpose: This file is used to generate the SEO meta tags for the site. It is included in the head section of the HTML document.
7
+ -->
8
+
9
+ <!-- -->
10
+
11
+ {%- assign seo_url = site.url | append: site.baseurl -%}
12
+ {%- assign canonical_url = site.url %}
13
+ {%- assign seo_title = page.title | default: site.title | append: " " | append: title_separator | append: " " | append: site.title -%}
14
+ {% assign title_separator = site.title_separator | default: '-' %}
15
+ {%- assign seo_description = page.description | default: site.description -%}
16
+
17
+ {%- assign author = page.author | default: site.author -%}
18
+
19
+ <!-- TODO: build author data set for SEO -->
20
+
21
+ {%- assign author_twitter = site.author.twitter_username %}
22
+
23
+ {%- assign page_large_image = page.header.og_image | default: page.header.overlay_image | default: page.header.image | absolute_url -%}
24
+ {%- assign page_large_image = page_large_image | escape -%}
25
+
26
+ {%- assign page_teaser_image = page.preview | default: site.og_image -%}
27
+ {%- assign page_teaser_image = {{ site.public_folder }}/page_teaser_image | escape -%}
28
+
29
+ {%- assign site_og_image = site.og_image | absolute_url -%}
30
+ {%- assign site_og_image = site_og_image | escape -%}
31
+
32
+ {%- if page.date -%}
33
+ {%- assign og_type = "article" -%}
34
+ {%- else -%}
35
+ {%- assign og_type = "website" -%}
36
+ {%- endif -%}
37
+
38
+ <title>{{ seo_title | default: site.title }}{% if paginator %}{% unless paginator.page == 1 %} {{ title_separator }} {{ site.data.ui-text[site.locale].page | default: "Page" }} {{ paginator.page }}{% endunless %}{% endif %}</title>
39
+ <meta name="description" content="{{ seo_description }}">
40
+ <meta name="author" content="{{ author.name | default: author }}">
41
+
42
+ {% if og_type == "article" %}
43
+ <meta property="article:author" content="{{ author.name | default: author }}">
44
+ {% endif %}
45
+
46
+ <meta property="og:type" content="{{ og_type }}">
47
+ <meta property="og:locale" content="{{ site.locale | replace: "-", "_" | default: "en_US" }}">
48
+ <meta property="og:site_name" content="{{ site.title }}">
49
+ <meta property="og:title" content="{{ page.title | default: site.title | markdownify | strip_html | strip_newlines | escape_once }}">
50
+ <meta property="og:url" content="{{ canonical_url }}">
51
+
52
+ <meta property="og:description" content="{{ seo_description }}">
53
+
54
+
55
+ {% if page_large_image %}
56
+ <meta property="og:image" content="{{ page_large_image }}">
57
+ {% elsif page_teaser_image %}
58
+ <meta property="og:image" content="{{ page_teaser_image }}">
59
+ {% endif %}
60
+
61
+ {% if site.twitter.username %}
62
+ <meta name="twitter:site" content="@{{ site.twitter.username | replace: "@", "" }}">
63
+ <meta name="twitter:title" content="{{ page.title | default: site.title | markdownify | strip_html | strip_newlines | escape_once }}">
64
+ <meta name="twitter:description" content="{{ seo_description }}">
65
+ <meta name="twitter:url" content="{{ canonical_url }}">
66
+
67
+ {% if page_large_image %}
68
+ <meta name="twitter:card" content="summary_large_image">
69
+ <meta name="twitter:image" content="{{ page_large_image }}">
70
+ {% else %}
71
+ <meta name="twitter:card" content="summary">
72
+ {% if page_teaser_image %}
73
+ <meta name="twitter:image" content="{{ page_teaser_image }}">
74
+ {% endif %}
75
+ {% endif %}
76
+
77
+ {% if author_twitter %}
78
+ <meta name="twitter:creator" content="@{{ author_twitter }}">
79
+ {% endif %}
80
+ {% endif %}
81
+
82
+ <meta property="article:published_time" content="{{ page.date | default: page.lastmod | date_to_xmlschema }}">
83
+
84
+ {% if og_type == "article" and page.last_modified_at %}
85
+ <meta property="article:modified_time" content="{{ page.last_modified_at | date_to_xmlschema }}">
86
+ {% endif %}
87
+
88
+ {% if site.facebook %}
89
+ {% if site.facebook.publisher %}
90
+ <meta property="article:publisher" content="{{ site.facebook.publisher }}">
91
+ {% endif %}
92
+
93
+ {% if site.facebook.app_id %}
94
+ <meta property="fb:app_id" content="{{ site.facebook.app_id }}">
95
+ {% endif %}
96
+ {% endif %}
97
+
98
+ <link rel="canonical" href="{{ canonical_url }}">
99
+
100
+ {% if paginator.previous_page %}
101
+ <link rel="prev" href="{{ paginator.previous_page_path | absolute_url }}">
102
+ {% endif %}
103
+ {% if paginator.next_page %}
104
+ <link rel="next" href="{{ paginator.next_page_path | absolute_url }}">
105
+ {% endif %}
106
+
107
+ <script type="application/ld+json">
108
+ {
109
+ "@context": "https://schema.org",
110
+ {% if site.social.type == "Organization" %}
111
+ "@type": "Organization",
112
+ "url": {{ '/' | absolute_url | jsonify }}{% if site.og_image %},
113
+ "logo": {{ site_og_image | jsonify }}{% endif %}
114
+ {% else %}
115
+ "@type": "Person",
116
+ "name": {{ site.social.name | default: site.name | jsonify }},
117
+ "url": {{ '/' | absolute_url |jsonify }}{% if site.social.links %},
118
+ "sameAs": {{ site.social.links | jsonify }}{% endif %}
119
+ {% endif %}
120
+ }
121
+ </script>
122
+
123
+ <!-- Site verification -->
124
+
125
+ <meta name="google-site-verification" content="{{ site.google_site_verification }}" />
126
+ <meta name="msvalidate.01" content="{{ site.bing_site_verification }}">
127
+ <meta name="alexaVerifyID" content="{{ site.alexa_site_verification }}">
128
+ <meta name="yandex-verification" content="{{ site.yandex_site_verification }}">
129
+ <meta name="naver-site-verification" content="{{ site.naver_site_verification }}">
130
+ <meta name="baidu-site-verification" content="{{ site.baidu_site_verification }}">
131
+ <!-- end _includes/seo.html -->
@@ -0,0 +1,21 @@
1
+ <!-- sidebar-categories.html -->
2
+ <div class="d-flex flex-column flex-shrink-0" style="width: 280px;">
3
+ <a href="/" class="d-flex align-items-center text-decoration-none">
4
+ <span class="fs-4">Categories</span>
5
+ </a>
6
+ <hr>
7
+ {% for category in site.categories %}
8
+ <div class="">
9
+ <button class="btn btn-toggle align-items-center rounded collapsed" data-bs-toggle="collapse" data-bs-target="#{{category[0]}}-list" aria-expanded="false">
10
+ {{ category[0] }}
11
+ </button>
12
+ <div class="collapse" id="{{category[0]}}-list">
13
+ <ul class="btn-toggle-nav list-unstyled fw-normal small">
14
+ {% for post in category[1] %}
15
+ <li class="link-light"><a href="{{ post.url }}" class=" rounded">{{ post.title }}</a></li>
16
+ {% endfor %}
17
+ </ul>
18
+ </div>
19
+ </div>
20
+ {% endfor %}
21
+ </div>
@@ -0,0 +1,107 @@
1
+ <!--
2
+ file: sidebar-folders.html
3
+ title: Folder Structured Sidebar
4
+ -->
5
+
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>
24
+
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 %}
48
+ {% 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>
106
+ </li>
107
+ </ul> -->
@@ -0,0 +1,41 @@
1
+ <!--
2
+ file: sidebar.html
3
+ path: _includes/sidebar.html
4
+ includes: nav_list.html
5
+ -->
6
+
7
+ <!-- Sidebar Left Navigation - Offcanvas -->
8
+ <div class="offcanvas-lg offcanvas-start" tabindex="-1" id="bdSidebar" aria-labelledby="bdSidebarOffcanvasLabel">
9
+
10
+ <!-- Sidebar Header - Offcanvas -->
11
+ <div class="offcanvas-header border-bottom">
12
+ <h5 class="offcanvas-title" id="bdSidebarOffcanvasLabel">Browse docs</h5>
13
+ <button type="button" class="btn-close" data-bs-dismiss="offcanvas" aria-label="Close" data-bs-target="#bdSidebar"></button>
14
+ </div>
15
+
16
+ <!-- Left Sidebar Nav List - Offcanvas -->
17
+ <div class="offcanvas-body overflow-auto">
18
+
19
+ <!-- Dynamic listing of pages in side bar -->
20
+
21
+ {% if page.sidebar.nav == "dynamic" %}
22
+ <div class="list-group" id="sidebar-content">
23
+ {% assign folders = site.pages | where_exp: "item", "item.path contains 'index.md'" | sort: 'path' %}
24
+ {% include sidebar-folders.html folders=folders %}
25
+ </div>
26
+
27
+ <!-- Dynamic listing of page categories in side bar -->
28
+ {% elsif page.sidebar.nav == "searchCats" %}
29
+ <div class="list-group" id="sidebar-content">
30
+ {% assign categories = site.categories | sort %}
31
+ {% include sidebar-categories.html categories=categories %}
32
+
33
+ <!-- Manually defined navigation list in _data -->
34
+ {% elsif page.sidebar.nav %}
35
+ <!-- Includes nav_list.html -->
36
+ <nav class="w-100">
37
+ {% include nav_list.html nav=page.sidebar.nav %}
38
+ </nav>
39
+ </div>
40
+ {% endif %}
41
+ </div>
@@ -0,0 +1,47 @@
1
+ <!--
2
+ file: sidebar-right.html
3
+ path: _includes/sidebar-right.html
4
+ includes: nav_list.html, toc.html
5
+ -->
6
+
7
+ <!-- TOC button in mobile view -->
8
+ <div class="d-flex justify-content-end position-fixed top-50 end-0 translate-middle-y me-3">
9
+
10
+ <button class="btn bg-opacity-2 bd-toc-toggle d-lg-none border z-2" type="button" data-bs-toggle="offcanvas" data-bs-target="#tocContents" aria-controls="tocContents">
11
+ <i class="bi bi-list-ul"></i>
12
+ </button>
13
+ </div>
14
+
15
+ <!-- Right sidebar container -->
16
+ <div class="offcanvas-lg offcanvas-end" tabindex="-1" id="tocContents" aria-labelledby="tocLabel">
17
+ <div class="offcanvas-header">
18
+ <h5 class="offcanvas-title" id="tocLabel">Table of Contents</h5>
19
+ <button type="button" class="btn-close" data-bs-dismiss="offcanvas" aria-label="Close" data-bs-target="#tocContents"></button>
20
+ </div>
21
+ <div class="offcanvas-body">
22
+ <!-- Table of contents -->
23
+ <nav id="TableOfContents">
24
+ <!-- TOC tile -->
25
+ <div>
26
+ <strong>
27
+ <i class="fas fa-file-alt"></i>
28
+ On this page
29
+ </strong>
30
+ </div>
31
+
32
+ <!-- TOC list -->
33
+
34
+ <!-- TOC list -->
35
+ {% include toc.html sanitize=true html=content h_min=1 h_max=3 class="list-group-flush" item_class="list-group-item" anchor_class="" skip_no_ids=true %}
36
+ </nav>
37
+ </div>
38
+ </div>
39
+ <!-- Back to Top -->
40
+ <div>
41
+ <button onclick="topFunction()" id="backToTopBtn" title="Go to top">
42
+ <span class="arrow">&uarr;</span>
43
+ <span class="text">Back to Top</span>
44
+ </button>
45
+ </div>
46
+
47
+
@@ -0,0 +1,123 @@
1
+ <!--
2
+ file: sitemap.html
3
+ path: _includes/sitemap.html
4
+ description: This is the snippet for the sitemap page.
5
+ -->
6
+
7
+ <h1>Sitemap - Index</h1>
8
+
9
+ <input type="text" id="searchBar" onkeyup="searchFunction()" placeholder="Search for keywords..">
10
+
11
+ <div class="table-responsive">
12
+ <table class="table">
13
+ <thead>
14
+ <tr>
15
+ <th scope="col" data-type="string" data-order="desc">Collection <i class="sort-icon"></i></th>
16
+ <th scope="col" data-type="string" data-order="desc">Page <i class="sort-icon"></i></th>
17
+ <th scope="col" data-type="string" data-order="desc">Description<i class="sort-icon"></i></th>
18
+ <th scope="col" data-type="string" data-order="desc">Excerpt<i class="sort-icon"></i></th>
19
+ <th scope="col" data-type="string" data-order="desc">Path<i class="sort-icon"></i></th>
20
+ <th scope="col" data-type="date" data-order="desc">Last Modified Date <i class="sort-icon"></i></th>
21
+ <th scope="col" data-type="string" data-order="desc">Categories<i class="sort-icon"></i></th>
22
+ <th scope="col" data-type="string" data-order="desc">Tags<i class="sort-icon"></i></th>
23
+ <th scope="col" data-type="string" data-order="desc">Absolute URL<i class="sort-icon"></i></th>
24
+ <th scope="col" data-type="string" data-order="desc">Author <i class="sort-icon"></i></th>
25
+
26
+ </tr>
27
+ </thead>
28
+ <tbody>
29
+ {% for collection in site.collections %}
30
+ {% for item in collection.docs %}
31
+ <tr>
32
+ <td>{{ collection.label }}</td>
33
+ <td>
34
+ <a href="{{ item.url | relative_url }}">{{ item.title }}</a>
35
+ </td>
36
+ <td>{{ item.description }}</td>
37
+ <td>{{ item.excerpt }}</td>
38
+ <td>{{ item.path }}</td>
39
+ <td>{{ item.lastmod | date: "%Y/%m/%d" | default: "null" }}</td>
40
+ <td>{{ item.categories | join: ", " }}</td>
41
+ <td>{{ item.tags | join: ", " }}</td>
42
+ <td>
43
+ <a href="{{ site.url }}{{ item.url }}">{{ site.url }}{{ item.url }}</a>
44
+ </td>
45
+ <td>{{ item.author }}</td>
46
+ </tr>
47
+ {% endfor %}
48
+ {% endfor %}
49
+ </tbody>
50
+ </table>
51
+ </div>
52
+
53
+ <!-- Sorting feature -->
54
+
55
+ <script>
56
+ document.querySelectorAll('th').forEach(header => {
57
+ header.addEventListener('click', () => {
58
+ const tableElement = document.querySelector('table');
59
+ const headerIndex = Array.prototype.indexOf.call(header.parentNode.children, header);
60
+ const currentTbody = tableElement.querySelector('tbody');
61
+ const newTbody = currentTbody.cloneNode(true);
62
+ const rows = Array.from(newTbody.querySelectorAll('tr'));
63
+ const type = header.getAttribute('data-type');
64
+ const order = header.getAttribute('data-order');
65
+ const sortedRows = rows.sort((a, b) => {
66
+ const aValue = a.children[headerIndex].textContent;
67
+ const bValue = b.children[headerIndex].textContent;
68
+ if (type === 'date') {
69
+ const aDate = aValue === "null" ? new Date(0) : new Date(...aValue.split('/').map((val, idx) => parseInt(val) - (idx === 1 ? 1 : 0))); // subtract 1 from month
70
+ const bDate = bValue === "null" ? new Date(0) : new Date(...bValue.split('/').map((val, idx) => parseInt(val) - (idx === 1 ? 1 : 0))); // subtract 1 from month
71
+ return order === 'asc' ? aDate - bDate : bDate - aDate;
72
+ }
73
+ return order === 'asc' ? aValue.localeCompare(bValue) : bValue.localeCompare(aValue);
74
+ });
75
+ sortedRows.forEach(row => newTbody.appendChild(row));
76
+ tableElement.replaceChild(newTbody, currentTbody);
77
+ header.setAttribute('data-order', order === 'asc' ? 'desc' : 'asc');
78
+ document.querySelectorAll('.sort-icon').forEach(icon => icon.className = 'sort-icon'); // clear all icons
79
+ header.querySelector('.sort-icon').className = order === 'asc' ? 'sort-icon bi bi-arrow-down' : 'sort-icon bi bi-arrow-up'; // set the icon for the sorted column
80
+
81
+ });
82
+ });
83
+ </script>
84
+
85
+ <!-- searchbar script -->
86
+
87
+ <script>
88
+ function searchFunction() {
89
+ var input, filter, table, tr, td, i, j, txtValue;
90
+ input = document.getElementById("searchBar");
91
+ filter = input.value.toLowerCase();
92
+ table = document.getElementsByTagName("table");
93
+ tr = table[0].getElementsByTagName("tr");
94
+
95
+ for (i = 0; i < tr.length; i++) {
96
+ td = tr[i].getElementsByTagName("td");
97
+ for (j = 0; j < td.length; j++) {
98
+ if (td[j]) {
99
+ txtValue = td[j].textContent || td[j].innerText;
100
+ if (txtValue.toLowerCase().indexOf(filter) > -1) {
101
+ tr[i].style.display = "";
102
+ break;
103
+ } else {
104
+ tr[i].style.display = "none";
105
+ }
106
+ }
107
+ }
108
+ }
109
+ }
110
+ </script>
111
+
112
+ <script>
113
+ // Parse the URL query parameters
114
+ const urlParams = new URLSearchParams(window.location.search);
115
+ // Get the 'q' parameter
116
+ const searchQuery = urlParams.get('q');
117
+ // If a search query was provided, set it as the value of the search bar
118
+ if (searchQuery) {
119
+ document.getElementById('searchBar').value = searchQuery;
120
+ // Call the search function
121
+ searchFunction();
122
+ }
123
+ </script>