Neocities.org

Thricegreat's Webpage

thricegreat.neocities.org

248,465 views
65 followers
4,292 updates
0 tips
Using the neocities API, you can automatically generate what HTML you need for your index. You may do so by naming your posts in a way that they are naturally sorted in the correct order, request a listing of all your files from the neocities API, then generate HTML for all files in that output that match your naming pattern, that which you then upload back to neocities.org as index.html.
3 likes
kaa 1 year ago

Regarding naming scheme, sorting by date has been most practical for me. Naming files YEAR-MM-DD naturally sorts them oldest to newest, and when the output is reversed it is then newest to oldest. For that reversing, I use busybox's `sort -r`.

2 likes
kaa 1 year ago

Given that you seem to dislike writing HTML, I think that running a single command would be a nicer experience than writing out another a tag and a br every time you write something new.

2 likes
thricegreat 1 year ago

Thanks. But the problem is that I constantly change old posts. And I don't want to change the date.

1 like
zinportal 1 year ago

Have you tried https://github.com/sunainapai/makesite in which you can declare the blog entry’s date?

1 like
thricegreat 1 year ago

>>zinportal That's too much. kaa recommended the API, because it is just an URL.

thricegreat 1 year ago

I thought about this again. The main problem is about the data structure. At the surface, I'm using a data structure similar to a blockchain. Instead of a linked list, I use an array though.

thricegreat 1 year ago

A file content may change. But a (file, title) pair will not. It is ordered by date. I only add a pair, and don' t do another operation.

thricegreat 1 year ago

By this, I don't need to consider another operation. I only need to add. And I can easily add by simply writing "(a href=$file)$date $title(/a)(br)".

thricegreat 1 year ago

However, suppose that I start to sort. Then I need to change the data structure. It will have another operation. Like removing. This will make the problem complex.

Website Stats

Last updated 1 hour ago
CreatedMar 20, 2022
Site Traffic Stats

Tags

writing philosophy technology math blog