Add homeage and local sites to this project. This will require a rename at some point.

This commit is contained in:
Alexis Werefox 2021-10-17 20:50:27 +00:00
parent 1588c25ab9
commit 6db150076e
7 changed files with 198 additions and 0 deletions

View File

@ -0,0 +1,4 @@
--- # Introduction YAML
intro: |
Here's a simple little homepage for all the subdomains we host. 💙

View File

@ -0,0 +1,11 @@
--- # Other Useful Sites YAML
Servers:
url: "https://info.werefox.dev/servers"
images:
- { src: "/emoji/computer.svg", alt: "Computer emoji" }
"Support Us?":
url: "https://info.werefox.dev/support"
images:
- { src: "/emoji/green_money.svg", alt: "Green money emoji" }

View File

@ -0,0 +1,41 @@
--- # Subdomains YAML
Nextcloud:
url: "https://cloud.werefox.dev"
images:
- { src: "/emoji/nextcloud_logo.png", alt: "Nextcloud logo" }
"Element":
url: "https://elem.werefox.dev/"
images:
- { src: "/emoji/element_logo.svg", alt: "Element logo" }
Gitea:
url: "https://gitea.werefox.dev"
images:
- { src: "/emoji/gitea_logo.svg", alt: "Gitea logo" }
"Info Site":
url: "https://info.werefox.dev"
images:
- { src: "/images/werefox_logo.svg", alt: "Werefox logo" }
Mastodon:
url: "https://masto.werefox.dev"
images:
- { src: "/emoji/mastodon-logo.png", alt: "Mastodon logo" }
Pinafore:
url: "https://pina.werefox.dev"
images:
- { src: "/emoji/pinafore_logo.svg", alt: "Pinafore logo" }
Brutaldon:
url: "https://brutal.werefox.dev"
images:
- { src: "/emoji/brutaldon_logo.png", alt: "Brutaldon logo" }
PeerTube:
url: "https://vid.werefox.dev"
images:
- { src: "/emoji/peertube_logo.svg", alt: "PeerTube logo" }

View File

@ -0,0 +1,4 @@
--- # Introduction YAML
intro: |
Here's a simple little site with links to all the services on the local network. 💙

View File

@ -0,0 +1,43 @@
--- # Subdomains YAML
# lrwxrwxrwx 35 shadow8t4 17 Oct 02:24 aux.werefox.conf -> ../local-available/aux.werefox.conf
# lrwxrwxrwx 37 shadow8t4 17 Oct 02:24 gitea.werefox.conf -> ../local-available/gitea.werefox.conf
# lrwxrwxrwx 36 shadow8t4 17 Oct 02:24 home.werefox.conf -> ../local-available/home.werefox.conf
# lrwxrwxrwx 38 shadow8t4 17 Oct 17:46 kanban.werefox.conf -> ../local-available/kanban.werefox.conf
# lrwxrwxrwx 34 shadow8t4 17 Oct 03:22 pi.werefox.conf -> ../local-available/pi.werefox.conf
# lrwxrwxrwx 37 shadow8t4 17 Oct 02:24 tasmo.werefox.conf -> ../local-available/tasmo.werefox.conf
# lrwxrwxrwx 36 shadow8t4 17 Oct 02:24 wiki.werefox.conf -> ../local-available/wiki.werefox.conf
Airsonic:
url: "https://aux.werefox"
images:
- { src: "/emoji/navidrome_logo.png", alt: "Navidrome logo" }
"(Werefox) Gitea":
url: "https://gitea.werefox"
images:
- { src: "/emoji/gitea_logo.svg", alt: "Gitea logo" }
# "Home Assistant":
# url: "https://home.werefox"
# images:
# - { src: "/emoji/home_assistant_logo.svg", alt: "Home Assistant logo" }
Kanboard:
url: "https://kanban.werefox"
images:
- { src: "/emoji/kanboard_logo.svg", alt: "Kanboard logo" }
Pi-Hole:
url: "https://pi.werefox"
images:
- { src: "/emoji/pi_hole_logo.svg", alt: "Pi-Hole logo" }
# TasmoAdmin:
# url: "https://tasmo.werefox"
# images:
# - { src: "/emoji/tasmoadmin_logo.svg", alt: "TasmoAdmin logo" }
Wiki.JS:
url: "https://wiki.werefox"
images:
- { src: "/emoji/wikijs_logo.svg", alt: "Wiki.JS logo" }

View File

@ -0,0 +1,51 @@
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 = {};
let OTHER = {};
try {
let fileContent = fs.readFileSync("./data/homepage/introduction.yml", "utf8");
INTRODUCTION = yaml.load(fileContent);
fileContent = fs.readFileSync("./data/homepage/subdomains.yml", "utf8");
SUBDOMAINS = yaml.load(fileContent);
fileContent = fs.readFileSync("./data/homepage/other.yml", "utf8");
OTHER = yaml.load(fileContent);
} catch (e) {
console.log(e);
}
return {
props: {
INTRODUCTION,
SUBDOMAINS,
OTHER,
},
};
}
export default function Home({ INTRODUCTION, SUBDOMAINS, OTHER }) {
let introarray = INTRODUCTION["intro"].split("\n");
introarray = introarray.slice(0, introarray.length - 1);
const introdict = Object.assign({}, introarray);
return (
<HomePage page_title="Werefox Homepage" card_title="Werefox Homepage">
<WCard title="Welcome to werefox.dev">
<ICard introduction={introdict} />
</WCard>
<WCard title="Subdomains">
<PBlock pages={SUBDOMAINS} />
</WCard>
<WCard title="Other Useful Sites">
<PBlock pages={OTHER} />
</WCard>
</HomePage>
);
}

View File

@ -0,0 +1,44 @@
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 }) {
let introarray = INTRODUCTION["intro"].split("\n");
introarray = introarray.slice(0, introarray.length - 1);
const introdict = Object.assign({}, introarray);
return (
<HomePage page_title="Local Network Subdomains" card_title="Local Network Subdomains">
<WCard title="Welcome to local.werefox">
<ICard introduction={introdict} />
</WCard>
<WCard title="Subdomains">
<PBlock pages={SUBDOMAINS} />
</WCard>
</HomePage>
);
}