tjo.space/docusaurus.config.js

152 lines
4.2 KiB
JavaScript
Raw Normal View History

2023-09-10 16:01:52 +00:00
// @ts-check
// Note: type annotations allow type checking and IDEs autocompletion
2023-09-10 18:24:56 +00:00
const lightCodeTheme = require("prism-react-renderer/themes/github");
const darkCodeTheme = require("prism-react-renderer/themes/dracula");
2023-09-10 16:01:52 +00:00
/** @type {import('@docusaurus/types').Config} */
const config = {
2023-09-10 18:24:56 +00:00
title: "tjo.space",
2023-09-11 22:18:14 +00:00
tagline: "Your personal space.",
2023-09-10 18:24:56 +00:00
favicon: "img/icon.svg",
2023-09-10 16:01:52 +00:00
// Set the production url of your site here
2023-09-10 18:24:56 +00:00
url: "https://tjo.space",
2023-09-10 16:01:52 +00:00
// Set the /<baseUrl>/ pathname under which your site is served
// For GitHub pages deployment, it is often '/<projectName>/'
2023-09-10 18:24:56 +00:00
baseUrl: "/",
2023-09-10 16:01:52 +00:00
// GitHub pages deployment config.
// If you aren't using GitHub pages, you don't need these.
2023-09-10 18:24:56 +00:00
organizationName: "tjo-space", // Usually your GitHub org/user name.
projectName: "tjo.space", // Usually your repo name.
2023-09-10 16:01:52 +00:00
2023-09-10 18:24:56 +00:00
onBrokenLinks: "throw",
onBrokenMarkdownLinks: "warn",
2023-09-10 16:01:52 +00:00
// Even if you don't use internalization, you can use this field to set useful
// metadata like html lang. For example, if your site is Chinese, you may want
// to replace "en" with "zh-Hans".
i18n: {
2023-09-10 18:24:56 +00:00
defaultLocale: "en",
locales: ["en", "sl"],
2023-09-10 16:01:52 +00:00
},
presets: [
[
2023-09-10 18:24:56 +00:00
"classic",
2023-09-10 16:01:52 +00:00
/** @type {import('@docusaurus/preset-classic').Options} */
({
docs: {
2023-09-10 18:24:56 +00:00
sidebarPath: require.resolve("./sidebars.js"),
2023-09-10 16:01:52 +00:00
editUrl:
2023-09-10 18:24:56 +00:00
"https://code.tjo.space/tjo-space/tjo.space/src/branch/main/",
2023-09-10 16:01:52 +00:00
},
blog: {
showReadingTime: true,
editUrl:
2023-09-10 18:24:56 +00:00
"https://code.tjo.space/tjo-space/tjo.space/src/branch/main/",
feedOptions: {
type: "all",
copyright: `Copyright © ${new Date().getFullYear()} tjo.space.`,
createFeedItems: async (params) => {
const { blogPosts, defaultCreateFeedItems, ...rest } = params;
return defaultCreateFeedItems({
// keep only the 10 most recent blog posts in the feed
2023-09-11 22:18:14 +00:00
blogPosts: blogPosts.filter((_item, index) => index < 10),
2023-09-10 18:24:56 +00:00
...rest,
});
},
},
2023-09-10 16:01:52 +00:00
},
theme: {
2023-09-10 18:24:56 +00:00
customCss: require.resolve("./src/css/custom.css"),
2023-09-10 16:01:52 +00:00
},
2023-09-12 13:31:16 +00:00
sitemap: {
changefreq: "weekly",
priority: 0.5,
ignorePatterns: ["/tags/**"],
filename: "sitemap.xml",
},
2023-09-10 16:01:52 +00:00
}),
],
],
2023-09-10 18:24:56 +00:00
themes: [
[
require.resolve("@easyops-cn/docusaurus-search-local"),
{
hashed: true,
indexDocs: true,
indexBlog: true,
indexPages: true,
language: ["en"], // sl is not supported
},
],
],
2023-09-10 16:01:52 +00:00
themeConfig:
/** @type {import('@docusaurus/preset-classic').ThemeConfig} */
({
// Replace with your project's social card
2023-09-11 22:18:14 +00:00
image: "img/icon.svg",
2023-09-10 16:01:52 +00:00
navbar: {
2023-09-10 18:24:56 +00:00
title: "",
2023-09-10 16:01:52 +00:00
logo: {
2023-09-10 18:24:56 +00:00
alt: "tjo.space logo",
2023-09-11 22:18:14 +00:00
src: "img/logo-dark.svg",
srcDark: "img/logo-light.svg",
2023-09-10 16:01:52 +00:00
},
items: [
{
2023-09-10 18:24:56 +00:00
type: "docSidebar",
2023-09-11 22:18:14 +00:00
sidebarId: "documentationSidebar",
2023-09-10 18:24:56 +00:00
position: "left",
2023-09-11 22:18:14 +00:00
label: "Documentation",
2023-09-10 16:01:52 +00:00
},
2023-09-10 18:24:56 +00:00
{ to: "/blog", label: "Blog", position: "left" },
2023-09-12 13:31:16 +00:00
{ type: "custom-status-navbar-item", position: "left" },
2023-09-10 16:01:52 +00:00
{
2023-09-10 18:24:56 +00:00
type: "localeDropdown",
position: "right",
2023-09-10 16:01:52 +00:00
},
],
},
footer: {
2023-09-11 22:18:14 +00:00
style: "light",
logo: { src: "img/logo-dark.svg", srcDark: "img/logo-light.svg" },
2023-09-10 16:01:52 +00:00
links: [
{
2023-09-11 22:18:14 +00:00
title: "Articles",
2023-09-10 16:01:52 +00:00
items: [
{
2023-09-11 22:18:14 +00:00
label: "Documentation",
to: "/docs/home",
},
{
label: "Blog",
to: "/blog",
2023-09-10 16:01:52 +00:00
},
],
},
{
2023-09-10 18:24:56 +00:00
title: "Community",
2023-09-10 16:01:52 +00:00
items: [
{
2023-09-11 22:18:14 +00:00
label: "Matrix Room #hello:tjo.space",
2023-09-10 18:24:56 +00:00
href: "https://matrix.to/#/#hello:tjo.space",
2023-09-10 16:01:52 +00:00
},
],
},
],
2023-09-10 18:24:56 +00:00
copyright: `Copyright © ${new Date().getFullYear()} tjo.space. Built with Docusaurus.`,
2023-09-10 16:01:52 +00:00
},
prism: {
theme: lightCodeTheme,
darkTheme: darkCodeTheme,
},
}),
};
module.exports = config;