Skip to content

Commit

Permalink
Merge pull request #253 from yevgeny-shnaidman/yevgeny/fixing-docs
Browse files Browse the repository at this point in the history
docs: use jekyll-rtd-theme from a ruby gem
  • Loading branch information
k8s-ci-robot authored Dec 18, 2024
2 parents 8529175 + bb8c969 commit 943c7e4
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 9 deletions.
16 changes: 9 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,15 @@ CONTAINER_RUN_CMD ?= docker run -u "`id -u`:`id -g`"
# Use host networking because 'jekyll serve' is stupid enough to use the
# same site url than the "host" it binds to. Thus, all the links will be
# broken if we'd bind to 0.0.0.0
JEKYLL_VERSION := 3.8
RUBY_IMAGE_VERSION := 3.1
JEKYLL_ENV ?= development
SITE_BUILD_CMD := $(CONTAINER_RUN_CMD) --rm -i \
SITE_BUILD_CMD := $(CONTAINER_RUN_CMD) --rm -i -u "`id -u`:`id -g`" \
$(shell [ -t 0 ] && echo '-t') \
-e JEKYLL_ENV=$(JEKYLL_ENV) \
--volume="$$PWD/docs:/srv/jekyll":Z \
--volume="$$PWD/docs/vendor/bundle:/usr/local/bundle":Z \
--network=host jekyll/jekyll:$(JEKYLL_VERSION)
--volume="$$PWD/docs:/work" \
--volume="$$PWD/docs/vendor/bundle:/usr/local/bundle" \
-w /work \
--network=host ruby:$(RUBY_IMAGE_VERSION)
SITE_BASEURL ?=
SITE_DESTDIR ?= _site
JEKYLL_OPTS := -d '$(SITE_DESTDIR)' $(if $(SITE_BASEURL),-b '$(SITE_BASEURL)',)
Expand Down Expand Up @@ -209,11 +211,11 @@ push-debug:

site-build:
@mkdir -p docs/vendor/bundle
$(SITE_BUILD_CMD) sh -c '/usr/local/bin/bundle install && "$$BUNDLE_BIN/jekyll" build $(JEKYLL_OPTS)'
$(SITE_BUILD_CMD) sh -c "bundle plugin install bundler-override && bundle install && jekyll build $(JEKYLL_OPTS)"

site-serve:
@mkdir -p docs/vendor/bundle
$(SITE_BUILD_CMD) sh -c '/usr/local/bin/bundle install && "$$BUNDLE_BIN/jekyll" serve $(JEKYLL_OPTS) -H 127.0.0.1'
$(SITE_BUILD_CMD) sh -c "bundle plugin install bundler-override && bundle install && jekyll serve $(JEKYLL_OPTS) -H 127.0.0.1"

# Download controller-gen locally if necessary
CONTROLLER_GEN = $(PROJECT_DIR)/bin/controller-gen
Expand Down
9 changes: 9 additions & 0 deletions docs/Gemfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
source "https://rubygems.org"

# Use override plugin to drop incorrect dependency of jekyll-rtd-them on github-pages (~> 209)
# The original dep would allow github-pages v209.x but not v210 or later.
plugin 'bundler-override'
require File.join(Bundler::Plugin.index.load_paths("bundler-override")[0], "bundler-override") rescue nil
override 'jekyll-rtd-theme', :drop => "github-pages"

# Hello! This is where you manage which Jekyll version is used to run.
# When you want to use a different version, change it below, save the
# file and run `bundle install`. Run Jekyll with `bundle exec`, like so:
Expand Down Expand Up @@ -27,3 +33,6 @@ gem "wdm", "~> 0.1.1", :install_if => Gem.win_platform?
# kramdown v2 ships without the gfm parser by default. If you're using
# kramdown v1, comment out this line.
#gem "kramdown-parser-gfm"

gem "webrick", "~> 1.8"
gem 'jekyll-rtd-theme', '~> 2.0', '>= 2.0.10'
4 changes: 3 additions & 1 deletion docs/Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@ GEM
jekyll (>= 3.5, < 5.0)
jekyll-sass-converter (>= 1.0, <= 3.0.0, != 2.0.0)
rubyzip (>= 1.3.0, < 3.0)
jekyll-rtd-theme (2.0.10)
jekyll-sass-converter (1.5.2)
sass (~> 3.4)
jekyll-seo-tag (2.6.1)
Expand Down Expand Up @@ -278,9 +279,10 @@ PLATFORMS
DEPENDENCIES
github-pages (~> 209)
jekyll (~> 3.9.0)
jekyll-rtd-theme (~> 2.0, >= 2.0.10)
tzinfo (~> 1.2)
tzinfo-data
wdm (~> 0.1.1)

BUNDLED WITH
2.0.2
2.3.27
2 changes: 1 addition & 1 deletion docs/_config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ markdown: kramdown
kramdown:
toc_levels: 1..3

remote_theme: rundocs/jekyll-rtd-theme@v2.0.10
theme: jekyll-rtd-theme

# Exclude from processing.
# The following items will not be processed, by default. Create a custom list
Expand Down

0 comments on commit 943c7e4

Please sign in to comment.