Skip to content

Commit 4f4e8f6

Browse files
committed
Add next cards (#3737)
1 parent 987948a commit 4f4e8f6

File tree

10 files changed

+156
-18
lines changed

10 files changed

+156
-18
lines changed

assets/scss/_styles_project.scss

Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2692,3 +2692,97 @@ a.tree-root {
26922692
}
26932693

26942694
// Top level nav END
2695+
2696+
// Next page START
2697+
2698+
#next-page {
2699+
clear: both;
2700+
}
2701+
2702+
#next-page > div.left-only {
2703+
flex-direction: row-reverse;
2704+
}
2705+
2706+
#next-page > div > div.hover-card {
2707+
min-width: 250px;
2708+
max-width: unset;
2709+
}
2710+
2711+
@media (min-width: 500px) {
2712+
#next-page > div > div.hover-card {
2713+
max-width: calc((100% - 1.5rem)/2);
2714+
}
2715+
}
2716+
2717+
#next-page > div > div.hover-card.left {
2718+
float: left;
2719+
margin: 0rem 0.75rem 0rem 0rem;
2720+
}
2721+
2722+
#next-page > div > div.hover-card.right {
2723+
float: right;
2724+
margin: 0rem 0rem 0rem 0.75rem;
2725+
}
2726+
2727+
#next-page > div > div.hover-card > a {
2728+
width: 100%;
2729+
color: black;
2730+
display: flex;
2731+
flex-direction: row;
2732+
justify-content: space-between;
2733+
}
2734+
2735+
#next-page > div > div.hover-card > a > div > p {
2736+
font-family: space grotesk,sans-serif;
2737+
font-size: 1.1667rem !important;
2738+
line-height: 1.4375em;
2739+
}
2740+
2741+
#next-page > div > div.hover-card > a > div {
2742+
display: flex;
2743+
align-items: center;
2744+
}
2745+
2746+
#next-page > div > div.hover-card > a > div.text {
2747+
flex-direction: column;
2748+
}
2749+
2750+
#next-page > div > div.hover-card > a > div.text > p:first-child {
2751+
text-transform: uppercase;
2752+
font-family: Space Mono,sans-serif;
2753+
color: #aaa;
2754+
font-size: 0.833rem !important;
2755+
}
2756+
2757+
#next-page > div > div.hover-card.left > a > div.text > p:first-child {
2758+
align-self: flex-end;
2759+
}
2760+
2761+
#next-page > div > div.hover-card.right > a > div.text > p:first-child {
2762+
text-transform: uppercase;
2763+
align-self: flex-start;
2764+
}
2765+
2766+
2767+
#next-page > div > div.hover-card > a > div > div {
2768+
margin-bottom: 0;
2769+
}
2770+
2771+
#next-page > div > div.hover-card.left > a > div.arrow {
2772+
margin-right: 1.5rem;
2773+
}
2774+
2775+
#next-page > div > div.hover-card.left > a > div {
2776+
text-align: right;
2777+
}
2778+
2779+
#next-page > div > div.hover-card.right > a > div.arrow {
2780+
margin-left: 1.5rem;
2781+
}
2782+
2783+
#next-page > div > div.hover-card.right > a > div {
2784+
text-align: left;
2785+
}
2786+
2787+
2788+
// Next page END

docs/manage/fleet/provision/_index.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ title: "Provision devices using viam-agent"
44
weight: 25
55
layout: "docs"
66
type: "docs"
7-
no_list: true
87
description: "Provision a machine as it first comes online with a pre-defined configuration - in the factory or when the machine is taken into service."
98
images: ["/platform/provisioning-demo.gif"]
109
videos: ["/platform/provisioning-demo.webm", "/platform/provisioning-demo.mp4"]

docs/manage/fleet/setup.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ title: "Configure machine operating system settings"
44
weight: 20
55
layout: "docs"
66
type: "docs"
7-
no_list: true
87
description: "TODO"
98
---
109

docs/manage/software/deploy-packages.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,8 @@ title: "Deploy software packages to machines (OTA)"
44
weight: 30
55
layout: "docs"
66
type: "docs"
7-
no_list: true
87
images: ["/registry/module-puzzle-piece.svg"]
9-
description: You can use a fragment to deploy software packages and ML models to many machines, as well as to update deployed versions of those software packages and ML models."
8+
description: You can use a fragment to deploy software packages and ML models to many machines, as well as to update deployed versions of those software packages and ML models.
109
languages: []
1110
viamresources: []
1211
platformarea: ["registry", "fleet"]

docs/manage/software/update-packages.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ title: "Update packages"
44
weight: 40
55
layout: "docs"
66
type: "docs"
7-
no_list: true
87
description: "As new versions of software modules or ML models become available, you can update the deployed version on all machines in one go."
98
---
109

docs/manage/troubleshoot/alert.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ title: "Alert on machine telemetry"
44
weight: 20
55
layout: "docs"
66
type: "docs"
7-
no_list: true
87
description: "Configure a trigger to trigger actions when data is sent from your machine to the cloud, or when your machine's internet connectivity changes."
98
tags: ["triggers"]
109
aliases:

docs/manage/troubleshoot/monitor.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ title: "Monitor machine status"
44
weight: 10
55
layout: "docs"
66
type: "docs"
7-
no_list: true
87
description: "Monitor the status of all machines in an organization and investigate issues when needed."
98
---
109

docs/manage/troubleshoot/troubleshoot.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ title: "Troubleshoot problems"
44
weight: 30
55
layout: "docs"
66
type: "docs"
7-
no_list: true
87
description: "A guide to troubleshooting a Viam-based machine or system of machines with fixes to common problems."
98
date: "2022-01-01"
109
# updated: "" # When the content was last entirely checked

layouts/docs/content.html

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -49,17 +49,27 @@ <h4 class="alert-heading">DRAFT</h4>
4949

5050
{{ if ne .Params.no_list true}}
5151
{{ $pages := union .Sections .Pages }}
52-
<div id="archive" class="card-container">
53-
<div class="row-no-margin">
54-
{{ range sort $pages ".Weight"}}
55-
{{ partial "card.html" (dict "link" (.Page.File.Path) "class" "" "customTitle" "" "customDescription" "" "customCanonicalLink" (.Page.Params.canonical) ) }}
52+
<div id="next-page" class="card-container">
53+
<hr>
54+
{{ $pages := .CurrentSection.Pages.ByWeight }}
55+
<!-- These are swapped in order -->
56+
{{ if ($pages.Next .) }}
57+
<div class="row-no-margin">
58+
{{ else }}
59+
<div class="row-no-margin left-only">
60+
{{ end }}
61+
{{ with $pages.Next . }}
62+
{{ if not .Params.toc_hide }}
63+
{{ partial "nextcard.html" (dict "link" (.Page.File.Path) "class" "left" "customCanonicalLink" (.Page.Params.canonical) ) }}
5664
{{ end }}
57-
</div>
58-
</div>
59-
<div>
60-
<p>Have questions, or want to meet other people working on robots? Join our <a href="https://discord.gg/viam">Community Discord</a>.</p><p>If you notice any issues with the documentation, feel free to <a href="https://github.com/viamrobotics/docs/issues">file an issue</a> or <a target="_blank" title="Edit source file on GitHub" aria-label="Edit source file on GitHub" href="https://github.com/{{.Site.Params.github.repository}}/edit/{{.Site.Params.github.branch}}/docs/{{ replace .File.Path '\\' '/' }}">edit this file</a>.</p>
61-
</div>
62-
65+
{{ end }}
66+
{{ with $pages.Prev . }}
67+
{{ if not .Params.toc_hide }}
68+
{{ partial "nextcard.html" (dict "link" (.Page.File.Path) "class" "right" "customCanonicalLink" (.Page.Params.canonical) ) }}
69+
{{ end }}
70+
{{ end }}
71+
</div>
72+
</div>
6373
{{ end }}
6474

6575
{{ if (.Site.Params.DisqusShortname) }}

layouts/partials/nextcard.html

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
{{- $class := .class -}}
2+
{{- $customTitle := .customTitle -}}
3+
{{- $customCanonicalLink := .customCanonicalLink -}}
4+
{{- $link := (path.Clean (.link)) -}}
5+
{{- $baseurl := .Site.BaseURL -}}
6+
{{- if (eq (substr .Site.BaseURL -1 1) "/" ) -}}
7+
{{- $baseurl := (substr .Site.BaseURL 0 -1) -}}
8+
{{- end -}}
9+
<div class="col hover-card {{ if $class }}{{ $class }}{{ end }}">
10+
{{- if site.GetPage ($link | string) -}}
11+
{{- with site.GetPage ($link | string) -}}
12+
{{- if $customCanonicalLink -}}
13+
<a href="{{$customCanonicalLink}}">
14+
{{- else -}}
15+
<a href="{{.RelPermalink}}">
16+
{{- end -}}
17+
{{ if eq $class "left" }} <div class="arrow"><i class="fas fa-chevron-left"></i></div> {{ end }}
18+
<div class="text">
19+
{{ if eq $class "left" }} <p class="left">Previous</p> {{ else }} <p class="left">Next</p> {{ end }}
20+
<p> {{- .LinkTitle -}}</p>
21+
</div>
22+
{{ if eq $class "right" }} <div class="arrow"><i class="fas fa-chevron-right"></i></div> {{ end }} </a>
23+
{{- end -}}
24+
{{- else -}}
25+
{{- if strings.HasPrefix ($link | string) "http" -}}
26+
{{- if $customCanonicalLink -}}
27+
<a href="{{$customCanonicalLink}}">
28+
{{- else -}}
29+
<a href="{{.RelPermalink}}">
30+
{{- end -}}
31+
<div {{ if .webm_src }}class="small-hover-card-div"{{ end }}>
32+
{{- if $customTitle -}}
33+
<div> {{- $customTitle -}}</div>
34+
{{- end -}}
35+
</div>
36+
</a>
37+
{{- else -}}
38+
{{- warnf "Card has a bad link: %s" $link -}}
39+
{{- end -}}
40+
{{- end -}}
41+
</div>

0 commit comments

Comments
 (0)