File tree Expand file tree Collapse file tree 2 files changed +12
-3
lines changed
adi_doctools/theme/cosmic/scripts Expand file tree Collapse file tree 2 files changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -139,6 +139,12 @@ export class HotReload {
139139 }
140140 })
141141 }
142+ init_others () {
143+ let logo = DOM.get('.sphinxsidebarwrapper > a')
144+ logo.href = logo.href.replace(/#$/, '')
145+ logo = DOM.get('header a#logo')
146+ logo.href = logo.href.replace(/#$/, '')
147+ }
142148 popstate (ev) {
143149 let url = new URL(location.href)
144150 url.hash = ''
@@ -151,7 +157,8 @@ export class HotReload {
151157 init () {
152158 this.location_href = location.href
153159
154- this.init_toctree ()
160+ this.init_toctree()
161+ this.init_others()
155162 this.hot_links()
156163 window.addEventListener('popstate', (ev) => {
157164 this.popstate(ev)
Original file line number Diff line number Diff line change @@ -55,13 +55,15 @@ export class Links {
5555 let home = "index.html"
5656 this.$.linksOverlay = []
5757 this.$.linksSidebar = []
58+ let self_link = this.parent.state.offline ?
59+ this.parent.state.content_root :
60+ new URL(this.parent.state.content_root, location.href)
5861 for (const [key, value] of Object.entries(obj)) {
5962 if (!('name' in value))
6063 continue
6164
6265 let base = key == this.parent.state.repository ?
63- this.parent.state.content_root :
64- `${prefix}${key}/`
66+ self_link : `${prefix}${key}/`
6567 this.$.linksSidebar.push(new DOM('a', {
6668 'href': `${base}${home}`,
6769 'className': this.parent.state.repository === key ? 'current' : '',
You can’t perform that action at this time.
0 commit comments