Skip to content

Commit

Permalink
update to latest just-the-docs 6.2, fix last-mod-date
Browse files Browse the repository at this point in the history
  • Loading branch information
clearbluejar committed Sep 27, 2023
1 parent 29d69a7 commit 7b3bfb4
Show file tree
Hide file tree
Showing 6 changed files with 131 additions and 93 deletions.
6 changes: 3 additions & 3 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -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"
84 changes: 57 additions & 27 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,31 +1,47 @@
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)
ethon (0.16.0)
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)
Expand All @@ -41,67 +57,81 @@ 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
x86_64-linux

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
Expand Down
97 changes: 52 additions & 45 deletions _includes/head.html
Original file line number Diff line number Diff line change
@@ -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 -%}

<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=Edge">

{% unless site.plugins contains "jekyll-seo-tag" %}
<title>{{ page.title }} - {{ site.title }}</title>

{% if page.description %}
<meta name="Description" content="{{ page.description }}">
{% endif %}
{% endunless %}

{% include favicon.html %}

<link rel="stylesheet" href="{{ '/assets/css/just-the-docs-light.css' | relative_url }}" media="(prefers-color-scheme: light)">
<link rel="stylesheet" href="{{ '/assets/css/just-the-docs-dark.css' | relative_url }}" media="(prefers-color-scheme: dark)">

{% if site.ga_tracking != nil %}
<script async src="https://www.googletagmanager.com/gtag/js?id={{ site.ga_tracking }}"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());

gtag('config', '{{ site.ga_tracking }}'{% unless site.ga_tracking_anonymize_ip == nil %}, { 'anonymize_ip': true }{% endunless %});
</script>

{% endif %}

{% if site.search_enabled != false %}
<script src="{{ '/assets/js/vendor/lunr.min.js' | relative_url }}"></script>
{% endif %}

{% if site.mermaid %}
<script src="https://cdn.jsdelivr.net/npm/mermaid@{{ site.mermaid.version }}/dist/mermaid.min.js"></script>
{% endif %}

<script src="{{ '/assets/js/just-the-docs.js' | relative_url }}"></script>

<meta name="viewport" content="width=device-width, initial-scale=1">

{% seo %}

{% include head_custom.html %}

</head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=Edge">

<link rel="stylesheet" href="{{ '/assets/css/just-the-docs-default.css' | relative_url }}">
<link rel="stylesheet" href="{{ '/assets/css/just-the-docs-light.css' | relative_url }}"
media="(prefers-color-scheme: light)">
<link rel="stylesheet" href="{{ '/assets/css/just-the-docs-dark.css' | relative_url }}"
media="(prefers-color-scheme: dark)">

{% include head_nav.html %}

{% if site.ga_tracking != nil %}
{% assign ga_tracking_ids = site.ga_tracking | split: "," %}
<script async src="https://www.googletagmanager.com/gtag/js?id={{ ga_tracking_ids.first }}"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag() { dataLayer.push(arguments); }
gtag('js', new Date());

{% for ga_property in ga_tracking_ids %}
gtag('config', '{{ ga_property }}'{% unless site.ga_tracking_anonymize_ip == nil %}, { 'anonymize_ip': true }{% endunless %});
{% endfor %}
</script>
{% endif %}

{% if site.search_enabled != false %}
<script src="{{ '/assets/js/vendor/lunr.min.js' | relative_url }}"></script>
{% endif %}

<script src="{{ '/assets/js/just-the-docs.js' | relative_url }}"></script>

<meta name="viewport" content="width=device-width, initial-scale=1">

{% include_cached favicon.html %}

{% seo %}

{% include head_custom.html %}

</head>
14 changes: 7 additions & 7 deletions _includes/js/custom.js
Original file line number Diff line number Diff line change
@@ -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');
Expand Down
16 changes: 8 additions & 8 deletions _plugins/pages-lastmod-hook.rb
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
#!/usr/bin/env ruby
#
# Check for changed posts
# #!/usr/bin/env ruby
# #
# # Check for changed posts

Jekyll::Hooks.register :pages, :post_init do |page|

puts page.path
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
Expand Down
7 changes: 4 additions & 3 deletions index.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
<sub>Photo by Faik Akmd from Pexels</sub>

<sub>Created: 2020-12-15</sub>
<sub>Updated: {{page.last_modified_date | date: '%Y-%m-%d'}}</sub>

[Follow <i class='fab fa-twitter'></i> @clearbluejar](https://twitter.com/clearbluejar){: .btn .btn-blue .fs-4 .mb-4 .mb-md-0 .mr-2 } [<i class='fab fa-github'></i> View CNS on GitHub](https://github.com/cve-north-stars/cve-north-stars.github.io){: .btn .fs-4 .mb-4 .mb-md-0 }
[<i class='fab fa-github'></i> View on GitHub](https://github.com/cve-north-stars/cve-north-stars.github.io){: .btn .fs-4 .mb-4 .mb-md-0 }

## Overview

Expand All @@ -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 }
[Get started](docs/CVE-Research.md){: .btn .btn-primary .fs-4 .mb-4 .mb-md-0 .mr-2 }

<sub>Cover photo by Faik Akmd from Pexels</sub>

0 comments on commit 7b3bfb4

Please sign in to comment.