-
Notifications
You must be signed in to change notification settings - Fork 331
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
_content/blog: don't load godocs.js (and other scripts) more than once
By now, the /js/godocs.js and /js/playground.js scripts are already loaded on all go.dev pages because they're included at the bottom of the root site.tmpl template. The layout template for blog pages also loads those scripts. That means /js/godocs.js runs twice, and that causes duplicate anchor links to be added to article headings. Remove the duplicate scripts, keeping only play.js which isn't already present in site.html. Update it to reuse the existing window.initFuncs mechanism. For golang/go#68596. For golang/go#69816. Change-Id: I709f4b8df30500bddbbf16f4ddd95f266f290472 Reviewed-on: https://go-review.googlesource.com/c/website/+/619015 Reviewed-by: Hyang-Ah Hana Kim <[email protected]> Reviewed-by: Dmitri Shuralyov <[email protected]> Auto-Submit: Dmitri Shuralyov <[email protected]> LUCI-TryBot-Result: Go LUCI <[email protected]>
- Loading branch information
Showing
4 changed files
with
7 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -141,4 +141,4 @@ function initPlayground(transport) { | |
} | ||
} | ||
|
||
$(function() { playStart() }); | ||
window.initFuncs.push(playStart); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters