diff --git a/.gitmodules b/.gitmodules index 7028b79fbe7b1..da770687fc7f7 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,7 +1,3 @@ -[submodule "themes/docsy"] - path = themes/docsy - url = https://github.com/google/docsy.git - branch = v0.3.0 [submodule "api-ref-generator"] path = api-ref-generator url = https://github.com/kubernetes-sigs/reference-docs diff --git a/Makefile b/Makefile index 2f9a0612ee5fd..52503ab5cf24e 100644 --- a/Makefile +++ b/Makefile @@ -12,6 +12,19 @@ CONTAINER_IMAGE = $(IMAGE_REGISTRY)/k8s-website-hugo:v$(HUGO_VERSION)-$(IMAGE_ # Mount read-only to allow use with tools like Podman in SELinux mode # Container targets don't need to write into /src CONTAINER_RUN = "$(CONTAINER_ENGINE)" run --rm --interactive --tty --volume "$(CURDIR):/src:ro,Z" +CONTAINER_RUN_TTY = "$(CONTAINER_ENGINE)" run --rm --interactive --tty +CONTAINER_HUGO_MOUNTS = \ + --read-only \ + --mount type=bind,source=$(CURDIR)/.git,target=/src/.git,readonly \ + --mount type=bind,source=$(CURDIR)/archetypes,target=/src/archetypes,readonly \ + --mount type=bind,source=$(CURDIR)/assets,target=/src/assets,readonly \ + --mount type=bind,source=$(CURDIR)/content,target=/src/content,readonly \ + --mount type=bind,source=$(CURDIR)/data,target=/src/data,readonly \ + --mount type=bind,source=$(CURDIR)/i18n,target=/src/i18n,readonly \ + --mount type=bind,source=$(CURDIR)/layouts,target=/src/layouts,readonly \ + --mount type=bind,source=$(CURDIR)/static,target=/src/static,readonly \ + --mount type=tmpfs,destination=/tmp,tmpfs-mode=01777 \ + --mount type=bind,source=$(CURDIR)/hugo.toml,target=/src/hugo.toml,readonly CCRED=\033[0;31m CCEND=\033[0m @@ -98,15 +111,13 @@ docker-push: ## Build a multi-architecture image and push that into the registry container-build: module-check mkdir -p public - $(CONTAINER_RUN) --read-only \ - --mount type=tmpfs,destination=/tmp,tmpfs-mode=01777 \ - --mount type=bind,source=$(CURDIR)/public,target=/src/public $(CONTAINER_IMAGE) \ - hugo --cleanDestinationDir --buildDrafts --buildFuture --environment preview --noBuildLock + $(CONTAINER_RUN_TTY) $(CONTAINER_HUGO_MOUNTS) $(CONTAINER_IMAGE) \ + hugo --destination /tmp/public --cleanDestinationDir --buildDrafts --buildFuture --environment preview --noBuildLock # no build lock to allow for read-only mounts container-serve: module-check ## Boot the development server using container. - $(CONTAINER_RUN) --cap-drop=ALL --cap-add=AUDIT_WRITE --read-only \ - --mount type=tmpfs,destination=/tmp,tmpfs-mode=01777 -p 1313:1313 $(CONTAINER_IMAGE) \ + $(CONTAINER_RUN_TTY) --cap-drop=ALL --cap-add=AUDIT_WRITE $(CONTAINER_HUGO_MOUNTS) \ + -p 1313:1313 $(CONTAINER_IMAGE) \ hugo server --buildDrafts --buildFuture --environment development --bind 0.0.0.0 --destination /tmp/public --cleanDestinationDir --noBuildLock test-examples: diff --git a/README.md b/README.md index 7ad7457d45ab1..82e70fe4f9f7e 100644 --- a/README.md +++ b/README.md @@ -30,7 +30,7 @@ git clone https://github.com/kubernetes/website.git cd website ``` -The Kubernetes website uses the [Docsy Hugo theme](https://github.com/google/docsy#readme). Even if you plan to run the website in a container, we strongly recommend pulling in the submodule and other development dependencies by running the following: +The Kubernetes website uses git submodules. Even if you plan to run the website in a container, we strongly recommend pulling in the submodule and other development dependencies by running the following: ### Windows diff --git a/assets/scss/_custom.scss b/assets/scss/_custom.scss index de74a05cdf2da..b3c10f8c87d59 100644 --- a/assets/scss/_custom.scss +++ b/assets/scss/_custom.scss @@ -98,10 +98,7 @@ body.td-home main[role="main"] > section:first-of-type .content p:first-child { body.td-404 main .error-details { max-width: 1100px; - margin-left: auto; - margin-right: auto; - margin-top: 4em; - margin-bottom: 0; + margin: 0 auto; } /* Global - Mermaid.js diagrams */ @@ -1591,7 +1588,7 @@ html.no-js body div#announcement { // default background is blue; overrides are possible color: #fff; display: none; // When javascript is available, Let javascript handle the state of the announcement - + .announcement-main { margin-left: auto; margin-right: auto; @@ -1828,7 +1825,7 @@ div.alert > em.javascript-required { align-items: center; background-color: #fff; border: 1px solid #4c4c4c; - border-radius: 20px; + border-radius: 20px; vertical-align: middle; flex-grow: 1; overflow-x: hidden; @@ -1857,7 +1854,7 @@ div.alert > em.javascript-required { #search .pagefind-ui form input { background-color: #fff; border: 1px solid #4c4c4c; - border-radius: 20px; + border-radius: 20px; overflow-x: hidden; width: auto; padding: 6px 10px !important; @@ -1912,7 +1909,7 @@ body.td-search #search { } /* CSS for 'figure' full-screen display */ - + /* Define styles for full-screen overlay */ .figure-fullscreen-overlay { position: fixed; @@ -1941,7 +1938,7 @@ body.td-search #search { /* Define styles for close button */ .figure-close-button { position: absolute; - top: 1%; + top: 1%; right: 2%; cursor: pointer; font-size: calc(5vw + 10px); @@ -1954,6 +1951,10 @@ body.td-search #search { padding: 0.2rem; } +.includecode .highlight { + margin-top: 0; + margin-bottom: 0; +} // handle main page features on narrow viewports @media screen and (max-width: 768px) { diff --git a/hugo.toml b/hugo.toml index 9848d59785014..5dd9c53a9f185 100644 --- a/hugo.toml +++ b/hugo.toml @@ -3,6 +3,7 @@ title = "Kubernetes" # Hugo allows theme composition (and inheritance). The precedence is from left to right. theme = ["docsy"] +themesDir = "node_modules" # Language settings contentDir = "content/en" @@ -248,44 +249,44 @@ no = 'Sorry to hear that. Please

{{ T "error_404_were_you_looking_for" }} @@ -11,4 +12,5 @@ {{ end }}

+ {{ end }} diff --git a/layouts/blog/baseof.html b/layouts/blog/baseof.html index eace6776e7d36..3aac0fa0f92ba 100644 --- a/layouts/blog/baseof.html +++ b/layouts/blog/baseof.html @@ -34,7 +34,7 @@ > {{ with .CurrentSection.OutputFormats.Get "rss" -}}
- RSS + RSS {{ end -}} {{ block "main" . }}{{ end }} diff --git a/layouts/partials/blog-meta-links.html b/layouts/partials/blog-meta-links.html index 0d40c2dac80e9..c41e31a15cb50 100644 --- a/layouts/partials/blog-meta-links.html +++ b/layouts/partials/blog-meta-links.html @@ -1,13 +1,13 @@
{{ with site.Home.OutputFormats.Get "rss" -}} -
RSS Feed
+
RSS Feed
{{ end -}} -
Submit a Post
-
@Kubernetesio
-
on GitHub
-
#kubernetes-users
-
Stack Overflow
-
Forum
-
Kubernetes
+
Submit a Post
+
@Kubernetesio
+
on GitHub
+
#kubernetes-users
+
Stack Overflow
+
Forum
+
Kubernetes
diff --git a/layouts/partials/blog-sidebar.html b/layouts/partials/blog-sidebar.html index 7b3a1ddd2908a..e769eca1e02b0 100644 --- a/layouts/partials/blog-sidebar.html +++ b/layouts/partials/blog-sidebar.html @@ -1,4 +1,4 @@ -{{/* The blog nav organizes posts grouped by year, which represents a customized version of the +{{/* The blog nav organizes posts grouped by year, which represents a customized version of the sidebar-tree in use elsewhere on the site. */}} {{/* We cache this partial for bigger sites and set the active class client side. */}} @@ -8,10 +8,10 @@ - +