Skip to content

Commit 256dff0

Browse files
Fix global top menu: load the modern Containerize menu engine (match products.groupdocs.com)
The site inherited the deprecated menu.containerize.com/api/get-menu loader (venture groupdocsnet-<lang>) when it moved to the docs theme, which broke the global GroupDocs top menu. Load the modern self-contained engine.min.js (menucdn.containerize.com, venture groupdocs-<lang>) instead — the same loader products.groupdocs.com uses. Wired via foot.html so it applies to all main pages; the standalone 404 is unaffected.
1 parent c24c4fa commit 256dff0

2 files changed

Lines changed: 9 additions & 166 deletions

File tree

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,10 @@ tags), so changes accumulate under **[Unreleased]**.
7676
`/search-index.json` and `/llms-full.txt` on content pushes.
7777

7878
### Fixed
79+
- Restored the global GroupDocs top menu — load the modern Containerize menu engine
80+
(`menucdn.containerize.com/core/engine.min.js`, venture `groupdocs-<lang>`), the same loader
81+
products.groupdocs.com uses, replacing the deprecated `menu.containerize.com/api/get-menu` loader
82+
that broke when the site moved to the docs theme.
7983
- Family-page "Browse API reference" links now include the product path prefix.
8084
- Markdown output no longer leaks front matter on empty-body pages (CRLF-tolerant strip).
8185
- `build_search_index.py` handles UTF-8 BOM (python-net files) and non-UTF-8 bytes (`surrogateescape`).
Lines changed: 5 additions & 166 deletions
Original file line numberDiff line numberDiff line change
@@ -1,168 +1,7 @@
1-
<link rel="stylesheet" type="text/css" href="{{ `/menu/styles.min.css` | relURL }}">
1+
{{- /* GroupDocs global top menu. Loaded the same way as products.groupdocs.com (airspace-hugo):
2+
the modern self-contained Containerize menu engine, which injects the header/footer and its
3+
own styles. Replaces the deprecated menu.containerize.com/api/get-menu loader that broke when
4+
the site moved to this theme. Venture key: groupdocs-<lang> (the groupdocs.com menu). */ -}}
25
<script>
3-
window.ContainerizeMenuObject = 'groupdocsnet-{{ cond (eq .Site.LanguageCode "zh-hant") "zht" .Site.LanguageCode }}';
4-
5-
!function (e, t) {
6-
e = e || "docReady", t = t || window;
7-
var n = [], o = !1, r = !1;
8-
function a() {
9-
if (!o) {
10-
o = !0;
11-
for (var e = 0; e < n.length; e++)n[e].fn.call(window, n[e].ctx);
12-
n = []
13-
}
14-
}
15-
function i() {
16-
"complete" === document.readyState && a()
17-
}
18-
t[e] = function (e, t) {
19-
if ("function" != typeof e) throw new TypeError("callback for docReady(fn) must be a function");
20-
o ? setTimeout(function () { e(t) }, 1) : (n.push({ fn: e, ctx: t }), "complete" === document.readyState ? setTimeout(a, 1) : r || (document.addEventListener ? (document.addEventListener("DOMContentLoaded", a, !1), window.addEventListener("load", a, !1)) : (document.attachEvent("onreadystatechange", i), window.attachEvent("onload", a)), r = !0))
21-
}
22-
}("docReady", window);
23-
24-
var _defaultLanguage = "1",
25-
_baseURL = "https://menu.containerize.com/",
26-
_apiGetHTML = "api/get-menu/";
27-
28-
var Base64 = {
29-
_keyStr: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",
30-
encode: function (e) {
31-
var t, n, o, r, a, i, d, c = "", s = 0;
32-
for (e = Base64._utf8_encode(e); s < e.length;)
33-
r = (t = e.charCodeAt(s++)) >> 2,
34-
a = (3 & t) << 4 | (n = e.charCodeAt(s++)) >> 4,
35-
i = (15 & n) << 2 | (o = e.charCodeAt(s++)) >> 6,
36-
d = 63 & o,
37-
isNaN(n) ? i = d = 64 : isNaN(o) && (d = 64),
38-
c = c + this._keyStr.charAt(r) + this._keyStr.charAt(a) + this._keyStr.charAt(i) + this._keyStr.charAt(d);
39-
return c
40-
},
41-
decode: function (e) {
42-
var t, n, o, r, a, i, d = "", c = 0;
43-
for (e = e.replace(/[^A-Za-z0-9\+\/\=]/g, ""); c < e.length;)
44-
t = this._keyStr.indexOf(e.charAt(c++)) << 2 | (r = this._keyStr.indexOf(e.charAt(c++))) >> 4,
45-
n = (15 & r) << 4 | (a = this._keyStr.indexOf(e.charAt(c++))) >> 2,
46-
o = (3 & a) << 6 | (i = this._keyStr.indexOf(e.charAt(c++))),
47-
d += String.fromCharCode(t),
48-
64 != a && (d += String.fromCharCode(n)),
49-
64 != i && (d += String.fromCharCode(o));
50-
return d = Base64._utf8_decode(d)
51-
},
52-
_utf8_encode: function (e) {
53-
e = e.replace(/\r\n/g, "\n");
54-
for (var t = "", n = 0; n < e.length; n++) {
55-
var o = e.charCodeAt(n);
56-
o < 128 ? t += String.fromCharCode(o) :
57-
o > 127 && o < 2048 ? (t += String.fromCharCode(o >> 6 | 192), t += String.fromCharCode(63 & o | 128)) :
58-
(t += String.fromCharCode(o >> 12 | 224), t += String.fromCharCode(o >> 6 & 63 | 128), t += String.fromCharCode(63 & o | 128))
59-
}
60-
return t
61-
},
62-
_utf8_decode: function (e) {
63-
for (var t = "", n = 0, o = c1 = c2 = 0; n < e.length;)
64-
(o = e.charCodeAt(n)) < 128 ? (t += String.fromCharCode(o), n++) :
65-
o > 191 && o < 224 ? (c2 = e.charCodeAt(n + 1), t += String.fromCharCode((31 & o) << 6 | 63 & c2), n += 2) :
66-
(c2 = e.charCodeAt(n + 1), c3 = e.charCodeAt(n + 2), t += String.fromCharCode((15 & o) << 12 | (63 & c2) << 6 | 63 & c3), n += 3);
67-
return t
68-
}
69-
};
70-
71-
function maincssLoaded() {
72-
getJSON(_baseURL + _apiGetHTML, function (e) {
73-
if (null == e.ventureHead)
74-
return void console.log("error loading menu- venture css doesn't exist");
75-
const t = document.createElement("div");
76-
t.innerHTML = e.ventureHead, t.id = "dvMenuHeader",
77-
document.body.insertBefore(t, document.body.firstChild);
78-
ParseCSS(e.ventureHead);
79-
RenderMenu(e)
80-
})
81-
}
82-
83-
function RenderMenu(data) {
84-
const p = document.createElement("div");
85-
p.innerHTML = data.ventureHeader, p.id = "DynabicMenuInnerDiv",
86-
document.body.insertBefore(p, document.body.firstChild);
87-
const f = document.createElement("div");
88-
f.id = "dvMenuFooter", f.innerHTML = data.ventureFooter,
89-
document.body.appendChild(f);
90-
var cookie = GetUsernameCookie("aspose");
91-
if ("" != data.noLoginHTML && "" != data.LoginHTML)
92-
if ("" == cookie) {
93-
if ("" != data.noLoginHTML) {
94-
var elemuser = document.getElementById("DynabicMenuUserControls");
95-
null != elemuser && (elemuser.innerHTML = data.noLoginHTML)
96-
}
97-
} else "" != data.LoginHTML &&
98-
(document.getElementById("DynabicMenuUserControls").innerHTML = data.loginHTML,
99-
document.getElementById("UserNameLink").innerHTML = localStorage.getItem("UserNameLink"));
100-
if ("" != data.headScript) {
101-
var script = document.createElement("script");
102-
script.textContent = data.headScript,
103-
document.head.appendChild(script),
104-
eval("menuLoaded();")
105-
}
106-
}
107-
108-
function ParseCSS(e) {
109-
return e.split("\n")
110-
}
111-
112-
function LoadCSS(e, t) {
113-
var n = document.createElement("link");
114-
n.setAttribute("rel", "stylesheet"),
115-
n.setAttribute("type", "text/css"),
116-
n.onload = function () { t() },
117-
n.setAttribute("href", e),
118-
document.getElementsByTagName("head")[0].appendChild(n)
119-
}
120-
121-
docReady(function () {
122-
var e, t = window.ContainerizeMenuObject;
123-
"" == t && (console.log("error loading menu - venture doesn't exists"), 3 == (e = document.location.hostname.split(".")).length && (t += e[1] + "-en"));
124-
2 == (e = t.split("-")).length ? _apiGetHTML += e[0] + "/" + e[1] + "?format=json" : console.log("error loading menu - configuration is not valid")
125-
126-
maincssLoaded();
127-
});
128-
129-
var getJSON = function (e, t) {
130-
var n = new XMLHttpRequest;
131-
n.overrideMimeType("application/json"),
132-
n.open("GET", e, !0),
133-
n.onload = function () {
134-
var e = JSON.parse(n.responseText);
135-
t(e)
136-
},
137-
n.send(null)
138-
};
139-
140-
function GetUsernameCookie(e) {
141-
var t = "";
142-
if ("" == (t = Base64.decode(getCookie("UserInfo")))) return t;
143-
try {
144-
var n = t.split("&"),
145-
o = n[0].split("=")[1],
146-
r = n[1].split("=")[1],
147-
a = r;
148-
"" == r && (a = o),
149-
localStorage.setItem("UserNameLink", a)
150-
} catch (e) { }
151-
return t
152-
}
153-
154-
function getCookie(e) {
155-
for (var t = e + "=", n = decodeURIComponent(document.cookie).split(";"), o = 0; o < n.length; o++) {
156-
for (var r = n[o]; " " == r.charAt(0);)r = r.substring(1);
157-
if (0 == r.indexOf(t)) return r.substring(t.length, r.length)
158-
}
159-
return ""
160-
}
161-
162-
function setCookie(e, t, n) {
163-
var o = new Date;
164-
o.setTime(o.getTime() + 24 * n * 60 * 60 * 1e3);
165-
var r = "expires=" + o.toGMTString();
166-
document.cookie = e + "=" + t + ";" + r + ";path=/"
167-
}
6+
(function (i, s, o, g, r, a, m) { i['ContainerizeMenuObject'] = r; i[r] = i[r] || function () { (i[r].q = i[r].q || []).push(arguments) }, i[r].l = 1 * new Date(); a = s.createElement(o), m = s.getElementsByTagName(o)[0]; a.async = 1; a.src = g; m.parentNode.append(a) })(window, document, 'script', 'https://menucdn.containerize.com/core/engine.min.js?v=1.0.1', 'groupdocs-{{ cond (eq .Site.LanguageCode "zh-hant") "zht" .Site.LanguageCode }}');
1687
</script>

0 commit comments

Comments
 (0)