From df63969a018e79c901210fad54c57b20aab08487 Mon Sep 17 00:00:00 2001 From: Battlefield Duck Date: Tue, 13 Feb 2024 19:55:03 +0800 Subject: [PATCH] Enable Algolia DocSearch --- docs/docfx.json | 9 +- docs/template/layout/_master.tmpl | 189 ++++++++++++++++++++++++++++++ docs/template/public/main.css | 14 ++- 3 files changed, 210 insertions(+), 2 deletions(-) create mode 100644 docs/template/layout/_master.tmpl diff --git a/docs/docfx.json b/docs/docfx.json index 54f24bf..18220b6 100644 --- a/docs/docfx.json +++ b/docs/docfx.json @@ -44,7 +44,14 @@ "globalMetadata": { "_appName": "OpenGSQ .NET", "_appTitle": "OpenGSQ .NET", - "_enableSearch": true, + "_enableSearch": false, + "_docSearch": { + "enabled": true, + "container": "#docsearch", + "appId": "KWL1XULD5J", + "apiKey": "102640797dc889088bb60007dfe7ddf9", + "indexName": "docsearch" + }, "_appLogoPath": "images/logo.png", "_appFaviconPath": "images/favicon.ico", "_googleAnalyticsTagId": "G-EBNPX27LWD", diff --git a/docs/template/layout/_master.tmpl b/docs/template/layout/_master.tmpl new file mode 100644 index 0000000..ef18339 --- /dev/null +++ b/docs/template/layout/_master.tmpl @@ -0,0 +1,189 @@ +{{!Licensed to the .NET Foundation under one or more agreements. The .NET Foundation licenses this file to you under the +MIT license.}} +{{!include(/^public/.*/)}} +{{!include(favicon.ico)}} +{{!include(logo.svg)}} + + + + + + {{#redirect_url}} + + {{/redirect_url}} + {{^redirect_url}} + {{#title}}{{title}}{{/title}}{{^title}}{{>partials/title}}{{/title}} {{#_appTitle}}| {{_appTitle}} + {{/_appTitle}} + + + {{#_description}} + {{/_description}} + {{#description}} + {{/description}} + + + + {{#_docSearch.enabled}} + + + {{/_docSearch.enabled}} + + + {{#_noindex}} + {{/_noindex}} + {{#_enableSearch}} + {{/_enableSearch}} + {{#_disableNewTab}} + {{/_disableNewTab}} + {{#_disableTocFilter}} + {{/_disableTocFilter}} + {{#docurl}} + {{/docurl}} + + + + + + + + + + + + + {{/redirect_url}} + + +{{^redirect_url}} + + + + +{{#_googleAnalyticsTagId}} + + +{{/_googleAnalyticsTagId}} + + +
+ +
+ +
+
+
+
+
Table of Contents
+ +
+
+ +
+
+
+ +
+
+ + + +
+ +
+ {{!body}} +
+ + {{^_disableContribution}} +
+ {{#sourceurl}} + {{__global.improveThisDoc}} + {{/sourceurl}} + {{^sourceurl}}{{#docurl}} + {{__global.improveThisDoc}} + {{/docurl}}{{/sourceurl}} +
+ {{/_disableContribution}} + + {{^_disableNextArticle}} + + {{/_disableNextArticle}} + +
+ +
+ +
+
+ + {{#_enableSearch}} +
+ {{/_enableSearch}} + + + + {{#_docSearch.enabled}} + + + {{/_docSearch.enabled}} + +{{/redirect_url}} + + \ No newline at end of file diff --git a/docs/template/public/main.css b/docs/template/public/main.css index 11d47b0..6027b48 100644 --- a/docs/template/public/main.css +++ b/docs/template/public/main.css @@ -1,5 +1,17 @@ -/* Checkout https://getbootstrap.com/docs/5.3/customize/color/ for more customization options */ +/* + For more customization options, visit: + https://getbootstrap.com/docs/5.3/customize/color/ +*/ body { --bs-link-color-rgb: 235, 69, 158 !important; --bs-link-hover-color-rgb: 211, 62, 142 !important; +} + +/* + The z-index for the selectors '@media (min-width: 768px) body>header' and 'body[data-layout=landing]>header' is set to 1030. + To ensure that the '.DocSearch-Container' appears above these elements, its z-index is set to a higher value (1040). + The '!important' rule is used to override any other conflicting declarations. +*/ +.DocSearch-Container { + z-index: 1040 !important; } \ No newline at end of file