2022-11-05 15:24:54 +01:00
|
|
|
// @ts-check
|
|
|
|
// Note: type annotations allow type checking and IDEs autocompletion
|
|
|
|
|
2023-11-24 16:00:45 +01:00
|
|
|
const { themes } = require("prism-react-renderer");
|
2024-02-04 13:48:45 +01:00
|
|
|
const lightCodeTheme = themes.oneLight;
|
2023-11-25 21:49:46 +01:00
|
|
|
const darkCodeTheme = themes.dracula;
|
2022-11-05 15:24:54 +01:00
|
|
|
|
|
|
|
const math = require("remark-math");
|
|
|
|
const katex = require("rehype-katex");
|
|
|
|
|
|
|
|
require("dotenv").config();
|
|
|
|
|
2023-11-24 16:00:45 +01:00
|
|
|
class Docs {
|
|
|
|
constructor(path, description) {
|
|
|
|
this.path = path;
|
2022-11-05 23:01:28 +01:00
|
|
|
this.description = description;
|
|
|
|
}
|
|
|
|
|
|
|
|
docs() {
|
|
|
|
return [
|
|
|
|
"@docusaurus/plugin-content-docs",
|
|
|
|
{
|
2023-11-24 16:00:45 +01:00
|
|
|
id: this.path,
|
|
|
|
path: this.path,
|
|
|
|
routeBasePath: this.path,
|
2022-11-05 23:01:28 +01:00
|
|
|
sidebarPath: require.resolve("./sidebars.js"),
|
2023-07-16 01:08:54 +02:00
|
|
|
showLastUpdateTime: true,
|
2023-09-07 20:24:54 +02:00
|
|
|
editUrl: "https://github.com/mfocko/blog/tree/main",
|
2022-11-05 23:01:28 +01:00
|
|
|
remarkPlugins: [math],
|
|
|
|
rehypePlugins: [katex],
|
|
|
|
},
|
|
|
|
];
|
|
|
|
}
|
|
|
|
|
|
|
|
navbar() {
|
|
|
|
return {
|
|
|
|
type: "doc",
|
2023-11-24 16:00:45 +01:00
|
|
|
docId: `${this.path}-intro`,
|
|
|
|
docsPluginId: this.path,
|
|
|
|
label: `${this.description}`,
|
2022-11-05 23:01:28 +01:00
|
|
|
};
|
|
|
|
}
|
2022-12-18 15:36:09 +01:00
|
|
|
|
|
|
|
footer() {
|
|
|
|
return {
|
2023-11-24 16:00:45 +01:00
|
|
|
label: `${this.description}`,
|
|
|
|
to: this.path,
|
2023-07-15 11:50:27 +02:00
|
|
|
};
|
2022-12-18 15:36:09 +01:00
|
|
|
}
|
2022-11-05 22:43:54 +01:00
|
|
|
}
|
|
|
|
|
2022-11-05 23:01:28 +01:00
|
|
|
const subjects = [
|
2023-11-24 16:00:45 +01:00
|
|
|
new Docs("algorithms", "Algorithms"),
|
|
|
|
// new Docs("functional", "Non-imperative programming"),
|
|
|
|
// new Docs("automata", "Formal languages and automata"),
|
|
|
|
// new Docs("foundations", "Foundations of programming"),
|
|
|
|
new Docs("c", "C"),
|
|
|
|
new Docs("cpp", "C++"),
|
2022-11-05 23:01:28 +01:00
|
|
|
];
|
|
|
|
|
2023-11-24 16:08:32 +01:00
|
|
|
const fallbackMapping = [
|
|
|
|
{ new: "algorithms", old: ["ib002"] },
|
|
|
|
{ new: "functional", old: ["ib015"] },
|
|
|
|
{ new: "automata", old: ["ib110"] },
|
|
|
|
{ new: "foundations", old: ["ib111"] },
|
|
|
|
{ new: "c", old: ["pb071"] },
|
|
|
|
{ new: "cpp", old: ["pb161"] },
|
|
|
|
];
|
|
|
|
|
2022-11-05 15:24:54 +01:00
|
|
|
/** @type {import('@docusaurus/types').Config} */
|
|
|
|
const config = {
|
2022-12-25 19:10:03 +01:00
|
|
|
title: "mf",
|
|
|
|
tagline: "blog and additional materials for courses at φ",
|
2023-07-18 23:02:52 +02:00
|
|
|
|
2023-09-07 20:09:24 +02:00
|
|
|
url: "https://blog.mfocko.xyz",
|
|
|
|
baseUrl: "/",
|
2023-09-17 16:16:21 +02:00
|
|
|
|
|
|
|
// GitHub Pages deployment config.
|
|
|
|
organizationName: "mfocko",
|
|
|
|
projectName: "blog",
|
2023-09-07 20:09:24 +02:00
|
|
|
trailingSlash: true,
|
2023-07-18 23:02:52 +02:00
|
|
|
|
|
|
|
onBrokenLinks: "throw",
|
|
|
|
onBrokenMarkdownLinks: "throw",
|
2022-11-05 15:24:54 +01:00
|
|
|
favicon: "img/favicon.ico",
|
|
|
|
|
|
|
|
i18n: {
|
|
|
|
defaultLocale: "en",
|
2022-11-05 23:16:17 +01:00
|
|
|
locales: ["en"],
|
2022-11-05 15:24:54 +01:00
|
|
|
},
|
|
|
|
|
|
|
|
presets: [
|
|
|
|
[
|
|
|
|
"classic",
|
|
|
|
/** @type {import('@docusaurus/preset-classic').Options} */
|
|
|
|
({
|
2022-11-05 22:43:54 +01:00
|
|
|
docs: false,
|
2022-11-05 15:24:54 +01:00
|
|
|
blog: false,
|
|
|
|
theme: {
|
2023-07-17 20:03:12 +02:00
|
|
|
customCss: [
|
2024-06-02 21:22:44 +02:00
|
|
|
require.resolve("./src/css/cascadia_code.css"),
|
2024-02-06 00:12:20 +01:00
|
|
|
require.resolve("./src/css/custom.scss"),
|
2023-07-17 20:03:12 +02:00
|
|
|
],
|
2022-11-05 15:24:54 +01:00
|
|
|
},
|
|
|
|
}),
|
|
|
|
],
|
|
|
|
],
|
|
|
|
|
2022-12-14 21:38:27 +01:00
|
|
|
plugins: [
|
2023-07-15 11:50:27 +02:00
|
|
|
...subjects.map((s) => s.docs()),
|
2022-12-14 21:38:27 +01:00
|
|
|
[
|
2023-07-15 11:50:27 +02:00
|
|
|
"@docusaurus/plugin-content-blog",
|
2022-12-14 21:38:27 +01:00
|
|
|
{
|
2023-07-15 11:50:27 +02:00
|
|
|
id: "blog",
|
|
|
|
routeBasePath: "blog",
|
|
|
|
path: "./blog",
|
2022-12-14 21:38:27 +01:00
|
|
|
feedOptions: {
|
2023-07-15 11:50:27 +02:00
|
|
|
type: "all",
|
2023-07-15 11:50:55 +02:00
|
|
|
description: "mf's blog",
|
2022-12-14 21:38:27 +01:00
|
|
|
},
|
2023-09-07 20:24:54 +02:00
|
|
|
editUrl: "https://github.com/mfocko/blog/tree/main",
|
2022-12-15 01:03:08 +01:00
|
|
|
remarkPlugins: [math],
|
|
|
|
rehypePlugins: [katex],
|
2022-12-14 21:38:27 +01:00
|
|
|
},
|
|
|
|
],
|
2023-07-19 17:03:10 +02:00
|
|
|
"docusaurus-plugin-sass",
|
2023-11-24 16:08:32 +01:00
|
|
|
[
|
|
|
|
"@docusaurus/plugin-client-redirects",
|
|
|
|
{
|
|
|
|
createRedirects(existingPath) {
|
|
|
|
for (let mapping of fallbackMapping) {
|
|
|
|
if (existingPath.includes(`/${mapping.new}/`)) {
|
|
|
|
return mapping.old.map((old) =>
|
2024-01-03 19:38:35 +01:00
|
|
|
existingPath.replace(`/${mapping.new}/`, `/${old}/`),
|
2023-11-24 16:08:32 +01:00
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return undefined; // no redirect created
|
|
|
|
},
|
|
|
|
},
|
|
|
|
],
|
2022-12-14 21:38:27 +01:00
|
|
|
],
|
2022-11-05 15:24:54 +01:00
|
|
|
|
|
|
|
stylesheets: [
|
|
|
|
{
|
|
|
|
href: "https://cdn.jsdelivr.net/npm/katex@0.13.24/dist/katex.min.css",
|
|
|
|
type: "text/css",
|
|
|
|
integrity:
|
|
|
|
"sha384-odtC+0UGzzFL/6PNoE8rX/SPcQDXBJ+uRepguP4QkPCm2LBxH3FA3y+fKSiJ+AmM",
|
|
|
|
crossorigin: "anonymous",
|
|
|
|
},
|
2023-07-17 21:46:03 +02:00
|
|
|
// {
|
|
|
|
// href: "https://cdn.jsdelivr.net/npm/hack-font/build/web/hack.min.css",
|
|
|
|
// type: "text/css",
|
|
|
|
// crossorigin: "anonymous",
|
|
|
|
// },
|
2022-11-05 15:24:54 +01:00
|
|
|
],
|
|
|
|
|
|
|
|
themeConfig:
|
|
|
|
/** @type {import('@docusaurus/preset-classic').ThemeConfig} */
|
|
|
|
({
|
|
|
|
navbar: {
|
2022-12-25 19:10:03 +01:00
|
|
|
title: "mf",
|
2022-11-05 15:24:54 +01:00
|
|
|
items: [
|
2023-07-19 18:36:09 +02:00
|
|
|
{
|
|
|
|
type: "dropdown",
|
|
|
|
label: "Additional FI MU materials",
|
|
|
|
items: subjects.map((s) => s.navbar()),
|
|
|
|
},
|
2023-07-19 17:04:53 +02:00
|
|
|
{
|
|
|
|
to: "contributions",
|
|
|
|
label: "Contributions",
|
|
|
|
},
|
2023-07-19 18:34:44 +02:00
|
|
|
{
|
|
|
|
to: "talks",
|
|
|
|
label: "Talks",
|
|
|
|
},
|
2022-12-14 21:38:27 +01:00
|
|
|
{
|
|
|
|
to: "blog",
|
|
|
|
position: "right",
|
|
|
|
label: "Blog",
|
|
|
|
},
|
2022-11-05 15:24:54 +01:00
|
|
|
],
|
|
|
|
},
|
|
|
|
footer: {
|
|
|
|
style: "dark",
|
|
|
|
copyright: `Copyright © ${new Date().getFullYear()} Matej Focko.`,
|
2022-12-18 15:36:09 +01:00
|
|
|
links: [
|
|
|
|
{
|
2023-07-16 01:09:27 +02:00
|
|
|
title: "Git",
|
|
|
|
items: [
|
|
|
|
{
|
|
|
|
label: "GitHub",
|
|
|
|
href: "https://github.com/mfocko",
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: "GitLab",
|
|
|
|
href: "https://gitlab.com/mfocko",
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: "Gitea (self-hosted)",
|
|
|
|
href: "https://git.mfocko.xyz/mfocko",
|
|
|
|
},
|
|
|
|
],
|
2022-12-18 15:36:09 +01:00
|
|
|
},
|
|
|
|
{
|
|
|
|
title: "Social #1",
|
|
|
|
items: [
|
|
|
|
{
|
|
|
|
label: "LinkedIn",
|
|
|
|
href: "https://www.linkedin.com/in/mfocko/",
|
|
|
|
},
|
|
|
|
{
|
2023-07-16 01:09:27 +02:00
|
|
|
label: "Fosstodon",
|
|
|
|
href: "https://fosstodon.org/@m4tt_314",
|
2022-12-18 15:36:09 +01:00
|
|
|
},
|
|
|
|
{
|
2023-07-16 01:09:27 +02:00
|
|
|
label: "Hachyderm.io",
|
|
|
|
href: "https://hachyderm.io/@m4tt_314",
|
2022-12-18 15:36:09 +01:00
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
{
|
|
|
|
title: "Social #2",
|
|
|
|
items: [
|
|
|
|
{
|
|
|
|
label: "Twitter",
|
|
|
|
href: "https://twitter.com/m4tt_314",
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: "Twitch",
|
|
|
|
href: "https://twitch.tv/m4tt_314",
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: "Ko-fi",
|
|
|
|
href: "https://ko-fi.com/m4tt_314",
|
2023-07-15 11:50:27 +02:00
|
|
|
},
|
|
|
|
],
|
2022-12-18 15:36:09 +01:00
|
|
|
},
|
|
|
|
],
|
2022-11-05 15:24:54 +01:00
|
|
|
},
|
|
|
|
prism: {
|
|
|
|
theme: lightCodeTheme,
|
|
|
|
darkTheme: darkCodeTheme,
|
|
|
|
additionalLanguages: [
|
2022-12-11 21:31:19 +01:00
|
|
|
"ada",
|
2022-12-14 21:35:59 +01:00
|
|
|
"bash",
|
2022-11-05 15:24:54 +01:00
|
|
|
"csharp",
|
|
|
|
"dot",
|
|
|
|
"haskell",
|
2022-12-11 21:31:19 +01:00
|
|
|
"java",
|
|
|
|
"nix",
|
|
|
|
"pascal",
|
2023-11-11 01:22:51 +01:00
|
|
|
"python",
|
2022-12-11 21:31:19 +01:00
|
|
|
"ruby",
|
2022-11-05 15:24:54 +01:00
|
|
|
"rust",
|
|
|
|
],
|
|
|
|
},
|
2022-11-05 23:14:07 +01:00
|
|
|
docs: {
|
|
|
|
sidebar: {
|
|
|
|
hideable: true,
|
2023-07-15 11:50:27 +02:00
|
|
|
},
|
2023-02-04 17:52:16 +01:00
|
|
|
},
|
|
|
|
mermaid: {
|
|
|
|
options: {
|
2023-07-15 11:50:27 +02:00
|
|
|
fontFamily:
|
2024-06-02 21:22:44 +02:00
|
|
|
"'Cascadia Code PL', 'JetBrains Mono', 'Iosevka', 'Fira Code', 'Hack', monospace",
|
2023-02-04 17:52:16 +01:00
|
|
|
},
|
|
|
|
},
|
2023-07-18 17:31:56 +02:00
|
|
|
algolia: {
|
|
|
|
// The application ID provided by Algolia
|
|
|
|
appId: "0VXRFPR4QF",
|
|
|
|
// Public API key: it is safe to commit it
|
|
|
|
apiKey: "9d4d452117cfaaae3e51b9568e22aa16",
|
|
|
|
indexName: "mfocko",
|
|
|
|
},
|
2022-11-05 15:24:54 +01:00
|
|
|
}),
|
2023-02-04 17:52:16 +01:00
|
|
|
|
|
|
|
markdown: {
|
|
|
|
mermaid: true,
|
|
|
|
},
|
2023-07-15 11:50:27 +02:00
|
|
|
themes: ["@docusaurus/theme-mermaid"],
|
2022-11-05 15:24:54 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
module.exports = config;
|