Open rempsyc opened 2 years ago
/master
seems to be a vestige of the time before the transition to main
, and accordingly, the adapted URL does work as expected:
https://github.com/RemPsyc/rempsyc/commits/main
And can be changed in the rmarkdown readme
manually [edit: that's incorrect after all]. I just wonder if the badge_last_change()
function should be updated to reflect this, or at least whether the documentation should be updated to warn users about the change.
Actually, after further testing I thought that changing the link from /master
to /main
directly in the readme
would work but alas it does not because it also adds an unwanted /blob/main
which my repository doesn't have:
https://github.com/RemPsyc/rempsyc/blob/main/commits/main
Whereas the correct link should be:
https://github.com/RemPsyc/rempsyc/commits/main
So I have no working fix or workaround so far.
Hi Remy @RemPsyc , I would think switching to main would be much easier. I haven't touched this package in a while and I'm super busy, so I'm open to a pull request if you have one. I wish I changed this to main earlier, because I have changed almost all my repos to main
Thanks for your answer. I have never submitted a PR before, but I'm open to trying it. I've looked into it briefly but I'm already facing a few roadblocks.
badge_last_change()
in: https://github.com/RMHogervorst/badgecreatr/tree/master/REdit: Oh they're actually all in the same badges.R
file! https://github.com/RMHogervorst/badgecreatr/blob/master/R/badges.R
referlink = "/commits/master"
argument to referlink = "/commits/main"
inside the badge_last_change()
function but it still adds the blob/main
bit and I don't know where it's coming from since the rmarkdown code it outputs is this:[![Last-changedate](https://img.shields.io/badge/last%20change-`r gsub('-', '--', Sys.Date())`-yellowgreen.svg)](/commits/main)"
Where can I change the blob/main
then?
Ok one workaround for individual users (not related to the PR) is to simply put the full link at the end, like below, then it will work:
[![Last-changedate](https://img.shields.io/badge/last%20change-`r gsub('-', '--', Sys.Date())`-yellowgreen.svg)](https://github.com/RemPsyc/rempsyc/commits/main)
The following command:
badge_last_change(location = ".")
creates the following rmarkdown code:But on my package page, the link created on the badge (https://github.com/RemPsyc/rempsyc/commits/master) seems invalid and leads to the following GitHub error page:
404: This is not the web page you are looking for.
Indeed I do have a
/commits
but no/master
directory. I've tried changing the location argument but it always output the same result:Any idea what I'm doing wrong?