forked from simonlourson/blueprintnotincluded
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request simonlourson#22 from Sinetheta/bots-preview
Add link previews for social sharing
- Loading branch information
Showing
8 changed files
with
165 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import path from 'path'; | ||
import { Request, Response } from "express"; | ||
import isbot from 'isbot' | ||
|
||
export class StaticController { | ||
public serveHtml(req: Request, res: Response) { | ||
if (isbot(req.get('user-agent'))) { | ||
res.render('index-robots'); | ||
} else { | ||
res.sendFile(path.join(__dirname, 'public', 'index.html')); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta property="og:type" content="website" /> | ||
<meta property="og:title" content="Blueprint Not Included" /> | ||
<meta property="og:description" content="A place to upload, build, and share your favourite blueprint designs for Oxygen Not Included." /> | ||
|
||
<!-- Discord bot will respect "og:image:url" but needs a square image for small previews --> | ||
<meta property="og:image:url" content="/images/site-preview-large-square.png" /> | ||
<meta property="ogimage:type" content="image/png" /> | ||
<meta property="og:image:width" content="1200" /> | ||
<meta property="og:image:height" content="1200" /> | ||
<meta property="og:image:alt" content="An example blueprint, shown against the website editor." /> | ||
|
||
<!-- Discord bot will ignore "og:image:url" but can display a wide image --> | ||
<meta property="og:image" content="/images/site-preview-large-wide.png" /> | ||
<meta property="ogimage:type" content="image/png" /> | ||
<meta property="og:image:width" content="1200" /> | ||
<meta property="og:image:height" content="671" /> | ||
<meta property="og:image:alt" content="An example blueprint, shown against the website editor, next to the blueprint not included logo." /> | ||
</head> | ||
<body> | ||
</body> | ||
</html> |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters