Skip to content

Commit 8ed6362

Browse files
committed
improve tab component index
1 parent efa0b88 commit 8ed6362

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

examples/official-site/component.sql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
-- ensure that the component exists and do not render this page if it does not
22
select 'redirect' as component,
3-
'component_not_found.sql?component=' || sqlpage.url_encode($component) as link
4-
where $component is not null and not exists (select 1 from component where name = $component);
3+
'component_not_found.sql' || coalesce('?component=' || sqlpage.url_encode($component), '') as link
4+
where not exists (select 1 from component where name = $component);
55

66
-- This line, at the top of the page, tells web browsers to keep the page locally in cache once they have it.
77
select 'http_header' as component, 'public, max-age=600, stale-while-revalidate=3600, stale-if-error=86400' as "Cache-Control";

examples/official-site/component_not_found.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 'dynamic' as component, properties FROM example WHERE component = 'shell' LIMIT 1;
24

35
select

examples/official-site/sqlpage/migrations/13_tab.sql

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,9 +88,9 @@ View the [dynamic tabs example](examples/tabs.sql).
8888
JSON(
8989
'[
9090
{ "component": "tab" },
91-
{ "title": "My First tab", "active": true },
92-
{ "title": "This is tab two" },
93-
{ "title": "Third tab is crazy" }
91+
{ "title": "This tab does not exist", "active": true },
92+
{ "title": "I am not a true tab" },
93+
{ "title": "Do not click here" }
9494
]'
9595
)
9696
),

0 commit comments

Comments
 (0)