diff --git a/README.md b/README.md index e499457..7066ae1 100644 --- a/README.md +++ b/README.md @@ -203,10 +203,10 @@ For improved SEO and social sharing, you can use a Cloudflare Worker to dynamica ### index.json - ```json { "defaultPage": "home", + "showDocsLink": true, "metadata": { "title": "Site Title", "description": "Site description", @@ -226,6 +226,8 @@ For improved SEO and social sharing, you can use a Cloudflare Worker to dynamica } ``` +The `showDocsLink` option controls whether a "Docs" link is shown in the UI navigation. Set to `false` to hide it. + The build process generates the documents part for `index.json` ## Contributing diff --git a/js/DOMService.js b/js/DOMService.js index 99fc1a6..88d68d0 100644 --- a/js/DOMService.js +++ b/js/DOMService.js @@ -1,3 +1,13 @@ + /** + * Shows or hides the Docs link in the sidebar based on config. + * @param {boolean} show - Whether to show the Docs link. + */ + setShowDocsLink(show) { + const docsLink = document.querySelector('.github-link'); + if (docsLink) { + docsLink.style.display = show ? '' : 'none'; + } + } /** * Service responsible for DOM manipulation and UI rendering. * @class DOMService diff --git a/js/Documentation.js b/js/Documentation.js index 9d6b4f8..b7f32b5 100644 --- a/js/Documentation.js +++ b/js/Documentation.js @@ -172,6 +172,9 @@ class Documentation { this.loadCustomCSS(data.customCSS); } + // Show/hide Docs link in sidebar + this.domService.setShowDocsLink(data.showDocsLink !== false); + this.searchService.buildSearchIndex(this.indexData.documents); this.domService.setupSearch(this.searchService);