Skip to content

Commit

Permalink
start adding some SEO shenanigans
Browse files Browse the repository at this point in the history
  • Loading branch information
withinboredom committed Jul 17, 2023
1 parent 41c0e5c commit df86a17
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
5 changes: 5 additions & 0 deletions public/robots.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
robots.txt generated by www.seoptimer.com
User-agent: *
Disallow:
Disallow: /cgi-bin/
Disallow: /reviews
12 changes: 12 additions & 0 deletions src/Components/LeaveReview.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,10 @@ public function submit(string $userId, int $round, array $state, string $text_ed
return $this->end();
}

private function currentUri(): string {
return 'https://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
}

public function render(string $userId, int $round)
{
// see if the user exists
Expand All @@ -97,6 +101,14 @@ public function render(string $userId, int $round)
return "<ErrorPage></ErrorPage>";
}

$this->headTagFilter->setOpenGraph(
pageUrl: $this->currentUri(),
title: 'Peer Reviews',
description: 'Leave a review for ' . $snapshot->getFirstName() . ' ' . $snapshot->getLastName() . '.',
imageUrl: $snapshot->getImageUrl(),
locale: 'en_US'
);

// send the round to the orchestration if it is valid
$status = $this->client->getStatus(new OrchestrationInstance(ReviewProcess::class, $userId . '-' . $round));
match ($status->runtimeStatus) {
Expand Down

0 comments on commit df86a17

Please sign in to comment.