Skip to content

Instantly share code, notes, and snippets.

@hf02
Last active July 3, 2024 18:07
Show Gist options
  • Save hf02/1570e009bd337bc09db6f3e3c29938ca to your computer and use it in GitHub Desktop.
Save hf02/1570e009bd337bc09db6f3e3c29938ca to your computer and use it in GitHub Desktop.
Connecting a Neocities website to your Discord profile

Connecting a Neocities website to your Discord profile

This works for a Neocities website without a custom domain.

This should also work for a site with a custom domain, but I haven't tested it.

In the end, you'll get something like this:

image

Section 1: Getting there in Discord

Step 1: Go to the connections tab under settings

image

image

Step 2: Select the domain connection

image

image

Step 3: Enter your website's domain

image

image

image

Step 4: Select "Verify using HTTPS"

image

image

Leave Discord be here. We will be coming back to it later.

Section 2: Setting up your Neocities website

This is where things can feel somewhat non-sensical, as we are working around some Neocities restrictions.

Step 1: Outside any folders, make a new file called discord.html and open it

"Outside of any folders" is also called the root of your site.

Link to your dashboard, for convience

image

image

image

image

Tip

Discord is looking for a file just named discord. To do this without supporter, we use an HTML document, as Neocities removes the .html from their URLs. While it's still technically an HTML file, Discord doesn't care.

Verify discord.html was created right by opening this link. Does it successfully start editing discord.html?

Step 2: Delete everything in discord.html

image

image

Step 3: Paste the text from Discord's "content" textbox into discord.html

image

image

image

Note

Paste using CTRL+V. The Neocities editor doesn't suppost pasting using right click.

Warning

Make sure only the text Discord provided is in there. Even any spare spaces or blank lines will cause it to fail, and you'll have to go all the way back to this step.

This may feel weird to leave it as-is without a <body> or anything else, but Discord wants it like this.

Verify discord.html was updated right by opening this link. Does it successfully show the text in Discord's "content" textbox?

Step 4: Create a new folder called .well-known, outside of any folders

"Outside of any folders" is also called the root of your site.

image

image

image

Step 5: Move discord.html into the .well-known folder

Link to your dashboard, for convience

image

image

image

Tip

We didn't just create discord.html inside of the .well-known folder because Neocities' editor breaks when editing inside of a folder starting with a dot.

Verify discord.html was moved right by opening this link. Can you see the editor, even if it never loads? Does clicking the "View" button successfully show the text in Discord's "content" textbox?

Section 3: Verifying on Discord

Step 1: Click verify

image

image

If it appears in your connections without any errors, you're done! Keep discord.html where it is on your site as long as you want it connected to your Discord profile.

Doesn't work?

Open this link to troubleshoot with.

"You are being rate limited."

This is Discord's way of saying you are trying too fast. Just wait a little bit and try again.

If a different error pops up, go on.

Does the editor open, even if it never loads?

If not, you might have moved discord.html into the wrong place.

Did you paste the text correctly?

Click the "View" button in the Neocities editor and use your browser's "View Source" feature.

image

image

image

Compare with Discord to make sure it matches Discord's "content" textbox. You may have to scroll in Discord to view the entire thing.

Make sure there aren't any stray spaces or lines. You can easily check this by selecting the entire source with CTRL+A.

image

If you have random HTML you didn't add inside discord.html, try disabling extensions or using a different browser and try again. Some extensions (most infamously ExpressVPN) are known to inject HTML in a way that affects saving on Neocities.

Did you enter the correct domain into Discord?

Copy the URL in Discord's "Name" textbox and paste it into your browser. Make sure it opens your discord.html and doesn't 404.

image

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment