Skip to content

Commit

Permalink
✨ Allowed customGraph to be passed in
Browse files Browse the repository at this point in the history
  • Loading branch information
chanjunren committed Jan 25, 2025
1 parent 03ef8a1 commit f5ccaff
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 6 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "vaultusaurus",
"version": "1.0.13",
"version": "1.0.14",
"description": "Utilities for publishing Obsidian markdown documents to Docusaurus",
"keywords": [
"mdast",
Expand Down
1 change: 0 additions & 1 deletion src/plugin/css/index.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
background: var(--graph-bg);
aspect-ratio: 1 / 1;
border-radius: 8px;
margin-right: 0.5rem;
}

.graphComponent {
Expand Down
9 changes: 7 additions & 2 deletions src/plugin/theme/LocalGraph/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,16 @@ import {
} from "@vaultusaurus/plugin/utils";
import { ReactElement, useRef } from "react";

export default function LocalGraph(): ReactElement {
interface ILocalGraph {
customGraph?: GraphInfo;
}

export default function LocalGraph({ customGraph }): ReactElement<ILocalGraph> {
const globalData = usePluginData(
"docusaurus-plugin-vaultusaurus"
) as VaultusaurusGlobalData;
const graphInfo: GraphInfo = globalData.graphInfo[window.location.pathname];
const graphInfo: GraphInfo =
globalData.graphInfo[window.location.pathname] || customGraph;

if (!graphInfo) {
return null;
Expand Down

0 comments on commit f5ccaff

Please sign in to comment.