Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 1 addition & 0 deletions hugo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ id = "G-HX135VWX9B"
languageName = "English"
# Weight used for sorting.
weight = 1
direction = "ltr"
[languages.en.params]
title = "Layer5"
description = "Product Documentation"
Expand Down
2 changes: 1 addition & 1 deletion layouts/404.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!doctype html>
<html itemscope itemtype="http://schema.org/WebPage" lang="{{ .Site.Language.Lang }}" class="no-js">
<html itemscope itemtype="http://schema.org/WebPage" lang="{{ .Site.Language.Lang }}" dir="{{ .Site.Language.Direction }}" class="no-js">
<head>
{{ partial "head.html" . }}
</head>
Expand Down
1 change: 1 addition & 0 deletions layouts/_default/baseof.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
itemscope
itemtype="http://schema.org/WebPage"
lang="{{ .Site.Language.Lang }}"
dir="{{ .Site.Language.Direction }}"
class="no-js"
>
<head>
Expand Down
2 changes: 1 addition & 1 deletion layouts/docs/baseof.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!DOCTYPE html>
<html itemscope itemtype="http://schema.org/WebPage" lang="{{ .Site.Language.Lang }}" class="no-js">
<html itemscope itemtype="http://schema.org/WebPage" lang="{{ .Site.Language.Lang }}" dir="{{ .Site.Language.Direction }}" class="no-js">

<head>
{{ partial "head.html" . }}
Expand Down
30 changes: 30 additions & 0 deletions layouts/partials/head-css.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{{ $scssMain := "scss/main.scss" -}}
{{ $css := resources.Get $scssMain
| toCSS (dict "enableSourceMap" (not hugo.IsProduction)) -}}

{{/* NOTE: we only apply `postCSS` in production or for RTL languages. This
makes it snappier to develop in Chrome, but it may look sub-optimal in other
browsers. */ -}}

{{ if eq .Site.Language.Direction "rtl" -}}
{{ $css = $css
| postCSS (dict "use" "autoprefixer rtlcss" "noMap" true)
| resources.Copy (replace $scssMain "." ".rtl.") -}}
{{ else if hugo.IsProduction -}}
{{ $css = $css | postCSS -}}
{{ end -}}

{{ if hugo.IsProduction -}}
{{ $css = $css | minify | fingerprint -}}
<link rel="preload" href="{{ $css.RelPermalink }}" as="style" integrity="{{ $css.Data.Integrity }}" crossorigin="anonymous">
{{ end -}}

{{ with $css -}}
<link href="{{ .RelPermalink }}" rel="stylesheet"
{{- with .Data.Integrity }} integrity="{{ . }}" crossorigin="anonymous"{{ end -}}
>
{{ else -}}
{{ errorf "Resource not found or error building CSS: %s" $scssMain -}}
{{ end -}}

{{- /**/ -}}
1 change: 1 addition & 0 deletions layouts/release/baseof.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
itemscope
itemtype="http://schema.org/WebPage"
lang="{{ .Site.Language.Lang }}"
dir="{{ .Site.Language.Direction }}"
class="no-js"
>
<head>
Expand Down
1 change: 1 addition & 0 deletions layouts/video/baseof.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
itemscope
itemtype="http://schema.org/WebPage"
lang="{{ .Site.Language.Lang }}"
dir="{{ .Site.Language.Direction }}"
class="no-js"
>
<head>
Expand Down
2 changes: 1 addition & 1 deletion layouts/video/video.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!DOCTYPE html>
<html itemscope itemtype="http://schema.org/WebPage" lang="{{ .Site.Language.Lang }}" class="no-js">
<html itemscope itemtype="http://schema.org/WebPage" lang="{{ .Site.Language.Lang }}" dir="{{ .Site.Language.Direction }}" class="no-js">

<head>
{{ partial "head.html" . }}
Expand Down
Loading