✏️ 正在编辑: scripts.js
路径:
/opt/alt/alt-nodejs12/root/usr/lib/node_modules/npm/docs/src/components/scripts.js
提示:
您可以编辑任何文件(包括二进制文件),但请注意不当修改可能导致文件损坏。
import React from 'react' const IS_STATIC = process.env.GATSBY_IS_STATIC const Scripts = () => { // Workaround: Make links work on the static html site if (IS_STATIC) { return ( <script dangerouslySetInnerHTML={{ __html: ` var anchors = document.querySelectorAll(".sidebar a, .documentation a") Array.prototype.slice.call(anchors).map(function(el) { if (el.href.match(/file:\\/\\//)) { el.href = el.href + "/index.html" } }) ` }} /> ) } return null } export default Scripts
💾 保存文件
← 返回文件管理器