Skip to content

Commit

Permalink
Website Common Configuration (#524)
Browse files Browse the repository at this point in the history
* adds common config and directory structure for website

* updates baseURL to relative path

* updates website config with changes from @geoffcline

* removes duplicate website make target

Co-authored-by: Alex Kestner <kestnera@amazon.com>
Co-authored-by: Geoffrey Cline <gcline@amazon.com>
  • Loading branch information
3 people committed Jul 22, 2021
1 parent 8e754d1 commit 0a48cd1
Show file tree
Hide file tree
Showing 8 changed files with 144 additions and 3 deletions.
10 changes: 10 additions & 0 deletions DEVELOPER_GUIDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,16 @@ kubectl patch deployment karpenter -n karpenter --type='json' -p='[{"op": "repla
open http://localhost:8080/metrics && kubectl port-forward service/karpenter-metrics -n karpenter 8080
```

### Marketing and Docs Website
The Karpenter marketing and docs site uses [Hugo](https://gohugo.io/) and [npm](https://www.npmjs.com/) to generate HTML markup from Markdown content and configuration files in `/website`. Hugo makes use of [`git submodules`](https://git-scm.com/book/en/v2/Git-Tools-Submodules) to bring in theme assets and configruation. The Karpenter website uses the [Docsy theme](https://www.docsy.dev/). To serve this website locally, ensure you have `hugo` and `npm` installed, have initialized and updated your local repository's submodules with `git submodule update --init --recursive`, and then use the follow commands to bring up a local webserver:
```bash
cd website
npm install
hugo server -D
```

_If you get `fatal error: pipe failed` running the local server on macOS, you may need to increase the maximum number of files that can be open at a time by following the instructions in [this GitHub issue comment](https://github.com/google/docsy-example/issues/89#issuecomment-758311888)._

## Environment specific setup

### AWS
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ helm: ## Generate Helm Chart
cd charts;helm lint karpenter;helm package karpenter;helm repo index .

website: ## Generate Docs Website
cd website;npm install;hugo -d ../docs
cd website; npm install; git submodule update --init --recursive; hugo

toolchain: ## Install developer toolchain
./hack/toolchain.sh
Expand Down
Binary file added website/assets/icons/logo.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions website/assets/scss/_variables_project.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
/*
Add styles or override variables from the theme here.
*/
122 changes: 120 additions & 2 deletions website/config.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,122 @@
baseURL = "http://awslabs.github.com/karpenter/docs"
baseURL = "/karpenter/"

# Hugo allows theme composition (and inheritance). The precedence is from left to right.
theme = ["docsy"]

# Build settings
publishDir = "../docs"
disableKinds = ["taxonomy", "taxonomyTerm"]

# Language settings
contentDir = "content/en"
defaultContentLanguage = "en"
defaultContentLanguageInSubdir = false
# Useful when translating.
enableMissingTranslationPlaceholders = true

# Localizations
languageCode = "en-us"
[languages]
[languages.en]
title = "Karpenter"
theme = "docsy"
description = "Just-in-time Nodes for Any Kubernetes Cluster"
languageName = "English"
# Weight used for sorting.
weight = 1

# Syntax Highlighting config
pygmentsCodeFences = true
pygmentsUseClasses = false
# Use the new Chroma Go highlighter in Hugo.
pygmentsUseClassic = false
#pygmentsOptions = "linenos=table"
# See https://help.farbox.com/pygments.html
pygmentsStyle = "tango"

# Configure how URLs look like per section.
[permalinks]
blog = "/:section/:year/:month/:day/:slug/"

## Configuration for BlackFriday markdown parser: https://github.com/russross/blackfriday
[blackfriday]
plainIDAnchors = true
hrefTargetBlank = true
angledQuotes = false
latexDashes = true

# Markup configuration
[markup]
[markup.goldmark]
[markup.goldmark.renderer]
unsafe = true
[markup.highlight]
# See a complete list of available styles at https://xyproto.github.io/splash/docs/all.html
style = "tango"
# Uncomment if you want your chosen highlight style used for code blocks without a specified language
# guessSyntax = "true"

# Image processing configuration.
[imaging]
resampleFilter = "CatmullRom"
quality = 75
anchor = "smart"

## Site Params
[params]
copyright = "Amazon.com, Inc. or its affiliates."
# Repository configuration (URLs for in-page links to opening issues and suggesting changes)
github_repo = "https://github.com/awslabs/karpenter"
# Specify a value here if your content directory is not in your repo's root directory
github_subdir = "website"

# Version configuration
# Menu title if your navbar has a versions selector to access old versions of your site.
# This menu appears only if you have at least one [params.versions] set.
version_menu = "Releases"
# Flag used in the "version-banner" partial to decide whether to display a
# banner on every page indicating that this is an archived version of the docs.
# Set this flag to "true" if you want to display the banner.
archived_version = false
# The version number for the version of the docs represented in this doc set.
# Used in the "version-banner" partial to display a version number for the
# current doc set.
version = "0.2"

# User interface configuration
[params.ui]
# Enable to show the side bar menu in its compact state.
sidebar_menu_compact = false
# Set to true to disable breadcrumb navigation.
breadcrumb_disable = false
# Set to true to hide the sidebar search box (the top nav search box will still be displayed if search is enabled)
sidebar_search_disable = false
# Set to false if you don't want to display a logo (/assets/icons/logo.svg) in the top nav bar
navbar_logo = false
# Set to true to disable the About link in the site footer
footer_about_disable = true

[params.links]
# End user relevant links. These will show up on left side of footer and in the community page if you have one.
#[[params.links.user]]
# name = "Twitter"
# url = "https://example.org/twitter"
# icon = "fab fa-twitter"
# desc = "Follow us on Twitter to get the latest news!"
# Developer relevant links. These will show up on right side of footer and in the community page if you have one.
[[params.links.developer]]
name = "GitHub"
url = "https://github.com/awslabs/karpenter"
icon = "fab fa-github"
desc = "Development takes place here!"
[[params.links.developer]]
name = "Slack"
url = "https://slack.k8s.io/"
icon = "fab fa-slack"
desc = "Chat with us on Slack in the #aws-provider channel"

# Navigation menu
[[menu.main]]
name = "GitHub"
weight = 99
url = "https://github.com/awslabs/karpenter"
pre = "<i class='fab fa-github'></i>"
Empty file added website/content/en/.keep
Empty file.
Empty file added website/content/en/docs/.keep
Empty file.
8 changes: 8 additions & 0 deletions website/layouts/404.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{{ define "main"}}
<main id="main">
<div>
<h1 id="title">Not found</h1>
<p>Oops! This page doesn't exist. Try going back to our <a href="{{ "/" | relURL }}">home page</a>.</p>
</div>
</main>
{{ end }}

0 comments on commit 0a48cd1

Please sign in to comment.