Skip to content

When using code-tools: source: repo link to exact commit #4819

@kdheepak

Description

@kdheepak

Bug description

I think when linking to the source file, it would be nice if the code-tools: source: repo linked to exact commit for that file on GitHub.

For my personal blog, I used to do something like this:

const commit = child_process
  .spawnSync("git", ["log", "-n", "1", "--pretty=format:%H", "--", `${filename}`])
  .stdout.toString();
metadata.source = `https://github.com/kdheepak/blog/blob/${commit}/${filename}`;

Checklist

  • Please include a minimal, fully reproducible example in a single .qmd file? Please provide the whole file rather than the snippet you believe is causing the issue.
  • Please format your issue so it is easier for us to read the bug report.
  • Please document the RStudio IDE version you're running (if applicable), by providing the value displayed in the "About RStudio" main menu dialog?
  • Please document the operating system you're running. If on Linux, please provide the specific distribution.
  • Please provide the output of quarto check so we know which version of quarto and its dependencies you're running.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requesthtmlIssues with HTML and related web technology (html/css/scss/js)

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions