Skip to content

Commit f01f1fd

Browse files
committed
[bugfix] Correct the parameters for the 'Edit this page' button
1 parent 1b5a8d5 commit f01f1fd

5 files changed

Lines changed: 44 additions & 29 deletions

File tree

.github/workflows/pages.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
- name: Generate website (XSLT)
3232
id: generate
3333
# Override Maven properties for the Petal button url
34-
run: mvn -B -Dpetal.api-url=https://petal.evolvedbinary.com -Dpetal.github-org-name=evolvedbinary -Dpetal.github-repo-name=cityehr-documentation -Dpetal.github-branch=develop -Dpetal.referrer-base-url=https://evolvedbinary.github.io/cityehr-documentation package -Dcityehr-documentation-website=true
34+
run: mvn -B -Dpetal.api-url=https://petal.evolvedbinary.com -Dpetal.github-org-name=cityehr -Dpetal.github-repo-name=cityehr-documentation -Dpetal.github-branch=main -Dpetal.referrer-base-url=https://cityehr.github.io/cityehr-documentation package -Dcityehr-documentation-website=true
3535
- name: Setup Pages
3636
uses: actions/configure-pages@v5
3737
- name: Upload pages artifact

cityehr-documentation-common/src/main/xslt/create-topic-html.xslt

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,12 @@
2424
<!-- PARAMETER - the revision date and time of the generated document -->
2525
<xsl:param name="revision" required="no" as="xs:dateTime" select="current-dateTime()"/>
2626

27-
<xsl:param name="petal-api-url" as="xs:string" required="yes"/>
28-
<xsl:param name="petal-github-org-name" as="xs:string" required="yes"/>
29-
<xsl:param name="petal-github-repo-name" as="xs:string" required="yes"/>
30-
<xsl:param name="petal-github-branch" as="xs:string" required="yes"/>
31-
<xsl:param name="petal-referrer-base-url" as="xs:string" required="yes"/>
27+
<xsl:param name="petal-api-url" as="xs:string" required="yes"/>
28+
<xsl:param name="petal-github-org-name" as="xs:string" required="yes"/>
29+
<xsl:param name="petal-github-repo-name" as="xs:string" required="yes"/>
30+
<xsl:param name="petal-github-branch" as="xs:string" required="yes"/>
31+
<xsl:param name="petal-referrer-base-url" as="xs:string" required="yes"/>
32+
<xsl:param name="petal-referrer-sub-folder" as="xs:string?" required="no"/>
3233

3334
<xsl:variable name="authors" as="xs:string+" select="('John Chelsom', 'Stephanie Cabrera', 'Catriona Hopper', 'Jennifer Ramirez')"/>
3435

@@ -50,7 +51,7 @@
5051

5152
<!-- Petal Edit Button -->
5253
<div id="petal-edit-page-button">
53-
<a href="{htop:petal-edit-url(com:document-uri(.), $petal-api-url, $petal-github-org-name, $petal-github-repo-name, $petal-github-branch, $petal-referrer-base-url)}">
54+
<a href="{htop:petal-edit-url(com:document-uri(.), $petal-api-url, $petal-github-org-name, $petal-github-repo-name, $petal-github-branch, $petal-referrer-base-url, $petal-referrer-sub-folder)}">
5455
<input type="button" value="Edit this page"/>
5556
</a>
5657
</div>
@@ -172,17 +173,18 @@
172173
Generates an Edit button URL for Petal
173174
-->
174175
<xsl:function name="htop:petal-edit-url" as="xs:string">
175-
<xsl:param name="petal-source-file-uri" as="xs:string" required="yes"/>
176-
<xsl:param name="petal-api-url" as="xs:string" required="yes"/>
177-
<xsl:param name="petal-github-org-name" as="xs:string" required="yes"/>
178-
<xsl:param name="petal-github-repo-name" as="xs:string" required="yes"/>
179-
<xsl:param name="petal-github-branch" as="xs:string" required="yes"/>
180-
<xsl:param name="petal-referrer-base-url" as="xs:string" required="yes"/>
176+
<xsl:param name="petal-source-file-uri" as="xs:string" required="yes"/>
177+
<xsl:param name="petal-api-url" as="xs:string" required="yes"/>
178+
<xsl:param name="petal-github-org-name" as="xs:string" required="yes"/>
179+
<xsl:param name="petal-github-repo-name" as="xs:string" required="yes"/>
180+
<xsl:param name="petal-github-branch" as="xs:string" required="yes"/>
181+
<xsl:param name="petal-referrer-base-url" as="xs:string" required="yes"/>
182+
<xsl:param name="petal-referrer-sub-folder" as="xs:string?"/>
181183

182184
<xsl:variable name="petal-source-file-uri-tokens" select="tokenize($petal-source-file-uri, concat($petal-github-repo-name, '/'))" />
183185
<xsl:variable name="petal-source-file" select="$petal-source-file-uri-tokens[last()]" />
184186
<xsl:variable name="petal-webpage-filename" select="hcom:dita-filename-to-html(com:filename($petal-source-file-uri))" />
185-
<xsl:sequence select="concat($petal-api-url, '?ghrepo=', $petal-github-org-name, '/', $petal-github-repo-name, '&amp;source=', $petal-source-file, '&amp;branch=', $petal-github-branch, '&amp;referer=', $petal-referrer-base-url, '/', $petal-webpage-filename)" />
187+
<xsl:sequence select="concat($petal-api-url, '?ghrepo=', $petal-github-org-name, '/', $petal-github-repo-name, '&amp;source=', $petal-source-file, '&amp;branch=', $petal-github-branch, '&amp;referer=', string-join(($petal-referrer-base-url, $petal-referrer-sub-folder, $petal-webpage-filename), '/'))" />
186188
</xsl:function>
187189

188-
</xsl:stylesheet>
190+
</xsl:stylesheet>

cityehr-documentation-common/src/test/xspec/create-topic-html.xspec

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,13 @@
55
xmlns:htop="http://cityehr/html/topic"
66
stylesheet="../../main/xslt/create-topic-html.xslt">
77

8-
<x:param name="version" as="xs:string">xspec-test-version</x:param>
9-
<x:param name="petal-api-url" as="xs:string">https://petal.evolvedbinary.com</x:param>
10-
<x:param name="petal-github-org-name" as="xs:string">evolvedbinary</x:param>
11-
<x:param name="petal-github-repo-name" as="xs:string">cityehr-documentation</x:param>
12-
<x:param name="petal-github-branch" as="xs:string">develop</x:param>
13-
<x:param name="petal-referrer-base-url" as="xs:string">https://evolvedbinary.github.io/cityehr-documentation</x:param>
8+
<x:param name="version" as="xs:string">xspec-test-version</x:param>
9+
<x:param name="petal-api-url" as="xs:string">https://petal.evolvedbinary.com</x:param>
10+
<x:param name="petal-github-org-name" as="xs:string">evolvedbinary</x:param>
11+
<x:param name="petal-github-repo-name" as="xs:string">cityehr-documentation</x:param>
12+
<x:param name="petal-github-branch" as="xs:string">develop</x:param>
13+
<x:param name="petal-referrer-base-url" as="xs:string">https://evolvedbinary.github.io/cityehr-documentation</x:param>
14+
<x:param name="petal-referrer-sub-folder" as="xs:string">quick-start-guide</x:param>
1415

1516
<x:scenario label="Scenario for testing the petal-edit-url function with source file from local filesytem">
1617
<x:call function="htop:petal-edit-url">
@@ -20,8 +21,9 @@
2021
<x:param name="petal-github-repo-name" as="xs:string">cityehr-documentation</x:param>
2122
<x:param name="petal-github-branch" as="xs:string">develop</x:param>
2223
<x:param name="petal-referrer-base-url" as="xs:string">https://evolvedbinary.github.io/cityehr-documentation</x:param>
24+
<x:param name="petal-referrer-sub-folder" as="xs:string">quick-start-guide</x:param>
2325
</x:call>
24-
<x:expect label="Correct Petal Edit URL" select="'https://petal.evolvedbinary.com?ghrepo=evolvedbinary/cityehr-documentation&amp;source=cityehr-quick-start-guide/src/main/lwdita/quick-start-guide/verify-install.dita&amp;branch=develop&amp;referer=https://evolvedbinary.github.io/cityehr-documentation/verify-install.html'"/>
26+
<x:expect label="Correct Petal Edit URL" select="'https://petal.evolvedbinary.com?ghrepo=evolvedbinary/cityehr-documentation&amp;source=cityehr-quick-start-guide/src/main/lwdita/quick-start-guide/verify-install.dita&amp;branch=develop&amp;referer=https://evolvedbinary.github.io/cityehr-documentation/quick-start-guide/verify-install.html'"/>
2527
</x:scenario>
2628

2729
<x:scenario label="Scenario for testing the petal-edit-url function with source file in GitHub Action container">
@@ -32,8 +34,9 @@
3234
<x:param name="petal-github-repo-name" as="xs:string">cityehr-documentation</x:param>
3335
<x:param name="petal-github-branch" as="xs:string">develop</x:param>
3436
<x:param name="petal-referrer-base-url" as="xs:string">https://evolvedbinary.github.io/cityehr-documentation</x:param>
37+
<x:param name="petal-referrer-sub-folder" as="xs:string">quick-start-guide</x:param>
3538
</x:call>
36-
<x:expect label="Correct Petal Edit URL" select="'https://petal.evolvedbinary.com?ghrepo=evolvedbinary/cityehr-documentation&amp;source=cityehr-quick-start-guide/src/main/lwdita/quick-start-guide/verify-install.dita&amp;branch=develop&amp;referer=https://evolvedbinary.github.io/cityehr-documentation/verify-install.html'"/>
39+
<x:expect label="Correct Petal Edit URL" select="'https://petal.evolvedbinary.com?ghrepo=evolvedbinary/cityehr-documentation&amp;source=cityehr-quick-start-guide/src/main/lwdita/quick-start-guide/verify-install.dita&amp;branch=develop&amp;referer=https://evolvedbinary.github.io/cityehr-documentation/quick-start-guide/verify-install.html'"/>
3740
</x:scenario>
3841

3942
</x:description>

cityehr-modelling-guide/pom.xml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,11 @@
2828
<website.output.folder>${project.build.directory}/website</website.output.folder>
2929

3030
<petal.api-url>https://petal.evolvedbinary.com</petal.api-url>
31-
<petal.github-org-name>evolvedbinary</petal.github-org-name>
31+
<petal.github-org-name>cityehr</petal.github-org-name>
3232
<petal.github-repo-name>cityehr-documentation</petal.github-repo-name>
33-
<petal.github-branch>develop</petal.github-branch>
34-
<petal.referrer-base-url>https://evolvedbinary.github.io/cityehr-documentation</petal.referrer-base-url>
33+
<petal.github-branch>main</petal.github-branch>
34+
<petal.referrer-base-url>https://cityehr.github.io/cityehr-documentation</petal.referrer-base-url>
35+
<petal.referrer-sub-folder>modelling-guide</petal.referrer-sub-folder>
3536
</properties>
3637

3738
<dependencies>
@@ -266,6 +267,10 @@
266267
<name>petal-referrer-base-url</name>
267268
<value>${petal.referrer-base-url}</value>
268269
</parameter>
270+
<parameter>
271+
<name>petal-referrer-sub-folder</name>
272+
<value>${petal.referrer-sub-folder}</value>
273+
</parameter>
269274
</parameters>
270275
<outputDir>${html.generated-resources}</outputDir>
271276
<fileMappers>

cityehr-quick-start-guide/pom.xml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,11 @@
2828
<website.output.folder>${project.build.directory}/website</website.output.folder>
2929

3030
<petal.api-url>https://petal.evolvedbinary.com</petal.api-url>
31-
<petal.github-org-name>evolvedbinary</petal.github-org-name>
31+
<petal.github-org-name>cityehr</petal.github-org-name>
3232
<petal.github-repo-name>cityehr-documentation</petal.github-repo-name>
33-
<petal.github-branch>develop</petal.github-branch>
34-
<petal.referrer-base-url>https://evolvedbinary.github.io/cityehr-documentation</petal.referrer-base-url>
33+
<petal.github-branch>main</petal.github-branch>
34+
<petal.referrer-base-url>https://cityehr.github.io/cityehr-documentation</petal.referrer-base-url>
35+
<petal.referrer-sub-folder>quick-start-guide</petal.referrer-sub-folder>
3536
</properties>
3637

3738
<dependencies>
@@ -268,6 +269,10 @@
268269
<name>petal-referrer-base-url</name>
269270
<value>${petal.referrer-base-url}</value>
270271
</parameter>
272+
<parameter>
273+
<name>petal-referrer-sub-folder</name>
274+
<value>${petal.referrer-sub-folder}</value>
275+
</parameter>
271276
</parameters>
272277
<outputDir>${html.generated-resources}</outputDir>
273278
<fileMappers>

0 commit comments

Comments
 (0)