Skip to content

Commit 9762575

Browse files
committed
prevent google duplicate content
1 parent 5998d20 commit 9762575

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

examples/official-site/examples/authentication/basic_auth.sql

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
select 'http_header' as component, 'noindex' as "X-Robots-Tag";
2+
13
SELECT 'authentication' AS component,
24
case sqlpage.basic_auth_username()
35
when 'admin'

examples/official-site/examples/layouts.sql

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
select 'http_header' as component, 'nofollow' as "X-Robots-Tag"; -- nofollow to avoid duplicate content
2+
13
set layout = coalesce($layout, 'boxed');
24
set sidebar = coalesce($sidebar, 0);
35

examples/official-site/index.sql

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
select 'http_header' as component, 'public, max-age=600, stale-while-revalidate=3600, stale-if-error=86400' as "Cache-Control";
2-
select 'redirect' as component, '/' as link where sqlpage.path() <> '/';
1+
select 'http_header' as component,
2+
'public, max-age=600, stale-while-revalidate=3600, stale-if-error=86400' as "Cache-Control",
3+
'<https://sql.datapage.app/>; rel="canonical"' as "Link";
34

45
-- Fetch the page title and header from the database
56
select 'dynamic' as component, properties FROM example WHERE component = 'shell' LIMIT 1;

0 commit comments

Comments
 (0)