Docs for Myself

colon fin or whatever / Dec 9 2025 / 10:18

Contents

Directory Layout

Everything that will be hosted on neocities is located in the /public folder. Everything that generates or is used to build the site is in the /src folder.
There are also

md_reader.rb & manager.rb

The md_reader.rb script handles reading data from markdown files. Specifically, it reads the header data that determines the title/subtitle/date.
MDReader.get_status_info also used to handle reading the status data, before this was moved to a server-side JS script.
MDReader.get_blog_info(file_name) returns the values title, subtitle, date, time

The syntax for the markdown headers is:

title[title of post here]
subtitle[subtitle here] 
date[mm-dd-yyyy]
time[12:00]
start content'=' # without the quotes

everything between the brackets is returned as its respective value. Everything after start content'=' is returned as the post content.

manager.rb is used to manager the site. It has these functions:

Usage: manager [options]
    -s, --status                     change status
    -l, --medialog                   refresh media log
    -b, --microblog                  refresh micro blog
    -p, --posts_list                 refresh the post.html page
    -e, --posts                      refresh each individual post
    -m, --map                        refresh sitemap
    -h, --help                       prints this page

Manager and the scripts it controls assume an enviroment with the directory structure above, so I will break if called from somewhere else. Everything mentioned below should (hopefully) be doable through this cli.

Status

The status data that appears on the index page is stored in the /public/data/status.json file. It can be edited from the cli, or manually changed.
The JSON file:

{
  "status": "",
  "date": "",
  "listening": "",
  "reading": "",
  "watching": ""
}

Values left empty will not be shown on the status page.

The status data is filled on-load by Javascript. The status.html page is embedded as an iframe on the index page.

Media Log

The media log page is generated by the media_log.rb. The script uses erb to fill in the templates/media_log/media_log_template.erb the section of the page is save to start.txt, and the footer is stored at templates/footer.txt which is used my multiple pages.
The main content is generated at the template file, then start.txt and footer.txt are prepended and appened.

The images for the log are stored at /public/img/media. The data for the page is stored in /src/data/media_log.json.
Here is an exerpt from the JSON file

"i think you should leave": {
        "title": "I Think You Should Leave",
        "media type": "show",
        "image": "i-think-you-should-leave.jpg",
        "date": "June 2025",
        "review": "such a funny show"
    },

The first "i think you should leave" value can be anything. As long as its a unqiue key, its fine. The rest of the values are displayed on the page.
The image value should be the images filename in /public/img/media
To help with organization, entries that have "last of year": "year here" will have a <h2>year</h2> above them.

There is currently no automated way to add manager the media log, so it has to be done manueally. It should be noted that the list is generated top-to-bottom, so more recent entries are at the top of the file.

Microblog

The microblog works very simalarly to the medialog. The entries are stored in a JSON file, templates/micro_blog/micro_blog_template.erb. The template file is handled the same, with a start.txt and the footer file.
The JSON file:

 "hiu aiul asdf": {
        "date": "date",
        "content": "words and words and sentances and words."
    }

Again, the first value can be anything. The value of content can include HTML such as <br>.

Blog

don't feel like writing this right now