-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add dynamic social share image (#63)
* Add social.njk base * Add support for social.scss and update CSS rendering * Refactor styles and remove unused code * Refactor social card styles and add social card component * Update social card styles and remove social.njk file * Refactor meta tags and add open graph screenshot URL shortcode * Add disallow rule for /social-card/* in robots.txt * Update meta tags for social media sharing * Remove unnecessary code and exclude pages from collections
- Loading branch information
1 parent
6c59e7f
commit 3284c3e
Showing
9 changed files
with
192 additions
and
83 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
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,51 @@ | ||
body.social-card { | ||
background-color: $white; | ||
color: $gray-950; | ||
display: block; | ||
margin: 0; | ||
|
||
.box { | ||
width: 1200px; | ||
height: 630px; | ||
position: relative; | ||
background-color: $gray-50; | ||
padding: 32px; | ||
box-sizing: border-box; | ||
display: flex; | ||
|
||
.container { | ||
background: $white; | ||
color: $gray-950; | ||
border-radius: 32px; | ||
height: 100%; | ||
width: 100%; | ||
padding: 48px; | ||
position: relative; | ||
display: flex; | ||
|
||
img { | ||
border-radius: 100px; | ||
position: absolute; | ||
} | ||
|
||
h1 { | ||
width: 696px; | ||
font-size: 70px; | ||
display: flex; | ||
align-items: center; | ||
line-height: 5rem; | ||
margin: 0; | ||
} | ||
|
||
p { | ||
font-family: "Inter"; | ||
font-weight: 500; | ||
font-size: 32px; | ||
line-height: 3rem; | ||
letter-spacing: -0.001em; | ||
position: absolute; | ||
bottom: 48px; | ||
} | ||
} | ||
} | ||
} |
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
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,23 @@ | ||
--- | ||
pagination: | ||
data: collections.writing | ||
size: 1 | ||
alias: post | ||
permalink: "social-card/{{ post.url }}/" | ||
eleventyExcludeFromCollections: true | ||
--- | ||
|
||
<html> | ||
<head> | ||
<link rel="stylesheet" href="{{ '/assets/styles/main.css' | url }}"/> | ||
</head> | ||
<body class="social-card"> | ||
<div class="box"> | ||
<div class="container"> | ||
<img src="{{ '/assets/images/afnizar-nur-ghifari.png' | url }}" alt="Afnizar Nur Ghifari" height="70" width="70" decoding="async"/> | ||
<h1 class="headline">{{ post.data.title }}</h1> | ||
<p>Afnizar Nur Ghifari</p> | ||
</div> | ||
</div> | ||
</body> | ||
</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
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
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