Post tags
All Tags
Keeping a presence on Neocities

When I started this site back in 2019 I did it on Neocities. It was a great place to start and take off the rust from the little html I learned on highschool. After a while when the site itself started to grow and I wanted to host other stuff (Neocities only allows you to upload certain file types) I moved to a VPS.

All worked really well but I missed a bit having my site poping up on there and also many people followed the site trough the Neocities Feed page (wich is ok and all but you should use RSS!)

But well, this is what I do to make it like my site is still on Neocities.


First! Making a index.html that redirects to my real site

This was the first step, I made the index.html on neocites like this so if you found my site there it goes straight into my real site.

This is the code:

<head>
	<meta http-equiv='refresh' content='0; URL=https://grafo.zone'>
</head>
My Neocities preview page

With that little file we already have our neocities profile redirecting to our main site and also it takes right the screenshot for the site preview!

Wich is good and cool but I don’t think it’s enough, I would like to get my sites updates there. For this I created one of those files for each section of my site that redirects to the section it correspond. I ended with this ones

index.html
blog.html
fotolog.html
music.html
writing.html
links.html

The idea is that every time I update one of those sections the neocites counterpart its going to get a comment added to the html so it pushes it up on the feed.

So let’s do that.

Editing the files for Neocities

A while ago I made a post about My first Bash Script wich was an updater for my site (it’s really a simple thing, basically an rsync from my pc to the vps). Now I’m going to modify it a bit to get everything running.

First we need to modify the htmls, for this I added this to my script:

# Upload to NEOCITIES
echo -e "${GREEN}Uploading to Neocities${NC}"
echo -e "Select the page that was modified"
select page in index blog fotolog music writing links
do
echo "<!-- UPDATE" >> ~/neocities/$page.html
date +"Year: %Y, Month: %m, Day: %d" >> ~/neocities/$page.html
echo "-->" >> ~/neocities/$page.html
break
done

What this does is asks me wich page I want to add the Update coment and then proceds to write on it. Once this is done I need to push it to neocities.

I used to use the Neocities CLI client to do the uploads to my site but one day it decided it didn’t want to work anymore so I moved to this: Bashcities. Bashcities is another client for Neocities and this one works! It’s really easy to set up and there on the previous link there is a step by step guide on how to do it.

Once you have all set up and connected to your neocities profile I added this to the script

bashcities -p yourneocities --no-git status
bashcities -p yourneocities --no-git push

The first line see wich files need to be updated and the second one is the push to the server.

All this thing working! :D
And that’s it! Now every time I update my site and push it to my VPS the script also add a comment on the neocities and uploads to it so the people there are aware that the site is still alive :P

I hope someone else find this useful and if you do, let me know!

Post tags
Menu
Support me

If you like any of the stuff I put on here and feel like throwing some money... Thanks! You can do it here:

Guestbook!
[ Click on the book to go to the guestbook! ]