Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Point docs links to current tag if available #5219

Merged
merged 1 commit into from
Mar 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions docs/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true
WORKDIR /usr/src/yarn-project
RUN ./bootstrap.sh

# Make COMMIT_TAG visible to build scripts
ARG COMMIT_TAG=""
ENV COMMIT_TAG=$COMMIT_TAG

WORKDIR /usr/src/docs
RUN yarn && yarn build

Expand Down
13 changes: 8 additions & 5 deletions docs/src/preprocess/include_code.js
Original file line number Diff line number Diff line change
Expand Up @@ -234,11 +234,14 @@ async function preprocessIncludeCode(markdownContent, filePath, rootDir) {
filePath
);

const relativeCodeFilePath = path.resolve(rootDir, codeFilePath);

let urlText = `${relativeCodeFilePath}#L${startLine}-L${endLine}`;
const tag = "master";
const url = `https://github.com/AztecProtocol/aztec-packages/blob/${tag}/${relativeCodeFilePath}#L${startLine}-L${endLine}`;
const relativeCodeFilePath = path
.resolve(rootDir, codeFilePath)
.replace(/^\//, "");
const urlText = `${relativeCodeFilePath}#L${startLine}-L${endLine}`;
const tag = process.env.COMMIT_TAG
? `aztec-packages-${process.env.COMMIT_TAG}`
: "master";
const url = `https://github.com/AztecProtocol/aztec-packages/blob/${tag}/${urlText}`;

const title = noTitle ? "" : `title="${identifier}"`;
const lineNumbers = noLineNumbers ? "" : "showLineNumbers";
Expand Down
Loading