Website: Move docsearch public api key to config variable (#7771)
* move docsearch api key to a config variable, update styles to disable outline on input * Update basic-handbook.less * Update basic-handbook.less * update config variable name & update comment
This commit is contained in:
@@ -75,7 +75,8 @@ module.exports = {
|
||||
thisPage.meta.description ? thisPage.meta.description // « custom meta description for this page, if provided in markdown
|
||||
: 'Documentation for Fleet for osquery.'// « otherwise use the generic description
|
||||
),
|
||||
showSwagForm
|
||||
showSwagForm,
|
||||
algoliaPublicKey: sails.config.custom.algoliaPublicKey,
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -69,6 +69,7 @@ module.exports = {
|
||||
thisPage.meta.description ? thisPage.meta.description // « custom meta description for this page, if provided in markdown
|
||||
: 'View the Fleet handbook.'// « otherwise use a generic description
|
||||
),
|
||||
algoliaPublicKey: sails.config.custom.algoliaPublicKey,
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
+12
-10
@@ -82,16 +82,18 @@ parasails.registerPage('basic-documentation', {
|
||||
|
||||
mounted: async function() {
|
||||
// Algolia DocSearch
|
||||
docsearch({
|
||||
appId: 'NZXAYZXDGH',
|
||||
apiKey: 'f3c02b646222734376a5e94408d6fead',
|
||||
indexName: 'fleetdm',
|
||||
inputSelector: (this.isDocsLandingPage ? '#docsearch-query-landing' : '#docsearch-query'),
|
||||
debug: false,
|
||||
algoliaOptions: {
|
||||
'facetFilters': ['section:docs']
|
||||
},
|
||||
});
|
||||
if(this.algoliaPublicKey) { // Note: Docsearch will only be enabled if sails.config.custom.algoliaPublicKey is set. If the value is undefined, the documentation search will be disabled.
|
||||
docsearch({
|
||||
appId: 'NZXAYZXDGH',
|
||||
apiKey: this.algoliaPublicKey,
|
||||
indexName: 'fleetdm',
|
||||
inputSelector: (this.isDocsLandingPage ? '#docsearch-query-landing' : '#docsearch-query'),
|
||||
debug: false,
|
||||
algoliaOptions: {
|
||||
'facetFilters': ['section:docs']
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
// Handle hashes in urls when coming from an external page.
|
||||
if(window.location.hash){
|
||||
|
||||
+13
-11
@@ -25,17 +25,19 @@ parasails.registerPage('basic-handbook', {
|
||||
mounted: async function() {
|
||||
|
||||
// Algolia DocSearch
|
||||
docsearch({
|
||||
appId: 'NZXAYZXDGH',
|
||||
apiKey: 'f3c02b646222734376a5e94408d6fead',
|
||||
indexName: 'fleetdm',
|
||||
inputSelector: '#docsearch-query',
|
||||
debug: false,
|
||||
clickAnalytics: true,
|
||||
algoliaOptions: {
|
||||
facetFilters: ['section:handbook']
|
||||
},
|
||||
});
|
||||
if(this.algoliaPublicKey) {// Note: Docsearch will only be enabled if sails.config.custom.algoliaPublicKey is set. If the value is undefined, the handbook search will be disabled.
|
||||
docsearch({
|
||||
appId: 'NZXAYZXDGH',
|
||||
apiKey: this.algoliaPublicKey,
|
||||
indexName: 'fleetdm',
|
||||
inputSelector: '#docsearch-query',
|
||||
debug: false,
|
||||
clickAnalytics: true,
|
||||
algoliaOptions: {
|
||||
facetFilters: ['section:handbook']
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
// Handle hashes in urls when coming from an external page.
|
||||
if(window.location.hash){
|
||||
|
||||
@@ -97,6 +97,9 @@
|
||||
height: 100%;
|
||||
width: 98%;
|
||||
}
|
||||
.docsearch-input:focus-visible {
|
||||
outline: none;
|
||||
}
|
||||
|
||||
.ds-input:focus {
|
||||
outline: rgba(0, 0, 0, 0);
|
||||
|
||||
@@ -35,6 +35,9 @@
|
||||
height: 100%;
|
||||
width: 98%;
|
||||
}
|
||||
.docsearch-input:focus-visible {
|
||||
outline: none;
|
||||
}
|
||||
.ds-input:focus {
|
||||
outline: rgba(0, 0, 0, 0);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user