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

refactor: layout locations and code styling updates #6098

Merged
merged 4 commits into from
Nov 9, 2023
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: 2 additions & 2 deletions COLLABORATOR_GUIDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
- [Adding new pages](#adding-new-pages)
- [Create the page content](#create-the-page-content)
- [Translating pages](#translating-pages)
- [Creating Components](#creating-components)
- [Creating Components](#creating-react-components)
- [Styling a Component](#styling-a-component)
- [Best practices when creating a Component](#best-practices-when-creating-a-component)
- [How a new Component should look like when freshly created](#how-a-new-component-should-look-like-when-freshly-created)
Expand Down Expand Up @@ -141,7 +141,7 @@ layout: layout-name.hbs
```

> \[!NOTE]\
> A list of currently available Layouts is provided within `providers/layoutProvider` on the `getLegacyProviders` map.\
> A list of currently available Layouts is provided within `components/withLayout` on the `layoutComponents` map.\
> This is a temporary map and this map might change its location and be defined in a different way in the future.

### Translating Pages
Expand Down
4 changes: 2 additions & 2 deletions app/[locale]/[[...path]]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ export const viewport = DEFAULT_VIEWPORT;

// This generates each page's HTML Metadata
// @see https://nextjs.org/docs/app/api-reference/functions/generate-metadata
export const generateMetadata = async (c: DynamicParams) => {
const { path = [], locale = defaultLocale.code } = c.params;
export const generateMetadata = async ({ params }: DynamicParams) => {
const { path = [], locale = defaultLocale.code } = params;

const pathname = dynamicRouter.getPathname(path);

Expand Down
9 changes: 4 additions & 5 deletions app/sitemap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,14 @@ const sitemap = async (): Promise<MetadataRoute.Sitemap> => {

for (const locale of availableLocaleCodes) {
const routesForLanguage = await dynamicRouter.getRoutesByLanguage(locale);

paths.push(...routesForLanguage.map(route => `${locale}/${route}`));
paths.push(
...routesForLanguage.map(route => `${baseUrlAndPath}/${locale}/${route}`)
);
}

const currentDate = new Date().toISOString();

const appRoutes = paths.sort().map(route => `${baseUrlAndPath}/${route}`);

return [...appRoutes, ...EXTERNAL_LINKS_SITEMAP].map(route => ({
return [...paths, ...EXTERNAL_LINKS_SITEMAP].map(route => ({
url: route,
lastModified: currentDate,
changeFrequency: 'always',
Expand Down
2 changes: 1 addition & 1 deletion client-context.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { cache } from 'react';

import type { ClientSharedServerContext } from './types';
import type { ClientSharedServerContext } from '@/types';

// This allows us to have Server-Side Context's of the shared "contextual" data
// which includes the frontmatter, the current pathname from the dynamic segments
Expand Down
Loading