Skip to content

Commit c844af0

Browse files
committed
restructure backups sidebar
1 parent 780d3d2 commit c844af0

File tree

2 files changed

+15
-2
lines changed

2 files changed

+15
-2
lines changed

sidebars.js

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1343,7 +1343,18 @@ const sidebars = {
13431343
"operations/startup-scripts",
13441344
"operations/storing-data",
13451345
"operations/allocation-profiling",
1346-
"operations/backup",
1346+
{
1347+
type: "category",
1348+
label: "Backup/Restore",
1349+
collapsed: true,
1350+
collapsible: true,
1351+
items: [
1352+
{
1353+
type: "autogenerated",
1354+
dirName: "operations/backup_restore",
1355+
}
1356+
]
1357+
},
13471358
"operations/caches",
13481359
"operations/workload-scheduling",
13491360
"operations/update",

src/theme/CodeBlock/index.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ import CodeViewer from "../../components/CodeViewer";
44

55

66
function countLines(text) {
7+
// Handle undefined or null input
8+
if (!text) return 1; // Return 1 as default line count
79
// Split the string by newline characters
810
const lines = text.split('\n');
911
// Return the number of lines
@@ -36,7 +38,7 @@ function parseMetaString(meta = '') {
3638
export default function CodeBlockWrapper(props) {
3739
const lineHeight = 18.85;
3840
const [isLoaded, setIsLoaded] = useState(false);
39-
const [estimatedHeight, setEstimatedHeight] = useState(countLines(props.children)*lineHeight);
41+
const [estimatedHeight, setEstimatedHeight] = useState(countLines(props.children || '') * lineHeight);
4042
const codeBlockRef = useRef(null);
4143

4244
const handleIntersection = useCallback((entries) => {

0 commit comments

Comments
 (0)