Autogenerated og images

Signed-off-by: Joshua Castle <26531652+Kas-tle@users.noreply.github.com>
This commit is contained in:
Joshua Castle committed 2024-03-24 22:55:16 -07:00
1 parent 2afa822ae6
commit c32eb18056
67 files changed
+2530 -771

No files matched your search

+1
View File
@@ -3,6 +3,7 @@ title: "1.18 Release, MCProtocolLib, Refactors & More!"
slug: "1-18-release-and-more" slug: "1-18-release-and-more"
authors: RednedEpic authors: RednedEpic
hide_table_of_contents: false hide_table_of_contents: false
description: "In this post, we will be covering all the changes that led up to the 1.18 release."
--- ---
Hi everyone 👋 Hi everyone 👋
+1
View File
@@ -3,6 +3,7 @@ title: "Looking back at 2022"
slug: "looking-back-at-2022" slug: "looking-back-at-2022"
authors: Camotoy authors: Camotoy
hide_table_of_contents: false hide_table_of_contents: false
description: "A look back at the year of 2022 for Geyser."
--- ---
Hi. Hi.
+1
View File
@@ -3,6 +3,7 @@ title: "Four Years of Geyser"
slug: "four-years-of-geyser" slug: "four-years-of-geyser"
authors: RednedEpic authors: RednedEpic
hide_table_of_contents: false hide_table_of_contents: false
description: "Geyser is now four years old!"
--- ---
Hi everyone, Hi everyone,
+1
View File
@@ -1,5 +1,6 @@
--- ---
title: Floodgate API title: Floodgate API
description: Floodgate has an API to allow servers to get information about the Bedrock client. It also allows plugins access to Cumulus, an API to send and collect form data from Bedrock players.
--- ---
Floodgate has an API to extend what is possible and allow servers to get information about the Bedrock client. It also allows other plugins access to [Cumulus](/geyser/forms/) Floodgate has an API to extend what is possible and allow servers to get information about the Bedrock client. It also allows other plugins access to [Cumulus](/geyser/forms/)
+1
View File
@@ -1,5 +1,6 @@
--- ---
title: Commands title: Commands
description: Commands and their associated permission nodes for Floodgate.
--- ---
| Command | Permission | Description | | Command | Permission | Description |
+1
View File
@@ -1,5 +1,6 @@
--- ---
title: FAQ title: FAQ
description: Frequently asked questions about Floodgate such as changing prefixes, obtaining Bedrock player UUIDs, and using Floodgate with PlaceholderAPI and Skript.
--- ---
import { Questions, Q, A } from "../../src/components/Questions"; import { Questions, Q, A } from "../../src/components/Questions";
+1
View File
@@ -1,5 +1,6 @@
--- ---
title: Features title: Features
description: Learn about the features of Floodgate 2.0, including the whitelist command and skin uploading.
--- ---
## Whitelist command {#whitelist-command} ## Whitelist command {#whitelist-command}
+1
View File
@@ -1,6 +1,7 @@
--- ---
title: Floodgate title: Floodgate
permalink: /floodgate/ permalink: /floodgate/
description: 'Floodgate is a hybrid mode plugin that allows Minecraft: Bedrock Accounts to join Minecraft: Java Edition servers without needing a Minecraft: Java Edition account.'
--- ---
# Floodgate # Floodgate
+1
View File
@@ -1,5 +1,6 @@
--- ---
title: Issues title: Issues
description: Troubleshoot common Floodgate issues. Get solutions for connection problems, configuration errors, and known limitations.
--- ---
# Known Issues & Caveats # Known Issues & Caveats
+1
View File
@@ -1,5 +1,6 @@
--- ---
title: Linking title: Linking
description: Learn how to link your Java and Bedrock Minecraft accounts for crossplay. Understand builtin Global Linking or how to set up optional local linking.
--- ---
## What is Global Linking? {#what-is-global-linking} ## What is Global Linking? {#what-is-global-linking}
+1
View File
@@ -1,5 +1,6 @@
--- ---
title: FloodgatePlayer title: FloodgatePlayer
description: FloodgatePlayer is the main class for accessing bedrock player data.
--- ---
FloodgatePlayer is something that every player who's connect through Floodgate has. FloodgatePlayer is something that every player who's connect through Floodgate has.
+1
View File
@@ -1,6 +1,7 @@
--- ---
title: Floodgate Setup title: Floodgate Setup
page_sidebar: false page_sidebar: false
description: Set up Floodgate to allow Bedrock users to authenticate with their Bedrock account on your Java Minecraft server.
--- ---
import Tabs from "@theme/Tabs"; import Tabs from "@theme/Tabs";
+6
View File
@@ -1,3 +1,9 @@
---
title: Floodgate Fabric Setup
description: Learn how to set up Floodgate on your Fabric server.
hide_title: true
---
1. Download Floodgate-Fabric from the [modrinth page](https://modrinth.com/mod/floodgate). 1. Download Floodgate-Fabric from the [modrinth page](https://modrinth.com/mod/floodgate).
2. Place the Floodgate-Fabric.jar in the `mods` folder, and restart the server. **You also need [FabricAPI](https://modrinth.com/mod/fabric-api) installed.** 2. Place the Floodgate-Fabric.jar in the `mods` folder, and restart the server. **You also need [FabricAPI](https://modrinth.com/mod/fabric-api) installed.**
3. Change `auth-type` in Geyser's config to `floodgate`. 3. Change `auth-type` in Geyser's config to `floodgate`.
+6
View File
@@ -1,3 +1,9 @@
---
title: Floodgate Paper / Spigot Setup
description: Learn how to set up Floodgate on your Paper or Spigot server.
hide_title: true
---
1. Download Floodgate-Spigot from the [download page](https://download.geysermc.org/v2/projects/floodgate/versions/latest/builds/latest/downloads/spigot). 1. Download Floodgate-Spigot from the [download page](https://download.geysermc.org/v2/projects/floodgate/versions/latest/builds/latest/downloads/spigot).
2. Place the Floodgate-Spigot.jar in the `plugins` folder, and restart the server. 2. Place the Floodgate-Spigot.jar in the `plugins` folder, and restart the server.
3. Change `auth-type` in Geyser's config to `floodgate`. 3. Change `auth-type` in Geyser's config to `floodgate`.
+6
View File
@@ -1,3 +1,9 @@
---
title: Floodgate Proxy Servers Setup
description: Learn how to set up Floodgate on your Bungee, Waterfall, or Velocity server.
hide_title: true
---
:::info :::info
You only need to install Floodgate on the BungeeCord or Velocity proxy server, unless you want to use the Floodgate API on the backend servers. You only need to install Floodgate on the BungeeCord or Velocity proxy server, unless you want to use the Floodgate API on the backend servers.
Additionally, it will display Bedrock edition skins properly. Additionally, it will display Bedrock edition skins properly.
+6
View File
@@ -1,3 +1,9 @@
---
title: Floodgate Geyser Standalone Setup
description: Learn how to set up Floodgate with Geyser Standalone.
hide_title: true
---
:::info :::info
To be able to use Floodgate authentication, you need to be able to install Floodgate on the Java server you are connecting to. To be able to use Floodgate authentication, you need to be able to install Floodgate on the Java server you are connecting to.
::: :::
+6
View File
@@ -1,3 +1,9 @@
---
title: Floodgate ViaProxy Setup
description: Learn how to set up Floodgate with ViaProxy.
hide_title: true
---
:::info :::info
To be able to use Floodgate authentication, you need to be able to install Floodgate on the Java server you are connecting to. To be able to use Floodgate authentication, you need to be able to install Floodgate on the Java server you are connecting to.
::: :::
+1
View File
@@ -1,5 +1,6 @@
--- ---
title: Anticheat Compatibility title: Anticheat Compatibility
description: A list of community compiled list of Anticheats and their compatibility with Geyser.
--- ---
:::caution :::caution
+1
View File
@@ -1,5 +1,6 @@
--- ---
title: Geyser API title: Geyser API
description: The Geyser API allows you to interact with Geyser in your own plugins, mods, or extensions.
--- ---
Geyser has an API to extend what is possible with Geyser, and to allow you to interact with Geyser in your own plugins, mods, or extensions. Geyser has an API to extend what is possible with Geyser, and to allow you to interact with Geyser in your own plugins, mods, or extensions.
+1
View File
@@ -1,5 +1,6 @@
--- ---
title: Commands and Permissions title: Commands and Permissions
description: Commands and their associated permission nodes for Geyser.
--- ---
# Commands and Permissions # Commands and Permissions
+1
View File
@@ -1,5 +1,6 @@
--- ---
title: Common Issues title: Common Issues
description: Common issues that people may encounter with Geyser and potential fixes for them.
--- ---
# Common Issues # Common Issues
+1
View File
@@ -1,5 +1,6 @@
--- ---
title: Creating a Startup Script title: Creating a Startup Script
description: Learn how to create a startup script for Geyser-Standalone.
--- ---
# Creating a Startup Script for Geyser-Standalone # Creating a Startup Script for Geyser-Standalone
+1
View File
@@ -1,5 +1,6 @@
--- ---
title: Current Limitations title: Current Limitations
description: Current known limitations of Geyser.
--- ---
# Current Limitations # Current Limitations
+1
View File
@@ -1,5 +1,6 @@
--- ---
title: Custom blocks with Geyser title: Custom blocks with Geyser
description: Geysers allows custom blocks to be mapped to Vanilla Java blockstates or modded blocks to allow custom block models.
--- ---
# Custom blocks with Geyser # Custom blocks with Geyser
+1
View File
@@ -1,5 +1,6 @@
--- ---
title: Custom items with Geyser title: Custom items with Geyser
description: Geyser allows custom Bedrock items to be added for an equivalency to Vanilla Java item predicates or modded items.
--- ---
# Custom items with Geyser # Custom items with Geyser
+1
View File
@@ -1,5 +1,6 @@
--- ---
title: Custom skulls with Geyser title: Custom skulls with Geyser
description: Geyser allows mapping of custom skulls to custom blocks for use in inventories and on entities.
--- ---
# Custom skulls with Geyser # Custom skulls with Geyser
+1
View File
@@ -1,5 +1,6 @@
--- ---
title: Geyser Events title: Geyser Events
description: Geyser has a powerful event system that allows you to listen to events that are sent by Geyser. Events are at the heart of Geyser Extensions, and can be used by plugins and mods as well.
--- ---
# Geyser Events # Geyser Events
+1
View File
@@ -1,5 +1,6 @@
--- ---
title: Geyser Extensions title: Geyser Extensions
description: Geyser Extensions are the equivalent of "plugins", but specifically for the Geyser platform. This brings the advantage of them being platform-agnostic, meaning that you won't have to worry about supporting all platforms individually.
--- ---
# Geyser Extensions # Geyser Extensions
+1
View File
@@ -1,5 +1,6 @@
--- ---
title: Frequently Asked Questions title: Frequently Asked Questions
description: Frequently asked questions about Geyser, including how it works, what plugins are incompatible, and more.
--- ---
import { Questions, Q, A } from "../../src/components/Questions"; import { Questions, Q, A } from "../../src/components/Questions";
@@ -1,5 +1,6 @@
--- ---
title: Fixing 'Unable to Connect to World' title: Fixing 'Unable to Connect to World'
description: Common issues and solutions for the 'Unable to Connect to World' error.
--- ---
## Fixing 'Unable to Connect to World' errors {#fixing-unable-to-connect-to-world-errors} ## Fixing 'Unable to Connect to World' errors {#fixing-unable-to-connect-to-world-errors}
+1
View File
@@ -1,5 +1,6 @@
--- ---
title: Forms and Cumulus title: Forms and Cumulus
description: Cumulus is the Forms API used in Geyser and Floodgate, and is available for use in projects that extend Geyser or Floodgate.
--- ---
# What is Cumulus? # What is Cumulus?
@@ -1,5 +1,6 @@
--- ---
title: Getting Started with the API title: Getting Started with the API
description: 'A primer on how to use the Geyser and Floodgate APIs.'
--- ---
To start, add the Open Collaboration repository to your project: To start, add the Open Collaboration repository to your project:
@@ -1,5 +1,6 @@
--- ---
title: Geyser Command Line Arguments and System Properties title: Geyser Command Line Arguments and System Properties
description: Geyser offers a few command line arguments/system properties to allow you to configure Geyser without editing the config files.
--- ---
# Geyser Command Line Arguments and System Properties # Geyser Command Line Arguments and System Properties
+1
View File
@@ -1,5 +1,6 @@
--- ---
title: Global API title: Global API
description: 'The Global API is a service that allows for global linking, skin uploading, and access to various info about all Bedrock players that have joined Floodgate servers before.'
--- ---
The Global API is available for every server. It currently includes: [Global Linking](/floodgate/linking#what-is-global-linking), [skin uploading](/floodgate/features#what-is-skin-uploading), getting a xuid by gamertag, and getting a gamertag by xuid. The Global API is available for every server. It currently includes: [Global Linking](/floodgate/linking#what-is-global-linking), [skin uploading](/floodgate/features#what-is-skin-uploading), getting a xuid by gamertag, and getting a gamertag by xuid.
+1
View File
@@ -1,6 +1,7 @@
--- ---
title: Geyser title: Geyser
permalink: /geyser/ permalink: /geyser/
description: 'Geyser is a bridge between Minecraft: Bedrock Edition and Minecraft: Java Edition, closing the gap from those wanting to play true cross-platform.'
--- ---
import { Versions } from '../../src/components/Versions' import { Versions } from '../../src/components/Versions'
+1
View File
@@ -1,5 +1,6 @@
--- ---
title: playit.gg Setup title: playit.gg Setup
description: How to set up playit.gg to use Geyser without port forwarding.
--- ---
## Prerequisites {#prerequisites} ## Prerequisites {#prerequisites}
+1
View File
@@ -1,5 +1,6 @@
--- ---
title: Port forwarding title: Port forwarding
description: Information on how to set up UDP port forwarding required for Geyser.
--- ---
# Port forwarding # Port forwarding
+1
View File
@@ -1,5 +1,6 @@
--- ---
title: Geyser and Secure Chat title: Geyser and Secure Chat
description: Information about disabling secure chat to allow Bedrock players to chat on Java servers.
--- ---
In the 1.19 Java Edition updates, a mechanism for reporting player chat messages to Mojang was implemented. In the 1.19 Java Edition updates, a mechanism for reporting player chat messages to Mojang was implemented.
+1
View File
@@ -1,6 +1,7 @@
--- ---
title: Setup title: Setup
page_sidebar: false page_sidebar: false
description: Guides to setup Geyser on all supported platforms
--- ---
import Tabs from "@theme/Tabs"; import Tabs from "@theme/Tabs";
@@ -1,3 +1,8 @@
---
title: Geyser Hosting Provider Modded Setup
description: Learn how to set up Geyser on your Fabric or NeoForge server from a hosting provider.
---
import { Versions } from '../../../../src/components/Versions' import { Versions } from '../../../../src/components/Versions'
:::caution :::caution
@@ -1,3 +1,9 @@
---
title: Geyser Hosting Provider Paper / Spigot Setup
description: Learn how to set up Geyser on a Paper or Spigot server from a hosting provider.
hide_title: true
---
import { Versions } from '../../../../src/components/Versions' import { Versions } from '../../../../src/components/Versions'
:::info :::info
@@ -1,3 +1,9 @@
---
title: Geyser Hosting Provider Proxy Servers Setup
description: Learn how to set up Geyser on your Bungee, Waterfall, or Velocity server from a hosting provider.
hide_title: true
---
import { Versions } from '../../../../src/components/Versions' import { Versions } from '../../../../src/components/Versions'
:::info :::info
@@ -1,3 +1,9 @@
---
title: Geyser Self-Hosted Modded Setup
description: Learn how to set up Geyser on your self-hosted Fabric or NeoForge server.
hide_title: true
---
import { Versions } from '../../../../src/components/Versions' import { Versions } from '../../../../src/components/Versions'
:::caution :::caution
+5
View File
@@ -1,3 +1,8 @@
---
title: Geyser Self-Hosted Paper / Spigot Setup
description: Learn how to set up Geyser on your self-hosted Paper or Spigot server.
---
import { Versions } from '../../../../src/components/Versions' import { Versions } from '../../../../src/components/Versions'
:::info :::info
+7
View File
@@ -1,3 +1,10 @@
---
title: Geyser Self-Hosted Proxy Servers Setup
description: Learn how to set up Geyser on your self-hosted Bungee, Waterfall, or Velocity server.
hide_title: true
---
import { Versions } from '../../../../src/components/Versions' import { Versions } from '../../../../src/components/Versions'
:::info :::info
+6
View File
@@ -1,3 +1,9 @@
---
title: Geyser Standalone Setup
description: Learn how to set up Geyser Standalone, a standalone Java program that allows you to connect Bedrock players to your Java Edition server.
hide_title: true
---
:::info :::info
You need to have Java 17 or higher installed to run Geyser. To run Geyser Standalone on Android, see the bottom of this page. You need to have Java 17 or higher installed to run Geyser. To run Geyser Standalone on Android, see the bottom of this page.
::: :::
+5
View File
@@ -1,3 +1,8 @@
---
title: Geyser ViaProxy Setup
description: Learn how to set up Geyser with ViaProxy.
---
1. [Setup ViaProxy](https://github.com/ViaVersion/ViaProxy?tab=readme-ov-file#usage-for-players-gui). 1. [Setup ViaProxy](https://github.com/ViaVersion/ViaProxy?tab=readme-ov-file#usage-for-players-gui).
2. Download the plugin from [the download page](https://download.geysermc.org/v2/projects/geyser/versions/latest/builds/latest/downloads/viaproxy). 2. Download the plugin from [the download page](https://download.geysermc.org/v2/projects/geyser/versions/latest/builds/latest/downloads/viaproxy).
3. Place the Geyser-ViaProxy.jar in the `plugins` folder, and restart ViaProxy. 3. Place the Geyser-ViaProxy.jar in the `plugins` folder, and restart ViaProxy.
@@ -1,5 +1,6 @@
--- ---
title: Supported Hosting Providers title: Supported Hosting Providers
description: A list of hosting providers and their support for Geyser.
--- ---
import { Provider } from "../../src/components/Provider"; import { Provider } from "../../src/components/Provider";
+1
View File
@@ -1,5 +1,6 @@
--- ---
title: Supported Languages & Translations title: Supported Languages & Translations
description: Geyser supports a wide variety of languages to offer the best experience for players all over the globe. Community members can help translate Geyser into more languages.
--- ---
Geyser supports a wide variety of languages to offer the best experience for players all over the globe. Geyser supports a wide variety of languages to offer the best experience for players all over the globe.
+1
View File
@@ -1,5 +1,6 @@
--- ---
title: Understanding the Config title: Understanding the Config
description: This page covers basic information about the Geyser config and the function of each option.
--- ---
This page covers basic information about the Geyser config and what each option does. Though they are explained in the configuration itself, this explains what each option does in more detail. This page covers basic information about the Geyser config and what each option does. Though they are explained in the configuration itself, this explains what each option does in more detail.
@@ -1,5 +1,6 @@
--- ---
title: Using Geyser with Consoles title: Using Geyser with Consoles
description: Information on how to use Geyser with consoles, including how to join servers on console versions of Bedrock Edition.
--- ---
# Using Geyser with Consoles # Using Geyser with Consoles
+1
View File
@@ -1,5 +1,6 @@
--- ---
title: Community Geyser Projects title: Community Geyser Projects
description: A list of community-compiled plugins, extensions and tools that work with Geyser.
--- ---
Below is a list of community-compiled plugins, extensions and tools that work with Geyser. Below is a list of community-compiled plugins, extensions and tools that work with Geyser.
+1
View File
@@ -1,5 +1,6 @@
--- ---
title: Developer Guide title: Developer Guide
description: A guide for developers who want to contribute to GeyserMC projects.
--- ---
## Compiling {#compiling} ## Compiling {#compiling}
+1
View File
@@ -1,5 +1,6 @@
--- ---
title: Discord Bot Usage title: Discord Bot Usage
description: Information about how to use the Geyser Discord bot.
--- ---
Our discord bot provides some very useful toos to debug/issue track your server. We will go in-depth on how to use the bot commands and its tools. Our discord bot provides some very useful toos to debug/issue track your server. We will go in-depth on how to use the bot commands and its tools.
+1
View File
@@ -1,5 +1,6 @@
--- ---
title: GeyserConnect title: GeyserConnect
description: GeyserConnect is a extension for Geyser that allows you to join multiple servers using a single Geyser proxy.
--- ---
GeyserConnect is a extension for Geyser that allows you to join multiple servers using a single GeyserMC proxy. GeyserConnect is a extension for Geyser that allows you to join multiple servers using a single GeyserMC proxy.
+1
View File
@@ -1,5 +1,6 @@
--- ---
title: GeyserOptionalPack title: GeyserOptionalPack
description: GeyserOptionalPack is a Bedrock resource pack that fixes parity issues with Geyser to bring Bedrock Edition in line with Java Edition.
--- ---
# GeyserOptionalPack # GeyserOptionalPack
+1
View File
@@ -1,5 +1,6 @@
--- ---
title: Hurricane title: Hurricane
description: Hurricane is a Paper / Spigot plugin and Fabric mod that fixes some bugs that otherwise cannot be fixed without server-side modification.
--- ---
# Hurricane # Hurricane
+1
View File
@@ -1,6 +1,7 @@
--- ---
title: Other title: Other
permalink: /other/ permalink: /other/
description: Information about other Geyser-related projects.
--- ---
# Other # Other
+1
View File
@@ -1,5 +1,6 @@
--- ---
title: Test Server title: Test Server
description: Information about joining and using the Geyser test server.
--- ---
### Details {#details} ### Details {#details}
+12
View File
@@ -1,6 +1,7 @@
import { themes as prismThemes } from 'prism-react-renderer'; import { themes as prismThemes } from 'prism-react-renderer';
import type { Config } from '@docusaurus/types'; import type { Config } from '@docusaurus/types';
import type * as Preset from '@docusaurus/preset-classic'; import type * as Preset from '@docusaurus/preset-classic';
import { docOgRenderer, blogOgRenderer, pageOgRenderer } from './src/renderer/ImageRenderers';
const config: Config = { const config: Config = {
title: 'GeyserMC', title: 'GeyserMC',
@@ -72,6 +73,17 @@ const config: Config = {
} }
} }
}, },
],
[
'@kas-tle/docusaurus-og',
{
path: './preview-images',
imageRenderers: {
'docusaurus-plugin-content-docs': docOgRenderer,
'docusaurus-plugin-content-pages': pageOgRenderer,
'docusaurus-plugin-content-blog': blogOgRenderer,
},
},
] ]
], ],
themes: ["docusaurus-theme-openapi-docs"], themes: ["docusaurus-theme-openapi-docs"],
+1
View File
@@ -23,6 +23,7 @@
"@fortawesome/free-regular-svg-icons": "^6.5.1", "@fortawesome/free-regular-svg-icons": "^6.5.1",
"@fortawesome/free-solid-svg-icons": "^6.5.1", "@fortawesome/free-solid-svg-icons": "^6.5.1",
"@fortawesome/react-fontawesome": "^0.2.0", "@fortawesome/react-fontawesome": "^0.2.0",
"@kas-tle/docusaurus-og": "https://github.com/Kas-tle/docusaurus-og",
"@mdx-js/react": "^3.0.0", "@mdx-js/react": "^3.0.0",
"clsx": "^1.2.1", "clsx": "^1.2.1",
"docusaurus-plugin-openapi-docs": "^3.0.0-beta.5", "docusaurus-plugin-openapi-docs": "^3.0.0-beta.5",
+1 -1
View File
@@ -94,7 +94,7 @@ const DownloadPage: React.FC = () => (
export default function Download(): JSX.Element { export default function Download(): JSX.Element {
return ( return (
<Layout <Layout
title={`Geyser Downloads`} title={`Download`}
description="Download the latest versions of our various projects." description="Download the latest versions of our various projects."
> >
<main> <main>
+2 -4
View File
@@ -1,5 +1,4 @@
import clsx from 'clsx'; import clsx from 'clsx';
import useDocusaurusContext from '@docusaurus/useDocusaurusContext';
import Layout from '@theme/Layout'; import Layout from '@theme/Layout';
import HomepageFeatures from '@site/src/components/HomepageFeatures'; import HomepageFeatures from '@site/src/components/HomepageFeatures';
import Heading from '@theme/Heading'; import Heading from '@theme/Heading';
@@ -28,11 +27,10 @@ function HomepageHeader() {
} }
export default function Home(): JSX.Element { export default function Home(): JSX.Element {
const { siteConfig } = useDocusaurusContext();
return ( return (
<Layout <Layout
title={`Hello from ${siteConfig.title}`} title="Geyser"
description="Description will go into a meta tag in <head />" description="Enable clients from Minecraft Bedrock Edition to join your Minecraft Java server."
> >
<HomepageHeader /> <HomepageHeader />
<main> <main>
-7
View File
@@ -1,7 +0,0 @@
---
title: Markdown page example
---
# Markdown page example
You don't need React to write simple standalone pages.
+265
View File
@@ -0,0 +1,265 @@
import React, { ReactSVGElement } from 'react';
import type { DocsPageData, ImageRenderer, ImageGeneratorOptions, BlogPageData, PageData } from '@kas-tle/docusaurus-og';
import { join } from 'path';
import { readFileSync } from 'fs'
import { faDownload, faHouse, faBlog, faBook, IconDefinition } from '@fortawesome/free-solid-svg-icons';
const geyserLogo = join(__dirname, '../../static/img/icons/geyser.png');
const geyserLogoBase64 = `data:image/png;base64,${readFileSync(geyserLogo).toString('base64')}`;
const titleElement = ({ children }) => React.createElement(
'label',
{
style: {
fontSize: 72,
fontWeight: 800,
letterSpacing: 1,
margin: '25px 225px 10px 0px',
color: '#e3e3e3',
wordBreak: 'break-word',
}
},
children
);
const docsSvgElement = faSvg(faBook);
const blogSvgElement = faSvg(faBlog);
const homeSvgElement = faSvg(faHouse);
const downloadSvgElement = faSvg(faDownload);
const geyserLogoElement = React.createElement(
'img',
{
src: geyserLogoBase64,
style: {
position: 'absolute',
top: 20,
right: 20,
width: 225,
height: 225,
borderRadius: '50%',
border: '10px solid #e3e3e3'
},
},
)
const headerElement = (header: string, svg: ReactSVGElement) => React.createElement(
'div',
{
style: {
display: 'flex',
alignItems: 'center',
position: 'absolute',
top: 20,
left: 40,
},
},
svg,
React.createElement(
'label',
{
style: {
fontSize: 32,
fontWeight: 600,
letterSpacing: 1,
color: '#e3e3e3',
},
},
header,
),
)
const rootDivStyle: React.CSSProperties = {
display: 'flex',
flexDirection: 'column',
height: '100%',
width: '100%',
padding: '10px 40px',
justifyContent: 'center',
fontFamily: 'Montserrat',
fontSize: 32,
fontWeight: 400,
backgroundColor: '#0f1b23',
color: '#e3e3e3',
borderBottom: '2rem solid rgb(37, 194, 160)',
};
export const docOgRenderer: ImageRenderer<DocsPageData> = async (data, context) => {
const element = React.createElement(
'div',
{ style: rootDivStyle },
React.createElement(titleElement, null, data.metadata.title),
React.createElement('div', null, data.metadata.description),
geyserLogoElement,
headerElement(docSectionPath(data.metadata.slug, context.siteConfig.title), docsSvgElement),
);
return [
element,
await imageGeneratorOptions(),
];
};
export const blogOgRenderer: ImageRenderer<BlogPageData> = async (data, context) => {
const isPost = data.pageType === 'post';
let posterImageElement = undefined;
if (isPost && data.data.metadata.authors.length > 0) {
// Create line of all author avatar images in top right corner
const authorImages = data.data.metadata.authors.map(async author => React.createElement(
'img',
{
src: await encodeRemoteImage(author.imageURL),
style: {
width: 112.5,
height: 112.5,
marginRight: 10,
borderRadius: '50%',
border: '10px solid #e3e3e3',
},
},
));
posterImageElement = React.createElement(
'div',
{
style: {
display: 'flex',
position: 'absolute',
top: 20,
right: 175,
},
},
...await Promise.all(authorImages),
);
}
const element = React.createElement(
'div',
{ style: rootDivStyle },
React.createElement(titleElement, null, isPost ? data.data.metadata.title : context.siteConfig.title + ' Blog'),
React.createElement('div', null, isPost ? data.data.metadata.description : ''),
geyserLogoElement,
posterImageElement,
headerElement(context.siteConfig.title + ' / Blog' + (isPost ? ` / ${new Date(data.data.metadata.date).toISOString().split('T')[0].replaceAll('-','.')}` : ''), blogSvgElement),
);
return [
element,
await imageGeneratorOptions(),
];
};
export const pageOgRenderer: ImageRenderer<PageData> = async (data, context) => {
const extraTitleLength = (' ' + context.siteConfig.titleDelimiter + ' ' + context.siteConfig.title).length;
await data.document.load();
const title = (data.document.loaded && data.document.root.querySelector('title')?.textContent).slice(0, -extraTitleLength) || context.siteConfig.title;
const description = (data.document.loaded && data.document.root.querySelector('meta[name="description"]').getAttribute('content')) || context.siteConfig.tagline;
const element = React.createElement(
'div',
{ style: rootDivStyle },
React.createElement(titleElement, null, title),
React.createElement('div', null, description),
geyserLogoElement,
headerElement(context.siteConfig.title + ' / ' + title, pageSvg(data.metadata.permalink)),
);
return [
element,
await imageGeneratorOptions(),
];
};
const imageGeneratorOptions = async (): Promise<ImageGeneratorOptions> => {
return {
width: 1200,
height: 600,
fonts: [
{
name: 'Montserrat',
data: await getTtfFont('Montserrat', ['ital', 'wght'], [0, 400]),
weight: 400,
style: 'normal',
},
{
name: 'Montserrat',
data: await getTtfFont('Montserrat', ['ital', 'wght'], [0, 600]),
weight: 600,
style: 'normal',
},
{
name: 'Montserrat',
data: await getTtfFont('Montserrat', ['ital', 'wght'], [0, 800]),
weight: 800,
style: 'normal',
},
],
};
}
function docSectionPath(slug: string, title: string) {
let section = slug.split('/')[1].toString();
// Override some sections by slug
switch (section) {
case 'api':
section = 'REST APIs';
break;
}
section = section.charAt(0).toUpperCase() + section.slice(1);
return `${title} / ${section}`;
}
function pageSvg(permalink: string) {
switch (permalink.slice(1, -1)) {
case 'download':
return downloadSvgElement;
default:
return homeSvgElement;
}
}
async function getTtfFont(family: string, axes: string[], value: number[]): Promise<ArrayBuffer> {
const familyParam = axes.join(',') + '@' + value.join(',');
// Get css style sheet with user agent Mozilla/5.0 Firefox/1.0 to ensure TTF is returned
const cssCall = await fetch(`https://fonts.googleapis.com/css2?family=${family}:${familyParam}&display=swap`, {
headers: {
'User-Agent': 'Mozilla/5.0 Firefox/1.0',
},
});
const css = await cssCall.text();
const ttfUrl = css.match(/url\(([^)]+)\)/)?.[1];
return await fetch(ttfUrl).then(res => res.arrayBuffer());
}
async function encodeRemoteImage(url: string): Promise<string> {
try {
const res = await fetch(url);
const buffer = await res.arrayBuffer().then(buf => Buffer.from(buf));
return `data:${res.headers.get('content-type')};base64,${buffer.toString('base64')}`;
} catch (error) {
return geyserLogoBase64;
}
}
function faSvg(icon: IconDefinition): ReactSVGElement {
// create all path elements from icon.icon[4] contents (could be string or array of strings)
const paths = typeof icon.icon[4] === 'string' ? [icon.icon[4]] : icon.icon[4];
const svgPaths = paths.map((path: string) => React.createElement('path', { d: path, fill: '#e3e3e3' }));
const viewBox = '0 0 ' + icon.icon[0] + ' ' + icon.icon[1];
const element = React.createElement('svg', {
width: '50px',
viewBox,
style: { marginRight: 10 },
}, ...svgPaths);
return element;
}
+2
View File
@@ -2,6 +2,8 @@
// This file is not used in compilation. It is here just for a nice editor experience. // This file is not used in compilation. It is here just for a nice editor experience.
"extends": "@docusaurus/tsconfig", "extends": "@docusaurus/tsconfig",
"compilerOptions": { "compilerOptions": {
"lib": ["DOM", "DOM.Iterable", "ESNext"],
"target": "ESNext",
"baseUrl": "." "baseUrl": "."
}, },
"exclude": [ "exclude": [
+2125 -759
View File
File diff suppressed because it is too large. Load diff