Skip to content

Open source website builder and Webflow alternative. Webstudio is an advanced visual builder that connects to any headless CMS, supports all CSS properties, and can be hosted anywhere, including with us.

fix: add page meta to published sites

Andras Bacsaic9ebf4c01ae5
diff --git a/packages/http-client/package.json b/packages/http-client/package.json
index 31ecf5644d..3fd785de35 100644
--- a/packages/http-client/package.json
+++ b/packages/http-client/package.json
@@ -1,6 +1,6 @@
{
"name": "@webstudio-is/http-client",
- "version": "0.2.0",
+ "version": "0.3.0",
"description": "Webstudio HTTP Client",
"author": "Webstudio <[email protected]>",
"homepage": "https://webstudio.is",
diff --git a/packages/http-client/src/index.d.ts b/packages/http-client/src/index.d.ts
index e6da2f1621..8a14becff7 100644
--- a/packages/http-client/src/index.d.ts
+++ b/packages/http-client/src/index.d.ts
@@ -12,6 +12,7 @@ export type Page = {
};
export type Project = {
[include in string]: {
+ page: Page;
tree: BaseInstance & { errors: string };
props: Array<UserProp> & { errors: string };
breakpoints: Array<Breakpoint> & {
diff --git a/packages/http-client/src/index.ts b/packages/http-client/src/index.ts
index f2b3c4a444..4ae944e962 100644
--- a/packages/http-client/src/index.ts
+++ b/packages/http-client/src/index.ts
@@ -30,21 +30,25 @@ export const loadProject = async ({
const breakpointsUrl = new URL(`/rest/breakpoints/${projectId}`, baseUrl);
const cssUrl = new URL(`/rest/css/${projectId}/${id}`, baseUrl);
urls.push({
+ page: { ...homePage },
url: treeUrl,
path: "/",
type: "tree",
});
urls.push({
+ page: { ...homePage },
url: propsUrl,
path: "/",
type: "props",
});
urls.push({
+ page: { ...homePage },
url: breakpointsUrl,
path: "/",
type: "breakpoints",
});
urls.push({
+ page: { ...homePage },
url: cssUrl,
path: "/",
type: "css",
@@ -59,18 +63,21 @@ export const loadProject = async ({
const cssUrl = new URL(`/rest/css/${projectId}/${id}`, baseUrl);
urls.push({
+ page,
url: treeUrl,
path,
type: "tree",
});
urls.push({
+ page,
url: propsUrl,
path,
type: "props",
});
urls.push({
+ page,
url: cssUrl,
path,
type: "css",
@@ -86,6 +93,7 @@ export const loadProject = async ({
const res = await fetch(url.url);
if (res.ok) {
return {
+ page: url.page,
path: url.path,
type: url.type,
data: url.type === "css" ? await res.text() : await res.json(),
@@ -100,10 +108,11 @@ export const loadProject = async ({
if (Object.keys(data).length > 0) {
for (const page of data) {
if (page && page.path && page.type && page.data) {
- const { path, type, data } = page;
+ const { path, type } = page;
gatheredPages[path] = {
...gatheredPages[path],
- [type]: data,
+ page: page.page,
+ [type]: page.data,
breakpoints: breakpoints?.data || {},
};
}