Skip to content

Commit bf113ba

Browse files
authored
Merge pull request #4396 from platformsh/4395-adjust-markdown-button-location
4395 adjust markdown button location
2 parents bf32ca3 + 4e88f89 commit bf113ba

File tree

4 files changed

+21
-17
lines changed

4 files changed

+21
-17
lines changed

sites/upsun/src/get-started/stacks/_index.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: Frameworks
2+
title: How to deploy
33
weight: -80
44
layout: single
55
# aliases:

themes/psh-docs/layouts/partials/editpagebutton.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<!-- Edit page button link -->
22
<div class="hidden md:block mb-6 mr-2 text-right">
33
{{ $editLocation := printf "%sedit/main/%s/src/%s" site.Params.repo site.Params.folder .File.Path }}
4-
<a href="{{ $editLocation }}" rel="noopener" class="print:hidden font-semibold bg-gray-400 text-white hover:bg-ebony focus:bg-ebony pl-4 pr-3 py-2 font-['Space_Grotesk'] text-xs rounded-full inline-flex items-center gap-2">
4+
<a href="{{ $editLocation }}" rel="noopener" target="_blank" class="print:hidden font-semibold bg-gray-400 text-white hover:bg-ebony focus:bg-ebony pl-4 pr-3 py-2 font-['Space_Grotesk'] text-xs rounded-full inline-flex items-center gap-2">
55

66
Edit page<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="inline">
77
<path d="M17 3a2.85 2.83 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5Z"/>

themes/psh-docs/layouts/partials/page-content.html

+18-14
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,24 @@
1818
<!-- If the feature is in beta -->
1919
{{ partial "beta-flag/banner.html" .context }}
2020

21-
{{ if ne .context.Params.editPage false }}
22-
{{ partial "editpagebutton.html" .context }}
23-
{{ end }}
21+
<div class="flex justify-end mr-4">
22+
<!-- Add a Button to open the Markdown version of this page (Upsun only) -->
23+
{{ if and ( eq .context.Site.Params.vendor.config.version 2 ) ( ne .context.Page.RelPermalink "/" ) }}
24+
<div class="hidden md:block mb-6 mr-2 text-right">
25+
<a href="{{ if eq .context.Page.RelPermalink "/" }}/index.md{{ else }}{{ .context.Page.RelPermalink | replaceRE ".html" ".md" }}{{ end }}"
26+
class="print:hidden font-semibold bg-skye text-white hover:bg-skye-dark focus:bg-skye-dark px-4 py-2 font-['Space_Grotesk'] text-xs rounded-full inline-flex items-center gap-2"
27+
title="Open this page in a markdown format. This format is easier for AI and other tools to read."
28+
target="_blank">
29+
View in markdown
30+
</a>
31+
</div>
32+
{{ end }}
33+
34+
<!-- Edit page button link -->
35+
{{ if ne .context.Params.editPage false }}
36+
{{ partial "editpagebutton.html" .context }}
37+
{{ end }}
38+
</div>
2439

2540
<!-- Page title -->
2641
{{ if ne .context.Params.showTitle false }}
@@ -102,17 +117,6 @@ <h3 class="pt-4 pb-2 font-light text-base text-slate">On this page</h3>
102117
</div>
103118
{{ end }}
104119

105-
<!-- Add a Button to open the Markdown version of this page (Upsun only) -->
106-
{{ if ( eq .context.Site.Params.vendor.config.version 2 ) }}
107-
<div class="justify-start border border-stone border-t-0 px-4 pt-10 pb-4 mb-12 md:mb-0 bottom-0 text-sm [&_a]:text- hover:[&_a]:underline focus:[&_a]:underline [&_ul_ul]:pl-4">
108-
<a href="{{ if eq .context.Page.RelPermalink "/" }}/index.md{{ else }}{{ .context.Page.RelPermalink | replaceRE ".html" ".md" }}{{ end }}"
109-
class="px-6 py-2 bg-[#6046FF] hover:!bg-[#4D38CC] rounded-3xl text-white text-center text-sm font-semibold"
110-
title="View this page in a Markdown format"
111-
target="_blank">
112-
View Markdown version
113-
</a>
114-
</div>
115-
{{ end }}
116120
</div>
117121

118122
<div class="prose xl:prose-lg max-w-[96vw] md:max-w-full w-full prose-code:!mb-0 prose-h2:text-xl prose-h3:text-xl prose-h4:text-lg">

themes/psh-docs/layouts/partials/sidebar/nav.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
{{ if $isHome }}
3030
{{ $inCurrentSection = false }}
3131
{{ end }}
32-
<div x-data="{ expanded: {{ $inCurrentSection }} }">
32+
<div x-data="{ expanded: {{ or $inCurrentSection (eq .section "home") }} }">
3333
<h3 class="font-semibold">
3434
<button class="bg-no-repeat bg-right-2 w-[95%] py-4 pl-2 pr-6 my-2 text-left bg-grey" :style="expanded ? 'background-image: url(/images/icons/minus.svg);' : 'background-image: url(/images/icons/add.svg);'" @click="expanded = ! expanded" aria-controls="section-{{ .section }}" aria-expanded="{{ $inCurrentSection }}">
3535
{{ .title }}

0 commit comments

Comments
 (0)