Skip to content
This repository has been archived by the owner on Jul 1, 2024. It is now read-only.

add new layoutz to registry #2977

Merged
merged 20 commits into from
Jun 6, 2023
324 changes: 283 additions & 41 deletions themes/default/assets/css/bundle.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion themes/default/assets/js/bundle.js

Large diffs are not rendered by default.

14 changes: 6 additions & 8 deletions themes/default/layouts/partials/docs/breadcrumb.html
Original file line number Diff line number Diff line change
@@ -1,21 +1,19 @@
<!-- Based on https://gohugo.io/content-management/sections/#example-breadcrumb-navigation -->

<!-- Don't show the breadcrumb on the main docs landing page. -->
{{ if ne .RelPermalink "/docs/" }}
<ol class="docs-breadcrumb">
{{ template "breadcrumbnav" (dict "p1" . "p2" .) }}
</ol>
{{ end }}
<ol class="docs-breadcrumb">
{{ template "breadcrumbnav" (dict "p1" . "p2" .) }}
</ol>

{{ define "breadcrumbnav" }}
<!-- Don't include the website home page in the breadcrumb. -->
{{ if and .p1.Parent (ne .p1.Parent .p1.Site.Home) }}
{{ template "breadcrumbnav" (dict "p1" .p1.Parent "p2" .p2) }}
{{ end }}
<!-- If the page is a redirect page, don't include it in the breadcrumb. -->
{{ if not (isset .p1.Params "redirect_to") }}
<li {{ if eq .p1 .p2 }}class="active"{{ end }}>
<a data-track="breadcrumb" href="{{ .p1.RelPermalink }}">{{ .p1.LinkTitle }}</a>
<a data-track="breadcrumb" href="{{ .p1.RelPermalink }}">
{{ .p1.LinkTitle }}
</a>
</li>
{{ end }}
{{ end }}
117 changes: 67 additions & 50 deletions themes/default/layouts/partials/docs/table-of-contents.html
Original file line number Diff line number Diff line change
@@ -1,63 +1,80 @@
{{ with .File }}
{{ if not $.Page.Params.no_on_this_page }}
<div class="table-of-contents">
<div id="accordion-table-of-contents" class="accordion flex-1-col">
<div>
<input type="checkbox" id="accordion-checkbox-table-of-contents" />
<label for="accordion-checkbox-table-of-contents" class="show">
<div class="heading">
<div class="icon-heading-wrapper">
<div class="icon icon-12-12 icon-on-this-page"></div>
<h2 class="no-anchor">On this page</h2>
</div>
<div class="icon icon-18-18 expand-more-18-18"></div>
</div>
</label>
<label for="accordion-checkbox-table-of-contents" class="hide">
<div class="heading">
<div class="icon-heading-wrapper">
<div class="icon icon-12-12 icon-on-this-page"></div>
<h2 class="no-anchor">On this page</h2>
</div>
<div class="icon icon-18-18 expand-more-18-18"></div>
{{ if not $.Page.Params.no_on_this_page }}
<div class="table-of-contents">
{{ if strings.Contains $.Page.Permalink "registry/packages" }}
{{ partial "registry/package/package-card.html" . }}
{{ end }}
<div id="accordion-table-of-contents" class="accordion">
<div>
<input type="checkbox" id="accordion-checkbox-table-of-contents" />
<label for="accordion-checkbox-table-of-contents" class="show">
<div class="heading">
<div class="icon-heading-wrapper">
<div class="icon icon-12-12 icon-on-this-page"></div>
<h2 class="no-anchor">On this page</h2>
</div>
</label>
<div class="accordion-content flex">
<div class="content">
<ul class="table-of-contents-list">
{{/* This will be populated dynamically with all H2s and H3s on the page; see ts/misc.ts */}}
</ul>
<div class="icon icon-18-18 expand-more-18-18"></div>
</div>
</label>
<label for="accordion-checkbox-table-of-contents" class="hide">
<div class="heading">
<div class="icon-heading-wrapper">
<div class="icon icon-12-12 icon-on-this-page"></div>
<h2 class="no-anchor">On this page</h2>
</div>
<div class="icon icon-18-18 expand-more-18-18"></div>
</div>
</label>
<div class="accordion-content flex">
<div class="content">
<ul class="table-of-contents-list">
{{/* This will be populated dynamically with all H2s and H3s on the page; see ts/misc.ts */}}
</ul>
{{ if strings.Contains $.Page.Permalink "registry/packages" }}
{{ $path := (split .Page.Params.title_tag ".") }}
{{- if eq (len $path) 3 -}}
{{ $packageName := index $path 0 }}
{{ $moduleName := index $path 1 }}
{{ $resourceName := index $path 2 }}
<div class="mt-6">
<pulumi-resource-links
package-name="{{ $packageName }}"
module-name="{{ $moduleName }}"
resource-name="{{ $resourceName }}"
></pulumi-resource-links>
</div>
{{ end }}
{{ end }}
</div>
</div>
</div>
</div>
{{ end }}
<ul class="p-0 list-none table-of-contents-feedback">
<!-- Only show "Edit this Page" for pages that are not generated. -->
{{ $isCLICommand := hasPrefix .Path "docs/cli/commands" }}
{{ $isAPIDoc := and (hasPrefix .Path "docs/reference/pkg/") (ne .Path "docs/reference/pkg/_index.md") }}
{{ if not (or $isCLICommand $isAPIDoc $.Page.Params.no_edit_this_page) }}
<li>
<a
data-track="edit-page"
class="text-gray-600 hover:text-gray-700 text-xs"
href="{{ $.Site.Params.contentRepositoryURL }}/edit/{{ $.Site.Params.contentRepositoryBaseBranch }}/{{ getenv "REPO_THEME_PATH" }}content/{{ .Path }}"
target="_blank"
>
<i class="fas fa-edit mr-2" style="width: 14px"></i>Edit this Page
</a>
</li>
{{ end }}
</div>
{{ end }}
<ul class="p-0 list-none table-of-contents-feedback">
<!-- Only show "Edit this Page" for pages that are not generated. -->
{{ $isCLICommand := hasPrefix .Path "docs/cli/commands" }}
{{ $isAPIDoc := and (hasPrefix .Path "docs/reference/pkg/") (ne .Path "docs/reference/pkg/_index.md") }}
{{ if not (or $isCLICommand $isAPIDoc $.Page.Params.no_edit_this_page) }}
<li>
<a
data-track="request-change"
data-track="edit-page"
class="text-gray-600 hover:text-gray-700 text-xs"
href="{{ $.Site.Params.contentRepositoryURL }}/issues/new?body=File: [{{ getenv "REPO_THEME_PATH" }}content/{{ .Path }}]({{ $.Page.Permalink }})"
href="{{ $.Site.Params.contentRepositoryURL }}/edit/{{ $.Site.Params.contentRepositoryBaseBranch }}/{{ getenv "REPO_THEME_PATH" }}content/{{ .Path }}"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this link looks like it opens the code editor in github in the browser with the changes are against master by default in edit mode. the user will need to make their own branch and PR, so not sure if this may end up being confusing.

image

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sean1588 this new flow in github, when you select that commit button, it goes through a flow of creating a branch; or it should; happy to change this though, its just what was already in use

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mind doing a follow on pr though if its an issue?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ahh ok, never knew it did that when you select the commit button. that sounds good then! thanks!

target="_blank"
>
<i class="far fa-check-square mr-2" style="width: 14px"></i>Request a Change
<i class="fas fa-edit mr-2" style="width: 14px"></i>Edit this Page
</a>
</li>
</ul>
{{ end }} <pulumi-top-button></pulumi-top-button>
{{ end }}
<li>
<a
data-track="request-change"
class="text-gray-600 hover:text-gray-700 text-xs"
href="{{ $.Site.Params.contentRepositoryURL }}/issues/new?body=File: [{{ getenv "REPO_THEME_PATH" }}content/{{ .Path }}]({{ $.Page.Permalink }})"
target="_blank"
>
<i class="far fa-check-square mr-2" style="width: 14px"></i>Request a Change
</a>
</li>
</ul>
<pulumi-top-button></pulumi-top-button>
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading