Skip to content

Commit

Permalink
docs: Fix website local build (aws#4718)
Browse files Browse the repository at this point in the history
Signed-off-by: David Tesar <[email protected]>
Co-authored-by: Nick Tran <[email protected]>
  • Loading branch information
dtzar and njtran authored Nov 7, 2023
1 parent 0d5520a commit 1d5282d
Show file tree
Hide file tree
Showing 16 changed files with 1,687 additions and 900 deletions.
3 changes: 0 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +0,0 @@
[submodule "website/themes/docsy"]
path = website/themes/docsy
url = https://github.com/google/docsy.git
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ KO_DOCKER_REPO ?= ${AWS_ACCOUNT_ID}.dkr.ecr.${AWS_DEFAULT_REGION}.amazonaws.com/
GETTING_STARTED_SCRIPT_DIR = website/content/en/preview/getting-started/getting-started-with-karpenter/scripts

# Common Directories
MOD_DIRS = $(shell find . -name go.mod -type f | xargs dirname)
MOD_DIRS = $(shell find . -path "./website" -prune -o -name go.mod -type f -print | xargs dirname)
KARPENTER_CORE_DIR = $(shell go list -m -f '{{ .Dir }}' github.com/aws/karpenter-core)

# TEST_SUITE enables you to select a specific test suite directory to run "make e2etests" or "make test" against
Expand Down Expand Up @@ -195,7 +195,7 @@ issues: ## Run GitHub issue analysis scripts
./hack/github/label_issue_count.py > "karpenter-labels-$(shell date +"%Y-%m-%d").csv"

website: ## Serve the docs website locally
cd website && npm install && git submodule update --init --recursive && hugo server
cd website && npm install && hugo mod tidy && hugo server

tidy: ## Recursively "go mod tidy" on all directories where go.mod exists
$(foreach dir,$(MOD_DIRS),cd $(dir) && go mod tidy $(newline))
Expand Down
2 changes: 1 addition & 1 deletion website/.node-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
14
18
7 changes: 0 additions & 7 deletions website/assets/js/index.js

This file was deleted.

1 change: 0 additions & 1 deletion website/assets/js/offline-search.js

This file was deleted.

196 changes: 0 additions & 196 deletions website/assets/js/offlineSearch/index.js

This file was deleted.

44 changes: 44 additions & 0 deletions website/assets/js/search.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
/*
Copyright 2018 Google LLC
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

(function ($) {
"use strict";

var Search = {
init: function () {
$(document).ready(function () {
// Fill the search input form with the current search keywords
const searchKeywords = new URLSearchParams(location.search).get('q');
if (searchKeywords !== null && searchKeywords !== '') {
const searchInput = document.querySelector('.td-search-input');
searchInput.focus();
searchInput.value = searchKeywords;
}

// Set a keydown event
$(document).on("keypress", ".td-search-input", function (e) {
if (e.keyCode !== 13) {
return;
}

var query = $(this).val();
document.location = "{{ 'Search/' | absURL }}?q=" + query;

return false;
});
});
},
};

Search.init();
})(jQuery);
25 changes: 0 additions & 25 deletions website/assets/js/versionWarning/index.js

This file was deleted.

8 changes: 8 additions & 0 deletions website/go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
module github.com/aws/karpenter/website

go 1.21

require (
github.com/google/docsy v0.6.0
github.com/google/docsy/dependencies v0.6.0
)
6 changes: 6 additions & 0 deletions website/go.sum
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
github.com/FortAwesome/Font-Awesome v0.0.0-20220831210243-d3a7818c253f/go.mod h1:IUgezN/MFpCDIlFezw3L8j83oeiIuYoj28Miwr/KUYo=
github.com/google/docsy v0.6.0 h1:43bVF18t2JihAamelQjjGzx1vO2ljCilVrBgetCA8oI=
github.com/google/docsy v0.6.0/go.mod h1:VKKLqD8PQ7AglJc98yBorATfW7GrNVsn0kGXVYF6G+M=
github.com/google/docsy/dependencies v0.6.0 h1:BFXDCINbp8ZuUGl/mrHjMfhCg+b1YX+hVLAA5fGW7Pc=
github.com/google/docsy/dependencies v0.6.0/go.mod h1:EDGc2znMbGUw0RW5kWwy2oGgLt0iVXBmoq4UOqstuNE=
github.com/twbs/bootstrap v4.6.2+incompatible/go.mod h1:fZTSrkpSf0/HkL0IIJzvVspTt1r9zuf7XlZau8kpcY0=
23 changes: 15 additions & 8 deletions website/config.yaml → website/hugo.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
theme:
- docsy
module:
hugoVersion:
extended: true
max: "v0.120.3"
min: "v0.119.0"
imports:
- path: github.com/google/docsy
- path: github.com/google/docsy/dependencies
baseURL: /
disableKinds:
- taxonomy
- taxonomyTerm
- term
enableRobotsTXT: true
contentDir: content/en
defaultContentLanguage: en
Expand All @@ -15,14 +21,15 @@ services:
languageCode: en-us
languages:
en:
params:
pygmentsCodeFences: true
pygmentsUseClasses: false
pygmentsUseClassic: false
pygmentsStyle: tango
description: Just-in-time Nodes for Any Kubernetes Cluster
title: Karpenter
description: Just-in-time Nodes for Any Kubernetes Cluster
languageName: English
weight: 1
pygmentsCodeFences: true
pygmentsUseClasses: false
pygmentsUseClassic: false
pygmentsStyle: tango
blackfriday:
plainIDAnchors: true
hrefTargetBlank: true
Expand Down
2 changes: 0 additions & 2 deletions website/layouts/partials/hooks/body-end.html

This file was deleted.

Loading

0 comments on commit 1d5282d

Please sign in to comment.