Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update docusaurus.config.js #276

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
161 changes: 11 additions & 150 deletions docusaurus.config.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
// @ts-check
// Note: type annotations allow type checking and IDEs autocompletion
require("dotenv").config();
import { config as dotenvConfig } from "dotenv";
dotenvConfig();

const { themes } = require("prism-react-renderer");
import { themes } from "prism-react-renderer";
const lightCodeTheme = themes.github;
const darkCodeTheme = themes.dracula;
const math = require("remark-math");
const katex = require("rehype-katex");
import math from "remark-math";
import katex from "rehype-katex";

/** @type {import('@docusaurus/types').Config} */
const config = {
Expand All @@ -24,11 +25,11 @@ const config = {
organizationName: "layr-labs", // Usually your GitHub org/user name.
projectName: "docusaurus", // Usually your repo name.

onBrokenLinks: "throw",
onBrokenMarkdownLinks: "throw",
onBrokenLinks: "warn",
onBrokenMarkdownLinks: "warn",

markdown: {
mermaid: true
mermaid: true,
},

// Even if you don't use internalization, you can use this field to set useful
Expand Down Expand Up @@ -56,11 +57,6 @@ const config = {
from: "/overview/terms-of-service",
to: "/eigenlayer/legal/terms-of-service",
},
// This is implicit, covered by the function case below
// {
// from: "/overview/",
// to: "/eigenlayer/overview/",
// },
{
from: "/overview/intro/",
to: "/eigenlayer/overview/",
Expand All @@ -73,10 +69,6 @@ const config = {
from: "/eigenda-guides/eigenda-rollup-user-guides/",
to: "/eigenda/integrations-guides/rollup-guides/",
},
{
from: "/eigenda-guides/eigenda-rollup-user-guides/building-on-top-of-eigenda",
to: "/eigenda/integrations-guides/rollup-guides/",
},
{
from: "/eigenda/rollup-guides/tutorial",
to: "/eigenda/integrations-guides/rollup-guides/",
Expand Down Expand Up @@ -187,7 +179,6 @@ const config = {
},
],
createRedirects(existingPath) {

// eigenlayer redirects
if (existingPath.includes('/eigenlayer')) {
return [
Expand All @@ -203,10 +194,10 @@ const config = {

stylesheets: [
{
href: "https://cdn.jsdelivr.net/npm/katex@0.13.24/dist/katex.min.css",
href: "https://cdn.jsdelivr.net/npm/katex@0.15.3/dist/katex.min.css",
type: "text/css",
integrity:
"sha384-odtC+0UGzzFL/6PNoE8rX/SPcQDXBJ+uRepguP4QkPCm2LBxH3FA3y+fKSiJ+AmM",
"sha384-A6M2d8kxCUZh9Q52KpBcIVtWAE5wTS9ITC9SWI4FZB70xif52XLThf+PI5tHx/S3",
crossorigin: "anonymous",
},
],
Expand All @@ -222,150 +213,20 @@ const config = {
sidebarPath: require.resolve("./sidebars.js"),
remarkPlugins: [math],
rehypePlugins: [katex],
showLastUpdateTime: false
showLastUpdateTime: false,
},
blog: {
blogTitle: "EigenLayer Status",
postsPerPage: "ALL",
routeBasePath: "/status",
},

theme: {
customCss: require.resolve("./src/css/custom.css"),
},

gtag: {
trackingID: 'G-GN5RBJ9VRL',
anonymizeIP: true,
},
}),
],
],

themeConfig:
/** @type {import('@docusaurus/preset-classic').ThemeConfig} */
({
image: 'img/eigenlayer-logo.png',

navbar: {
title: "EigenLayer Docs",
logo: {
alt: "EigenLayer Logo",
src: "img/eigenlayer-logo.png",
},
items: [
{
to: "eigenlayer/overview",
label: "EigenLayer",
position: "left",
activeBasePath: 'eigenlayer/',
},
{
to: "eigenda/overview",
label: "EigenDA",
position: "left",
activeBasePath: 'eigenda/',
},
{
to: "status",
label: "Status",
position: "left",
},
{
href: "https://github.com/Layr-Labs",
className: "header--github-link",
"aria-label": "GitHub repository",
position: "right",
},
],
},
footer: {
style: "dark",
links: [
{
title: "EigenLayer",
items: [
{
label: "About",
href: "https://www.eigenlayer.xyz/",
},
{
label: "Privacy Policy",
href: "https://docs.eigenlayer.xyz/eigenlayer/legal/eigenlayer-privacy-policy",
},
{
label: "Terms of Service",
href: "https://docs.eigenlayer.xyz/eigenlayer/legal/terms-of-service",
},
],
},
{
title: "Community",
items: [
{
label: "Discord",
href: "https://discord.com/invite/eigenlayer",
},
{
label: "Twitter",
href: "https://twitter.com/eigenlayer",
},
],
},
{
title: "More",
items: [
{
label: "GitHub",
href: "https://github.com/Layr-Labs",
},
{
label: "Discourse",
href: "http://forum.eigenlayer.xyz/",
},
{
label: "Youtube",
href: "https://www.youtube.com/@EigenLayer",
},
],
},
],
copyright: `Copyright © ${new Date().getFullYear()} Layr Labs`,
},
docs: {
sidebar: {
hideable: true,
},
},
prism: {
theme: lightCodeTheme,
darkTheme: darkCodeTheme,
additionalLanguages: ["bash"],
},
}),
scripts: [
// Object format.
{
src: '/js/intercom.js',
async: true,
},
],
themes: [
[
// @ts-ignore
require.resolve("@easyops-cn/docusaurus-search-local"),
/** @type {import("@easyops-cn/docusaurus-search-local").PluginOptions} */
// @ts-ignore
({
// `hashed` is recommended as long-term-cache of index file is possible
language: ["en"],
indexDocs: true,
indexBlog: false,
docsRouteBasePath: "/",
}),
],
'@docusaurus/theme-mermaid'
],
};

module.exports = config;