solomonkinard / public

Other
4 stars 2 forks source link

Inquiry about Git Web URL #15

Closed nikkizhu1999 closed 4 weeks ago

nikkizhu1999 commented 1 month ago

20240624-114850

Hi there, i want to replace the "doc" (which is the name of a project in GitLab) with parameters like "$ID". Do we have this? I would assume it is "$githubproject" or something, but it doesn't work

Looking forward to your reply, thanks! :)))

solomonkinard commented 1 month ago

If the online web url started from "https://example.com/doc/commit/", you'd be able to open the commit on the web by adding "$ID" at the end. But in your case you want to replace doc with a project. So the result would be "https://example.com/project/commit/$ID". It could be saved as a workspace only setting, like what's shown in the photo. Does that work, is this a bug, or a new feature request?

Screenshot 2024-06-24 at 00 12 08
nikkizhu1999 commented 1 month ago

Hi solomonkinard,

Yes, it works. However, what should I do if I have more than one repository, such as doc, doc2, and doc3? Currently, I have to manually change the settings from "https://example.com/doc/commit/" to "https://example.com/doc2/commit/" when the file belongs to doc2. Is there a parameter or method I can use to automatically fill in the appropriate URL based on the file's repository?

solomonkinard commented 1 month ago

Your new feature request has been rolled into 0.2.22 for you to enjoy. Hopefully it solves your problem. Just add a ".gitblame" file anywhere you want - to replace variables. Here the format.

{
  "openOnline": {
    "url": "https://example.com/$PROJECT/$ID",
    "replacements": {
      "$PROJECT": "doc1",
      "wHaTeVeR u WaNt": "tO rEpLaCe",,
      ...
    }
  }
}