From 7b3bfb4241df72749e24aa392c94ef96fdbdb99e Mon Sep 17 00:00:00 2001 From: clearbluejar <3752074+clearbluejar@users.noreply.github.com> Date: Wed, 27 Sep 2023 15:47:45 +0000 Subject: [PATCH] update to latest just-the-docs 6.2, fix last-mod-date --- Gemfile | 6 +-- Gemfile.lock | 84 +++++++++++++++++++---------- _includes/head.html | 97 ++++++++++++++++++---------------- _includes/js/custom.js | 14 ++--- _plugins/pages-lastmod-hook.rb | 16 +++--- index.md | 7 +-- 6 files changed, 131 insertions(+), 93 deletions(-) diff --git a/Gemfile b/Gemfile index 5004807..74904a1 100644 --- a/Gemfile +++ b/Gemfile @@ -1,11 +1,11 @@ source 'https://rubygems.org' -gem "jekyll", "~> 4.2" # installed by `gem jekyll` +gem "jekyll", "~> 4.3.2" # installed by `gem jekyll` gem "webrick" # required when using Ruby >= 3 -gem "just-the-docs", "0.4.0.rc3" +gem "just-the-docs", "0.6.2" gem "jekyll-relative-links" gem "jekyll-sitemap" - +gem "jekyll-seo-tag" gem "html-proofer" \ No newline at end of file diff --git a/Gemfile.lock b/Gemfile.lock index d6a2b8e..617b874 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,10 +1,20 @@ GEM remote: https://rubygems.org/ specs: - addressable (2.8.1) + Ascii85 (1.1.0) + addressable (2.8.5) public_suffix (>= 2.0.2, < 6.0) + afm (0.2.2) + async (2.6.4) + console (~> 1.10) + fiber-annotation + io-event (~> 1.1) + timers (~> 4.1) colorator (1.1.0) - concurrent-ruby (1.1.10) + concurrent-ruby (1.2.2) + console (1.23.2) + fiber-annotation + fiber-local em-websocket (0.5.3) eventmachine (>= 0.12.9) http_parser.rb (~> 0) @@ -12,20 +22,26 @@ GEM ffi (>= 1.15.0) eventmachine (1.2.7) ffi (1.15.5) + fiber-annotation (0.2.0) + fiber-local (1.0.0) forwardable-extended (2.6.0) - html-proofer (4.4.3) + google-protobuf (3.24.3-aarch64-linux) + google-protobuf (3.24.3-x86_64-linux) + hashery (2.1.2) + html-proofer (5.0.8) addressable (~> 2.3) - mercenary (~> 0.3) + async (~> 2.1) nokogiri (~> 1.13) - parallel (~> 1.10) + pdf-reader (~> 2.11) rainbow (~> 3.0) typhoeus (~> 1.3) yell (~> 2.0) zeitwerk (~> 2.5) http_parser.rb (0.8.0) - i18n (1.12.0) + i18n (1.14.1) concurrent-ruby (~> 1.0) - jekyll (4.3.1) + io-event (1.3.2) + jekyll (4.3.2) addressable (~> 2.4) colorator (~> 1.0) em-websocket (~> 0.5) @@ -41,56 +57,69 @@ GEM safe_yaml (~> 1.0) terminal-table (>= 1.8, < 4.0) webrick (~> 1.7) - jekyll-relative-links (0.6.1) + jekyll-include-cache (0.2.1) + jekyll (>= 3.7, < 5.0) + jekyll-relative-links (0.7.0) jekyll (>= 3.3, < 5.0) - jekyll-sass-converter (2.2.0) - sassc (> 2.0.1, < 3.0) + jekyll-sass-converter (3.0.0) + sass-embedded (~> 1.54) jekyll-seo-tag (2.8.0) jekyll (>= 3.8, < 5.0) jekyll-sitemap (1.4.0) jekyll (>= 3.7, < 5.0) jekyll-watch (2.2.1) listen (~> 3.0) - just-the-docs (0.4.0.rc3) + just-the-docs (0.6.2) jekyll (>= 3.8.5) + jekyll-include-cache jekyll-seo-tag (>= 2.0) rake (>= 12.3.1) kramdown (2.4.0) rexml kramdown-parser-gfm (1.1.0) kramdown (~> 2.0) - liquid (4.0.3) - listen (3.7.1) + liquid (4.0.4) + listen (3.8.0) rb-fsevent (~> 0.10, >= 0.10.3) rb-inotify (~> 0.9, >= 0.9.10) mercenary (0.4.0) - nokogiri (1.13.10-aarch64-linux) + nokogiri (1.15.4-aarch64-linux) racc (~> 1.4) - nokogiri (1.13.10-x86_64-linux) + nokogiri (1.15.4-x86_64-linux) racc (~> 1.4) - parallel (1.22.1) pathutil (0.16.2) forwardable-extended (~> 2.6) - public_suffix (5.0.1) - racc (1.6.1) + pdf-reader (2.11.0) + Ascii85 (~> 1.0) + afm (~> 0.2.1) + hashery (~> 2.0) + ruby-rc4 + ttfunk + public_suffix (5.0.3) + racc (1.7.1) rainbow (3.1.1) rake (13.0.6) rb-fsevent (0.11.2) rb-inotify (0.10.1) ffi (~> 1.0) - rexml (3.2.5) - rouge (4.0.0) + rexml (3.2.6) + rouge (4.1.3) + ruby-rc4 (0.1.5) safe_yaml (1.0.5) - sassc (2.4.0) - ffi (~> 1.9) + sass-embedded (1.68.0-aarch64-linux-gnu) + google-protobuf (~> 3.23) + sass-embedded (1.68.0-x86_64-linux-gnu) + google-protobuf (~> 3.23) terminal-table (3.0.2) unicode-display_width (>= 1.1.1, < 3) + timers (4.3.5) + ttfunk (1.7.0) typhoeus (1.4.0) ethon (>= 0.9.0) - unicode-display_width (2.3.0) - webrick (1.7.0) + unicode-display_width (2.4.2) + webrick (1.8.1) yell (2.2.2) - zeitwerk (2.6.6) + zeitwerk (2.6.11) PLATFORMS aarch64-linux @@ -98,10 +127,11 @@ PLATFORMS DEPENDENCIES html-proofer - jekyll (~> 4.2) + jekyll (~> 4.3.2) jekyll-relative-links + jekyll-seo-tag jekyll-sitemap - just-the-docs (= 0.4.0.rc3) + just-the-docs (= 0.6.2) webrick BUNDLED WITH diff --git a/_includes/head.html b/_includes/head.html index 528dbfa..3a690bd 100644 --- a/_includes/head.html +++ b/_includes/head.html @@ -1,46 +1,53 @@ +{%- comment -%} +Include as: {%- include head.html -%} +Depends on: site.ga_tracking, site.ga_tracking_anonymize_ip, +site.search_enabled, site.static_files, site.favicon_ico. +Results in: HTML for the head element. +Includes: +head_nav.html, head_custom.html. +Overwrites: +ga_tracking_ids, ga_property, file, favicon. +Should not be cached, because included files depend on page. +{%- endcomment -%} + - - - - {% unless site.plugins contains "jekyll-seo-tag" %} - {{ page.title }} - {{ site.title }} - - {% if page.description %} - - {% endif %} - {% endunless %} - - {% include favicon.html %} - - - - - {% if site.ga_tracking != nil %} - - - - {% endif %} - - {% if site.search_enabled != false %} - - {% endif %} - - {% if site.mermaid %} - - {% endif %} - - - - - - {% seo %} - - {% include head_custom.html %} - - \ No newline at end of file + + + + + + + + {% include head_nav.html %} + + {% if site.ga_tracking != nil %} + {% assign ga_tracking_ids = site.ga_tracking | split: "," %} + + + {% endif %} + + {% if site.search_enabled != false %} + + {% endif %} + + + + + + {% include_cached favicon.html %} + + {% seo %} + + {% include head_custom.html %} + + \ No newline at end of file diff --git a/_includes/js/custom.js b/_includes/js/custom.js index a99a4d6..0c0d964 100644 --- a/_includes/js/custom.js +++ b/_includes/js/custom.js @@ -1,11 +1,11 @@ // window.matchMedia('(prefers-color-scheme: dark)') -// .addEventListener('change', event => { -// if (event.matches) { -// jtd.setTheme('dark'); -// } else { -// jtd.setTheme('light'); -// } -// }); +// .addEventListener('change', event => { +// if (event.matches) { +// jtd.setTheme('dark'); +// } else { +// jtd.setTheme('light'); +// } +// }); // if (window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches) { // jtd.setTheme('dark'); diff --git a/_plugins/pages-lastmod-hook.rb b/_plugins/pages-lastmod-hook.rb index 49299f3..44af858 100644 --- a/_plugins/pages-lastmod-hook.rb +++ b/_plugins/pages-lastmod-hook.rb @@ -1,6 +1,6 @@ -#!/usr/bin/env ruby -# -# Check for changed posts +# #!/usr/bin/env ruby +# # +# # Check for changed posts Jekyll::Hooks.register :pages, :post_init do |page| @@ -8,13 +8,13 @@ commit_num = `test -f "#{ page.path }" && git rev-list --count HEAD "#{ page.path }"` lastmod_date = nil - url = "https://api.github.com/repos/cve-north-stars/cve-north-stars.github.io/commits?path=#{page.path}&page=1&per_page=1" + #url = "https://api.github.com/repos/cve-north-stars/cve-north-stars.github.io/commits?path=#{page.path}&page=1&per_page=1" if commit_num.to_i > 1 - #lastmod_date = `git log -1 --pretty="%ad" --date=iso "#{ page.path }"` - lastmod_date = `curl -s "#{url}" | jq -r '.[0].commit.committer.date'` - else - lastmod_date = `curl -s "#{url}" | jq -r '.[0].commit.committer.date'` + lastmod_date = `git log -1 --pretty="%ad" --date=iso "#{ page.path }"` + #lastmod_date = `curl -s "#{url}" | jq -r '.[0].commit.committer.date'` + #else + #lastmod_date = `curl -s "#{url}" | jq -r '.[0].commit.committer.date'` end if lastmod_date diff --git a/index.md b/index.md index 1ac4eab..026d658 100644 --- a/index.md +++ b/index.md @@ -14,12 +14,11 @@ last_modified_date: 2022-08-24 *Leveraging CVEs as North Stars in vulnerability discovery and comprehension.* ![pexels-faik-akmd-1025469](/assets/images/pexels-faik-akmd-1025469.jpg) -Photo by Faik Akmd from Pexels Created: 2020-12-15 Updated: {{page.last_modified_date | date: '%Y-%m-%d'}} -[Follow @clearbluejar](https://twitter.com/clearbluejar){: .btn .btn-blue .fs-4 .mb-4 .mb-md-0 .mr-2 } [ View CNS on GitHub](https://github.com/cve-north-stars/cve-north-stars.github.io){: .btn .fs-4 .mb-4 .mb-md-0 } +[ View on GitHub](https://github.com/cve-north-stars/cve-north-stars.github.io){: .btn .fs-4 .mb-4 .mb-md-0 } ## Overview @@ -39,4 +38,6 @@ Along the way, this tutorial analyzes [several](https://cve.mitre.org/cgi-bin/cv - Introduction to [Root Cause Analysis](docs/Root-Cause-Analysis.md) -[Get started](docs/CVE-Research.md){: .btn .btn-primary .fs-4 .mb-4 .mb-md-0 .mr-2 } \ No newline at end of file +[Get started](docs/CVE-Research.md){: .btn .btn-primary .fs-4 .mb-4 .mb-md-0 .mr-2 } + +Cover photo by Faik Akmd from Pexels \ No newline at end of file