Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use Hugo for Sass processing #9404

Merged
merged 21 commits into from
Jul 26, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
8b99d17
Move all Sass into a common /assets directory
lucperkins Jul 6, 2018
8c1aeed
Remove node-sass make command
lucperkins Jul 6, 2018
f42f8a5
Change head partial to accommodate full Sass rules
lucperkins Jul 6, 2018
86a2204
Bump Hugo version in Netlify config
lucperkins Jul 9, 2018
d20c9ab
Use separate partial for CSS imports
lucperkins Jul 10, 2018
cd1a8a0
Bump Hugo version
lucperkins Jul 10, 2018
9e00c2d
Remove PostCSS from the pipeline
lucperkins Jul 10, 2018
be45df6
Un-bump version
lucperkins Jul 10, 2018
f135a44
Fix merge conflict
lucperkins Jul 12, 2018
f5a943e
Update Hugo version to 0.44
lucperkins Jul 13, 2018
8c597ee
Update Hugo version in Makefile
lucperkins Jul 13, 2018
e6f293e
Merge remote-tracking branch 'upstream/master' into lperkins/hugo-sass
lucperkins Jul 13, 2018
458f085
Update production Hugo version
lucperkins Jul 13, 2018
ded7c9b
Merge remote-tracking branch 'upstream/master' into lperkins/hugo-sass
lucperkins Jul 19, 2018
b042dee
Fix misspelled variable name
lucperkins Jul 19, 2018
b543f85
Add ./resources folder to Git
lucperkins Jul 19, 2018
6457dca
Merge remote-tracking branch 'upstream/master' into lperkins/hugo-sass
lucperkins Jul 19, 2018
7927e1d
Update Hugo version in Netlify config to 0.45.1
lucperkins Jul 19, 2018
502f83e
Use un-cached css.html partial
lucperkins Jul 25, 2018
2d9ba4d
Merge remote-tracking branch 'upstream/master' into lperkins/hugo-sass
lucperkins Jul 25, 2018
1bc8dfc
Re-work extra CSS logic for .Params.css
lucperkins Jul 25, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 2 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
DOCKER = docker
HUGO_VERSION = 0.40.3
HUGO_VERSION = 0.44
DOCKER_IMAGE = kubernetes-hugo
DOCKER_RUN = $(DOCKER) run --rm --interactive --tty --volume $(PWD):/src

Expand All @@ -10,18 +10,14 @@ help: ## Show this help.

all: build ## Build site with production settings and put deliverables in _site.

sass: # Rebuild the SASS source into CSS
node-sass --output-style compact ./src/sass/styles.sass ./static/css/styles.css
node-sass --output-style compact ./src/sass/case_study_styles.sass ./static/css/case_study_styles.css

build: ## Build site with production settings and put deliverables in _site.
hugo

build-preview: ## Build site with drafts and future posts enabled.
hugo -D -F

serve: ## Boot the development server.
hugo server
hugo server --ignoreCache --disableFastRender

docker-image:
$(DOCKER) build . --tag $(DOCKER_IMAGE) --build-arg HUGO_VERSION=$(HUGO_VERSION)
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 0 additions & 2 deletions content/en/docs/home/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,3 @@ linkTitle: "Documentation"
main_menu: true
weight: 5
---


33 changes: 33 additions & 0 deletions layouts/partials/css.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{{- $mainSass := "sass/styles.sass" }}
{{- $caseStudySass := "sass/case_study_styles.sass" }}
<link rel="stylesheet" type="text/css" href="/css/base_fonts.css">
{{- if .Site.IsServer }}
{{- $mainCssOpts := (dict "targetPath" "css/styles.css") }}
{{- $mainCss := resources.Get $mainSass | toCSS $mainCssOpts }}
<link rel="stylesheet" media="screen" href="{{ $mainCss.RelPermalink }}"><!-- default styles.css on -->
{{- else }}
{{- $mainCssOpts := (dict "targetPath" "css/styles.css") }}
{{- $mainCss := resources.Get $mainSass | toCSS $mainCssOpts | minify | fingerprint }}
<link rel="stylesheet" media="screen" href="{{ $mainCss.RelPermalink }}" integrity="{{ $mainCss.Data.Integrity }}"><!-- default styles.css on -->
{{- end }}
{{- if .Params.case_study_styles }}
{{- $caseStudyCssOpts := (dict "targetPath" "css/styles.css") }}
{{- $caseStudyCss := resources.Get $caseStudySass | toCSS $caseStudyCssOpts | minify | fingerprint }}
<link rel="stylesheet" media="screen" href="{{ $caseStudyCss.Permalink }}" integrity="{{ $caseStudyCss.Data.Integrity }}"><!-- custom case_study_styles on -->
{{- end }}
<link rel="stylesheet" type="text/css" href="https://code.jquery.com/ui/1.12.1/themes/smoothness/jquery-ui.css">
<link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/sweetalert/1.1.3/sweetalert.min.css">
<link rel="stylesheet" type="text/css" href="{{ "css/callouts.css" | relURL }}">
<link rel="stylesheet" type="text/css" href="{{ "css/custom-jekyll/tags.css" | relURL }}">
{{- if .Params.deprecated }}
<link rel="stylesheet" type="text/css" href="{{ "css/deprecation-warning.css" | relURL }}">
{{- end }}
{{- if eq .Params.class "gridPage" }}
<link rel="stylesheet" type="text/css" href="{{ "css/gridpage.css" | relURL }}">
{{- end }}
{{- with .Params.css }}
{{- range (split . ",") }}
{{- $url := trim . " " | relURL }}
<link rel="stylesheet" type="text/css" href="{{ $url }}"><!-- custom css added -->
{{- end }}
{{- end }}
11 changes: 1 addition & 10 deletions layouts/partials/head.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,7 @@
<title>{{ if .Title }}{{ .Title }} - {{ end }}{{ .Site.Title }}</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="shortcut icon" type="image/png" href="{{ "images/favicon.png" | relURL }}">
<link rel="stylesheet" type="text/css" href="/css/base_fonts.css">
{{ if .Params.case_study_styles }}<link rel="stylesheet" type="text/css" href="{{ "css/case_study_styles.css" | relURL }}"><!-- custom case_study_styles on -->{{ else }}<link rel="stylesheet" type="text/css" href="{{ "css/styles.css" | relURL }}"><!-- default styles.css on -->{{ end }}
<link rel="stylesheet" type="text/css" href="https://code.jquery.com/ui/1.12.1/themes/smoothness/jquery-ui.css">
<link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/sweetalert/1.1.3/sweetalert.min.css">
<link rel="stylesheet" type="text/css" href="{{ "css/callouts.css" | relURL }}">
<link rel="stylesheet" type="text/css" href="{{ "css/custom-jekyll/tags.css" | relURL }}">
{{ if .Params.deprecated }}<link rel="stylesheet" type="text/css" href="{{ "css/deprecation-warning.css" | relURL }}">{{ end }}
{{ if eq .Params.class "gridPage" }}<link rel="stylesheet" type="text/css" href="{{ "css/gridpage.css" | relURL }}">{{ end }}
{{ with .Params.css }}{{ range (split . ",") }}<link rel="stylesheet" type="text/css" href="{{ (trim . " ") | relURL }}"><!-- custom css added -->
{{ end }}{{ else }}<!-- no custom css detected -->{{ end }}
{{ partial "css.html" . }}
{{ if .Params.description }}
<meta name="description" content="{{ .Params.description }}" />
<meta property="og:description" content="{{ .Params.description }}" />
Expand Down
6 changes: 3 additions & 3 deletions netlify.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,21 @@ command = "hugo --enableGitInfo && cp netlify_noindex_headers.txt public/_header

[context.production.environment]
HUGO_BASEURL = "https://kubernetes.io/"
HUGO_VERSION = "0.40.3"
HUGO_VERSION = "0.45.1"
HUGO_ENV = "production"
HUGO_ENABLEGITINFO = "true"

[context.deploy-preview]
command = "hugo --enableGitInfo -b $DEPLOY_PRIME_URL"

[context.deploy-preview.environment]
HUGO_VERSION = "0.40.3"
HUGO_VERSION = "0.45.1"

[context.branch-deploy]
command = "hugo --enableGitInfo -b $DEPLOY_PRIME_URL"

[context.branch-deploy.environment]
HUGO_VERSION = "0.40.3"
HUGO_VERSION = "0.45.1"

[context.master]
# This context is triggered by the master branch and allows search indexing
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"Target":"css/styles.min.cc96976ab977e15130372b9aa336567b7cd2c0cfdbacc2884d84a5f56868cc20.css","MediaType":"text/css","Data":{"Integrity":"sha256-zJaXarl34VEwNyuaozZWe3zSwM/brMKITYSl9WhozCA="}}

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"Target":"css/styles.min.3a4a157b6c0f5130dd7ada2cc65c770a1e7b22b443594d9f713ff99fd6ca0425.css","MediaType":"text/css","Data":{"Integrity":"sha256-OkoVe2wPUTDdetosxlx3Ch57IrRDWU2fcT/5n9bKBCU="}}

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"Target":"css/styles.min.cc96976ab977e15130372b9aa336567b7cd2c0cfdbacc2884d84a5f56868cc20.css","MediaType":"text/css","Data":{"Integrity":"sha256-zJaXarl34VEwNyuaozZWe3zSwM/brMKITYSl9WhozCA="}}