Skip to content

Commit

Permalink
Website: fix more 404
Browse files Browse the repository at this point in the history
  • Loading branch information
mnapoli committed Sep 18, 2023
1 parent 002dbb5 commit dac4c68
Show file tree
Hide file tree
Showing 10 changed files with 19 additions and 10 deletions.
2 changes: 1 addition & 1 deletion docs/_meta.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"index": "What is Bref and serverless?",
"cost-calculator": "Costs calculator",
"costs-calculator": "Costs calculator",
"-- Getting started": {
"type": "separator",
"title": "Getting started"
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion docs/deploy/docker.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ Bref offers the following base images:

- `bref/php-xx-fpm:2`: PHP-FPM to run HTTP applications
- `bref/php-xx-console:2`: to run PHP CLI commands
- `bref/php-xx:2`: to run [PHP functions](../functions/README.md)
- `bref/php-xx:2`: to run [PHP functions](../runtimes/function.mdx)

### Extra PHP extensions

Expand Down
6 changes: 3 additions & 3 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ Bref and AWS Lambda can be used to run many kind of PHP application, for example

Bref aims to support any PHP framework as well.

If you are interested in real-world examples as well as cost analyses head over to the [**Case Studies** page](case-studies.md).
If you are interested in real-world examples as well as cost analyses head over to the [**Case Studies** page](/docs/case-studies.md).

## Maturity matrix

Expand Down Expand Up @@ -170,7 +170,7 @@ This matrix will be updated as Bref and AWS services evolve over time.

- **Website**

Websites can run on AWS Lambda. Assets can be stored in S3 and served via Cloudfront. This is documented in the ["Websites" documentation](/docs/web-apps/website-assets.md). Performance is as good as any server.
Websites can run on AWS Lambda. Assets can be stored in S3 and served via Cloudfront. This is documented in the ["Websites" documentation](/docs/use-cases/websites.mdx). Performance is as good as any server.

- **Legacy application**

Expand All @@ -180,4 +180,4 @@ This matrix will be updated as Bref and AWS services evolve over time.

## Getting started

Get started with Bref by reading the [installation documentation](setup.mdx).
Get started with Bref by reading the [installation documentation](/docs/setup.mdx).
2 changes: 1 addition & 1 deletion docs/laravel/getting-started.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ This guide helps you run Laravel applications on AWS Lambda using Bref. These in

## Setup

First, **follow the [Setup guide](../setup.md)** to create an AWS account and install the necessary tools.
First, **follow the [Setup guide](../setup.mdx)** to create an AWS account and install the necessary tools.

Next, in an existing Laravel project, install Bref and the [Laravel-Bref package](https://github.com/brefphp/laravel-bridge).

Expand Down
2 changes: 1 addition & 1 deletion docs/setup.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ To use Bref, you will need an AWS account and the `serverless` CLI. Let's get st
If you have already set up AWS credentials on your machine (for example if you use the `aws` CLI), you can skip this step.
</Callout>

- [Create AWS access keys](/docs/setup/aws-keys.mdx)
- [Create AWS access keys](./setup/aws-keys.mdx)

- Set up those keys by running:

Expand Down
2 changes: 1 addition & 1 deletion docs/symfony/getting-started.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ This guide helps you run Symfony applications on AWS Lambda using Bref. These in

## Setup

First, **follow the [Setup guide](../setup.md)** to create an AWS account and install the necessary tools.
First, **follow the [Setup guide](../setup.mdx)** to create an AWS account and install the necessary tools.

Next, in an existing Symfony project, install Bref and the [Symfony Bridge package](https://github.com/brefphp/symfony-bridge).

Expand Down
2 changes: 1 addition & 1 deletion docs/use-cases/http/binary-requests-responses.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { Callout } from 'nextra/components';
AWS Lambda is only used for executing code. Serving assets via PHP does not make sense as this would be a waste of resources and money.

<Callout>
Deploying a website with assets (e.g. CSS, JavaScript, images) is covered in [the "Websites" documentation](./websites.md).
Deploying a website with assets (e.g. CSS, JavaScript, images) is covered in [the "Websites" documentation](../websites.mdx).
</Callout>

In some cases however, you want to serve images (or other assets) via PHP. One example would be if you served generated images or PDFs via PHP.
Expand Down
2 changes: 1 addition & 1 deletion website/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ node_modules:
npm install

check-links:
node link-checker/index.js https://website-v3--bref-website-v2.netlify.app/docs
node link-checker/index.js https://bref-website.vercel.app/
9 changes: 9 additions & 0 deletions website/link-checker/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,14 @@ async function scan(stdout, url, links, brokenLinks, pageCache) {
const urlWithoutAnchor = url.split('#')[0];
if (pageCache[urlWithoutAnchor] === undefined) {
const response = await fetch(url);
// Ignore redirects to other domains (e.g. https://bref.sh/slack)
const originalDomain = new URL(url).hostname;
const finalDomain = new URL(response.url).hostname;
if (finalDomain !== originalDomain) {
console.log(`Ignoring ${url} redirecting to ${response.url}`);
pageCache[urlWithoutAnchor] = false;
return;
}
if (! response.ok) {
pageCache[urlWithoutAnchor] = false;
} else {
Expand Down Expand Up @@ -80,6 +88,7 @@ async function scan(stdout, url, links, brokenLinks, pageCache) {
// Ignore already scanned links
return;
}
stdout.write(`Found new link ${newLink} on ${url}\n`);
links[newLink] = false;
}
},
Expand Down

0 comments on commit dac4c68

Please sign in to comment.