diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 86e430b..51a3137 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -20,6 +20,9 @@ jobs: node-version: 18 cache: npm + - name: test thing + run: node gen-webring-routes.js + - name: Install dependencies run: npm ci - name: Build website diff --git a/docusaurus.config.ts b/docusaurus.config.ts index ef64ed8..82c8b01 100644 --- a/docusaurus.config.ts +++ b/docusaurus.config.ts @@ -1,149 +1,159 @@ -import {themes as prismThemes} from 'prism-react-renderer'; -import type {Config} from '@docusaurus/types'; -import type * as Preset from '@docusaurus/preset-classic'; -import remarkMath from 'remark-math'; -import rehypeKatex from 'rehype-katex'; +import { themes as prismThemes } from "prism-react-renderer"; +import type { Config } from "@docusaurus/types"; +import type * as Preset from "@docusaurus/preset-classic"; +import remarkMath from "remark-math"; +import rehypeKatex from "rehype-katex"; const config: Config = { - title: 'Graphics Programming Discord', - tagline: 'Articles, guides, tips and tricks from and for frogs and forgis of the graphics programming discord. This is what we do:', - favicon: 'img/favicon.ico', + title: "Graphics Programming Discord", + tagline: + "Articles, guides, tips and tricks from and for frogs and forgis of the graphics programming discord. This is what we do:", + favicon: "img/favicon.ico", // Set the production url of your site here - url: 'https://graphicsprogramming.github.io/', + url: "https://graphicsprogramming.github.io/", // Set the // pathname under which your site is served // For GitHub pages deployment, it is often '//' - baseUrl: '/', + baseUrl: "/", // GitHub pages deployment config. - organizationName: 'GraphicsProgramming', - projectName: 'blog', - deploymentBranch: 'gh-pages', + organizationName: "GraphicsProgramming", + projectName: "blog", + deploymentBranch: "gh-pages", trailingSlash: false, - onBrokenLinks: 'warn', - onBrokenMarkdownLinks: 'warn', + onBrokenLinks: "warn", + onBrokenMarkdownLinks: "warn", - plugins: [[ require.resolve('docusaurus-lunr-search'), { - languages: ['en'] // language codes - }]], + plugins: [ + [ + require.resolve("docusaurus-lunr-search"), + { + languages: ["en"], // language codes + }, + ], + ], // Even if you don't use internationalization, 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: { - defaultLocale: 'en', - locales: ['en'], + defaultLocale: "en", + locales: ["en"], }, stylesheets: [ { - href: 'https://cdn.jsdelivr.net/npm/katex@0.16.11/dist/katex.min.css', - type: 'text/css', + href: "https://cdn.jsdelivr.net/npm/katex@0.16.11/dist/katex.min.css", + type: "text/css", integrity: - 'sha384-nB0miv6/jRmo5UMMR1wu3Gz6NLsoTkbqJghGIsx//Rlm+ZU03BU6SQNC66uf4l5+', - crossorigin: 'anonymous', - } + "sha384-nB0miv6/jRmo5UMMR1wu3Gz6NLsoTkbqJghGIsx//Rlm+ZU03BU6SQNC66uf4l5+", + crossorigin: "anonymous", + }, ], presets: [ [ - 'classic', + "classic", { docs: { - routeBasePath: 'docs', - sidebarPath: './sidebars.ts', + routeBasePath: "docs", + sidebarPath: "./sidebars.ts", }, blog: { showLastUpdateTime: true, showLastUpdateAuthor: true, showReadingTime: true, feedOptions: { - type: ['rss', 'atom'], + type: ["rss", "atom"], xslt: true, }, // Remove this to remove the "edit this page" links. - editUrl: - 'https://github.com/GraphicsProgramming/blog', + editUrl: "https://github.com/GraphicsProgramming/blog", // Useful options to enforce blogging best practices - onInlineTags: 'warn', - onInlineAuthors: 'warn', - onUntruncatedBlogPosts: 'warn', + onInlineTags: "warn", + onInlineAuthors: "warn", + onUntruncatedBlogPosts: "warn", //routeBasePath: '/', - blogSidebarCount: 'ALL', + blogSidebarCount: "ALL", remarkPlugins: [remarkMath], rehypePlugins: [rehypeKatex], }, theme: { - customCss: './src/css/custom.css', + customCss: "./src/css/custom.css", }, sitemap: { - changefreq: 'always' - } + changefreq: "always", + }, } satisfies Preset.Options, ], ], themeConfig: { colorMode: { - defaultMode: 'dark', + defaultMode: "dark", respectPrefersColorScheme: true, }, - image: 'img/social-embed.png', + image: "img/social-embed.png", navbar: { - title: 'Graphics Programming', + title: "Graphics Programming", logo: { - alt: 'Graphics Programming', - src: 'img/gp-discord-logo.webp', + alt: "Graphics Programming", + src: "img/gp-discord-logo.webp", }, items: [ { - to: '/blog', - label: 'Blog', - position: 'left' + to: "/blog", + label: "Blog", + position: "left", + }, + { + type: "docSidebar", + sidebarId: "discordServer", + position: "left", + label: "Discord Server", }, { - type: 'docSidebar', - sidebarId: 'discordServer', - position: 'left', - label: 'Discord Server', + type: "docSidebar", + sidebarId: "communityProjects", + position: "left", + label: "Community Projects", }, { - type: 'docSidebar', - sidebarId: 'communityProjects', - position: 'left', - label: 'Community Projects' - } + to: "/webring", + label: "Webring", + position: "left", + }, ], }, footer: { - style: 'dark', + style: "dark", links: [ { - title: 'Community', + title: "Community", items: [ { - label: 'Discord', - href: 'https://discord.com/invite/graphicsprogramming', + label: "Discord", + href: "https://discord.com/invite/graphicsprogramming", }, { - label: 'YouTube', - href: 'https://www.youtube.com/@graphicsprogramming9074', + label: "YouTube", + href: "https://www.youtube.com/@graphicsprogramming9074", }, { - label: 'Twitter', - href: 'https://x.com/i/communities/1500963350825472000' - } + label: "Twitter", + href: "https://x.com/i/communities/1500963350825472000", + }, ], }, { - title: 'More', + title: "More", items: [ { - label: 'Blog', - to: 'https://graphics-programming.org/', + label: "Blog", + to: "https://graphics-programming.org/", }, { - label: 'GitHub', - href: 'https://github.com/GraphicsProgramming', + label: "GitHub", + href: "https://github.com/GraphicsProgramming", }, ], }, @@ -153,9 +163,7 @@ const config: Config = { prism: { theme: prismThemes.duotoneLight, darkTheme: prismThemes.duotoneDark, - additionalLanguages: [ - 'glsl' - ] + additionalLanguages: ["glsl"], }, } satisfies Preset.ThemeConfig, }; diff --git a/gen-webring-routes.js b/gen-webring-routes.js new file mode 100644 index 0000000..7d36363 --- /dev/null +++ b/gen-webring-routes.js @@ -0,0 +1,38 @@ +const fs = require("fs"); + +// Import ze froges +const frogs = require("./static/webring/froglist.json"); + +function makeHtmlRedirect(frog) { + return ` + + + + + + + Page Redirection + + + + If you are not redirected automatically, follow this link. + + `; +} + +function makeRoutes(frog, nextFrog, prevFrog) { + fs.mkdirSync(`./static/webring/frogs/${frog.name}`, { recursive: true }); + fs.appendFileSync(`./static/webring/frogs/${frog.name}.html`, makeHtmlRedirect(frog)); + fs.appendFileSync(`./static/webring/frogs/${frog.name}/next.html`, makeHtmlRedirect(nextFrog)); + fs.appendFileSync(`./static/webring/frogs/${frog.name}/prev.html`, makeHtmlRedirect(prevFrog)); +} + +frogs.forEach((frog, i) => { + const nextFrog = frogs.at((i + 1) % frogs.length); + const prevFrog = frogs.at(i - 1); // array.at(-1) returns the last element + + makeRoutes(frog, nextFrog, prevFrog); +}); \ No newline at end of file diff --git a/src/pages/index.tsx b/src/pages/index.tsx index 2c3f6c1..1d2fc91 100644 --- a/src/pages/index.tsx +++ b/src/pages/index.tsx @@ -43,6 +43,22 @@ export default function Home(): JSX.Element {
+ +
); diff --git a/src/pages/webring.tsx b/src/pages/webring.tsx new file mode 100644 index 0000000..2df0518 --- /dev/null +++ b/src/pages/webring.tsx @@ -0,0 +1,41 @@ +import React from "react"; +import Layout from "@theme/Layout"; + +import froglist from "/static/webring/froglist.json"; + +export default function Hello() { + return ( + +
+

Graphics Programming Webring

+ +
+
+ ); +} diff --git a/static/img/froge.webp b/static/img/froge.webp new file mode 100644 index 0000000..6e2deb0 Binary files /dev/null and b/static/img/froge.webp differ diff --git a/static/webring/froglist.json b/static/webring/froglist.json new file mode 100644 index 0000000..789a689 --- /dev/null +++ b/static/webring/froglist.json @@ -0,0 +1,15 @@ +[ + { + "name": "gp-blog", + "url": "https://graphics-programming.org/", + "displayName": "Graphics Programming Blog", + "description": "The official site for the Graphics Programming discord" + }, + { + "name": "bluescreen", + "url": "https://fumagalli.ar/", + "displayName": "Teo Fumagalli (bluescreen)", + "description": "Hi! I made a website with stuff in it" + } +] +