Skip to content

Killing Oldframe #276

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

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
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: 9 additions & 1 deletion assets/css/v2/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -1067,7 +1067,7 @@ p {
.breadcrumb-layout {
position: relative;
background-color: white;
width: calc(100% + 4rem);
/* width: calc(100% + 4rem); */
margin-left: -2rem;
padding: 1rem 2rem;

Expand Down Expand Up @@ -1712,6 +1712,14 @@ ul .code-block {
background-color: oklch(var(--color-codeblock-highlight));
}

/* MARK: Catalog
*/
.catalog {
.catalog__table {
padding-bottom: 2rem;
}
}

/* MARK: Images
*/
figure {
Expand Down
1 change: 0 additions & 1 deletion exampleSite/content/test-product/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ hasCustomContent: true
Examples for codeblock shortcode
{{</ card >}}
{{</ card-section >}}

# Other Products on ExampleSite
{{< card-section title="NGINX" showAsCards="true" >}}
{{< card title="NGINX Plus" titleUrl="/nginx/" >}}
Expand Down
9 changes: 3 additions & 6 deletions layouts/_default/_markup/render-codeblock.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
{{ $isSingleLine := eq (len $lines) 1 }}

{{- if $isSingleLine -}}
<div class="code-block" data-mf="true" style="display: none;">
<div class="code-block">
<div class="code-container chroma">
<button onclick="copyToClipBoard(this, {{ $codeBlockId }})" class="code-copy-button" type="button">Copy</button>
<div class="highlight-v2 single-line" id="{{ $codeBlockId }}">
Expand All @@ -13,7 +13,7 @@
</div>
</div>
{{- else -}}
<div class="code-block" data-mf="true" style="display: none;">
<div class="code-block">
{{- if and (ne .Type "") (ne .Type "none") -}}
<span class="code-type chroma">{{ .Type }}</span>
{{- end -}}
Expand All @@ -24,7 +24,4 @@
</div>
</div>
</div>
{{- end -}}
<div id="code-block-v1" data-mf="false">
{{ $result.Wrapped }}
</div>
{{- end -}}
9 changes: 1 addition & 8 deletions layouts/_default/_markup/render-heading.html
Original file line number Diff line number Diff line change
@@ -1,13 +1,6 @@
<h{{ .Level }}
id="{{ .Anchor | safeURL }}">
<div data-mf="false">
{{ .Text | safeHTML }}
<a class="headerlink float-right" href="#{{ .Anchor | safeURL }}" title="{{ .Text | safeHTML }}">
<i class="fas fa-link fa-xs"></i>
</a>
</div>

<div data-mf="true">
<div>
<a class="headerlink float-right" href="#{{ .Anchor | safeURL }}" title="{{ .Text | safeHTML }}">
{{ .Text | safeHTML }}
</a>
Expand Down
173 changes: 17 additions & 156 deletions layouts/_default/baseof.html
Original file line number Diff line number Diff line change
@@ -1,202 +1,63 @@
<!DOCTYPE html>
<html lang="{{ .Site.LanguageCode }}">

<head>
<style>
body {
/* Hide entire body for first paint. This suppresses flicker when theme is loading. */
visibility: hidden;
height: 100vh;
display: flex;
flex-direction: column;
}
</style>

<noscript>
<style>
/* Styles when JavaScript is disabled. Fallsback to old theme. */
body {
visibility: visible;
}
</style>
</noscript>



<script>

const setTheme = (isNewTheme) => {
localStorage.setItem("useNewTheme", `${isNewTheme}`);
// swap out v1 and v2 css style
const v1cssIds = [
"cssFA1",
"cssFA2",
"cssFA3",
"cssBootstrap",
"css1",
"css2",
"css3",
"css4",
"css5",
"css6",
];

v1cssIds.forEach((cssId) => {
const element = document.getElementById(cssId);
if (element !== null) {
element.disabled = isNewTheme;
}
});

const v2cssIds = ["css7", "css9"];
v2cssIds.forEach((cssId) => {
const element = document.getElementById(cssId);
if (element !== null) {
element.disabled = !isNewTheme;
}
});

// swap out v1 and v2 elements
const v1ElementIds = ["sidebar", "footer", "toc", "api", "search-v1", "breadcrumb-v1", "list-v1"]

v1ElementIds.forEach((elementId) => {
const element = document.getElementById(elementId);
if (element !== null) {
element.style.display = isNewTheme ? "none" : "";
}

const trustarc = document.getElementById("teconsent-v1");
if (trustarc) {
trustarc.id = isNewTheme ? "teconsent-v1" : "teconsent";
}
});

document.querySelectorAll(".table-v1").forEach((table) => {
table.style.display = isNewTheme ? "none" : "";
});

const notMfElements = ['[data-mf="false"]'];
notMfElements.forEach((elementId) => {
document.querySelectorAll(elementId).forEach((element) => {
element.style.display = isNewTheme ? "none" : "";
});
})

const mfElements = ['[data-mf="true"]'];
mfElements.forEach((elementId) => {
document.querySelectorAll(elementId).forEach((element) => {
element.style.display = isNewTheme ? "" : "none";

const trustarc = document.getElementById("teconsent-v2");
if (trustarc) {
trustarc.id = isNewTheme ? "teconsent" : "teconsent-v2";
}
});
});

document.getElementById("body").style.visibility = "visible";
};

const toggleTheme = () => {
setTheme(!(localStorage.getItem("useNewTheme") === "true"));
};

// toggle theme aliases
const mf = toggleTheme;
const useNewTheme = toggleTheme;

document.addEventListener("DOMContentLoaded", () => {
setTheme(localStorage.getItem("useNewTheme") === "true");
});

function gameCode(callback) {
let kkeys = [];
// up,up,down,down,left,right,left,right,B,A
const code = "38,38,40,40,37,39,37,39,66,65";
return (event) => {
kkeys.push(event.keyCode);
if (kkeys.toString().indexOf(code) >= 0) {
callback(event);
kkeys = [];
}
};
}
const handler = gameCode(() => {
mf();
});
window.addEventListener("keydown", handler);

</script>
<head>

{{ block "head" . }}

{{ partial "meta.html" . }}

{{ partial "favicon.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 or ( not hugo.IsServer ) ( not ( in .Site.Params.buildtype "package" ) ) }}

{{ partial "trustarc.html" . }}

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

{{ end }}

{{ end }}

<script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
})(window,document,'script','dataLayer','GTM-K5HG9JT');</script>

</head>

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

<header>
{{ block "header" . }}{{end}}
</header>

<section class="base-layout" data-testid="base-layout">
<section id="breadcrumb-v1">
{{ if not .IsHome }}
{{ if not (in .Params.display_breadcrumb "false" ) }}
{{ partial "breadcrumb" .}}
{{ end }}
{{ end }}
</section>

<div class="main container-fluid min-page-height" data-menu-id="{{.RelPermalink}}">
{{ block "main" . }}{{ end }}
</div>
</section>

<footer id="footer">
{{ block "footer" . }}
{{ partial "footer.html" . }}
{{ end }}
</footer>

<footer data-mf="true" id="footer-v2" style="display:none;">
<footer id="footer-v2">
{{ block "footer-v2" . }}
{{ partial "footer-v2.html" . }}
{{ end }}
</footer>
{{ partial "scripts.html" . }}
{{ partial "scripts.html" . }}
<div id="consent_blackbar"></div>
</body>
</html>
25 changes: 7 additions & 18 deletions layouts/_default/docs.html
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
{{ define "main" }}
<div class="docs-container row override-sidebar-collapse">
<div class="docs-container row override-sidebar-collapse">
<nav id="sidebar" class="sidenav overflow-auto col-md-3 d-none d-xl-block d-print-none align-top">
{{ partial "sidebar.html" . }}
</nav>

<!-- Replace icons -->
{{ $content := partial "icon-replacement.html" (dict "content" .Content) }}

{{if (.Params.catalog) }}
<main class="content content-has-toc" role="main">
{{ else if and (gt .WordCount 200 ) (.Params.toc) }}
Expand All @@ -18,18 +14,18 @@

<section class="main-layout">
<div class="sidebar-layout" id="sidebar-layout">
<button class="sidebar__mobile__toggle" aria-expanded="false" data-mf="true">{{ partial "lucide" (dict "context" . "icon" "x")}}Close</button>
<nav data-mf="true" id="sidebar-v2" class="sidebar">
<button class="sidebar__mobile__toggle" aria-label="sidebar__mobile__toggle" aria-expanded="false">{{ partial "lucide" (dict "context" . "icon" "x")}}Close</button>
<nav id="sidebar-v2" class="sidebar">
{{ partial "sidebar-v2.html" . }}
</nav>
</div>

<section id="maincontent" class="content-layout">
<div data-cms-edit="content" class="text-content">
<section class="breadcrumb-layout wide" data-mf="true" style="display: none;">
<section class="breadcrumb-layout wide">
{{ if not .IsHome }}
{{ if not (in .Params.display_breadcrumb "false" ) }}
{{ partial "breadcrumb" .}}
{{ partial "breadcrumb" .}}
{{ end }}
{{ end }}
</section>
Expand All @@ -40,7 +36,7 @@ <h1>{{ .Title }}</h1>
{{ if in .Params.doctypes "beta" }}{{ partial "beta-badge" . }}{{ end }}

<hr>

{{ if .Page.Lastmod }}
<div class="last-modified">
{{ partial "page-meta-links" . }}
Expand All @@ -52,14 +48,7 @@ <h1>{{ .Title }}</h1>

{{ partial "previous-next-links-in-section-with-title.html" . }}
</main>
{{ if and (gt .WordCount 200 ) (.Params.toc) }}
{{ if (add (len (findRE "<h3" .Content)) (len (findRE "<h2" .Content))) }}
<div id="toc" class="col-md-3 d-none d-xl-block d-print-none nginx-toc align-top">
{{ partial "toc.html" . }}
</div>
{{ end }}
{{ end }}


</div>
</section>
</section>
Expand Down
21 changes: 4 additions & 17 deletions layouts/_default/list.html
Original file line number Diff line number Diff line change
@@ -1,25 +1,15 @@
{{ define "main" }}
<div class="row flex-xl-nowrap" id="list-v1">
<nav class="sidenav overflow-auto col-md-3 d-none d-xl-block d-print-none">
{{ partial "sidebar.html" . }}
</nav>
<main class="content col-xl-9 d-block" role="main">
{{ partial "list-main" . }}
</main>
</div>

{{/* mf list page */}}

<main class="content col d-block align-top content-has-toc" role="main" data-mf="true" style="display: none">
<main class="content col d-block align-top content-has-toc" role="main">
<section class="main-layout">
<div class="sidebar-layout" id="sidebar-layout">
<button class="sidebar__mobile__toggle" aria-expanded="false" data-mf="true">{{ partial "lucide" (dict "context" . "icon" "x")}}Close</button>
<nav data-mf="true" id="sidebar-v2" class="sidebar" style="display:none;">
<button class="sidebar__mobile__toggle" aria-label="sidebar__mobile__toggle" aria-expanded="false">{{ partial "lucide" (dict "context" . "icon" "x")}}Close</button>
<nav id="sidebar-v2" class="sidebar">
{{ partial "sidebar-v2.html" . }}
</nav>
</div>

<section id="maincontent" class="content-layout" data-mf="true" style="display: none">
<section id="maincontent" class="content-layout">
<div data-cms-edit="content" class="text-content list-page">
<section class="breadcrumb-layout wide">
{{ if not .IsHome }}
Expand Down Expand Up @@ -58,9 +48,6 @@ <h2>
</div>
</section>
</section>



</section>
</main>
{{ end }}
Expand Down
Loading
Loading