From 38eafac7d9435608840d74e913e6f9404d540325 Mon Sep 17 00:00:00 2001 From: Reed Loden Date: Wed, 9 Jun 2021 00:08:33 -0700 Subject: [PATCH 001/418] Bring back the old Jekyll site with a few new changes --- Gemfile | 4 --- Rakefile | 6 ++-- _config.yml | 24 ++++++++-------- _includes/after_footer.html | 19 +++++++++++-- _includes/archive_post.html | 5 ++-- _includes/category_links.html | 21 ++++++++++++++ _includes/footer.html | 9 ++++-- _includes/head.html | 2 +- _includes/header.html | 50 ++++++++++++++++++--------------- _includes/post/categories.html | 9 +++--- _includes/sidebar.html | 2 +- _layouts/advisory.html | 19 ++++++++++++- images/rubysec-logo.png | Bin 0 -> 164789 bytes index.html | 18 ++++++------ 14 files changed, 123 insertions(+), 65 deletions(-) create mode 100644 _includes/category_links.html create mode 100644 images/rubysec-logo.png diff --git a/Gemfile b/Gemfile index bd2fd82f..b60ee9ee 100644 --- a/Gemfile +++ b/Gemfile @@ -2,7 +2,3 @@ source 'https://rubygems.org' gem 'github-pages' gem 'rake' - -group :jekyll_plugins do - gem 'octopress-filters' -end diff --git a/Rakefile b/Rakefile index ec0a691e..3038f332 100644 --- a/Rakefile +++ b/Rakefile @@ -11,7 +11,7 @@ namespace :advisories do desc 'Updates the advisory db' task :update => '_advisories' do - Dir.chdir('_advisories') { sh 'git pull' } unless ENV['CI'] + Dir.chdir('_advisories') { sh 'git pull --ff-only' } unless ENV['CI'] end desc 'Regenerate the advisory posts' @@ -20,7 +20,9 @@ namespace :advisories do advisory = YAML.load_file(advisory_path) id = if advisory['cve'] then "CVE-#{advisory['cve']}" - else "OSVDB-#{advisory['osvdb']}" + elsif advisory['ghsa'] then "GHSA-#{advisory['ghsa']}" + elsif advisory['osvdb'] then "OSVDB-#{advisory['osvdb']}" + else File.basename(advisory_path, ".*") end slug = "#{advisory['date']}-#{id}" post = File.join('advisories', '_posts', "#{slug}.md") diff --git a/_config.yml b/_config.yml index ae33c8b0..27dbd187 100644 --- a/_config.yml +++ b/_config.yml @@ -1,4 +1,4 @@ -url: http://rubysec.com +url: https://rubysec.com title: RubySec subtitle: Providing security resources for the Ruby community author: RubySec @@ -6,16 +6,16 @@ simple_search: https://www.google.com/search description: Advisory database of security vulnerabilities found in Ruby projects exclude: - - _advisories - - Gemfile - - Gemfile.lock - - Rakefile - - README.md - - vendor - -gems: - - octopress-filters - - jekyll-paginate + [ + .bundle, + .github, + _advisories, + CNAME, + Gemfile, + Rakefile, + README.md, + vendor, + ] subscribe_rss: /atom.xml email: rubysec-announce@googlegroups.com @@ -28,7 +28,7 @@ pagination_dir: advisories # Directory base for pagination URLs eg. /blog/p recent_posts: 5 # Posts in the sidebar Recent Posts section excerpt_link: "Read on →" # "Continue reading" link text at the bottom of excerpted articles -titlecase: true # Converts page and post titles to titlecase +titlecase: false # Converts page and post titles to titlecase twitter_user: rubysec twitter_tweet_button: true diff --git a/_includes/after_footer.html b/_includes/after_footer.html index af3d0cad..121dddaf 100644 --- a/_includes/after_footer.html +++ b/_includes/after_footer.html @@ -1,3 +1,18 @@ - + - + diff --git a/_includes/archive_post.html b/_includes/archive_post.html index 3bbf3e6f..2e7a255e 100644 --- a/_includes/archive_post.html +++ b/_includes/archive_post.html @@ -2,9 +2,8 @@

- {% capture category %}{{ post.categories | size }}{% endcapture %}

{{post.title}}

- {% if category != '0' %} -

posted in {{ post.categories | category_links }}

+ {% if post.categories != empty or post.tags != empty %} +

posted in {% include category_links.html categories=post.categories tags=post.tags %}

{% endif %} diff --git a/_includes/category_links.html b/_includes/category_links.html new file mode 100644 index 00000000..28cdcbf6 --- /dev/null +++ b/_includes/category_links.html @@ -0,0 +1,21 @@ +{% if include.categories != empty %} • + {% for category in include.categories %} + {% assign no_comma = forloop.last %} + {% for archive in site.archives %} + {% if archive.type == "category" and archive.title == category %} + {{ archive.title | escape }}{% unless no_comma %},{% endunless %} + {% endif %} + {% endfor %} + {% endfor %} +{% endif %} + +{% if include.tags != empty %} • + {% for tag in include.tags %} + {% assign no_comma = forloop.last %} + {% for archive in site.archives %} + {% if archive.type == "tag" and archive.title == tag %} + {{ archive.title | escape }}{% unless no_comma %},{% endunless %} + {% endif %} + {% endfor %} + {% endfor %} +{% endif %} diff --git a/_includes/footer.html b/_includes/footer.html index 4cfe1b7a..a2cbfa8b 100644 --- a/_includes/footer.html +++ b/_includes/footer.html @@ -1,3 +1,6 @@ -

- Copyright © {{ site.time | date: "%Y" }} - {{ site.author }} -

+ diff --git a/_includes/head.html b/_includes/head.html index bf6d2eda..e44070b2 100644 --- a/_includes/head.html +++ b/_includes/head.html @@ -18,7 +18,7 @@ {% capture canonical %}{{ site.url }}{% if site.permalink contains '.html' %}{{ page.url }}{% else %}{{ page.url | remove:'index.html' | strip_slash }}{% endif %}{% endcapture %} - + diff --git a/_includes/header.html b/_includes/header.html index 339c5681..c3d1b254 100644 --- a/_includes/header.html +++ b/_includes/header.html @@ -1,23 +1,29 @@ -
- - - - {% if site.subscribe_rss %} - - {% endif %} - - {% if site.twitter_user %} - - {% endif %} - - {% if site.github_repo %} - - {% endif %} - -
Get Updates:   By ATOM  On Twitter  On GitHub
-
+
+ -

{{ site.title }}

-{% if site.subtitle %} -

{{ site.subtitle }}

-{% endif %} +
+

+ + {{ site.title }} +

+ {% if site.subtitle %} +

{{ site.subtitle }}

+ {% endif %} +
diff --git a/_includes/post/categories.html b/_includes/post/categories.html index 4a98b29d..80becd66 100644 --- a/_includes/post/categories.html +++ b/_includes/post/categories.html @@ -1,10 +1,9 @@ -{% capture category %}{% if post %}{{ post.categories | category_links | size }}{% else %}{{ page.categories | category_links | size }}{% endif %}{% endcapture %} -{% unless category == '0' %} +{% if post.categories != empty or post.tags != empty or page.categories != empty or page.tags != empty %} {% if post %} - {{ post.categories | category_links }} + {% include category_links.html categories=post.categories tags=post.tags %} {% else %} - {{ page.categories | category_links }} + {% include category_links.html categories=page.categories tags=page.tags %} {% endif %} -{% endunless %} +{% endif %} diff --git a/_includes/sidebar.html b/_includes/sidebar.html index 20139cd9..32fd7c6d 100644 --- a/_includes/sidebar.html +++ b/_includes/sidebar.html @@ -1,7 +1,7 @@ {% unless page.sidebar == false %}