Skip to content

Commit d05eecb

Browse files
Merge pull request #4453 from platformsh/llms-psh-issue
2 parents 0e82b61 + aeffa6a commit d05eecb

File tree

6 files changed

+34
-19
lines changed

6 files changed

+34
-19
lines changed

Diff for: sites/platform/config/_default/params.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ vendor:
3737
routes: routes
3838
urls:
3939
main: https://platform.sh/
40-
docs: https://docs.platform.sh/
40+
docs: https://docs.platform.sh
4141
support: https://support.platform.sh/
4242
sales: https://platform.sh/contact
4343
console: https://console.platform.sh/

Diff for: sites/platform/src/create-apps/hooks/_index.md

+12-12
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ Create your `build` hook to install them all:
3636

3737
1. Create a `build` hook in your [app configuration](/create-apps/app-reference/single-runtime-image.md):
3838

39-
```yaml {configfile="app" dir="client" }
39+
```yaml {configFile="app" dir="client" }
4040
hooks:
4141
build: |
4242
set -e
@@ -54,7 +54,7 @@ Create your `build` hook to install them all:
5454
If other hooks fail, the deploy still happens.
5555
2. Install your top-level dependencies inside this `build` hook:
5656

57-
```yaml {configfile="app" dir="client"}
57+
```yaml {configFile="app" dir="client"}
5858
hooks:
5959
build: |
6060
set -e
@@ -71,7 +71,7 @@ Create your `build` hook to install them all:
7171
In this case, the app root is `client`.
7272
To run commands from a different directory, you need to change directories (relative to the app root):
7373

74-
```yaml {configfile="app" dir="client"}
74+
```yaml {configFile="app" dir="client"}
7575
hooks:
7676
build: |
7777
set -e
@@ -82,7 +82,7 @@ Create your `build` hook to install them all:
8282

8383
5. Install the dependencies for the testing script:
8484

85-
```yaml {configfile="app" dir="client"}
85+
```yaml {configFile="app" dir="client"}
8686
hooks:
8787
build: |
8888
set -e
@@ -122,7 +122,7 @@ All of this configuration and preparation can be handled in a bash script.
122122
Unlike in the `build` hook, in the `deploy` hook the system is generally read-only.
123123
So create a mount where you can write the Drush configuration:
124124

125-
```yaml {configfile="app" dir="api"}
125+
```yaml {configFile="app" dir="api"}
126126
mounts:
127127
/.drush:
128128
source: storage
@@ -131,7 +131,7 @@ All of this configuration and preparation can be handled in a bash script.
131131

132132
4. Add a `deploy` hook that runs the preparation script:
133133

134-
```yaml {configfile="app" dir="api"}
134+
```yaml {configFile="app" dir="api"}
135135
hooks:
136136
deploy: !include
137137
type: string
@@ -159,7 +159,7 @@ So you don't have to rebuild Drupal but you still get fresh content.
159159
1. Set a relationship for Next.js with Drupal.
160160
This allows the Next.js app to make requests and receive data from the Drupal app.
161161

162-
```yaml {configfile="app" dir="client"}
162+
```yaml {configFile="app" dir="client"}
163163
relationships:
164164
api:
165165
service: 'api'
@@ -170,7 +170,7 @@ So you don't have to rebuild Drupal but you still get fresh content.
170170
Like the [`deploy` hook](#configure-drush-and-drupal), the `post_deploy` hook has a read-only file system.
171171
Create mounts for your Next.js files:
172172

173-
```yaml {configfile="app" dir="client"}
173+
```yaml {configFile="app" dir="client"}
174174
mounts:
175175
/.cache:
176176
source: local
@@ -189,7 +189,7 @@ So you don't have to rebuild Drupal but you still get fresh content.
189189

190190
3. Add a `post_deploy` hook that first tests the connection between the apps:
191191

192-
```yaml {configfile="app" dir="client"}
192+
```yaml {configFile="app" dir="client"}
193193
hooks:
194194
post_deploy: |
195195
. deploy/platformsh.environment
@@ -200,7 +200,7 @@ So you don't have to rebuild Drupal but you still get fresh content.
200200

201201
4. Then build the Next.js site:
202202

203-
```yaml {configfile="app" dir="client"}
203+
```yaml {configFile="app" dir="client"}
204204
hooks:
205205
post_deploy: |
206206
. deploy/platformsh.environment
@@ -220,7 +220,7 @@ The following shows only the parts necessary for the hooks.
220220

221221
### Drupal
222222

223-
```yaml {configfile="app" dir="api"}
223+
```yaml {configFile="app" dir="api"}
224224
# The name of this app. Must be unique within the project.
225225
name: 'drupal'
226226
@@ -265,7 +265,7 @@ mounts:
265265

266266
### Next.js
267267

268-
```yaml {configfile="app" dir="client"}
268+
```yaml {configFile="app" dir="client"}
269269
# The name of this app, which must be unique within the project.
270270
name: 'nextjs'
271271

Diff for: sites/platform/src/create-apps/web/serve-different-directories.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ If so, you can serve all requests by your app code except for those that start w
2727
which you serve with your generated docs.
2828
Use a [`web` configuration](/create-apps/app-reference/single-runtime-image.md#web) similar to the following:
2929

30-
```yaml {configfile="app"}
30+
```yaml {configFile="app"}
3131
web:
3232
locations:
3333
'/':

Diff for: sites/upsun/src/create-apps/web/serve-different-directories.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ If so, you can serve all requests by your app code except for those that start w
2525
which you serve with your generated docs.
2626
Use a [`web` configuration](/create-apps/app-reference/single-runtime-image.md#web) similar to the following:
2727

28-
```yaml {configfile="apps"}
28+
```yaml {configFile="apps"}
2929
applications:
3030
docs:
3131
source:

Diff for: sites/upsun/src/learn/overview/yaml/yaml-structure.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ This YAML file is located in your ``.{{% vendor/cli %}}`` directory, at the root
1515
```bash
1616
.
1717
├── {{< vendor/configdir >}}
18-
|   └── {{< vendor/configfile "apps" "strip" >}}
19-
└── <source code>
18+
| └── {{< vendor/configfile "apps" "strip" >}}
19+
└── <SOURCE_CODE>
2020
```
2121
## Mandatory top-level keys
2222
In the ``config.yaml`` file, there are only three mandatory top-level YAML keys:

Diff for: themes/psh-docs/layouts/partials/llms/replace-html.md

+17-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
{{- $full := .full | default (0) -}}
22
{{- $level := .level | default (1) -}}
33
{{- $baseURL := .vendor.urls.docs -}}
4+
{{- $appsConfigFile := .vendor.config.files.apps -}}
5+
{{- $appConfigFile := .vendor.config.files.app -}}
6+
{{- $envConfigFile := .vendor.config.files.env | default "" -}}
7+
{{- $servicesConfigFile := .vendor.config.files.services -}}
8+
{{- $routesConfigFile := .vendor.config.files.routes -}}
49
{{- if .title -}}
510
{{- if eq .version "2" }}
611
{{ range $num := (seq $level) }}#{{ end }} {{ .title | replaceRE `\{\{[%\|\<]?\ *vendor\/name\ *[\%|\>]?\}\}` "Upsun" }}
@@ -75,15 +80,25 @@
7580

7681
| replaceRE `<title>(.*)?<\/title>` "**$1**"
7782
| replaceRE `<\/?(ol|ul)>` ""
78-
| replaceRE `<li>\n?` ` - ` -}}
83+
| replaceRE `<li>\n?` ` - `
84+
| replaceRE `\:first-child\]\:mt\-0 \[\&\>:last-child\]:mb-0">` ""
85+
| replaceRE ` \{configFile=\"apps\"` (printf ` {location="%s"` $appsConfigFile)
86+
| replaceRE ` \{configFile=\"app\"` (printf ` {location="%s"` $appConfigFile)
87+
| replaceRE ` \{configFile=\"env\"` (printf ` {location="%s"` $envConfigFile)
88+
| replaceRE ` \{configFile=\"routes\"` (printf ` {location="%s"` $routesConfigFile)
89+
| replaceRE ` \{configFile=\"services\"` (printf ` {location="%s"` $servicesConfigFile)
90+
| replaceRE `\{location="([^"]+)"(?: dir="([^"]*)")?\}` ` {location="${2}/${1}"}`
91+
| replaceRE ` {location="/([^"]+)"}` ` {location="${1}"}`
92+
93+
-}}
7994

8095
{{- if .full -}}
8196
{{- $content = $content | replaceRE "(?m)^(#{2,6})(\\s|$)" (printf "${1}%s " $hashes) -}}
8297
{{- end -}}
8398

8499
{{- $content = $content
85100
| replaceRE ` ([a-zA-Z0-9\@:-]){2,}="([][a-zA-Z0-9\.\_\!\+:='\''\;,\/\{\}\(\)\&><↗\ -]{0,})"` ``
86-
| replaceRE "(`[^`]*?)( )?(<)([^>]+)(>)([^`^ ]*?`)" "${1}${2}##PLACEHOLDER_START##${4}##PLACEHOLDER_END##${6}"
101+
| replaceRE `<([A-Z0-9_]+)>` "##PLACEHOLDER_START##${1}##PLACEHOLDER_END##"
87102
| replaceRE `<[^>]+>` ""
88103
| replaceRE "##PLACEHOLDER_START##(.*?)##PLACEHOLDER_END##" "<${1}>"
89104
| replaceRE `\[Back\]\([^)]+\)[\n|\ ]*\[[^\]]+\]\([^)]+\)` "\n"

0 commit comments

Comments
 (0)