Skip to content

Commit 862ce91

Browse files
authored
Merge pull request #416 from api-platform/staging
MEP
2 parents 3e14871 + e5d1f53 commit 862ce91

File tree

12 files changed

+45
-27
lines changed

12 files changed

+45
-27
lines changed

.github/workflows/deploy.yml

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,8 @@ jobs:
123123
--set=pwa.image.repository=eu.gcr.io/${{ secrets.gke-project }}/website/pwa \
124124
--set=pwa.image.tag=${{ inputs.docker-images-version }} \
125125
--set=pwa.image.pullPolicy=Always \
126+
--set=pwa.resources.requests.cpu=200m \
127+
--set=pwa.resources.requests.memory=700Mi \
126128
--set=bucket.s3Upstream=storage.googleapis.com \
127129
--set=bucket.s3Name=api-platform-website-v3 \
128130
--set=service.type=NodePort \
@@ -140,9 +142,6 @@ jobs:
140142
--set=php.host=${{ env.URL }} \
141143
--set=next.rootUrl=${{ env.URL }} \
142144
--set=github.key=${{ secrets.gh-key }} \
143-
--set=ressources.requests.cpu=250m \
144-
--set=ressources.requests.memory=256Mi \
145-
--set=ressources.limits.memory=700Mi \
146145
--set=postgresql.global.postgresql.auth.password=$(openssl rand -base64 32 | tr -d "=+/") \
147146
--set=postgresql.global.postgresql.auth.username=website \
148147
| sed --unbuffered '/USER-SUPPLIED VALUES/,$d'
@@ -168,12 +167,11 @@ jobs:
168167
--set=pwa.image.repository=eu.gcr.io/${{ secrets.gke-project }}/website/pwa \
169168
--set=pwa.image.tag=${{ inputs.docker-images-version }} \
170169
--set=pwa.image.pullPolicy=Always \
170+
--set=pwa.resources.requests.cpu=200m \
171+
--set=pwa.resources.requests.memory=700Mi \
171172
--set=php.corsAllowOrigin="^$(echo "${{ join(fromJSON(env.CORS), '|') }}" | sed 's/\./\\./g')$" \
172173
--set=github.key=${{ secrets.gh-key }} \
173174
--set=next.rootUrl=${{ env.URL }} \
174-
--set=ressources.requests.cpu=250m \
175-
--set=ressources.requests.memory=256Mi \
176-
--set=ressources.limits.memory=700Mi \
177175
--set=bucket.s3Upstream=storage.googleapis.com \
178176
--set=bucket.s3Name=api-platform-website-v3 \
179177
| sed --unbuffered '/USER-SUPPLIED VALUES/,$d'

helm/api-platform/templates/pwa-deployment.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ spec:
5959
path: /
6060
port: http
6161
resources:
62-
{{- toYaml .Values.resources | nindent 12 }}
62+
{{- toYaml .Values.pwa.resources | nindent 12 }}
6363
{{- with .Values.nodeSelector }}
6464
nodeSelector:
6565
{{- toYaml . | nindent 8 }}

helm/api-platform/values.yaml

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,11 @@ pwa:
2525
pullPolicy: IfNotPresent
2626
# Overrides the image tag whose default is the chart appVersion.
2727
tag: ""
28+
resources:
29+
requests:
30+
memory: 700Mi
31+
cpu: 250m
32+
2833

2934
next:
3035
rootUrl: ChangeMe
@@ -59,13 +64,13 @@ postgresql:
5964
username: "example"
6065
password: "!ChangeMe!"
6166
database: "api"
67+
# Persistent Volume Storage configuration.
68+
# ref: https://kubernetes.io/docs/user-guide/persistent-volumes
69+
primary:
6270
resources:
6371
requests:
6472
memory: 50Mi
6573
cpu: 1m
66-
# Persistent Volume Storage configuration.
67-
# ref: https://kubernetes.io/docs/user-guide/persistent-volumes
68-
primary:
6974
persistence:
7075
enabled: true
7176
storageClass: "standard"
@@ -125,11 +130,9 @@ ingress:
125130
# # choice for the user. This also increases chances charts run on environments with little
126131
# # resources, such as Minikube. If you do want to specify resources, uncomment the following
127132
# # lines, adjust them as necessary, and remove the curly braces after 'resources:'.
128-
# limits:
129-
# memory: 750Mi
130133
# requests:
131134
# cpu: 150m
132-
# memory: 256Mi
135+
# memory: 500Mi
133136

134137
# If you use Mercure, you need the managed or the On Premise version to deploy more than one pod: https://mercure.rocks/docs/hub/cluster
135138
replicaCount: 1

pwa/api/doc/index.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { readFile } from "node:fs/promises";
22
import path from "node:path";
33
import matter from "gray-matter";
4-
import { extractHeadingsFromMarkdown } from "utils";
4+
import { extractHeadingsFromMarkdown, slugify } from "utils";
55
import { Octokit } from "octokit";
66
import { throttling } from "@octokit/plugin-throttling";
77
import { markedHighlight } from "marked-highlight";
@@ -185,6 +185,8 @@ const absoluteImgRegex = /src="\/docs\/(.*?\.(jpg|jpeg|png|gif|svg))"/gm;
185185
const blankLinkRegex =
186186
/<a\s+([^>]*\s+)?href="http[^"]*"(?![^>]*\starget=[^>]*>)/gm;
187187

188+
const headingRegex = /<h([2-4])>(.*?)<\/h\1>/gm;
189+
188190
function getLang(block: string): string {
189191
const language = block.match(codeLanguage);
190192

@@ -321,5 +323,12 @@ export const getHtmlFromGithubContent = async (
321323
absoluteImgRegex,
322324
`src="https://raw.githubusercontent.com/api-platform/docs/${version}/$1"`
323325
)
326+
.replace(headingRegex, (match, p1, p2) => {
327+
const slug = slugify(p2);
328+
return `<h${p1} class="group">${p2} <a id=${slug} class="opacity-0 group-hover:opacity-100" style="
329+
padding-top: 80px;
330+
margin-top: -80px;
331+
" href=#${slug}>#</a></h${p1}>`;
332+
})
324333
.replace(blankLinkRegex, '$& target="_blank"');
325334
};

pwa/app/(common)/community/page.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -170,8 +170,8 @@ export default async function Page() {
170170
</Button>
171171
</div>
172172
</ShapeSection>
173-
<div className="bg-gray-100 dark:bg-blue-darkest pb-12">
174-
<div className="container relative py-6">
173+
<div className="bg-gray-100 dark:bg-blue-darkest after:absolute after:w-full after:h-80 after:top-full after:left-0 after:bg-gray-100 after:dark:bg-blue-darkest">
174+
<div className="container relative pt-6">
175175
<Heading size="lg" level="h2">
176176
Our events
177177
</Heading>

pwa/app/(common)/components/RealTime.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ export default function RealTime() {
2727
<Button
2828
className="mt-8"
2929
empty
30-
external
3130
href="/docs/core/mercure/"
3231
ariaLabel="Real time with Mercure"
3332
>

pwa/app/(common)/components/Timeline.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ export default function Timeline() {
185185
>
186186
paginate
187187
</Link>{" "}
188-
and
188+
and{" "}
189189
<Link
190190
href="/docs/core/validation"
191191
prefetch={false}
@@ -202,7 +202,7 @@ export default function Timeline() {
202202
className="link"
203203
>
204204
PostgreSQL
205-
</Link>{" "}
205+
</Link>
206206
,{" "}
207207
<Link href="/docs/core/mongodb/" prefetch={false} className="link">
208208
MongoDB
@@ -244,6 +244,7 @@ export default function Timeline() {
244244
prefetch={false}
245245
className="link"
246246
>
247+
{" "}
247248
extension points
248249
</Link>
249250
.

pwa/app/(common)/events/components/EventsPage.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ export default function EventsPage({ events }: EventsPageProps) {
4747
};
4848

4949
return (
50-
<div className="bg-gray-100 dark:bg-blue-black pb-12">
50+
<div className="bg-gray-100 dark:bg-blue-black pb-12 relative after:absolute after:w-full after:h-80 after:top-full after:left-0 after:bg-gray-100 after:dark:bg-blue-black">
5151
<ShapeSection
5252
className="bg-blue-black h-[75vh]"
5353
effect="right-triangle"

pwa/app/(common)/help/page.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -159,8 +159,8 @@ export default async function Page() {
159159
/>
160160
</div>
161161
</div>
162-
<div className="bg-blue-extralight/50 dark:bg-blue-dark dark:text-white">
163-
<div className="container xl:max-w-5xl flex flew-row items-center relative gap-16 py-12">
162+
<div className="bg-blue-extralight/50 dark:bg-blue-dark dark:text-white after:absolute after:w-full after:h-80 after:top-full after:left-0 after:bg-blue-extralight/50 after:dark:bg-blue-dark">
163+
<div className="container xl:max-w-5xl flex flew-row items-center relative gap-16 pt-12">
164164
<Image
165165
width={800}
166166
height={686}

pwa/app/(common)/resources/colouring-webby/page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ export default async function Page() {
2727
.filter((filename: string) => path.parse(filename).ext === ".jpg")
2828
.map((filename: string) => path.parse(filename).name);
2929
return (
30-
<section className="pt-16 bg-gray-100 dark:bg-blue-black">
30+
<section className="pt-16 bg-gray-100 dark:bg-blue-black after:absolute after:w-full after:h-80 after:top-full after:left-0 after:bg-gray-100 after:dark:bg-blue-black">
3131
<div className="bg-blue py-8 text-white dark:text-blue-black">
3232
<div className="container relative z-10 text-white flex flex-row gap-8 justify-center items-center min-h-full">
3333
<div className="text-center">

0 commit comments

Comments
 (0)