diff --git a/.gitignore b/.gitignore
index c77287a..b6515b7 100644
--- a/.gitignore
+++ b/.gitignore
@@ -29,5 +29,3 @@ prisma/dev.db
# opencode - agentes y scripts locales (no subir a producción)
opencode/
.opencode/
-.env
-docs/
diff --git a/src/components/BaseHead.astro b/src/components/BaseHead.astro
index 541a678..a1ff7be 100644
--- a/src/components/BaseHead.astro
+++ b/src/components/BaseHead.astro
@@ -8,6 +8,7 @@ const {
image = null,
url = null,
date = null,
+ noindex = false,
} = Astro.props;
const imageUrl = image ? new URL(image, Astro.site).toString() : null;
@@ -20,6 +21,7 @@ const canonicalURL = new URL(url || Astro.url.pathname, Astro.site);
+ {noindex && }
{title}
diff --git a/src/layouts/MainLayout.astro b/src/layouts/MainLayout.astro
index 1edcab3..432452b 100644
--- a/src/layouts/MainLayout.astro
+++ b/src/layouts/MainLayout.astro
@@ -8,7 +8,7 @@ import "@fontsource/poppins/700.css";
import "@fontsource-variable/kameron";
import ShareSticky from "../components/ShareSticky.vue";
import { routeTranslations } from "../i18n";
-const { title, description, image, url, date } = Astro.props;
+const { title, description, image, url, date, noindex } = Astro.props;
const currentLocale = Astro.currentLocale ?? "es";
const direction = currentLocale === "he" ? "rtl" : "ltr";
@@ -28,6 +28,7 @@ const isNewsPage = contentSegments.some((segment) =>
image={image}
url={url}
date={date}
+ noindex={noindex}
/>
+
diff --git a/src/pages/api/lib/googleSheets.ts b/src/pages/api/lib/googleSheets.ts
index 972826a..dcf8271 100644
--- a/src/pages/api/lib/googleSheets.ts
+++ b/src/pages/api/lib/googleSheets.ts
@@ -37,6 +37,17 @@ export async function emailExists(email: string): Promise {
}
+export async function getVolunteerCount(): Promise {
+ const result = await sheets.spreadsheets.values.get({
+ spreadsheetId: SPREADSHEET_ID,
+ range: 'VOLUNTARIOS!B2:B', // columna nombre_completo, se llena en cada registro
+ valueRenderOption: 'UNFORMATTED_VALUE',
+ });
+
+ const rows = result.data.values || [];
+ return rows.filter((row) => row[0] !== undefined && row[0] !== '').length;
+}
+
export async function appendToSheet(values: any[]) {
try {
await sheets.spreadsheets.values.append({
diff --git a/src/pages/api/voluntarios/count.ts b/src/pages/api/voluntarios/count.ts
new file mode 100644
index 0000000..4cc10b3
--- /dev/null
+++ b/src/pages/api/voluntarios/count.ts
@@ -0,0 +1,21 @@
+import type { APIRoute } from "astro";
+import { getVolunteerCount } from "../lib/googleSheets";
+
+export const prerender = false;
+
+export const GET: APIRoute = async () => {
+ try {
+ const count = await getVolunteerCount();
+
+ return Response.json(
+ { success: true, count },
+ { headers: { "Cache-Control": "no-store" } }
+ );
+ } catch (error) {
+ console.error("Error en /api/voluntarios/count:", error);
+ return Response.json(
+ { success: false, message: "Error al obtener el contador de voluntarios" },
+ { status: 500 }
+ );
+ }
+};