docs: make script non blocking and tweaked some link
MODIFY
website/src/_includes/layouts/base.njk
website/src/_includes/layouts/base.njk
</footer>
<script defer async src="{{ '/js/index.js' | url }}"></script>
- <script type="text/javascript" src="https://cdn.jsdelivr.net/npm/docsearch.js@2/dist/cdn/docsearch.min.js"></script>
- <script type="text/javascript">
- docsearch({
- apiKey: '66db1ad366d458c6acded7cbc23dba7e',
- indexName: 'romefrontend',
- inputSelector: '#docsearch',
- debug: false // Set debug to true if you want to inspect the dropdown
- });
- </script>
</body>
</html>

MODIFY
website/src/index.md
website/src/index.md
@@ -6,13 +6,13 @@ layout: layouts/homepage.njk
# The Rome Frontend Toolchain
-->
-**Rome** is a linter, compiler, bundler, and [more](https://romefrontend.dev/#development-status) for JavaScript, TypeScript, HTML, Markdown, and CSS. Read more about our language support [here](https://romefrontend.dev/docs/language-support).
+**Rome** is a linter, compiler, bundler, and [more](https://romefrontend.dev/#development-status) for JavaScript, TypeScript, HTML, Markdown, and CSS. Read more about our [language support](https://romefrontend.dev/docs/language-support).
**Rome** unifies functionality that has previously been completely separate tools. Most frontend tooling have a significant overlap in responsibilities and implementation. There is value in these being a single tool. Building upon a shared base allows us to provide a cohesive experience for processing code, displaying errors, parallelizing work, caching, and configuration.
**Rome** has been built from scratch without the usage of existing libraries. **Rome** contains no third-party library dependencies.
-**Rome** has strong conventions and aims to have minimal configuration. Read more about our project philosophy [here](https://romefrontend.dev/about#philosophy).
+**Rome** has strong conventions and aims to have minimal configuration. Read more about our [project philosophy](https://romefrontend.dev/about#philosophy).
**Rome** is maintained by a [team of volunteers](https://romefrontend.dev/contributing/team). **Rome** was started by [Sebastian McKenzie](https://twitter.com/sebmck), the author of [Babel](https://babeljs.io) and [Yarn](https://yarnpkg.com).

MODIFY
website/static/js/index.js
website/static/js/index.js
@@ -185,6 +185,22 @@ window.onload = function() {
scrollToHeading(window.location.hash);
}
toc.highlight();
+ const script = document.createElement("script");
+ script.src = "https://cdn.jsdelivr.net/npm/docsearch.js@2/dist/cdn/docsearch.min.js";
+ script.async = true;
+ script.defer = true;
+ script.addEventListener(
+ "load",
+ () => {
+ window.docsearch({
+ apiKey: "66db1ad366d458c6acded7cbc23dba7e",
+ indexName: "romefrontend",
+ inputSelector: "#docsearch",
+ debug: false, // Set debug to true if you want to inspect the dropdown
+ });
+ },
+ );
+ document.body.appendChild(script);
};
document.addEventListener(

docs: make script non blocking and tweaked some link (#864)