Skip to content

Commit

Permalink
dont show edit source for ipynb
Browse files Browse the repository at this point in the history
  • Loading branch information
jjallaire committed Apr 13, 2022
1 parent c0370bf commit 5c21866
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions src/project/types/website/website-navigation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ import {
HtmlPostProcessResult,
kHtmlEmptyPostProcessResult,
} from "../../../command/render/types.ts";
import { isJupyterNotebook } from "../../../core/jupyter/jupyter.ts";

// static navigation (initialized during project preRender)
const navigation: Navigation = {
Expand Down Expand Up @@ -603,10 +604,14 @@ function repoActionLinks(
return actions.map((action) => {
switch (action) {
case "edit":
return {
text: language[kRepoActionLinksEdit],
url: `${repoInfo.baseUrl}edit/${branch}/${repoInfo.path}${source}`,
};
if (!isJupyterNotebook(source)) {
return {
text: language[kRepoActionLinksEdit],
url: `${repoInfo.baseUrl}edit/${branch}/${repoInfo.path}${source}`,
};
} else {
return null;
}
case "source":
return {
text: language[kRepoActionLinksSource],
Expand Down

0 comments on commit 5c21866

Please sign in to comment.