I was recently asked to write a post for the Beyond40 blog to offer an update on our local organizing efforts in Missouri. I needed to make a few edits after it was published and rather than just send an updated file, I wanted to make a pull request directly. I’d never used GIT or Codeberg but was happy to give it a try. I was having a variety of issues ranging from my creating keys that would not validate to then just getting a bit lost. So, over to Signal I went to request an assist and they suggested we do a call/screenshare. We did and now I get it. At their suggestion I’ve written up this brief tutorial for any other GIT/Codeberg newbies that might have need to post a story to the Beyond40 blog or their own Codeberg hosted site/blog…
Starting from the beginning, in very basic steps. Say I’ve written a blog post that I want to publish to the Beyond40 site. Before we proceed to the site, ensure that your post is formatted in Markdown and you’ll want to include YAML data at the top in this format:
- Login to my Codeberg account.
- Hop over to the Beyond40 Codeberg source page. Top right corner, click Fork. Note: This forking step only needs to happen once. Once done the Fork you have created will remain in your Repositories.
- Once forked I can now return to my profile and see the Beyond40 Repository listed in my Repositories. I click that and am taken to into my local profile repository. Relevant folders are here:
- Data/Authors will have an entry in the JSON format. Assets for the author entry include an Avatar.
- Blog posts are in the Content>Blog>recap folder
- With my local Markdown file ready to publish, I navigate to Content>Blog>recap where I’ll see an option to create or upload a new file. As I’ve written locally and have a saved file I’ll upload.
- In the upload dialog I’ll have the option to Commit directy to the main branch which is selected by deafult. Proceed.
- Once my file is uploaded I can open the post, click the pencil icon to edit. You’ll want to do your editing in the “raw” code view of the editor. Assuming there are some edits (there always are!) when committing changes remember to add a title and description of the changes. Again, commit to main branch is selected by default. I can go ahead and commit with my edits.
- Now, remember, all of this process has been happening in my repository. So, I’ve got a new story ready to go in my repository, the next step is to scroll to the top of the page where I’ll see the link on the top left: forked from Beyond40/pages-hugo-source. Clicking that link takes me back to the Beyond40 Repository where I can make a Pull Request.
- Click the Pull Request button then select the option in the button dropdown to pull from your repository. This will merge my story into the main repository.
That’s it. If you’re posting a new story or editing a story for Beyond40 make sure to message one of the admins to let them know you’ve made changes. All of these steps also apply to editing a story that has already been published to the website. The only difference being that, in step 4 above you uploaded a new file, when editing you’ll just be clicking the link to you’re already published article. This will initially open it in view mode. To edit you’ll click the little pencil icon on the right side which will open it to editing mode. Then edit, scroll to bottom of the page and title your edit and add a description if necessary. Then commit and repeat steps 7-8 above.
Also, it’s worth noting that anytime you come back to your repository you may notice that the main fork has since been changed and there will be an option to sync your local fork to the main. You’ll want to do that so that you’re version is up-to-date.