Skip to content

Commit 77be269

Browse files
committed
Add Dynamic Child Cards
1 parent 54dd138 commit 77be269

26 files changed

+95
-122
lines changed

_includes/auto_child_cards.html

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{%- assign docs_pages = site[page.collection] | default: site.html_pages
2+
| where_exp: "item", "item.title != nil" -%}
3+
{%- assign docs_pages = docs_pages
4+
| where_exp: "item", "item.nav_exclude != true" -%}
5+
6+
{%- if page.url == "/" -%}
7+
{%- assign card_pages = docs_pages | where_exp: "item", "item.parent == nil" -%}
8+
{%- assign card_pages = card_pages | where_exp: "item", "item.url != page.url" -%}
9+
{%- else -%}
10+
{%- assign card_pages = docs_pages | where: "parent", page.title -%}
11+
{%- endif -%}
12+
13+
{%- include components/nav/sorted.html pages=card_pages -%}
14+
{%- assign card_pages = nav_sorted -%}
15+
16+
{%- if page.child_nav_order == "desc" or page.child_nav_order == "reversed" -%}
17+
{%- assign card_pages = card_pages | reverse -%}
18+
{%- endif -%}
19+
20+
{%- if card_pages.size > 0 -%}
21+
{% include card_grid.html cards=card_pages %}
22+
{%- endif -%}

_layouts/default.html

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
---
2+
layout: table_wrappers
3+
---
4+
5+
<!DOCTYPE html>
6+
7+
<html lang="{{ site.lang | default: 'en-US' }}">
8+
{% include head.html %}
9+
<body>
10+
<a class="skip-to-main" href="#main-content">Skip to main content</a>
11+
{% include icons/icons.html %}
12+
{% if page.nav_enabled == true %}
13+
{% include components/sidebar.html %}
14+
{% elsif layout.nav_enabled == true and page.nav_enabled == nil %}
15+
{% include components/sidebar.html %}
16+
{% elsif site.nav_enabled != false and layout.nav_enabled == nil and page.nav_enabled == nil %}
17+
{% include components/sidebar.html %}
18+
{% endif %}
19+
<div class="main" id="top">
20+
{% include components/header.html %}
21+
<div class="main-content-wrap">
22+
{% include components/breadcrumbs.html %}
23+
<div id="main-content" class="main-content">
24+
<main>
25+
{% if site.heading_anchors != false %}
26+
{% include vendor/anchor_headings.html html=content beforeHeading="true" anchorBody="<svg viewBox=\"0 0 16 16\" aria-hidden=\"true\"><use xlink:href=\"#svg-link\"></use></svg>" anchorClass="anchor-heading" anchorAttrs="aria-labelledby=\"%html_id%\"" %}
27+
{% else %}
28+
{{ content }}
29+
{% endif %}
30+
31+
{% include auto_child_cards.html %}
32+
33+
{% if page.has_toc != false %}
34+
{% include components/children_nav.html %}
35+
{% endif %}
36+
</main>
37+
{% include components/footer.html %}
38+
</div>
39+
</div>
40+
{% if site.search_enabled != false %}
41+
{% include components/search_footer.html %}
42+
{% endif %}
43+
</div>
44+
45+
{% if site.mermaid %}
46+
{% include components/mermaid.html %}
47+
{% endif %}
48+
</body>
49+
</html>

pages/concepts/external-refinements.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ title: External Refinements
33
parent: Concepts
44
nav_order: 4
55
permalink: /concepts/external-refinements/
6+
description: Learn how to refine external libraries that cannot be annotated directly.
67
---
78

89
# External Refinements

pages/concepts/ghosts.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ title: Ghosts
33
parent: Concepts
44
nav_order: 5
55
permalink: /concepts/ghosts/
6+
description: Learn how to track logical state that helps express and verify richer object invariants.
67
---
78

89
# Ghosts

pages/concepts/index.md

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -5,26 +5,8 @@ has_children: true
55
has_toc: false
66
permalink: /concepts/
77
description: Learn LiquidJava concepts to understand how to write specifications.
8-
cards:
9-
- title: Refinements
10-
url: /concepts/refinements/
11-
description: Learn about how to use refinements to specify constraints on variables, fields, parameters, and return values.
12-
- title: Refinement Aliases
13-
url: /concepts/refinement-aliases/
14-
description: Learn how to reuse common refinement predicates with aliases to keep contracts shorter and easier to maintain.
15-
- title: State Refinements
16-
url: /concepts/state-refinements/
17-
description: Learn how to model protocol-oriented object states and valid method transitions.
18-
- title: External Refinements
19-
url: /concepts/external-refinements/
20-
description: Learn how to refine external libraries that cannot be annotated directly.
21-
- title: Ghosts
22-
url: /concepts/ghosts/
23-
description: Learn how to track logical state that helps express and verify richer object invariants.
248
---
259

2610
# Concepts
2711

2812
LiquidJava extends Java with logical predicates and object protocol specifications. This section covers the core concepts and features of the LiquidJava type system.
29-
30-
{% include card_grid.html cards=page.cards %}

pages/concepts/refinement-aliases.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ title: Refinement Aliases
33
parent: Concepts
44
nav_order: 2
55
permalink: /concepts/refinement-aliases/
6+
description: Learn how to reuse common refinement predicates with aliases to keep contracts shorter and easier to maintain.
67
---
78

89
# Refinement Aliases

pages/concepts/refinements.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ title: Refinements
33
parent: Concepts
44
nav_order: 1
55
permalink: /concepts/refinements/
6+
description: Learn about how to use refinements to specify constraints on variables, fields, parameters, and return values.
67
---
78

89
# Refinements

pages/concepts/state-refinements.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ title: State Refinements
33
parent: Concepts
44
nav_order: 3
55
permalink: /concepts/state-refinements/
6+
description: Learn how to model protocol-oriented object states and valid method transitions.
67
---
78

89
# State Refinements

pages/diagnostics/custom-messages.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ title: Custom Messages
33
parent: Diagnostics
44
nav_order: 3
55
permalink: /diagnostics/custom-messages/
6+
description: Learn how to provide clearer diagnostic messages.
67
---
78

89
# Custom Messages

pages/diagnostics/errors.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ title: Errors
33
parent: Diagnostics
44
nav_order: 1
55
permalink: /diagnostics/errors/
6+
description: Learn about the different verification errors LiquidJava can report and what each one means.
67
---
78

89
# Errors

0 commit comments

Comments
 (0)