Skip to content

Commit

Permalink
fixed links to edit
Browse files Browse the repository at this point in the history
  • Loading branch information
PiffPaffM committed Aug 26, 2021
1 parent 538ca60 commit 1ba16e5
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 3 deletions.
4 changes: 3 additions & 1 deletion lib/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,12 @@ export const getStaticLayoutProps = async ({
content,
version,
docTitleSlug,
type,
}: {
content: string;
version?: string;
docTitleSlug: string;
type: string;
}) => {
const getHeadings = () => {
const headingLines = content
Expand All @@ -73,7 +75,7 @@ export const getStaticLayoutProps = async ({
const latestVersion = getLatestVersion();
const editOnGitHubLink = `https://github.com/deepset-ai/haystack-website/blob/source/docs/${
version || latestVersion
}/${docTitleSlug.replace("-", "_")}.mdx`;
}/${type}/${docTitleSlug.replace("-", "_")}.mdx`;

const stars = await getStargazersCount();

Expand Down
3 changes: 3 additions & 0 deletions pages/overview/[...slug].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -118,10 +118,13 @@ export const getStaticProps: GetStaticProps<StaticPageProps> = async ({

const version = getVersionFromParams(params.slug) || getLatestVersion();

const type = "overview";

const layoutProps = await getStaticLayoutProps({
content,
version,
docTitleSlug,
type,
});

return {
Expand Down
5 changes: 4 additions & 1 deletion pages/reference/[...slug].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export default function ReferenceDoc({
return (
<Layout
menu={menu}
editOnGitHubLink=""
editOnGitHubLink="https://github.com/deepset-ai/haystack/tree/master/haystack"
stars={stars}
toc={toc}
>
Expand Down Expand Up @@ -108,10 +108,13 @@ export const getStaticProps: GetStaticProps<StaticPageProps> = async ({
const { content } = matter(fileContentWithFrontMatter);
const { markup } = await markdownToHtml({ content, downloadUrl });

const type = "";

const layoutProps = await getStaticLayoutProps({
content,
version,
docTitleSlug,
type,
});

return {
Expand Down
5 changes: 4 additions & 1 deletion pages/tutorials/[...slug].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export default function TutorialDoc({
return (
<Layout
menu={menu}
editOnGitHubLink=""
editOnGitHubLink="https://github.com/deepset-ai/haystack/tree/master/tutorials"
stars={stars}
toc={toc}
>
Expand Down Expand Up @@ -106,10 +106,13 @@ export const getStaticProps: GetStaticProps<StaticPageProps> = async ({
const { content } = matter(fileContentWithFrontMatter);
const { markup } = await markdownToHtml({ content, downloadUrl });

const type = "";

const layoutProps = await getStaticLayoutProps({
content,
version,
docTitleSlug,
type,
});

return {
Expand Down
3 changes: 3 additions & 0 deletions pages/usage/[...slug].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -115,10 +115,13 @@ export const getStaticProps: GetStaticProps<StaticPageProps> = async ({

const version = getVersionFromParams(params.slug) || getLatestVersion();

const type = "usage";

const layoutProps = await getStaticLayoutProps({
content,
version,
docTitleSlug,
type,
});

return {
Expand Down

0 comments on commit 1ba16e5

Please sign in to comment.