Skip to content

[Site] Add robots.txt & sitemap.xml #1814

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 1, 2024
Merged

Conversation

smnandre
Copy link
Member

@smnandre smnandre commented May 1, 2024

No description provided.

@carsonbot carsonbot added Site ux.symfony.com Status: Needs Review Needs to be reviewed labels May 1, 2024
@smnandre smnandre requested a review from kbond May 1, 2024 04:27
Comment on lines 32 to +41
}

#[Route(path: '/robots.txt', name: 'app_robots')]
public function __invoke(Request $request): Response
{
$response = $this->render('robots.txt.twig');
$response->headers->set('Content-Type', 'text/plain');

return $response;
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about creating the file in public/?
So the file can be delivered by the webserver instead of the Symfony app

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, because you use {{ url('app_sitemap') }}

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To be fair, you're right, and i think we will soon render it once after the deployment ... but i need to check first how it goes :)

@carsonbot carsonbot added Status: Reviewed Has been reviewed by a maintainer and removed Status: Needs Review Needs to be reviewed labels May 1, 2024
@kbond kbond force-pushed the site/sitemap-robots branch from 1b8502e to 446ff5c Compare May 1, 2024 13:55
@kbond
Copy link
Member

kbond commented May 1, 2024

Thanks Simon.

@kbond kbond merged commit 277a73b into symfony:2.x May 1, 2024
3 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Site ux.symfony.com Status: Reviewed Has been reviewed by a maintainer
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants