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.

refactor: merge exclude from search flags (#3765)

Bogdan Chadkin1c3e878ca024
diff --git a/fixtures/webstudio-cloudflare-template/app/routes/_index.tsx b/fixtures/webstudio-cloudflare-template/app/routes/_index.tsx
index ea8c7443e6..4987ac6bde 100644
--- a/fixtures/webstudio-cloudflare-template/app/routes/_index.tsx
+++ b/fixtures/webstudio-cloudflare-template/app/routes/_index.tsx
@@ -65,11 +65,14 @@ export const loader = async (arg: LoaderFunctionArgs) => {
// typecheck
arg.context.EXCLUDE_FROM_SEARCH satisfies boolean;
+ if (arg.context.EXCLUDE_FROM_SEARCH) {
+ pageMeta.excludePageFromSearch = arg.context.EXCLUDE_FROM_SEARCH;
+ }
+
return json(
{
host,
url: url.href,
- excludeFromSearch: arg.context.EXCLUDE_FROM_SEARCH,
system,
resources,
pageMeta,
@@ -133,7 +136,7 @@ export const meta: MetaFunction<typeof loader> = ({ data }) => {
});
}
- if (pageMeta.excludePageFromSearch || data.excludeFromSearch) {
+ if (pageMeta.excludePageFromSearch) {
metas.push({
name: "robots",
content: "noindex, nofollow",
diff --git a/fixtures/webstudio-custom-template/app/routes/[script-test]._index.tsx b/fixtures/webstudio-custom-template/app/routes/[script-test]._index.tsx
index 270e61a673..a8a339ab5b 100644
--- a/fixtures/webstudio-custom-template/app/routes/[script-test]._index.tsx
+++ b/fixtures/webstudio-custom-template/app/routes/[script-test]._index.tsx
@@ -65,11 +65,14 @@ export const loader = async (arg: LoaderFunctionArgs) => {
// typecheck
arg.context.EXCLUDE_FROM_SEARCH satisfies boolean;
+ if (arg.context.EXCLUDE_FROM_SEARCH) {
+ pageMeta.excludePageFromSearch = arg.context.EXCLUDE_FROM_SEARCH;
+ }
+
return json(
{
host,
url: url.href,
- excludeFromSearch: arg.context.EXCLUDE_FROM_SEARCH,
system,
resources,
pageMeta,
@@ -133,7 +136,7 @@ export const meta: MetaFunction<typeof loader> = ({ data }) => {
});
}
- if (pageMeta.excludePageFromSearch || data.excludeFromSearch) {
+ if (pageMeta.excludePageFromSearch) {
metas.push({
name: "robots",
content: "noindex, nofollow",
diff --git a/fixtures/webstudio-custom-template/app/routes/[world]._index.tsx b/fixtures/webstudio-custom-template/app/routes/[world]._index.tsx
index e191181261..0aec9c9eb2 100644
--- a/fixtures/webstudio-custom-template/app/routes/[world]._index.tsx
+++ b/fixtures/webstudio-custom-template/app/routes/[world]._index.tsx
@@ -65,11 +65,14 @@ export const loader = async (arg: LoaderFunctionArgs) => {
// typecheck
arg.context.EXCLUDE_FROM_SEARCH satisfies boolean;
+ if (arg.context.EXCLUDE_FROM_SEARCH) {
+ pageMeta.excludePageFromSearch = arg.context.EXCLUDE_FROM_SEARCH;
+ }
+
return json(
{
host,
url: url.href,
- excludeFromSearch: arg.context.EXCLUDE_FROM_SEARCH,
system,
resources,
pageMeta,
@@ -133,7 +136,7 @@ export const meta: MetaFunction<typeof loader> = ({ data }) => {
});
}
- if (pageMeta.excludePageFromSearch || data.excludeFromSearch) {
+ if (pageMeta.excludePageFromSearch) {
metas.push({
name: "robots",
content: "noindex, nofollow",
diff --git a/fixtures/webstudio-custom-template/app/routes/_index.tsx b/fixtures/webstudio-custom-template/app/routes/_index.tsx
index ea8c7443e6..4987ac6bde 100644
--- a/fixtures/webstudio-custom-template/app/routes/_index.tsx
+++ b/fixtures/webstudio-custom-template/app/routes/_index.tsx
@@ -65,11 +65,14 @@ export const loader = async (arg: LoaderFunctionArgs) => {
// typecheck
arg.context.EXCLUDE_FROM_SEARCH satisfies boolean;
+ if (arg.context.EXCLUDE_FROM_SEARCH) {
+ pageMeta.excludePageFromSearch = arg.context.EXCLUDE_FROM_SEARCH;
+ }
+
return json(
{
host,
url: url.href,
- excludeFromSearch: arg.context.EXCLUDE_FROM_SEARCH,
system,
resources,
pageMeta,
@@ -133,7 +136,7 @@ export const meta: MetaFunction<typeof loader> = ({ data }) => {
});
}
- if (pageMeta.excludePageFromSearch || data.excludeFromSearch) {
+ if (pageMeta.excludePageFromSearch) {
metas.push({
name: "robots",
content: "noindex, nofollow",
diff --git a/fixtures/webstudio-remix-netlify-edge-functions/app/routes/_index.tsx b/fixtures/webstudio-remix-netlify-edge-functions/app/routes/_index.tsx
index ea8c7443e6..4987ac6bde 100644
--- a/fixtures/webstudio-remix-netlify-edge-functions/app/routes/_index.tsx
+++ b/fixtures/webstudio-remix-netlify-edge-functions/app/routes/_index.tsx
@@ -65,11 +65,14 @@ export const loader = async (arg: LoaderFunctionArgs) => {
// typecheck
arg.context.EXCLUDE_FROM_SEARCH satisfies boolean;
+ if (arg.context.EXCLUDE_FROM_SEARCH) {
+ pageMeta.excludePageFromSearch = arg.context.EXCLUDE_FROM_SEARCH;
+ }
+
return json(
{
host,
url: url.href,
- excludeFromSearch: arg.context.EXCLUDE_FROM_SEARCH,
system,
resources,
pageMeta,
@@ -133,7 +136,7 @@ export const meta: MetaFunction<typeof loader> = ({ data }) => {
});
}
- if (pageMeta.excludePageFromSearch || data.excludeFromSearch) {
+ if (pageMeta.excludePageFromSearch) {
metas.push({
name: "robots",
content: "noindex, nofollow",
diff --git a/fixtures/webstudio-remix-netlify-functions/app/routes/_index.tsx b/fixtures/webstudio-remix-netlify-functions/app/routes/_index.tsx
index ea8c7443e6..4987ac6bde 100644
--- a/fixtures/webstudio-remix-netlify-functions/app/routes/_index.tsx
+++ b/fixtures/webstudio-remix-netlify-functions/app/routes/_index.tsx
@@ -65,11 +65,14 @@ export const loader = async (arg: LoaderFunctionArgs) => {
// typecheck
arg.context.EXCLUDE_FROM_SEARCH satisfies boolean;
+ if (arg.context.EXCLUDE_FROM_SEARCH) {
+ pageMeta.excludePageFromSearch = arg.context.EXCLUDE_FROM_SEARCH;
+ }
+
return json(
{
host,
url: url.href,
- excludeFromSearch: arg.context.EXCLUDE_FROM_SEARCH,
system,
resources,
pageMeta,
@@ -133,7 +136,7 @@ export const meta: MetaFunction<typeof loader> = ({ data }) => {
});
}
- if (pageMeta.excludePageFromSearch || data.excludeFromSearch) {
+ if (pageMeta.excludePageFromSearch) {
metas.push({
name: "robots",
content: "noindex, nofollow",
diff --git a/fixtures/webstudio-remix-vercel/app/routes/[_route_with_symbols_]._index.tsx b/fixtures/webstudio-remix-vercel/app/routes/[_route_with_symbols_]._index.tsx
index 0172e0534d..3719c7868a 100644
--- a/fixtures/webstudio-remix-vercel/app/routes/[_route_with_symbols_]._index.tsx
+++ b/fixtures/webstudio-remix-vercel/app/routes/[_route_with_symbols_]._index.tsx
@@ -65,11 +65,14 @@ export const loader = async (arg: LoaderFunctionArgs) => {
// typecheck
arg.context.EXCLUDE_FROM_SEARCH satisfies boolean;
+ if (arg.context.EXCLUDE_FROM_SEARCH) {
+ pageMeta.excludePageFromSearch = arg.context.EXCLUDE_FROM_SEARCH;
+ }
+
return json(
{
host,
url: url.href,
- excludeFromSearch: arg.context.EXCLUDE_FROM_SEARCH,
system,
resources,
pageMeta,
@@ -133,7 +136,7 @@ export const meta: MetaFunction<typeof loader> = ({ data }) => {
});
}
- if (pageMeta.excludePageFromSearch || data.excludeFromSearch) {
+ if (pageMeta.excludePageFromSearch) {
metas.push({
name: "robots",
content: "noindex, nofollow",
diff --git a/fixtures/webstudio-remix-vercel/app/routes/[form]._index.tsx b/fixtures/webstudio-remix-vercel/app/routes/[form]._index.tsx
index b58046d4f3..f9d4ee6ab0 100644
--- a/fixtures/webstudio-remix-vercel/app/routes/[form]._index.tsx
+++ b/fixtures/webstudio-remix-vercel/app/routes/[form]._index.tsx
@@ -65,11 +65,14 @@ export const loader = async (arg: LoaderFunctionArgs) => {
// typecheck
arg.context.EXCLUDE_FROM_SEARCH satisfies boolean;
+ if (arg.context.EXCLUDE_FROM_SEARCH) {
+ pageMeta.excludePageFromSearch = arg.context.EXCLUDE_FROM_SEARCH;
+ }
+
return json(
{
host,
url: url.href,
- excludeFromSearch: arg.context.EXCLUDE_FROM_SEARCH,
system,
resources,
pageMeta,
@@ -133,7 +136,7 @@ export const meta: MetaFunction<typeof loader> = ({ data }) => {
});
}
- if (pageMeta.excludePageFromSearch || data.excludeFromSearch) {
+ if (pageMeta.excludePageFromSearch) {
metas.push({
name: "robots",
content: "noindex, nofollow",
diff --git a/fixtures/webstudio-remix-vercel/app/routes/[heading-with-id]._index.tsx b/fixtures/webstudio-remix-vercel/app/routes/[heading-with-id]._index.tsx
index d91b50ccbc..b6dbae013b 100644
--- a/fixtures/webstudio-remix-vercel/app/routes/[heading-with-id]._index.tsx
+++ b/fixtures/webstudio-remix-vercel/app/routes/[heading-with-id]._index.tsx
@@ -65,11 +65,14 @@ export const loader = async (arg: LoaderFunctionArgs) => {
// typecheck
arg.context.EXCLUDE_FROM_SEARCH satisfies boolean;
+ if (arg.context.EXCLUDE_FROM_SEARCH) {
+ pageMeta.excludePageFromSearch = arg.context.EXCLUDE_FROM_SEARCH;
+ }
+
return json(
{
host,
url: url.href,
- excludeFromSearch: arg.context.EXCLUDE_FROM_SEARCH,
system,
resources,
pageMeta,
@@ -133,7 +136,7 @@ export const meta: MetaFunction<typeof loader> = ({ data }) => {
});
}
- if (pageMeta.excludePageFromSearch || data.excludeFromSearch) {
+ if (pageMeta.excludePageFromSearch) {
metas.push({
name: "robots",
content: "noindex, nofollow",
diff --git a/fixtures/webstudio-remix-vercel/app/routes/[nested].[nested-page]._index.tsx b/fixtures/webstudio-remix-vercel/app/routes/[nested].[nested-page]._index.tsx
index 426b367a98..be58b73e09 100644
--- a/fixtures/webstudio-remix-vercel/app/routes/[nested].[nested-page]._index.tsx
+++ b/fixtures/webstudio-remix-vercel/app/routes/[nested].[nested-page]._index.tsx
@@ -65,11 +65,14 @@ export const loader = async (arg: LoaderFunctionArgs) => {
// typecheck
arg.context.EXCLUDE_FROM_SEARCH satisfies boolean;
+ if (arg.context.EXCLUDE_FROM_SEARCH) {
+ pageMeta.excludePageFromSearch = arg.context.EXCLUDE_FROM_SEARCH;
+ }
+
return json(
{
host,
url: url.href,
- excludeFromSearch: arg.context.EXCLUDE_FROM_SEARCH,
system,
resources,
pageMeta,
@@ -133,7 +136,7 @@ export const meta: MetaFunction<typeof loader> = ({ data }) => {
});
}
- if (pageMeta.excludePageFromSearch || data.excludeFromSearch) {
+ if (pageMeta.excludePageFromSearch) {
metas.push({
name: "robots",
content: "noindex, nofollow",
diff --git a/fixtures/webstudio-remix-vercel/app/routes/[radix]._index.tsx b/fixtures/webstudio-remix-vercel/app/routes/[radix]._index.tsx
index 7b891cbe64..35829b7683 100644
--- a/fixtures/webstudio-remix-vercel/app/routes/[radix]._index.tsx
+++ b/fixtures/webstudio-remix-vercel/app/routes/[radix]._index.tsx
@@ -65,11 +65,14 @@ export const loader = async (arg: LoaderFunctionArgs) => {
// typecheck
arg.context.EXCLUDE_FROM_SEARCH satisfies boolean;
+ if (arg.context.EXCLUDE_FROM_SEARCH) {
+ pageMeta.excludePageFromSearch = arg.context.EXCLUDE_FROM_SEARCH;
+ }
+
return json(
{
host,
url: url.href,
- excludeFromSearch: arg.context.EXCLUDE_FROM_SEARCH,
system,
resources,
pageMeta,
@@ -133,7 +136,7 @@ export const meta: MetaFunction<typeof loader> = ({ data }) => {
});
}
- if (pageMeta.excludePageFromSearch || data.excludeFromSearch) {
+ if (pageMeta.excludePageFromSearch) {
metas.push({
name: "robots",
content: "noindex, nofollow",
diff --git a/fixtures/webstudio-remix-vercel/app/routes/[resources]._index.tsx b/fixtures/webstudio-remix-vercel/app/routes/[resources]._index.tsx
index 1c09cd463b..035fbff60f 100644
--- a/fixtures/webstudio-remix-vercel/app/routes/[resources]._index.tsx
+++ b/fixtures/webstudio-remix-vercel/app/routes/[resources]._index.tsx
@@ -65,11 +65,14 @@ export const loader = async (arg: LoaderFunctionArgs) => {
// typecheck
arg.context.EXCLUDE_FROM_SEARCH satisfies boolean;
+ if (arg.context.EXCLUDE_FROM_SEARCH) {
+ pageMeta.excludePageFromSearch = arg.context.EXCLUDE_FROM_SEARCH;
+ }
+
return json(
{
host,
url: url.href,
- excludeFromSearch: arg.context.EXCLUDE_FROM_SEARCH,
system,
resources,
pageMeta,
@@ -133,7 +136,7 @@ export const meta: MetaFunction<typeof loader> = ({ data }) => {
});
}
- if (pageMeta.excludePageFromSearch || data.excludeFromSearch) {
+ if (pageMeta.excludePageFromSearch) {
metas.push({
name: "robots",
content: "noindex, nofollow",
diff --git a/fixtures/webstudio-remix-vercel/app/routes/_index.tsx b/fixtures/webstudio-remix-vercel/app/routes/_index.tsx
index ea8c7443e6..4987ac6bde 100644
--- a/fixtures/webstudio-remix-vercel/app/routes/_index.tsx
+++ b/fixtures/webstudio-remix-vercel/app/routes/_index.tsx
@@ -65,11 +65,14 @@ export const loader = async (arg: LoaderFunctionArgs) => {
// typecheck
arg.context.EXCLUDE_FROM_SEARCH satisfies boolean;
+ if (arg.context.EXCLUDE_FROM_SEARCH) {
+ pageMeta.excludePageFromSearch = arg.context.EXCLUDE_FROM_SEARCH;
+ }
+
return json(
{
host,
url: url.href,
- excludeFromSearch: arg.context.EXCLUDE_FROM_SEARCH,
system,
resources,
pageMeta,
@@ -133,7 +136,7 @@ export const meta: MetaFunction<typeof loader> = ({ data }) => {
});
}
- if (pageMeta.excludePageFromSearch || data.excludeFromSearch) {
+ if (pageMeta.excludePageFromSearch) {
metas.push({
name: "robots",
content: "noindex, nofollow",
diff --git a/packages/cli/templates/defaults/app/route-templates/html.tsx b/packages/cli/templates/defaults/app/route-templates/html.tsx
index f9fcd888dc..3670483745 100644
--- a/packages/cli/templates/defaults/app/route-templates/html.tsx
+++ b/packages/cli/templates/defaults/app/route-templates/html.tsx
@@ -65,11 +65,14 @@ export const loader = async (arg: LoaderFunctionArgs) => {
// typecheck
arg.context.EXCLUDE_FROM_SEARCH satisfies boolean;
+ if (arg.context.EXCLUDE_FROM_SEARCH) {
+ pageMeta.excludePageFromSearch = arg.context.EXCLUDE_FROM_SEARCH;
+ }
+
return json(
{
host,
url: url.href,
- excludeFromSearch: arg.context.EXCLUDE_FROM_SEARCH,
system,
resources,
pageMeta,
@@ -133,7 +136,7 @@ export const meta: MetaFunction<typeof loader> = ({ data }) => {
});
}
- if (pageMeta.excludePageFromSearch || data.excludeFromSearch) {
+ if (pageMeta.excludePageFromSearch) {
metas.push({
name: "robots",
content: "noindex, nofollow",