This is Hacker Public Radio episode 3,797 for Tuesday, the 21st of February 2023. Today's show is entitled, How to Submit Changes to HPR. It is hosted by Ken Fallon and is about 32 minutes long. It carries a clean flag. The summery is row and shows Ken how to submit changes to the new HPR static site. Hi everybody, my name is Ken Fallon and you're listening to another episode of Hacker Public Radio. Today I am joined by Rome, say I play everyone. So this show where short of shows obviously because of HPR and because essentially you, dear listener need to submit me some more shows to this here, a podcast because it's a barcom podcast where our shows rely on people submitting stuff. What type of stuff, Rome, would be of interest, perhaps, how to submit a change to the HPR website? That would be, I think, a great interest to me to have more people submitting changes to the HPR website. To give you some background, our current website was developed back in the day, 17 years ago and we are now, yeah, the code is a little bit flaky, I think everybody involved of this will agree and we are called out by Popeye from the Ubuntu podcast from me. And essentially the word was open source you called or stuff complain about, and you stepped up and created a website, do you want to, what sort of tool to generate our websites? Do you want to give us a bit of background on that? Sure. So, I know Ken had mentioned in the various places, the email list and on, maybe it's some up community news, wanting the website to be statically generated, I decided, hey, that would be interesting and I'd already helped out a little bit with the free culture podcasts website. And new, it was generated using the tool kit template, it's a pearl template for generating static websites and so I thought, hey, Dave knows that, pearls have been around, don't think it's going anywhere. So I decided to create a site generator for HPR using the tool kit template. Basically, it's just a pearl script that then calls that and then it allows you to use the templating system to create new pages and add it to the site generator relatively easily. Yeah, it's not that rocket science, actually. The whole pearl part is really the thing that I intend to be changing most, it's probably just the template and that's pretty standard, I think, across those templating tools. You know, but it's got loops in there's on space as you can see the HTML and in between HTML there are various different methods that you can use for commands or whatever. Right, I mean, it's very similar to like PHP, it's just not being run, you know, on the server as you're doing it, you're just running it, you know, beforehand and then saving the output has static HTML. Yeah, so our goal here is to be able to have a static website that you do this and can all sink down to your Raspberry PiR assembly, similarly to low spec, low power machine and serve a mirror image of the HBR website from your fiber internet connection at home. So we have a massively distributed, mirror type content distribution system provided by the community. What could possibly go wrong? Do, do, do, do, do, do, do, do, do, do, do, do, do, do, do, do, do, do, do, do, do, do, do, do, do, do, do, do, do, do, do, do, do. And we sort of have a proof of concept working so far, so yeah, so that's actually running now. As you listen to this on hobby public radio, which is our sink from HPR.coarning.us. Yeah, so that's pretty much that. So when we make, when we make updates to the website, we'll regenerate new pages and then those can be our sink down to your local server and served. Easy peasy, lemon squeezy, but how do we, as an open source project, allow you to go in and fix some code. So that's where we are now. So where is our code hosted? So right now is generously being hosted by Honest Host at repo.inhonesthost.com. You do have to book this or dot net, oops, sorry about that. It just pops up into my browser so I don't really look at the dot part, not much, the ending. You do have to become a member, which is free, it's just to help, I guess, cut down on spam and then people just, you know, running a muck on the repo. Just quick word about that, that's, that's the Josh, who graciously takes care of all the stuff that we do, server wise and keep in mind dealing with the tax and all sorts. This, he already had a version of GITT running and it was GitLab actually and it was, it was not pleasant for him to have to maintain. So as a result, any thing that he's commenting on here or requirements to simply register is reasonable. What we can always do as a later date is make the entire code base just available somewhere else as well. So that when you do your R-sync, you pull down the repo as a, as a by the way. Yeah, I think that's, that's the plan. So then we come to the situation where Mickey of Tronic made a very valid request to have links to the various different files and various different places. So for one reason or another, they're working included because they're working included. So it's a bug where effectiveness will be fixed on the PHP site and now what I want to do is go and fix it on the static site because in the future, that's the only place changes are going to be allowed. So I basically want to know, okay, I asked you what is the procedure then for, for doing this and you said, use that meal list and I said, well, let's record a show about it. So that's what we're doing. So I think the one I've done so far is a gunned repo of the non-stores.net. I've logged in, I had already created an account, I set up my two-factor authentication. I saw I logged in and I put in my free OTP plus thing in there and now I'm here looking as looking at the web page, so what do I do? So once you're logged in and you'll want to find the particular repo, there are actually a couple of hosted on there, but you will want to find, I think it's called HPR Generator repo. Yes. Artage, oh, I'm just going in, I'm just going to register it, yep. So then now whether you want to fix the bug or not, if you want to, if you find a request, you can basically submit a request for a change to the website, be it whether you're going to do it yourself, hopefully, or just as the Justin's, like, hey, I found this bug, you would go to the issues section of the repo and then create a new issue. So I either like to do that kind of, if you want to, no, I've already created one issue. Okay, audio links to the index, index folder and series pages, so that's our issue. So there is five, six page needs a send, we've got an example, et cetera, yep. Okay, so now that we've done that, you can also provide labels, like the label, there's only a few, I think it's like bug fix, new feature or feature request, that sort of thing, let's make it a little easier for us to eyeball it, hold the record, this is, I mean, it's sort of either one, I mean, it is a, I guess a feature request, but I technically is probably more of a bug for a website, yeah, that's totally bugging it, yeah, let's, let's like it was a bug at times, good. Once you've done that, if you are, then want to submit a code change yourself, what I suppose, great, is I create a new local branch on my machine to make the change. So it's, you know, get check out that be name of your branch, okay, shall I do this play along? Basically. Yeah, sure. Yep, that sounds good. I typically name my branches like I, for issue and the number, and then either dash or an underscore to separate it, and then basically the title of the issue that I gave it, maybe a little abbreviated, just to do that, when I'm looking in my branches, it makes it very easy to find it, and then when you're referencing it, for other people, it makes it easier to link back to the issues that they can read about the details, like why you're creating this branch. Okay, so the first thing I need to do is get the code from somewhere, so what do I need to do on the website? Yeah, right, so if you're on the website, if you look under the code tab, yeah, the very first, it says pull request, you find a lot load, and SSH, and there's that download repository. Right, so that gives you, you can select either HTTPS or SSH for the, and it'll give you the URL for when you're cloning, so then you could go to get cloned, and then if you're using SSH, you would use the SSH link if you're going to just use the HTTPS, you know, you'd click on that and copy that and paste it in to get you the HTTPS link. So I've put it in here, Gitton, Gitton, Ribo, blah, blah, blah, blah, blah, blah, blah, blah, blah, blah, there's probably some settings that you need to have done this before, so I know it's going to work. Yeah, I mean, it will prompt you for a password, if you don't have that, that's sort of thing. And you can put your SSH keys up there as well, all that sort of stuff, but presumably if you're submitting code, if you just want to make an issue, you go to the website, press the button, you're making a issue, that's it, you'll work here and stuff. If you're submitting code, presumably you've used Git before, and this will be how you do it. Okay, so I've now got that downloaded. Okay, so now is when you want to create your branch, your new branch to work on. So if I remember some of Cloud2's shows, I said, you get stars or something, that's even to get status. That'll show you, should show you, you're on the main branch. Yeah, I need to change into the directory first, start. Yeah, on branch main, lovely, great. So now you can type, get space, check out, space, dash B, space, with just like, what is it? I mean, it moves, I really. And with as Tati says, we shouldn't use short things. So let's just have a quick look here, Git space, what? Now, the Git checkout commands, the Git space checkout, and then you want to give it the dash B option that says you're creating a new branch and then you space and then the name of whatever name you want to give the branch. So I'm just opening the git check out page here, man, git, dash, check out. So git checkout, dash B. Yes. And so, what do I call it? Ken, I'm just going to score. Yeah, you can't call it whatever, whatever makes sense to you. I, like said, I usually would like, I, dash, 70, underscore, fix downloads, something like, for whatever you call it, the, you know, the first couple words, yeah, yeah, yeah, let me do that. Yeah, one sec, fix links to all of you. How about that? Sounds great. Sorry for the delay here, you know, hopefully the listeners won't hear and truncate silence, but to, okay. So I can just do that. I mean, else, git checkout, dash B, and then the name, and the else. No, once you've done that, then you can start making your changes. So when I do a git status now, it says, on branch, blah, nothing to come is working directly. Yep, that sounds correct. And now you just need to fire up your favorite text editor and make the changes. Okay. What I'm actually going to do is modify the review file with a extra dust because we don't want to be here all day. That's good. What can I add to this for the, I'll talk to Hacker Public Radio on the, yeah, I don't know. I don't know what to do. I'll ask you, else. And in the read me, yeah, you could put something to Hacker Public Radio, I don't know. Now the code is free. Or it could actually try fixing the episode link. You could do that, which one would that be? So I'm looking at the template directory. I'm going to just content template. Look at, let's look at the series, shall we first start? So I've got content series, content series episode, series update episode. So it's got to be one of those three. So where did you change it on the index page? Like on the main page, I think, is where you change the review page? Yeah, it's two certain places, but the easiest one for now is the series one have, okay. Yeah, there it is. So hold on, let me, let me fire up my editor real quick. So I can sort of walk you through some of that. Thank you. So it's actually in the, on the page that says, in depth series, I'm getting there with the series, I'll do. So on the, so there's two pages here, related to the series, this is the main top page with all the series and it's got in depth series as the main header and number of episodes and that sort of thing. And then inside of that, there's in and out of one. That deals with the number of episodes. So if I click on the accessibility one, for example, the resatient of, I'm gonna open that up. It also gives a description of the series. Right, that's all right. So which file were you looking in again, I missed it? So content dash series on just our episode.tpl.html and there's content dash series.tpl.html and I think the one I need is on just core episodes. Yes. So what I want to do is add some HTML in there, which is listen in org speaks or MP3 for us where the org speaks and can be three, link to the link to the page and it's going to be a small type. And back in the ticket itself, there's the PHP version. Right, okay, so that if you look down there where there's the four each at the end. Yep. And then in that there's a macro called show summary. Yep. So we need to find a show summary macro, which should be in kind, what did I call it? I think it's share euthills. So I'm open to share euthills.tpl.html and I'm just gonna go back and copy the macro name which is show underscore summary and go back to share euthills.tp. It's actually, I think there's a shared dash episode dash summary.tpl.html that's where I put it because I found it in several places shared episode summary.tpl with the one I'm guessing. Yeah, yeah, shared episode summary is where the macro is defined. Super, okay, for race, excellent, couldn't be better. So looking at that code, it says it's got the common symbol and so less than an exclamation mark dash dash percent space and then all cups macro and then the name of the sum, show summary. Bracket show comma hide holes, comma bracket space block and all cups percent dash dash square. So presumably that goes down for, done until the end section. So macro end of my book. Yep, yep, yep. So right, probably right above the end tag for the macro, there is the show dot summary. That's between two HTMLP, you know, a P opening and a P closing bracket. Yeah, far enough. And so I'm guessing, I haven't looked at HTML yet on the website that gets generated, but I'm guessing you put it down under there. So root, we've got tags which aren't being displayed, I see on this page. So what I'll do is I'll do a paste into the chest. This link will be in the show notes, the two different versions. Okay. And I'll just quickly make a little bit of an image, just so we have comparison one second. Yeah, that's not gonna work. Pisting it, an image into the momental chest is simple to work just as both way. So I'll paste it into metrics for you to see. Okay, right? Yes, I'm pretty sure that we can, if, I mean one way to test it would be to just stick some text right under there, like holder and then generate those pages or a page and see what it looks like. That's usually how I do it. Yeah, exactly. That's fine. You know what I'm gonna do is that very thing, I'm just gonna put in a, we have the message show BR. So that should be visible on the, so what we're trying to do here is basically identify the location where we need to have the code, but I think that defeats the purpose of this episode as such. So what I'll do is I'll just put in any thing at all for now. Sounds good. I mean, I do have a, if I can find it real quick, there is a macro for inserting. I think those links, I don't know if it'd be more mad at quite correctly, but that might be another way to do it. If I can find the macro, it was like, I was supposed to buy one of them getting, yes. Okay, so let's not worry about that. So what I'm gonna do in is put a HTML comment. I can comment in there that your code goes here basically and we'll see how we go further. Okay. Okay, now I've saved that. I'm at the change, persisting everything works, fantastic, and I'm ready to do the next step. Okay, so once you've made your change and you're happy with it, then you just do your normal, get, you know, get at the changed file. No, no, no, no, there's no normal. I've never done this before. Oh, okay, but I'm sorry, normal for me. So it's very good to get. So now I've changed my file, yeah, and I look at, it's, it's houses. Yeah. So chilling a modified file, yeah. Yep, should be showing a modified file. So then if those changes are what you're happy with, you would then do get, add, and then the path to that file. Yeah, just did that. I know it's modified file, yeah, get stuff is right. So modified files means they're now ready to be committed. So if, you know, you've got more files you wanted, add in this commit, you could then, you know, modify them and add them later, or you can make all the changes and add them all at one time, however you want to do it. But once you have them all, all the files are ready for a commit, then you would do your get commit. Okay, let's do that. Yes, as I would, patiently for you to tell me what to do. Okay, okay, so get commit should fire up. If you just do a plane, get commit. That should fire up your default text editor. Got a default text editor and it says here, so yeah. So at the top of the, it usually there's like a blanks line and then it'll like say, give you some instructions and then a list the files that have been modified and then you like, once any that are, it basically gives you sort of a get status at the bottom. So it'll say, you know, files that will be committed, files that have been changed and then files that are not tracked. Okay, so I've got one file modified. And I'll save this file and then this shall it? Well, so what you do is then give it a, that's where like up at the top, you make your commit message. So yeah, I've added, you know, I've added a line here. I've added a comment to file, as example, for HPR 3797, which is what this is going to be released us. Okay, sounds good. So then you would just hit save and then exit and get status says, nothing to commit, work and directory is clean. Right. So now you could like do more changes in commits. I mean, this is your local, you know, your local, get repository. So if, you know, you, you can do a short series of commits, just so that like you can go back. Ideally, I have everything tested and working at this point because I don't want to embarrass myself by pushing it up. But we're, that's fast forward to that. Happy day. Everything's ready. You want next. Okay, so you're happy and you're ready now to push your changes back up to the repository for everybody to review. So this is where you would do a get push command. But does that not push up to the main branch? Well, so yeah, so you have to get, so you have to give it a location. So basically the full command would be get space push, space origin, space the name of the branch. So origin says push it, you know, back up into the cloud and then the name of the branch is saying, I want to put it at that repository in the cloud on this branch. So what would you use for this? So I would do get space push, dash origin, dash origin or not dash origin, space origin, sorry. Space and then I usually just copy and paste the name of the branch from my stack. Like I usually do a status first and then I just copy and paste the branch name at the end of that. Yeah, doing that right now. So I have get space push, space origin, space i70, I'm just going to fix links to audio with obscure sounds good. So then you just hit enter and it should hopefully push it up or it will tell you if there are any issues. So no issues creation, you pull request and to repo, new branch, fix links to audio. Yep, all looks good. Right, so now if you go back over to your browser and you go back on to repo. That and on is host.com. Yep, and there. Okay, so now if you look at the branches, I see three branches that I'm going to make sure I'm not sure I refresh my screen, but let me click on the branch. So I'm looking at, I'm looking at, Ron Ford Sush, HP or underscore generator. And I see cold issues. Where would I see the, oh, yeah, I'm so bad. Yeah. So if you're on the code tab. Yeah, underneath that, yeah, there's a drop down that says branches, got you. Yeah, so there's like three branches right there. Yeah, and you can click, if you click on that, yeah, that'll give you. Yeah. So there, you'll see, you know, the default branch, I see branches, my I30 series name for pound name, branch, and then I see your new branch. And then if you look there, you will see in that row a new pull request. Yep, taking a look at it. If you're ready, yep, then you can click new pull request. Mm-hmm. Sorry, I'm just trying, and so then it'll give you a page and then you name your pull request or give it a title. I can't remember what it's the name field or title field. I usually do like left square bracket. I, so for this case, it would be like left square bracket, i70, right square bracket, it's space. And then I usually just reuse the name or, you know, some explanation of the issue name. It might change a little bit depending on the PR, but usually it's fairly close to just whatever issue name. I gave it. Sorry, I'm, with lost, okay. So back on the branch is page. Yep, got that. And do you see, and you see your, your branch? Yeah, and there's a button that says new, new, new, new, new, new, new, new, new, new, new pull request. Yeah, right next to the job. Yep, so if you click on that, that should bring up a new page to create a new pull request. Yeah, that's it, I see it there, yep. And then, and then, yeah, so then title or name, I give it is usually, you know, based on the issue number, so like left square bracket, i70, right square bracket, and then space, and then, and usually I just reuse most of the text of the issue title, or, you know, something close to that. So when I press the green button, new pull request. So then once you're on that page, then there is another green button, like once you've done filling out all the information, then you're actually submitting the new pull request to be generated on the, to be added to the server. Okay, so there, so I'm on a page here now that says new pull request select, select the branch to merge into the branch to pull from. So I'm going to merge into the main, I'm going to pull from this one. Or, and if I press new pull request, it requires me to fill in the comment. Yes. And that's where I put in the IIE 70. Yeah, there should be, I should have brought it. I'm trying to bring one up, hold on. Let me, let me jump in onto that other, my other branch, so I can pull up a new pull request, myself, so I can make sure we're on the same page. Sure. All right. Yeah, so you did, I haven't remembered that extra new pull request thing, but anyway. So yeah, so you put in the title, which I, for the title, I give it like, you know, the issue number in brackets, and then basically the issue, and then there's a space below to give a more detailed comment, depending on how big of change it is, you know, I'll just maybe give some backstory to it, or if I've made certain assumptions or changes to the code, I don't know, I just try to anything that might feel useful in the comment to future people, reading back to figure out why this was done. I try to put it in the, you know, some things are so small that you don't need much other things, if you're making a big, you know, pull request, you might need to explain some things. Okay, so that was that new pull request then, right? And I usually do like put a label, and if it's a bug, I put a bug, if it's a feature request, I put a feature request, that sort of thing. Okay, I'm gonna put it in the title as you suggest. Let me see, if I was painful. So I 70 fixed all of you, that actually should be a demo for HPR, let's do that. Okay, and then I can press create pull request, I guess. Yes, and then once that accepted, I should be able to refresh my screen and see your pull request. Okay, and I just completely forgot to take screenshots with us. Ah, are there two sort of this? Well, you now have the only open pull request. Okay, so let's leave it there. Can you just delete that one please because that's enough? So at this point as a contributor, we're done, and you just review the code and that would be that, yeah. Pretty much, yes. Okay, so let's leave it at that there. Thank you, that was very useful. Now I need to figure out stuff like the actual code, and we can do that all fine. Okay, guys, thanks very much for taking the time to do this. And tune in tomorrow for another exciting episode of Hacker Public Radio. You have been listening to Hacker Public Radio at Hacker Public Radio.org. Today's show was contributed by a HBR this night like yourself. If you ever thought of recording podcast, click on our contributally to find out how easy it may be. Hosting Prage VR has been kindly provided by an onsthost.com, internet archive, and our Sync.net. On this otherwise stages, today's show is released on our creative comments. Attribution for going to international license.