Skip to content

Commit

Permalink
merge main
Browse files Browse the repository at this point in the history
  • Loading branch information
batdevis committed Sep 24, 2024
2 parents cec5c64 + fda6c3d commit 278be98
Show file tree
Hide file tree
Showing 94 changed files with 391 additions and 167 deletions.
6 changes: 0 additions & 6 deletions .changeset/breezy-seas-perform.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/calm-sloths-jog.md

This file was deleted.

5 changes: 5 additions & 0 deletions .changeset/cool-toes-hope.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"nextjs-website": minor
---

Add SEO to codecs and generate metadata in pages
5 changes: 0 additions & 5 deletions .changeset/eighty-dingos-move.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/mighty-hairs-exist.md

This file was deleted.

6 changes: 0 additions & 6 deletions .changeset/purple-garlics-wonder.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/rude-forks-provide.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/slimy-peas-lay.md

This file was deleted.

3 changes: 2 additions & 1 deletion .github/workflows/move_latest_tag.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ name: Move Latest Tag to New Commit
on:
push:
tags:
- '*'
# Trigger this workflow when a tag `nextjs-website@<sem-ver>` is pushed.
- 'nextjs-website@[0-9]+.[0-9]+.[0-9]+'
workflow_dispatch:
jobs:
move-latest-tag:
Expand Down
6 changes: 6 additions & 0 deletions apps/chatbot/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# chatbot

## 2.4.0

### Minor Changes

- d6f0518: Allowing the usage of Google Gemini generation and embedding models

## 2.3.0

### Minor Changes
Expand Down
2 changes: 1 addition & 1 deletion apps/chatbot/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "chatbot",
"version": "2.3.0",
"version": "2.4.0",
"private": true
}
2 changes: 1 addition & 1 deletion apps/chatbot/src/app/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ def find_or_create_session(userId: str):

return body


@app.get("/queries/{id}")
async def query_fetching(id: str):
# TODO: dynamoDB integration
Expand Down
6 changes: 6 additions & 0 deletions apps/infrastructure/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# infrastructure

## 1.1.0

### Minor Changes

- d6f0518: Allowing the usage of Google Gemini generation and embedding models

## 1.0.0

### Major Changes
Expand Down
2 changes: 1 addition & 1 deletion apps/infrastructure/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "infrastructure",
"version": "1.0.0",
"version": "1.1.0",
"private": true
}
14 changes: 14 additions & 0 deletions apps/nextjs-website/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
# nextjs-website

## 4.8.0

### Minor Changes

- 72c13cc: Add error alerts in chatbot chat

### Patch Changes

- d2b0c30: Change chatbot name, update chatbot first message and fix chatbot button size
- 617fef4: Fix the label of the guide links on the overview page
- bd9206d: Fix selectEmbedType method by adding 'design' option to Figma urls
- 3928519: Fix guidesTitle's position in Overview's PostIntegration component
- f683aa5: Fix Stats component layout in Solution's page

## 4.7.0

### Minor Changes
Expand Down
2 changes: 1 addition & 1 deletion apps/nextjs-website/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "nextjs-website",
"version": "4.7.0",
"version": "4.8.0",
"private": true,
"scripts": {
"download-docs": "./scripts/fetch-docs.sh docs/from-gitbook",
Expand Down
2 changes: 2 additions & 0 deletions apps/nextjs-website/src/_contents/makeDocs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { Product } from '@/lib/types/product';
import { parseDoc } from 'gitbook-docs/parseDoc';
import { BannerLinkProps } from '@/components/atoms/BannerLink/BannerLink';
import { SolutionTemplateProps } from '@/components/templates/SolutionTemplate/SolutionTemplate';
import { SEO } from '@/lib/types/seo';

export type TutorialsDefinition = {
readonly product: Product;
Expand All @@ -25,6 +26,7 @@ export type GuideDefinition = {
readonly dirName: string;
}>;
readonly bannerLinks: readonly BannerLinkProps[];
readonly seo?: SEO;
};

const parseDocOrThrow = flow(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,13 @@ import ProductLayout, {
import { Product } from '@/lib/types/product';
import ApiSection from '@/components/molecules/ApiSection/ApiSection';
import { Metadata, ResolvingMetadata } from 'next';
import { makeMetadata } from '@/helpers/metadata.helpers';
import {
makeMetadata,
makeMetadataFromStrapi,
} from '@/helpers/metadata.helpers';
import { ApiDataParams } from '@/lib/types/apiDataParams';
import PageNotFound from '@/app/not-found';
import { SEO } from '@/lib/types/seo';

export type ApiPageProps = {
readonly product?: Product;
Expand All @@ -18,6 +22,7 @@ export type ApiPageProps = {
url: string;
hideTryIt?: boolean;
}[];
readonly seo?: SEO;
} & ProductLayoutProps;

export async function generateStaticParams() {
Expand All @@ -31,6 +36,10 @@ export const generateMetadata = async (
const resolvedParent = await parent;
const ApiDataProps = await getApiData(params.apiDataSlug);

if (ApiDataProps?.seo) {
return makeMetadataFromStrapi(ApiDataProps.seo);
}

return makeMetadata({
title: ApiDataProps?.specURLsName,
description: ApiDataProps?.product?.description,
Expand Down
9 changes: 8 additions & 1 deletion apps/nextjs-website/src/app/[productSlug]/api/page.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
import ProductLayout from '@/components/organisms/ProductLayout/ProductLayout';
import ApiDataListTemplate from '@/components/templates/ApiDataListTemplate/ApiDataListTemplate';
import { baseUrl } from '@/config';
import { makeMetadata } from '@/helpers/metadata.helpers';
import {
makeMetadata,
makeMetadataFromStrapi,
} from '@/helpers/metadata.helpers';
import { getApiDataListPages, getProduct, getProductsSlugs } from '@/lib/api';
import { Metadata } from 'next';

Expand All @@ -22,6 +25,10 @@ export async function generateMetadata({
}): Promise<Metadata> {
const apiDataListPage = await getApiDataListPages(params?.productSlug);

if (apiDataListPage?.seo) {
return makeMetadataFromStrapi(apiDataListPage.seo);
}

return makeMetadata({
title: apiDataListPage?.hero.title,
url: `${baseUrl}/${apiDataListPage?.product.slug}/api`,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,10 @@ import {
} from '@/_contents/products';
import { ParseContentConfig } from 'gitbook-docs/parseContent';
import { Metadata } from 'next';
import { makeMetadata } from '@/helpers/metadata.helpers';
import {
makeMetadata,
makeMetadataFromStrapi,
} from '@/helpers/metadata.helpers';
import GitBookTemplate from '@/components/templates/GitBookTemplate/GitBookTemplate';
import { productPageToBreadcrumbs } from '@/helpers/breadcrumbs.helpers';
import { getGuidesProps } from '@/lib/cmsApi';
Expand Down Expand Up @@ -54,8 +57,13 @@ export async function generateMetadata({
}): Promise<Metadata> {
const {
page: { path, title },
seo,
} = await getGuide(params?.productSlug, params?.productGuidePage ?? ['']);

if (seo) {
return makeMetadataFromStrapi(seo);
}

return makeMetadata({
title,
url: path,
Expand Down
13 changes: 11 additions & 2 deletions apps/nextjs-website/src/app/[productSlug]/guides/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,13 @@ import ProductLayout, {
} from '@/components/organisms/ProductLayout/ProductLayout';
import { ProductParams } from '@/lib/types/productParams';
import { Metadata, ResolvingMetadata } from 'next';
import { makeMetadata } from '@/helpers/metadata.helpers';
import {
makeMetadata,
makeMetadataFromStrapi,
} from '@/helpers/metadata.helpers';
import { BannerLinkProps } from '@/components/atoms/BannerLink/BannerLink';
import { getGuideListPagesProps } from '@/lib/cmsApi';
import { SEO } from '@/lib/types/seo';

export async function generateStaticParams() {
return (await getGuideListPagesProps()).map(({ product }) => ({
Expand All @@ -29,14 +33,19 @@ export type GuidesPageProps = {
};
readonly guidesSections?: GuidesSectionProps[];
readonly bannerLinks?: readonly BannerLinkProps[];
readonly seo?: SEO;
} & ProductLayoutProps;

export const generateMetadata = async (
{ params }: ProductParams,
parent: ResolvingMetadata
): Promise<Metadata> => {
const resolvedParent = await parent;
const { path, abstract } = await getGuideLists(params?.productSlug);
const { path, abstract, seo } = await getGuideLists(params?.productSlug);

if (seo) {
return makeMetadataFromStrapi(seo);
}

return makeMetadata({
title: abstract?.title,
Expand Down
13 changes: 11 additions & 2 deletions apps/nextjs-website/src/app/[productSlug]/overview/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,12 @@ import { FeatureItem } from '@/editorialComponents/Feature/FeatureStackItem';
import { GuideCardProps } from '@/components/molecules/GuideCard/GuideCard';
import PostIntegration from '@/components/organisms/PostIntegration/PostIntegration';
import { ProductParams } from '@/lib/types/productParams';
import { makeMetadata } from '@/helpers/metadata.helpers';
import {
makeMetadata,
makeMetadataFromStrapi,
} from '@/helpers/metadata.helpers';
import { getOverviewsProps } from '@/lib/cmsApi';
import { SEO } from '@/lib/types/seo';

const MAX_NUM_TUTORIALS_IN_OVERVIEW = 3;

Expand Down Expand Up @@ -87,14 +91,19 @@ export type OverviewPageProps = {
href: string;
}[];
};
readonly seo?: SEO;
} & ProductLayoutProps;

export async function generateMetadata(
{ params }: ProductParams,
parent: ResolvingMetadata
): Promise<Metadata> {
const resolvedParent = await parent;
const { product, path } = await getOverview(params.productSlug);
const { product, path, seo } = await getOverview(params.productSlug);

if (seo) {
return makeMetadataFromStrapi(seo);
}

return makeMetadata({
parent: resolvedParent,
Expand Down
14 changes: 11 additions & 3 deletions apps/nextjs-website/src/app/[productSlug]/quick-start/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,11 @@ import QuickStartGuideStepper from '@/components/molecules/QuickStartGuideSteppe
import { Step } from '@/lib/types/step';
import { ProductParams } from '@/lib/types/productParams';
import { Metadata, ResolvingMetadata } from 'next';
import { makeMetadata } from '@/helpers/metadata.helpers';
import { Box, Divider } from '@mui/material';
import {
makeMetadata,
makeMetadataFromStrapi,
} from '@/helpers/metadata.helpers';
import { SEO } from '@/lib/types/seo';

export async function generateStaticParams() {
return [...getProductsSlugs('quickStart')].map((productSlug) => ({
Expand All @@ -25,17 +28,22 @@ export type QuickStartGuidePageProps = {
};
readonly defaultStepAnchor?: string;
readonly steps?: ReadonlyArray<Step>;
readonly seo?: SEO;
} & ProductLayoutProps;

export async function generateMetadata(
{ params }: ProductParams,
parent: ResolvingMetadata
): Promise<Metadata> {
const resolvedParent = await parent;
const { abstract, path, product } = await getQuickStartGuide(
const { abstract, path, product, seo } = await getQuickStartGuide(
params?.productSlug
);

if (seo) {
return makeMetadataFromStrapi(seo);
}

return makeMetadata({
parent: resolvedParent,
title: abstract?.title,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,10 @@ import {
} from '@/_contents/products';
import { ParseContentConfig } from 'gitbook-docs/parseContent';
import { Metadata } from 'next';
import { makeMetadata } from '@/helpers/metadata.helpers';
import {
makeMetadata,
makeMetadataFromStrapi,
} from '@/helpers/metadata.helpers';
import GuideInPageMenu from '@/components/organisms/GuideInPageMenu/GuideInPageMenu';
import { translations } from '@/_contents/translations';
import RelatedLinks, {
Expand Down Expand Up @@ -60,7 +63,12 @@ export async function generateMetadata({
tutorialPath,
]);
if (strapiTutorialProps) {
const { title, path } = strapiTutorialProps;
const { title, path, seo } = strapiTutorialProps;

if (seo) {
return makeMetadataFromStrapi(seo);
}

return makeMetadata({
title,
url: path,
Expand Down
Loading

0 comments on commit 278be98

Please sign in to comment.