Skip to content

Commit

Permalink
(Partners) Introduce partners section
Browse files Browse the repository at this point in the history
  • Loading branch information
hestonhoffman committed Jan 17, 2025
1 parent a92eaa8 commit 5304530
Show file tree
Hide file tree
Showing 6 changed files with 212 additions and 2 deletions.
10 changes: 8 additions & 2 deletions config/_default/menus/main.en.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -949,12 +949,18 @@ menu:
identifier: api
parent: essentials_heading
weight: 90000
- name: Partners
url: partners/
pre: colab
identifier: partners
parent: essentials_heading
weight: 100000
- name: Datadog Mobile App
url: mobile/
pre: mobile
identifier: mobile
parent: essentials_heading
weight: 100000
weight: 110000
- name: Enterprise Configuration
url: mobile/enterprise_configuration
identifier: mobile_enterprise_configuration
Expand All @@ -965,7 +971,7 @@ menu:
pre: coscreen
identifier: coscreen
parent: essentials_heading
weight: 110000
weight: 120000
- name: Troubleshooting
url: coscreen/troubleshooting
identifier: coscreen_troubleshooting
Expand Down
28 changes: 28 additions & 0 deletions config/_default/menus/partners.en.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
menu:
partners:
- name: Getting Started
url: /partners/
identifier: getting_started
weight: 1
- name: Billing and Usage Reporting
url: /partners/billing-and-usage-reporting/
identifier: billing-and-usage-reporting
weight: 2
- name: Data Intake
url: /partners/data-intake/
identifier: /data-intake
weight: 3
- name: Delivering Value
url: /partners/delivering-value
identifier: delivering-value
weight: 4
- name: Laying Groundwork
url: /partners/laying-the-groundwork/
identifier: laying-the-groundwork
weight: 5
- name: Sales Enablement
url: /partners/sales-enablement/
identifier: sales-enablement
weight: 6


82 changes: 82 additions & 0 deletions layouts/partials/nav/left-nav-partners.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
{{/*
This navigation is used on the left of the site, and is the main Partners documentation nav.
Looking for the header nav? see website-modules
*/}}

{{ $dot := . }}

{{ $partnersMenu := "partners" }}

<!-- if no partners menu in other languages fallback to english -->
{{ with index .Site.Menus $partnersMenu }}
{{ $dot.Scratch.Set "menu" . }}
{{ else }}
{{ $dot.Scratch.Set "menu" (index .Sites.First.Menus $partnersMenu) }}
{{ end }}
{{ $menu := .Scratch.Get "menu" }}

{{ $currentPage := . }}

<!-- set current english url. If url in menu doesn't start with /lang/ this lets us compare still -->
{{ $currentEnURL := $currentPage.RelPermalink }}
{{ if ne $currentPage.Lang "en" }}
{{ $currentEnURL = (strings.Replace $currentPage.RelPermalink (printf "/%s" .Lang) "") }}
{{ end }}


{{/*
build array ($engMenuChildren) of english menu items with parents from "partners.en.yaml".
for use in providing english names for anchoring the nav-links (.nav-link)
*/}}
{{ if ne $currentPage.Lang "en" }}
{{$engMenu := (index .Sites.First.Menus $partnersMenu) }}
{{ range $engMenu }}
{{ if and (.HasChildren) (ne $currentPage.CurrentSection.RelPermalink "/partners/") }}
{{ range .Children }}
{{ $dot.Scratch.SetInMap "engMenuChildren" .Identifier .Name }}
{{ end }}
{{ end }}
{{ end }}
{{ end }}

{{$engMenuChildren := $dot.Scratch.Get "engMenuChildren" | default dict}}

<ul class="list-unstyled">
{{ range $menu }}
<!-- check if on /partners/ top level section page, don't generate sub anchors if true -->
{{ if and (.HasChildren) (ne $currentPage.CurrentSection.RelPermalink "/partners/" ) }}
<li class="{{ if or ($currentPage.IsMenuCurrent $partnersMenu .) ($currentPage.HasMenuCurrent $partnersMenu .) (eq $currentEnURL .URL) }}active{{ end }}">
<a href="{{ (strings.TrimLeft "/" .URL) | absLangURL }}">
<span>{{ .Name }}</span>
</a>
<ul class="nav">
{{ range sort .Children ".Params.order" "asc" }}
<li class="row nav-item {{ if $currentPage.IsMenuCurrent $partnersMenu . }}active{{ end }}">
{{$identifier := .Identifier}}
{{/*
lookup english equivalent of non-english menu item identifier attr.
pull the name attr and plug into anchor href.
*/}}
{{ if ne $currentPage.Lang "en" }}
{{ $dot.Scratch.Set "name" (index $engMenuChildren $identifier) }}
{{ end }}

{{$engName := $dot.Scratch.Get "name"}}
<a class="col nav-link d-inline-block" href='{{ if hasPrefix .URL "#" }}#{{ default (.Name | anchorize) ($engName | anchorize) }}{{ else }}{{ (strings.TrimLeft "/" .URL) | absLangURL }}{{ end }}' data-bs-target="#{{.Identifier}}">
<span class="d-inline-block">{{ .Name }}</span>
</a>
</li>
{{ end }}
</ul>
</li>
{{ else }}
<li class="{{ if or ($currentPage.IsMenuCurrent $partnersMenu .) ($currentPage.HasMenuCurrent $partnersMenu .) (eq $currentEnURL .URL) }}active{{ end }}">
<a href="{{ (strings.TrimLeft "/" .URL) | absLangURL }}">
<span>{{ .Name }}</span>
</a>
</li>
{{ end }}
{{ end }}
</ul>


25 changes: 25 additions & 0 deletions layouts/partials/sidenav/partners-sidenav.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<aside class="sidenav sidenav-partners" id="navbar-example2">
<div class="row sticky">
<div class="col">

<a href="{{ "" | absLangURL }}">
<p class="h4">{{ i18n "datadog_docs" }} &nbsp;&nbsp;<span class="font-semibold">Partners</span></p>
</a>

{{ $ContentBaseName := "" }}
{{ with .File }}
{{ $ContentBaseName = .ContentBaseName }}
{{ end }}

{{ if ne $ContentBaseName "search" }}
{{ partial "search.html" . }}
{{ else }}
<div id="async-searchbar-mount"></div>
{{ end}}

<div class="sidenav-nav">
{{ partial "nav/left-nav-partners.html" . }}
</div>
</div>
</div>
</aside>
56 changes: 56 additions & 0 deletions layouts/partners/baseof.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
<!DOCTYPE html>
<html lang='{{ if eq .Site.Language.Lang "en" }}en-US{{ else }}{{ .Site.Language.Lang }}{{ end }}' data-type="{{.Type}}" data-relpermalink="{{.RelPermalink}}"
data-env="{{.Site.Params.environment}}" data-commit-ref="{{ .Site.Params.branch }}" style="opacity:0"
class="{{ if or $.Site.Params.announcement_banner.link $.Site.Params.announcement_banner.desktop_message }}banner announcement{{ end }}">

<head>

{{ partialCached "header-scripts.html" . }}

<meta charset="utf-8">
{{ partial "prefetch.html" . }}
{{ partial "preload.html" . }}
<title>{{ .Title }}</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
{{ if .Params.external_redirect }} {{ partial "meta-http-equiv.html" . }} {{ end }}
{{- partial "canonical.html" . -}}
{{- partial "noindex.html" . -}}
{{- partial "hreflang.html" . -}}
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<link rel="icon" type="image/png" href="https://docs.datadoghq.com/favicon.ico">

{{ partialCached "css.html" . }}

{{- if ne $.Params.disable_opengraph_meta_tags true -}}
{{- partial "meta.html" . -}}
{{- end -}}
</head>
{{- $bodyClass := $.Scratch.Get "bodyClass" -}}

<body
data-bs-spy="scroll" data-bs-target="#navbar-example2" data-bs-offset="5"
class="{{ .Site.Language.Lang }} {{ if .IsPage }} {{ replace $.Type "/" "-" }} {{ else }} {{ .Section }} {{ end }} {{ $bodyClass }} {{ if .Site.Params.announcement_banner }}announcement{{ end }}">

{{ partial "header/header.html" . }}

<div class="container container__content">
<div class="row">
<div class="d-none d-lg-flex col-sm-3 side">
{{ partial "sidenav/partners-sidenav.html" . }}
</div>
<div class="col-12 col-lg-9 main-paer">
{{ partial "api/api-toolbar.html" . }}
{{ block "partners-main" . }}{{ end }}
</div>
</div>
</div>

{{ partial "footer/footer.html" . }}


{{ partial "footer-scripts.html" . }}
{{ partial "footer-js-dd-docs-methods" . }}
{{ partial "preview_banner/preview_banner" . }}
</body>

</html>
13 changes: 13 additions & 0 deletions layouts/partners/list.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{{ define "partners-main" }}
<div class="row">
<div class="col-12 order-1">
<h1 id="pagetitle">{{ .Title }}</h1>
</div>
<div class="col-12">
{{ partial "breadcrumbs.html" . }}
</div>
</div>

{{ partial "translate_status_banner/translate_status_banner.html" . }}
{{ .Content }}
{{ end }}

0 comments on commit 5304530

Please sign in to comment.