mirror of
				https://github.com/flame-engine/flame.git
				synced 2025-10-31 00:48:47 +08:00 
			
		
		
		
	docs: Revert auto expand flame section on documentation home page (#1824)
This commit is contained in:
		| @ -64,7 +64,7 @@ pygments_style = 'monokai' | |||||||
| # relative to this directory. They are copied after the builtin static files, | # relative to this directory. They are copied after the builtin static files, | ||||||
| # so a file named "default.css" will overwrite the builtin "default.css". | # so a file named "default.css" will overwrite the builtin "default.css". | ||||||
| html_static_path = ['images', 'scripts', 'theme'] | html_static_path = ['images', 'scripts', 'theme'] | ||||||
| html_js_files = ['versions.js', 'menu-expand.js'] | html_js_files = ['versions.js'] | ||||||
|  |  | ||||||
| # -- Custom setup ------------------------------------------------------------ | # -- Custom setup ------------------------------------------------------------ | ||||||
| class TitleCollector(docutils.nodes.SparseNodeVisitor): | class TitleCollector(docutils.nodes.SparseNodeVisitor): | ||||||
|  | |||||||
| @ -1,21 +0,0 @@ | |||||||
| // Auto expand the first expandable node ("flame") when loaded. |  | ||||||
| window.addEventListener('load', (_event) => { |  | ||||||
|     expandFirstOnHome(); |  | ||||||
| }); |  | ||||||
|  |  | ||||||
| /** |  | ||||||
|  * This method expands the first expandable node on the home page. |  | ||||||
|  *  |  | ||||||
|  * If the current page is not the home page, this method does nothing. |  | ||||||
|  */ |  | ||||||
| // When the path name ends with index.html or an empty string, it is home page. |  | ||||||
| function expandFirstOnHome() { |  | ||||||
|     const parts = location.pathname.split('/'); |  | ||||||
|     const lastPart = parts[parts.length - 1]; |  | ||||||
|     const isHomePage = (lastPart == '') || (lastPart == 'index.html'); |  | ||||||
|  |  | ||||||
|     if (isHomePage) { |  | ||||||
|         // expand the first expandable node in the toctree |  | ||||||
|         $('li.toctree-l1').has('ul').first().addClass('current'); |  | ||||||
|     } |  | ||||||
| } |  | ||||||
		Reference in New Issue
	
	Block a user
	 Lukas Klingsbo
					Lukas Klingsbo