Bot releases are visible (Hide)
Published by github-actions[bot] about 1 year ago
getPage
method to Makeswift client.LinkControl
and Button
component if available.page-pathname-slices
.Published by github-actions[bot] about 1 year ago
Published by github-actions[bot] about 1 year ago
translatable-data
API handler to handle opional values for composable controls.Published by github-actions[bot] about 1 year ago
hreflang
tag to the HTML <head>
for pages that have localized versions. Click here to learn more about hreflang
tag.Published by github-actions[bot] about 1 year ago
0.11.3
.Published by github-actions[bot] about 1 year ago
feae6ba: Added merge-translated-data
API handler to merge translated data back into a Makeswift page.
To use this translation merging functionality, make sure to pass an instance of ReactRuntime
to the Makeswift API handler like so:
import { MakeswiftApiHandler } from '@makeswift/runtime/next'
import { runtime } from '../../../lib/makeswift/register-components'
export default MakeswiftApiHandler(process.env.MAKESWIFT_SITE_API_KEY, {
runtime,
})
Published by github-actions[bot] about 1 year ago
c630617: Add locale option to getSitemap
. If a locale is using domain-based localization, passing the locale to getSitemap
will return the sitemap for that particular domain.
For example, if in the site settings there is an es
locale with a domain of foo.es
, then passing es
to getSitemap
will return the sitemap for foo.es
.
Published by github-actions[bot] about 1 year ago
RichText
.Published by github-actions[bot] about 1 year ago
935ca2b: This version includes the stable release of the localization feature.
With this feature, you can create different variations of a page. For example, if you have a /pricing
page that you want to localize for Spanish-speaking countries, you can add an es
locale, and create a /es/pricing
page.
If you have used the unstable version before, here are the steps required to migrate to the stable version:
unstable_i18n
on the ReactRuntime
.unstable_locale
to locale
on the getPageSnapshot
.Now, all locales and default locale can be managed directly in the settings in the builder, on the Locales tab.
You can also add the domain on the locale if you want to use domain-based localization. For example, if your main domain is company.com
, on your es
locale, you can add the company.es
domain to make it the domain for your Spanish version of the site.
If you're interested in this feature, reach out to our support at [email protected].
Published by github-actions[bot] about 1 year ago
Published by github-actions[bot] about 1 year ago
Published by github-actions[bot] about 1 year ago
Published by github-actions[bot] about 1 year ago
Published by github-actions[bot] about 1 year ago
Published by github-actions[bot] about 1 year ago
Published by github-actions[bot] about 1 year ago
Published by github-actions[bot] about 1 year ago
Published by github-actions[bot] about 1 year ago
Published by github-actions[bot] about 1 year ago
b8e8124: Add getSitemap
to Makeswift client.
Use this method to generate a sitemap for your Makeswift host. Here's an example using the popular library next-sitemap
:
import { makeswift } from '@lib/makeswift'
import { GetServerSidePropsContext, GetServerSidePropsResult } from 'next'
import { getServerSideSitemapLegacy } from 'next-sitemap'
export async function getServerSideProps(
ctx: GetServerSidePropsContext,
): Promise<GetServerSidePropsResult<{}>> {
const sitemap = await makeswift.getSitemap()
return getServerSideSitemapLegacy(ctx, sitemap)
}
export default function Sitemap() {}
The getSitemap
method is paginated with a default page size of 50
. If you want to request more pages or use a different page size pass the limit
and after
arguments. Here's an example:
const sitemap: Sitemap = []
let page
let after: string | undefined = undefined
do {
page = await makeswift.getSitemap({ limit: 10, after })
sitemap.push(...page)
after = page.at(-1)?.id
} while (page.length > 0)
If using TypeScript, you can import the Sitemap
type from @makeswift/runtime/next
.
Also, the getSitemap
method supports filtering results by a pathname prefix using the pathnamePrefix
parameter. Here's an example using the popular library next-sitemap
:
import { makeswift } from '@lib/makeswift'
import { GetServerSidePropsContext, GetServerSidePropsResult } from 'next'
import { getServerSideSitemapLegacy } from 'next-sitemap'
export async function getServerSideProps(
ctx: GetServerSidePropsContext,
): Promise<GetServerSidePropsResult<{}>> {
const blogSitemap = await makeswift.getSitemap({ pathnamePrefix: '/blog/' })
return getServerSideSitemapLegacy(ctx, blogSitemap)
}
export default function BlogSitemap() {}
Published by github-actions[bot] about 1 year ago