Rename post to utils
This commit is contained in:
parent
005993da21
commit
bae2cc6be7
@ -1,9 +1,9 @@
|
||||
import path from 'path'
|
||||
|
||||
const dirTree = require("directory-tree");
|
||||
import {Node} from "./node"
|
||||
import {Transformer} from "./transformer";
|
||||
|
||||
const dirTree = require("directory-tree");
|
||||
|
||||
function pathSelector(filename, allFilePaths){
|
||||
if (filename.replace(".md", "") === "index"){
|
||||
return "/index.md"
|
||||
@ -11,8 +11,7 @@ function pathSelector(filename, allFilePaths){
|
||||
else if (filename.replace(".md", "") === "sidebar"){
|
||||
return "/sidebar.md"
|
||||
}
|
||||
const editedFilePaths = allFilePaths.filter(f => !(f.endsWith("index.md") && f.endsWith("sidebar.md") ))
|
||||
return editedFilePaths
|
||||
return allFilePaths.filter(f => !(f.endsWith("index.md") && f.endsWith("sidebar.md")))
|
||||
}
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
import Layout, {siteTitle} from "../components/layout";
|
||||
import {getSinglePost, getGraphData, getDirectoryData, convertObject, getFlattenArray} from "../lib/post";
|
||||
import {getSinglePost, getGraphData, getDirectoryData, convertObject, getFlattenArray} from "../lib/utils";
|
||||
import FolderTree from "../components/FolderTree";
|
||||
|
||||
export default function Home({content, graphdata, filenames, tree,flattenNodes, ...props}) {
|
||||
|
@ -3,7 +3,7 @@ import Link from 'next/link'
|
||||
import { useRouter } from 'next/router'
|
||||
import { useEffect,useRef } from "react";
|
||||
import Layout, { siteTitle } from "../../components/layout";
|
||||
import { getPostListData, getSinglePost, getGraphData} from "../../lib/post";
|
||||
import { getPostListData, getSinglePost, getGraphData} from "../../lib/utils";
|
||||
import { Network } from "../../components/graph";
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user