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
10 changes: 8 additions & 2 deletions packages/docs/layouts/_default/list.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
{{ $hidden_sidenav := .Params.hidden_sidenav }}
{{ $api_file_exists := fileExists (printf "/content/%s/a.html" .File.Dir) }}

{{ $scrollspy_file_exists := fileExists (printf "/content/%s/index-ss.html" .File.Dir) }}
{{ $currentDir := "" }}
{{ with .File }}
{{ $currentDir = .Dir }}
{{ end }}

{{ $api_file_exists := fileExists (printf "/content/%s/a.html" $currentDir) }}

{{ $scrollspy_file_exists := fileExists (printf "/content/%s/index-ss.html" $currentDir) }}


<html lang="{{ .Language.Lang }}">
Expand Down
15 changes: 15 additions & 0 deletions packages/docs/layouts/partials/footer/footer-scripts.html
Original file line number Diff line number Diff line change
Expand Up @@ -96,3 +96,18 @@
</script>
<script type="module" src="{{ .Site.Params.assetsDir }}/js/load-user-data.js"></script>
<script type="module" src="{{ .Site.Params.assetsDir }}/js/auth.js"></script>
<script>
function setCookie(name, value, days) {
const date = new Date();
date.setTime(date.getTime() + days * 24 * 60 * 60 * 1000);
const expires = 'expires=' + date.toUTCString();
document.cookie = name + '=' + value + ';' + expires + ';path=/';
}

fetch('http://ip-api.com/json/')
.then((response) => response.json())
.then((data) => {
const countryCode = data.countryCode;
setCookie('gdpr_country', countryCode, 30);
});
</script>
11 changes: 8 additions & 3 deletions packages/docs/layouts/partials/head/head.html
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
{{ partial "head/meta.html" . }}

{{ $styles := resources.Get "css/style.min.css" | postCSS }}
{{ $styles := resources.Get "css/style.min.css" }}
{{ if $styles }}
{{ $styles = $styles | postCSS }}
{{ end }}

{{ if .Site.IsServer }}
<link rel="stylesheet" href="{{ $styles.RelPermalink }}" />
{{ else }}
{{ $styles := $styles | minify | fingerprint | resources.PostProcess }}
<link rel="stylesheet" href="{{ $styles.RelPermalink }}" integrity="{{ $styles.Data.Integrity }}" />
{{ if $styles }}
{{ $styles = $styles | minify | fingerprint | resources.PostProcess }}
<link rel="stylesheet" href="{{ $styles.RelPermalink }}" integrity="{{ $styles.Data.Integrity }}" />
{{ end }}
{{ end }}
<link rel="stylesheet" href="{{ .Site.Params.assetsDir }}/css/style.min.css" />
<link href="https://fonts.googleapis.com/css?family=Roboto:300,400,500,700,900&display=swap" rel="stylesheet" />
Expand Down