Skip to content

Commit

Permalink
Merge pull request #2 from nginxinc/use-local-files
Browse files Browse the repository at this point in the history
feat: Use local files
  • Loading branch information
jputrino authored Mar 22, 2023
2 parents ba7d518 + f58bad5 commit 976c1cb
Show file tree
Hide file tree
Showing 30 changed files with 8,034 additions and 1,390 deletions.
1,308 changes: 0 additions & 1,308 deletions assets/css/kube.css

This file was deleted.

7,955 changes: 7,955 additions & 0 deletions assets/fontawesome/css/all.css

Large diffs are not rendered by default.

9 changes: 9 additions & 0 deletions assets/fontawesome/css/all.min.css

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions assets/fontawesome/css/v4-font-face.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions assets/fontawesome/css/v4-shims.min.css

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions assets/fontawesome/css/v5-font-face.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 0 additions & 6 deletions assets/js/all.min.js

This file was deleted.

2 changes: 2 additions & 0 deletions assets/js/jquery-3-6-4.min.js

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module github.com/nginxinc/nginx-hugo-theme

go 1.19
30 changes: 14 additions & 16 deletions layouts/_default/baseof.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,37 +4,35 @@
<head>
{{ block "head" . }}

{{ partial "meta.html" . }}
{{ partial "meta.html" . }}

{{ partial "favicon.html" . }}
{{ partial "favicon.html" . }}

{{ partial "styles.html" . }}
{{ partial "styles.html" . }}

{{ if in .Params.doctypes "devportal" }}
{{ partial "devportal/style.html" . }}
{{ end }}

{{ if fileExists "/layouts/partials/head_custom.html" }}
{{ partial "head_custom.html" . }}
{{ end }}
{{ if in .Params.doctypes "devportal" }}
{{ partial "devportal/style.html" . }}
{{ end }}

{{ partial "load_jquery.html" . }}
{{ if fileExists "/layouts/partials/head_custom.html" }}
{{ partial "head_custom.html" . }}
{{ end }}

{{ if or ( not .Site.IsServer ) ( not ( in .Site.Params.buildtype "package" ) ) }}
{{ if or ( not .Site.IsServer ) ( not ( in .Site.Params.buildtype "package" ) ) }}

{{ partial "trustarc.html" . }}
{{ partial "trustarc.html" . }}

{{ partial "tealium-profile.html" . }}
{{ partial "tealium-profile.html" . }}

{{ end }}
{{ end }}

{{ end }}

</head>

<body>
{{ if or ( not .Site.IsServer ) ( not ( in .Site.Params.buildtype "package" ) ) }}
{{ partial "universal-tag.html" . }}
{{ partial "universal-tag.html" . }}
{{ end }}

<header>
Expand Down
10 changes: 5 additions & 5 deletions layouts/partials/footer.html
Original file line number Diff line number Diff line change
Expand Up @@ -68,14 +68,14 @@
<div class="col-md-2 d-none d-md-block">
<span class="footer-head">Social</span>
<ul class="footer-social">
<li><a href="https://www.facebook.com/nginxinc" title="facebook" aria-label="facebook" target="_blank" rel="noreferrer"><i class="fa fa-facebook-square fa-lg" aria-hidden="true"></i>
<li><a href="https://www.facebook.com/nginxinc" title="facebook" aria-label="facebook" target="_blank" rel="noreferrer"><i class="fa-brands fa-facebook" aria-hidden="true"></i>
Facebook</a></li>
<li><a href="https://twitter.com/nginx" title="twitter" aria-label="twitter" target="_blank" rel="noreferrer"><i class="fa fa-twitter fa-lg" aria-hidden="true"></i>Twitter</a></li>
<li><a href="https://www.linkedin.com/company/nginx" title="linkedin" aria-label="linkedin" target="_blank" rel="noreferrer"><i class="fa fa-linkedin-square fa-lg" aria-hidden="true"></i>
<li><a href="https://twitter.com/nginx" title="twitter" aria-label="twitter" target="_blank" rel="noreferrer"><i class="fa-brands fa-twitter" aria-hidden="true"></i>Twitter</a></li>
<li><a href="https://www.linkedin.com/company/nginx" title="linkedin" aria-label="linkedin" target="_blank" rel="noreferrer"><i class="fa-brands fa-linkedin" aria-hidden="true"></i>
LinkedIn</a></li>
<li><a href="https://www.youtube.com/user/NginxInc" title="youtube" aria-label="youtube" target="_blank" rel="noreferrer" alt="NGINX Youtube Channel"><i class="fa fa-youtube-square fa-lg" aria-hidden="true"></i>
<li><a href="https://www.youtube.com/user/NginxInc" title="youtube" aria-label="youtube" target="_blank" rel="noreferrer" alt="NGINX Youtube Channel"><i class="fa-brands fa-square-youtube" aria-hidden="true"></i>
YouTube</a></li>
<li><a href="https://www.nginx.com/feed/" title="rss" aria-label="rss" target="_blank" ><i class="fa fa-rss-square fa-lg" aria-hidden="true"></i>
<li><a href="https://www.nginx.com/feed/" title="rss" aria-label="rss" target="_blank" ><i class="fa fa-rss-square" aria-hidden="true"></i>
RSS</a></li>
</ul>
</div>
Expand Down
1 change: 0 additions & 1 deletion layouts/partials/load_jquery.html

This file was deleted.

14 changes: 3 additions & 11 deletions layouts/partials/meta.html
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,9 @@


{{/* set custom CSP to load styles and scripts with special handling for GTM scripts (requires unsafe-inline) and Dev Portal page(s) (requires 'unsafe-eval') */}}
<meta http-equiv="Content-Security-Policy" content="script-src
'self'
https://code.jquery.com/
https://cdn.jsdelivr.net/
https://static.cloud.coveo.com
https://kit.fontawesome.com/
https://*.netlify.app
https://gist.github.com
<meta http-equiv="Content-Security-Policy" content="script-src 'self' 'unsafe-inline'
https://consent.trustarc.com/ https://mktg.tags.f5.com/basic/prod/utag.sync.js https://static.cloud.coveo.com/ https://*.f5.com/
https://*.netlify.app https://gist.github.com
https://tag.demandbase.com/pscSDsz4.min.js
https://munchkin.brightfunnel.com/js/build/bf-munchkin.min.js
https://www.googletagmanager.com/gtm.js
Expand All @@ -55,11 +50,8 @@
https://www.google-analytics.com/plugins/ua/linkid.js
https://cdn.bizible.com/scripts/bizible.js
https://cdn.bizible.com/xdc.js
https://consent.trustarc.com/
https://f5networksglobalprod.122.2o7.net/
https://f5networksnginxdocs.122.2o7.net/
https://*.f5.com
'unsafe-inline'
{{ if in .Params.doctypes "devportal" }} 'unsafe-eval' {{end}};
worker-src 'self' blob:">
{{/* end */}}
Expand Down
45 changes: 15 additions & 30 deletions layouts/partials/scripts.html
Original file line number Diff line number Diff line change
@@ -1,42 +1,26 @@
{{ $kubejs := resources.Get "/js/kube.js" }}
{{ $jquery := resources.Get "/js/jquery-3-6-4.min.js" }}

{{ if .Site.IsServer }}
<script src="{{ $kubejs.RelPermalink }}"></script>
{{ else }}
{{ $kubejs := $kubejs | minify | fingerprint "sha512" }}
<script src="{{ $kubejs.RelPermalink }}" type="text/javascript" integrity="{{ $kubejs.Data.Integrity }}"></script>
{{ end }}
<script src="{{ $jquery.RelPermalink }}" type="text/javascript" integrity="{{ $jquery.Data.Integrity }}"></script>

{{ if in .Site.Params.buildtype "package" }}
{{ $kubejs := resources.Get "/js/kube.js" | minify | fingerprint "sha512" }}
<script src="{{ $kubejs.RelPermalink }}" type="text/javascript" integrity="{{ $kubejs.Data.Integrity }}"></script>

<!-- load FontAwesome from assets -->
{{ $jsFA := resources.Get "js/all.min.js" | fingerprint }}
<script src="{{ $jsFA.RelPermalink }}" type="text/javascript" integrity="{{ $jsFA.Data.Integrity }}"></script>

<!-- load Bootstrap from local assets -->
{{ $jsBootstrap := resources.Get "js/bootstrap.bundle.min.js" | fingerprint }}
<script src="{{ $jsBootstrap.RelPermalink }}" type="text/javascript" integrity="{{ $jsBootstrap.Data.Integrity }}"></script>

{{ else }}

<!-- Load Bootstrap from CDN -->
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js" integrity="sha384-Piv4xVNRyMGpqkS2by6br4gNJ7DXjqk09RmUpJ8jgGtD7zP9yug3goQfGII0yAns" crossorigin="anonymous"></script>
<!-- end Bootstrap -->
{{ $jsBootstrap := resources.Get "js/bootstrap.bundle.min.js" | fingerprint "sha512" }}
<script src="{{ $jsBootstrap.RelPermalink }}" type="text/javascript" integrity="{{ $jsBootstrap.Data.Integrity }}"></script>

<!-- Don't need to load FontAwesome here as it's handled in partials/styles.html -->

{{ end }}

{{ if ( not ( in .Site.Params.buildtype "package" ) ) }}
<!-- START COVEO -->

<script class="coveo-script" src="https://static.cloud.coveo.com/searchui/v2.8959/js/CoveoJsSearch.Lazy.min.js"></script>
<script class="coveo-script" src="https://static.cloud.coveo.com/searchui/v2.8959/js/CoveoJsSearch.Lazy.min.js"></script>

<script src="https://static.cloud.coveo.com/searchui/v2.8959/js/templates/templates.js"></script>
<script src="https://static.cloud.coveo.com/searchui/v2.8959/js/templates/templates.js"></script>

{{ $coveo := resources.Get "js/coveo.js" }}
{{ $secureCoveo := $coveo | minify | fingerprint "sha512" }}
<script src="{{ $secureCoveo.RelPermalink }}" integrity="{{ $secureCoveo.Data.Integrity }}" type="text/javascript"></script>
{{ $coveo := resources.Get "js/coveo.js" }}
{{ $secureCoveo := $coveo | minify | fingerprint "sha512" }}
<script src="{{ $secureCoveo.RelPermalink }}" integrity="{{ $secureCoveo.Data.Integrity }}" type="text/javascript"></script>

<!-- END COVEO -->
{{ end }}
Expand All @@ -48,10 +32,11 @@
{{ $redoc := $redoc | fingerprint "sha512" }}

<!-- only load the redoc js if we're on an api reference page -->
{{ if and (in .Params.doctypes "reference") (in .Params.tags "api") }}<script src="{{$redoc.RelPermalink}}" type="text/javascript"></script>{{ end }}
{{ if and (in .Params.doctypes "reference") (in .Params.tags "api") }}
<script src="{{$redoc.RelPermalink}}" type="text/javascript"></script>{{ end }}

{{ end }}

<!-- Load Sidebar javascript -->
{{ $jsSidebar := resources.Get "js/sidebar.js" | fingerprint }}
<script src="{{ $jsSidebar.RelPermalink }}" type="text/javascript" integrity="{{ $jsSidebar.Data.Integrity }}"></script>
{{ $jsSidebar := resources.Get "js/sidebar.js" | minify | fingerprint "sha512" }}
<script src="{{ $jsSidebar.RelPermalink }}" type="text/javascript" integrity="{{ $jsSidebar.Data.Integrity }}"></script>
23 changes: 10 additions & 13 deletions layouts/partials/styles.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,20 @@
{{ $css5 := resources.Get "css/highlight.css" }}
{{ $css6 := resources.Get "css/coveo.css" }}

{{ if in .Site.Params.buildtype "package" }}

<!-- load FontAwesome from assets -->
{{ $cssFA := resources.Get "css/all.min.css" | fingerprint }}
<link href="{{ $cssFA.RelPermalink }}" integrity="{{ $cssFA.Data.Integrity }}" rel="stylesheet" type="text/css">
{{ $cssFA1 := resources.Get "fontawesome/css/all.min.css" | fingerprint "sha512" }}
<link href="{{ $cssFA1.RelPermalink }}" integrity="{{ $cssFA1.Data.Integrity }}" rel="stylesheet" type="text/css">

{{ $cssFA2 := resources.Get "fontawesome/css/v4-font-face.min.css" | fingerprint "sha512" }}
<link href="{{ $cssFA2.RelPermalink }}" integrity="{{ $cssFA2.Data.Integrity }}" rel="stylesheet" type="text/css">

{{ $cssFA3 := resources.Get "fontawesome/css/v5-font-face.min.css" | fingerprint "sha512" }}
<link href="{{ $cssFA3.RelPermalink }}" integrity="{{ $cssFA3.Data.Integrity }}" rel="stylesheet" type="text/css">

<!-- load Bootstrap from local assets -->
{{ $cssBootstrap := resources.Get "css/bootstrap.min.css" | fingerprint }}
<link href="{{ $cssBootstrap.RelPermalink }}" integrity="{{ $cssBootstrap.Data.Integrity }}" rel="stylesheet" type="text/css">

{{ else }}

<!-- load FontAwesome from CDN -->
<script src="https://kit.fontawesome.com/94f08dfe9d.js" crossorigin="anonymous"></script>
<!-- load Bootstrap from CDN -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" integrity="sha384-B0vP5xmATw1+K9KRQjQERJvTumQW0nPEzvF6L/Z6nronJ3oUOFUFpCjEUQouq2+l" crossorigin="anonymous">
{{ end }}
{{ $cssBootstrap := resources.Get "css/bootstrap.min.css" | fingerprint "sha512" }}
<link href="{{ $cssBootstrap.RelPermalink }}" integrity="{{ $cssBootstrap.Data.Integrity }}" rel="stylesheet" type="text/css">

{{ if ( not ( in .Site.Params.buildtype "package" ) ) }}
<!-- load Coveo CSS -->
Expand Down
Binary file removed static/css/webfonts/fa-brands-400.woff2
Binary file not shown.
Binary file removed static/css/webfonts/fa-regular-400.ttf
Binary file not shown.
Binary file removed static/css/webfonts/fa-regular-400.woff2
Binary file not shown.
Binary file removed static/css/webfonts/fa-solid-900.ttf
Binary file not shown.
Binary file removed static/css/webfonts/fa-solid-900.woff2
Binary file not shown.
Binary file removed static/css/webfonts/fa-v4compatibility.ttf
Binary file not shown.
Binary file removed static/css/webfonts/fa-v4compatibility.woff2
Binary file not shown.
Binary file not shown.
Binary file added static/fontawesome/webfonts/fa-brands-400.woff2
Binary file not shown.
Binary file added static/fontawesome/webfonts/fa-regular-400.ttf
Binary file not shown.
Binary file added static/fontawesome/webfonts/fa-regular-400.woff2
Binary file not shown.
Binary file added static/fontawesome/webfonts/fa-solid-900.ttf
Binary file not shown.
Binary file added static/fontawesome/webfonts/fa-solid-900.woff2
Binary file not shown.
Binary file not shown.
Binary file not shown.

0 comments on commit 976c1cb

Please sign in to comment.