diff --git a/.bundle/config b/.bundle/config deleted file mode 100644 index e66ea7b..0000000 --- a/.bundle/config +++ /dev/null @@ -1,2 +0,0 @@ ---- -BUNDLE_BIN: bin diff --git a/.gitignore b/.gitignore index d696873..e5784c7 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,8 @@ +/.jekyll-cache /_site /docs /tmp /.sass-cache /.env +/.idea +/.DS_Store diff --git a/.ruby-version b/.ruby-version new file mode 100644 index 0000000..1454f6e --- /dev/null +++ b/.ruby-version @@ -0,0 +1 @@ +4.0.1 diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 7b071c1..0000000 --- a/.travis.yml +++ /dev/null @@ -1,16 +0,0 @@ -language: minimal -services: - - docker -env: - global: - - ERRBIT_PATH=/tmp/errbit -before_script: - - git clone https://github.com/errbit/errbit.git $ERRBIT_PATH - - docker build --tag errbit-docs-builder . - - docker run --user $UID --volume "$PWD:/srv" errbit-docs-builder bundle install -script: - - docker run -e ERRBIT_PATH="$ERRBIT_PATH" --user $UID --volume "$PWD:/srv" --volume "$ERRBIT_PATH:$ERRBIT_PATH" errbit-docs-builder bundle exec jekyll build - - docker run -e AWS_ACCESS_KEY_ID="$AWS_ACCESS_KEY_ID" -e AWS_SECRET_ACCESS_KEY="$AWS_SECRET_ACCESS_KEY" --user $UID --volume "$PWD:/srv" errbit-docs-builder bundle exec s3_website push -cache: - directories: - - vendor/bundle diff --git a/Caddyfile b/Caddyfile new file mode 100644 index 0000000..fc6266a --- /dev/null +++ b/Caddyfile @@ -0,0 +1,19 @@ +{ + auto_https off + persist_config off + metrics + servers { + protocols h1 + } +} + +# Uncomment if you want to test changes locally! +#http://localhost { +# root * /www # sets the root of all other directives +# file_server # tells Caddy to serve the static files found at the root +#} + +http://errbit.com { + root * /www # sets the root of all other directives + file_server # tells Caddy to serve the static files found at the root +} diff --git a/Dockerfile b/Dockerfile index e9350b0..41e4e73 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,9 @@ -FROM ruby:2.6-stretch -RUN apt-get update && apt-get install -y cmake openjdk-8-jre -ENV BUNDLE_PATH=vendor/bundle -WORKDIR /srv +FROM docker.io/library/caddy:2.10.2 + +COPY Caddyfile /etc/caddy/ + +WORKDIR /www + +COPY _site/ . + +EXPOSE 80/tcp diff --git a/Gemfile b/Gemfile index 9d76d27..660c6d7 100644 --- a/Gemfile +++ b/Gemfile @@ -1,10 +1,9 @@ -source 'https://rubygems.org' +source "https://rubygems.org" -gem 'dotenv' -gem 'jekyll' -gem 'kramdown' -gem 'nokogumbo' -gem 'oga' -gem 'pry-byebug' -gem 'rugged' -gem 's3_website' +gem "dotenv" +gem "jekyll" +gem "kramdown" +gem "nokogiri" +gem "oga" +gem "pry-byebug" +gem "rugged" diff --git a/Gemfile.lock b/Gemfile.lock index 78a715b..725f3a6 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,100 +1,124 @@ GEM remote: https://rubygems.org/ specs: - addressable (2.5.0) - public_suffix (~> 2.0, >= 2.0.2) + addressable (2.8.8) + public_suffix (>= 2.0.2, < 8.0) ansi (1.5.0) - ast (2.3.0) - aws-sdk (2.11.197) - aws-sdk-resources (= 2.11.197) - aws-sdk-core (2.11.197) - aws-sigv4 (~> 1.0) - jmespath (~> 1.0) - aws-sdk-resources (2.11.197) - aws-sdk-core (= 2.11.197) - aws-sigv4 (1.0.3) - byebug (9.0.5) - coderay (1.1.1) + ast (2.4.3) + base64 (0.3.0) + bigdecimal (4.0.1) + byebug (13.0.0) + reline (>= 0.6.0) + coderay (1.1.3) colorator (1.1.0) - colored (1.2) - configure-s3-website (2.3.0) - aws-sdk (~> 2) - deep_merge (~> 1.0.0) - deep_merge (1.0.1) - dotenv (1.0.2) - ffi (1.9.17) + concurrent-ruby (1.3.6) + csv (3.3.5) + dotenv (3.2.0) + em-websocket (0.5.3) + eventmachine (>= 0.12.9) + http_parser.rb (~> 0) + eventmachine (1.2.7) + ffi (1.17.3) + ffi (1.17.3-x86_64-darwin) forwardable-extended (2.6.0) - jekyll (3.3.1) + google-protobuf (4.33.4) + bigdecimal + rake (>= 13) + http_parser.rb (0.8.1) + i18n (1.14.8) + concurrent-ruby (~> 1.0) + io-console (0.8.2) + jekyll (4.4.1) addressable (~> 2.4) + base64 (~> 0.2) colorator (~> 1.0) - jekyll-sass-converter (~> 1.0) - jekyll-watch (~> 1.1) - kramdown (~> 1.3) - liquid (~> 3.0) - mercenary (~> 0.3.3) + csv (~> 3.0) + em-websocket (~> 0.5) + i18n (~> 1.0) + jekyll-sass-converter (>= 2.0, < 4.0) + jekyll-watch (~> 2.0) + json (~> 2.6) + kramdown (~> 2.3, >= 2.3.1) + kramdown-parser-gfm (~> 1.0) + liquid (~> 4.0) + mercenary (~> 0.3, >= 0.3.6) pathutil (~> 0.9) - rouge (~> 1.7) + rouge (>= 3.0, < 5.0) safe_yaml (~> 1.0) - jekyll-sass-converter (1.5.0) - sass (~> 3.4) - jekyll-watch (1.5.0) - listen (~> 3.0, < 3.1) - jmespath (1.4.0) - kramdown (1.13.2) - liquid (3.0.6) - listen (3.0.8) - rb-fsevent (~> 0.9, >= 0.9.4) - rb-inotify (~> 0.9, >= 0.9.7) - mercenary (0.3.6) - method_source (0.8.2) - mini_portile2 (2.1.0) - nokogiri (1.7.0) - mini_portile2 (~> 2.1.0) - nokogumbo (1.4.10) - nokogiri - oga (2.2) + terminal-table (>= 1.8, < 4.0) + webrick (~> 1.7) + jekyll-sass-converter (3.1.0) + sass-embedded (~> 1.75) + jekyll-watch (2.2.1) + listen (~> 3.0) + json (2.18.0) + kramdown (2.5.1) + rexml (>= 3.3.9) + kramdown-parser-gfm (1.1.0) + kramdown (~> 2.0) + liquid (4.0.4) + listen (3.10.0) + logger + rb-fsevent (~> 0.10, >= 0.10.3) + rb-inotify (~> 0.9, >= 0.9.10) + logger (1.7.0) + mercenary (0.4.0) + method_source (1.1.0) + mini_portile2 (2.8.9) + nokogiri (1.19.0) + mini_portile2 (~> 2.8.2) + racc (~> 1.4) + nokogiri (1.19.0-x86_64-darwin) + racc (~> 1.4) + oga (3.4) ast ruby-ll (~> 2.1) - pathutil (0.14.0) + pathutil (0.16.2) forwardable-extended (~> 2.6) - pry (0.10.3) - coderay (~> 1.1.0) - method_source (~> 0.8.1) - slop (~> 3.4) - pry-byebug (3.4.0) - byebug (~> 9.0) - pry (~> 0.10) - public_suffix (2.0.5) - rb-fsevent (0.9.8) - rb-inotify (0.9.7) - ffi (>= 0.5.0) - rouge (1.11.1) - ruby-ll (2.1.2) + pry (0.16.0) + coderay (~> 1.1) + method_source (~> 1.0) + reline (>= 0.6.0) + pry-byebug (3.12.0) + byebug (~> 13.0) + pry (>= 0.13, < 0.17) + public_suffix (7.0.2) + racc (1.8.1) + rake (13.3.1) + rb-fsevent (0.11.2) + rb-inotify (0.11.1) + ffi (~> 1.0) + reline (0.6.3) + io-console (~> 0.5) + rexml (3.4.4) + rouge (4.7.0) + ruby-ll (2.1.4) ansi ast - rugged (0.21.0) - s3_website (3.4.0) - colored (= 1.2) - configure-s3-website (= 2.3.0) - dotenv (~> 1.0) - thor (~> 0.18) - safe_yaml (1.0.4) - sass (3.4.23) - slop (3.6.0) - thor (0.20.3) + rugged (1.9.0) + safe_yaml (1.0.5) + sass-embedded (1.97.2) + google-protobuf (~> 4.31) + rake (>= 13) + sass-embedded (1.97.2-x86_64-darwin) + google-protobuf (~> 4.31) + terminal-table (3.0.2) + unicode-display_width (>= 1.1.1, < 3) + unicode-display_width (2.6.0) + webrick (1.9.2) PLATFORMS ruby + x86_64-darwin-24 DEPENDENCIES dotenv jekyll kramdown - nokogumbo + nokogiri oga pry-byebug rugged - s3_website BUNDLED WITH - 1.17.2 + 4.0.4 diff --git a/README.md b/README.md index b3e470d..4c58561 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # Documentation Site for Errbit This project builds documentation for Errbit by checking out all prior -released versions of Errbit from Git (plus master) and processing the +released versions of Errbit from Git (plus main) and processing the docs folder for each one into its own section. # Building diff --git a/_config.yml b/_config.yml index b0e9b30..7a15fd6 100644 --- a/_config.yml +++ b/_config.yml @@ -1,12 +1,14 @@ --- encoding: utf-8 exclude: + - README.md - Gemfile - Gemfile.lock - bin - - s3_website.yml - CNAME - lib + - tmp + - vendor kramdown: input: GFM gfm_quirks: paragraph_end @@ -15,12 +17,3 @@ defaults: - values: layout: "default" -exclude: - - README.md - - Gemfile - - Gemfile.lock - - s3_website.yml - - tmp - - lib - - bin - - vendor diff --git a/bin/aws.rb b/bin/aws.rb deleted file mode 100755 index 3570065..0000000 --- a/bin/aws.rb +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env ruby -# frozen_string_literal: true -# -# This file was generated by Bundler. -# -# The application 'aws.rb' is installed as part of a gem, and -# this file is here to facilitate running it. -# - -require "pathname" -ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile", - Pathname.new(__FILE__).realpath) - -require "rubygems" -require "bundler/setup" - -load Gem.bin_path("aws-sdk-core", "aws.rb") diff --git a/bin/bundler b/bin/bundler deleted file mode 100755 index d6107f0..0000000 --- a/bin/bundler +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env ruby -# frozen_string_literal: true -# -# This file was generated by Bundler. -# -# The application 'bundler' is installed as part of a gem, and -# this file is here to facilitate running it. -# - -require "pathname" -ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile", - Pathname.new(__FILE__).realpath) - -require "rubygems" -require "bundler/setup" - -load Gem.bin_path("bundler", "bundler") diff --git a/bin/byebug b/bin/byebug deleted file mode 100755 index d9bf0f4..0000000 --- a/bin/byebug +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env ruby -# frozen_string_literal: true -# -# This file was generated by Bundler. -# -# The application 'byebug' is installed as part of a gem, and -# this file is here to facilitate running it. -# - -require "pathname" -ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile", - Pathname.new(__FILE__).realpath) - -require "rubygems" -require "bundler/setup" - -load Gem.bin_path("byebug", "byebug") diff --git a/bin/coderay b/bin/coderay deleted file mode 100755 index e248d24..0000000 --- a/bin/coderay +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env ruby -# frozen_string_literal: true -# -# This file was generated by Bundler. -# -# The application 'coderay' is installed as part of a gem, and -# this file is here to facilitate running it. -# - -require "pathname" -ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile", - Pathname.new(__FILE__).realpath) - -require "rubygems" -require "bundler/setup" - -load Gem.bin_path("coderay", "coderay") diff --git a/bin/configure-s3-website b/bin/configure-s3-website deleted file mode 100755 index d391fbf..0000000 --- a/bin/configure-s3-website +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env ruby -# frozen_string_literal: true -# -# This file was generated by Bundler. -# -# The application 'configure-s3-website' is installed as part of a gem, and -# this file is here to facilitate running it. -# - -require "pathname" -ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile", - Pathname.new(__FILE__).realpath) - -require "rubygems" -require "bundler/setup" - -load Gem.bin_path("configure-s3-website", "configure-s3-website") diff --git a/bin/dotenv b/bin/dotenv deleted file mode 100755 index c563e95..0000000 --- a/bin/dotenv +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env ruby -# frozen_string_literal: true -# -# This file was generated by Bundler. -# -# The application 'dotenv' is installed as part of a gem, and -# this file is here to facilitate running it. -# - -require "pathname" -ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile", - Pathname.new(__FILE__).realpath) - -require "rubygems" -require "bundler/setup" - -load Gem.bin_path("dotenv", "dotenv") diff --git a/bin/github-markup b/bin/github-markup deleted file mode 100755 index dbe86ee..0000000 --- a/bin/github-markup +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env ruby -# frozen_string_literal: true -# -# This file was generated by Bundler. -# -# The application 'github-markup' is installed as part of a gem, and -# this file is here to facilitate running it. -# - -require "pathname" -ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile", - Pathname.new(__FILE__).realpath) - -require "rubygems" -require "bundler/setup" - -load Gem.bin_path("github-markup", "github-markup") diff --git a/bin/kramdown b/bin/kramdown deleted file mode 100755 index d4b31f6..0000000 --- a/bin/kramdown +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env ruby -# frozen_string_literal: true -# -# This file was generated by Bundler. -# -# The application 'kramdown' is installed as part of a gem, and -# this file is here to facilitate running it. -# - -require "pathname" -ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile", - Pathname.new(__FILE__).realpath) - -require "rubygems" -require "bundler/setup" - -load Gem.bin_path("kramdown", "kramdown") diff --git a/bin/listen b/bin/listen deleted file mode 100755 index 65fe244..0000000 --- a/bin/listen +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env ruby -# frozen_string_literal: true -# -# This file was generated by Bundler. -# -# The application 'listen' is installed as part of a gem, and -# this file is here to facilitate running it. -# - -require "pathname" -ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile", - Pathname.new(__FILE__).realpath) - -require "rubygems" -require "bundler/setup" - -load Gem.bin_path("listen", "listen") diff --git a/bin/nokogiri b/bin/nokogiri deleted file mode 100755 index c1f0ca4..0000000 --- a/bin/nokogiri +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env ruby -# frozen_string_literal: true -# -# This file was generated by Bundler. -# -# The application 'nokogiri' is installed as part of a gem, and -# this file is here to facilitate running it. -# - -require "pathname" -ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile", - Pathname.new(__FILE__).realpath) - -require "rubygems" -require "bundler/setup" - -load Gem.bin_path("nokogiri", "nokogiri") diff --git a/bin/rougify b/bin/rougify deleted file mode 100755 index a46ae62..0000000 --- a/bin/rougify +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env ruby -# frozen_string_literal: true -# -# This file was generated by Bundler. -# -# The application 'rougify' is installed as part of a gem, and -# this file is here to facilitate running it. -# - -require "pathname" -ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile", - Pathname.new(__FILE__).realpath) - -require "rubygems" -require "bundler/setup" - -load Gem.bin_path("rouge", "rougify") diff --git a/bin/ruby-ll b/bin/ruby-ll deleted file mode 100755 index b80b724..0000000 --- a/bin/ruby-ll +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env ruby -# frozen_string_literal: true -# -# This file was generated by Bundler. -# -# The application 'ruby-ll' is installed as part of a gem, and -# this file is here to facilitate running it. -# - -require "pathname" -ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile", - Pathname.new(__FILE__).realpath) - -require "rubygems" -require "bundler/setup" - -load Gem.bin_path("ruby-ll", "ruby-ll") diff --git a/bin/s3_website b/bin/s3_website deleted file mode 100755 index e8ec6c5..0000000 --- a/bin/s3_website +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env ruby -# frozen_string_literal: true -# -# This file was generated by Bundler. -# -# The application 's3_website' is installed as part of a gem, and -# this file is here to facilitate running it. -# - -require "pathname" -ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile", - Pathname.new(__FILE__).realpath) - -require "rubygems" -require "bundler/setup" - -load Gem.bin_path("s3_website", "s3_website") diff --git a/bin/safe_yaml b/bin/safe_yaml deleted file mode 100755 index 5979200..0000000 --- a/bin/safe_yaml +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env ruby -# frozen_string_literal: true -# -# This file was generated by Bundler. -# -# The application 'safe_yaml' is installed as part of a gem, and -# this file is here to facilitate running it. -# - -require "pathname" -ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile", - Pathname.new(__FILE__).realpath) - -require "rubygems" -require "bundler/setup" - -load Gem.bin_path("safe_yaml", "safe_yaml") diff --git a/bin/sass b/bin/sass deleted file mode 100755 index ef9f699..0000000 --- a/bin/sass +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env ruby -# frozen_string_literal: true -# -# This file was generated by Bundler. -# -# The application 'sass' is installed as part of a gem, and -# this file is here to facilitate running it. -# - -require "pathname" -ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile", - Pathname.new(__FILE__).realpath) - -require "rubygems" -require "bundler/setup" - -load Gem.bin_path("sass", "sass") diff --git a/bin/sass-convert b/bin/sass-convert deleted file mode 100755 index 13936f1..0000000 --- a/bin/sass-convert +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env ruby -# frozen_string_literal: true -# -# This file was generated by Bundler. -# -# The application 'sass-convert' is installed as part of a gem, and -# this file is here to facilitate running it. -# - -require "pathname" -ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile", - Pathname.new(__FILE__).realpath) - -require "rubygems" -require "bundler/setup" - -load Gem.bin_path("sass", "sass-convert") diff --git a/bin/scss b/bin/scss deleted file mode 100755 index 76c0dce..0000000 --- a/bin/scss +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env ruby -# frozen_string_literal: true -# -# This file was generated by Bundler. -# -# The application 'scss' is installed as part of a gem, and -# this file is here to facilitate running it. -# - -require "pathname" -ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile", - Pathname.new(__FILE__).realpath) - -require "rubygems" -require "bundler/setup" - -load Gem.bin_path("sass", "scss") diff --git a/bin/thor b/bin/thor deleted file mode 100755 index 63f10e5..0000000 --- a/bin/thor +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env ruby -# frozen_string_literal: true -# -# This file was generated by Bundler. -# -# The application 'thor' is installed as part of a gem, and -# this file is here to facilitate running it. -# - -require "pathname" -ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile", - Pathname.new(__FILE__).realpath) - -require "rubygems" -require "bundler/setup" - -load Gem.bin_path("thor", "thor") diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..f6a0254 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,6 @@ +services: + caddy: + build: + context: . + ports: + - "8080:80" diff --git a/lib/doc_builder.rb b/lib/doc_builder.rb index 1e6bf25..be31bf0 100644 --- a/lib/doc_builder.rb +++ b/lib/doc_builder.rb @@ -3,8 +3,8 @@ require 'fileutils' require 'oga' -# Walk the github refs looking for all release tags and gathering up all the -# files from the docs/ folder for each release (plus master). +# Walk the GitHub refs looking for all release tags and gathering up all the +# files from the docs/ folder for each release (plus main). class DocBuilder attr_reader :versions @@ -19,8 +19,8 @@ def run build_tree(tag.target.tree, tag.name.dup) end - master = @repo.branches['master'] - build_tree(master.target.tree, 'master') + main = @repo.branches["main"] + build_tree(main.target.tree, "main") end def build_tree(tree, version) @@ -100,9 +100,9 @@ def delete_entries(entries) # master first, then descending numerically (by semver semantics) def sort_versions @versions.sort! do |a,b| - if a == 'master' + if a == "main" -1 - elsif b == 'master' + elsif b == "main" 1 else va = a.sub(/^v/, '') diff --git a/lib/doc_parser.rb b/lib/doc_parser.rb index 918c2ab..4a368d3 100644 --- a/lib/doc_parser.rb +++ b/lib/doc_parser.rb @@ -1,4 +1,4 @@ -require 'nokogumbo' +require "nokogiri" # Kramdown escapes certain HTML tags for unknown reasons, but if there are line # breaks before and after, kramdown understands that these tags are HTML and diff --git a/s3_website.yml b/s3_website.yml deleted file mode 100644 index 6a682e6..0000000 --- a/s3_website.yml +++ /dev/null @@ -1,9 +0,0 @@ ---- -s3_bucket: errbit.com -max_age: - "assets/*": 6000 - "*": 300 -gzip: - - .html - - .css - - .js