-
-
Notifications
You must be signed in to change notification settings - Fork 515
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 #172 from Suzu-Gears/support-CodePen-embed
Support CodePen embed
- Loading branch information
Showing
3 changed files
with
37 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
--- | ||
export interface Props { | ||
url: string | ||
} | ||
const { url } = Astro.props | ||
const user = url.pathname.split('/')[1] | ||
const id = url.pathname.split('/')[3] | ||
--- | ||
|
||
<div class="codepen-embed"> | ||
<p | ||
class="codepen" | ||
data-height="500" | ||
data-slug-hash={id.toString()} | ||
data-user={user.toString()} | ||
style="height: 300px; box-sizing: border-box; display: flex; align-items: center; justify-content: center; border: 2px solid; margin: 1em 0; padding: 1em;" | ||
> | ||
</p> | ||
</div> | ||
<script async src="https://cpwebassets.codepen.io/assets/embed/ei.js"></script> | ||
|
||
<style> | ||
.codepen-embed { | ||
background-color: #fff; | ||
} | ||
</style> |
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
5726b1c
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
astro-notion-blog – ./
astro-notion-blog-taupe.vercel.app
astro-notion-blog-git-main-otoyo.vercel.app
astro-notion-blog-otoyo.vercel.app