2021-10-17 15:50:27 -05:00
|
|
|
import HomePage from "../../components/home-page";
|
|
|
|
import ICard from "../../components/introduction-card";
|
|
|
|
import WCard from "../../components/werefox-card";
|
|
|
|
import PBlock from "../../components/page-block";
|
|
|
|
|
|
|
|
// Grab data from a static YAML file
|
|
|
|
export async function getStaticProps() {
|
|
|
|
const fs = require("fs");
|
|
|
|
const yaml = require("js-yaml");
|
|
|
|
let INTRODUCTION = {};
|
|
|
|
let SUBDOMAINS = {};
|
|
|
|
|
|
|
|
try {
|
|
|
|
let fileContent = fs.readFileSync("./data/local/introduction.yml", "utf8");
|
|
|
|
INTRODUCTION = yaml.load(fileContent);
|
|
|
|
fileContent = fs.readFileSync("./data/local/subdomains.yml", "utf8");
|
|
|
|
SUBDOMAINS = yaml.load(fileContent);
|
|
|
|
} catch (e) {
|
|
|
|
console.log(e);
|
|
|
|
}
|
|
|
|
return {
|
|
|
|
props: {
|
|
|
|
INTRODUCTION,
|
|
|
|
SUBDOMAINS,
|
|
|
|
},
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
export default function Home({ INTRODUCTION, SUBDOMAINS }) {
|
2022-01-19 21:56:01 -06:00
|
|
|
// let introarray = INTRODUCTION["intro"].split("\n");
|
|
|
|
// introarray = introarray.slice(0, introarray.length - 1);
|
|
|
|
// const introdict = Object.assign({}, introarray);
|
2021-10-17 15:50:27 -05:00
|
|
|
|
|
|
|
return (
|
2022-09-25 13:52:56 -05:00
|
|
|
<HomePage
|
2022-09-26 13:38:11 -05:00
|
|
|
theme="Skye"
|
2022-09-25 13:52:56 -05:00
|
|
|
page_title="Local Network Subdomains"
|
|
|
|
card_title="Local Network Subdomains"
|
|
|
|
>
|
2022-09-26 13:38:11 -05:00
|
|
|
<WCard theme="Skye" title="Welcome to local.werefox">
|
2022-09-25 13:52:56 -05:00
|
|
|
<ICard
|
2022-09-26 13:38:11 -05:00
|
|
|
theme="Skye"
|
2022-09-25 13:52:56 -05:00
|
|
|
introduction={INTRODUCTION.intro}
|
|
|
|
emoji_paths={{}}
|
|
|
|
/>
|
2021-10-17 15:50:27 -05:00
|
|
|
</WCard>
|
2022-09-26 13:38:11 -05:00
|
|
|
<WCard theme="Skye" title="Subdomains">
|
|
|
|
<PBlock theme="Skye" pages={SUBDOMAINS} />
|
2021-10-17 15:50:27 -05:00
|
|
|
</WCard>
|
|
|
|
</HomePage>
|
|
|
|
);
|
|
|
|
}
|