personal.community devwork - Day 04/30 - tags for new posts (and comments)

So last nights post is a bit late... and its likely because I have no idea what I'm doing... let me explain..

Last nights project was to get tags on new posts from personal.community, and sleepily I was going about it entirely wrong.. The solution was only discovered after sleeping and looking at some documentation (cuz you know, one would think the documentation was being browsed while the code was being worked on, but being the more "try all the ways to try something and learn from failures", RTFMing was out of the question, until frustration was hit and taking a break from the night.. and there it was, a solution of sorts,.. here

const tags = document.getElementById('tags').value;
const taglist = tags.split(' ');
//make simple json metadata including only tags
const json_metadata = JSON.stringify({ tags: taglist });

(from the above link)

you see, my approache before was something along the lines of

{
  tags: [tag],
  app: 'blokz'
 }

where "tag" was my jsonmetadata string.... this was breaking all the formatting for the actual json meta, which is that entire block and making a series of 2 or more tags show as a single tag complete with " and other marks... essentially putting json inside json, or something.. IDK, I'm playing with tools not fully understood ;) If only more time was spent learning the venacular.

My implmentation of the solution:

  let tag = document.getElementById('tag').value;
  tag = replaceAll(tag, " ", "")
  tag = tag.split(",")

  let jsonmeta = {
    tags: tag,
    app: 'blokz'
  }
  
  jsonmeta = JSON.stringify(jsonmeta)

I should look up setting variables, because I'm not entirely sure how it knows 'tag' is a variable in the let jsonmeta= assignment is the only variable, maybe words before the : are expected to not be variables... * shrugs * something to investigate... time to bust out : Eloquent Javascript (free ebook) although ydkjs (another free ebook) may be better here.

That wraps up this bit of code for the prior day (most of the work was done last night "learning" to bang heads against the wall, and implementation today after leaving this post in frustration until today... I'll be posting later tonight with more of my busy work, which I think may be tackling either storing posting keys or starting to work on reactions (upvotes).
The problem with having to enter the posting key every time you want to post something is that there is a lot of copy paste posting keys goin on,... not a bad thing IMO, but it is a bit inconvenient... I will eventually get onboard with hivesigner and hive keychain again, but I was really wanting to avoid either as the original goal was to have personal.community function as standalone without having to rely on other services or apps, just the site and the full nodes we are pinging with requests... not much a personal fan of the middlemen game, but some seem to be... and I do have my moments where id like that, but that's for another philosophical discussion I suppose.

I do also need to do a huge refactor of the blokz.js code.... want to aim for more of a SPA style approach, as opposed to a seperate page for updating profile, which just adds extra files... undecided on if making a true SPA is a good idea, or if just keeping a zip of files is more approachable for others.. the goal is to have things easy for others to "view-source" and see whats goin on, without having to look under a bunch of rocks essentially... I know I've been having a lot of trust issues with code these days, as it seems to be the thing to inject code in codebases and steal from others,.. This is something I worry about, and dont want others to have to spend a lot of unnecessary time reviewing my codebase... so.. there is that.

Also todo today is spend a bit of time going through my todo list for the site, bugs and features to add/edit/etc.. they are scattered around about a few different apps and sites, and not much organization there. I do have lists, but getting them all in one place is a task... I should probably reinstall the github app on my phone to get on that.. It was recently updated with a lot of new features.

Commit for these changes here:
https://github.com/blokz/personal.community/commit/dc66faf90f947fc2e7e6871ff4a8bacfa6d93485

the majority of the work as always was in blokz.js, which has a bit of extra fluff because of a "format code" press done in Visual Studio Code.

These devlogs aren't tutorials, they are logs of my work, tutorials will come later down the road once I have the codebase refactored and I have more of a grasp in what I'm really doin, or at least feel less of a developer imposter, #impostersyndrome is real. LoL... more so when you are really sus in the role. ;)

H2
H3
H4
3 columns
2 columns
1 column
2 Comments
Ecency