Skip to content
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

Fix preview urls #147

Merged
merged 1 commit into from
Feb 15, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 19 additions & 10 deletions admin/src/api/post/content-types/post/lifecycles.js
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ async function generatePreview(event) {
for (const element of embeds) {
let string = "";
if (["mp4", "webm"].some((v) => element.attributes.url.value.includes(v))) {
string = `<video style="margin:auto" autoplay loop muted>
string = `<video style="margin:auto;max-height:70vh" autoplay loop muted>
<source src="${element.attributes.url.value}" type="video/mp4">
Your browser does not support the video tag.
</video>`;
Expand Down Expand Up @@ -309,23 +309,31 @@ async function generatePreview(event) {
>
<h2
style="
max-height:40px;
margin: 0 !important;
overflow: hidden;
color: #242424;
text-overflow: ellipsis;
font-size: 16px !important;
color: #242424;
font-weight: 700;
margin: 0 !important;
-webkit-line-clamp: 2;
-webkit-box-orient:vertical;
"
>
${data.title}
</h2>
<div class="desc" style="margin-top: 8px">
<div style="margin-top: 8px">
<h3
style="
max-height:40px;
margin: 0 !important;
overflow: hidden;
color: #6b6b6b;
text-overflow: ellipsis;
font-size: 16px !important;
color: #6b6b6b;
line-height: 20px;
margin: 0 !important;
-webkit-line-clamp: 2;
-webkit-box-orient:vertical;
"
>
${data.description}
Expand All @@ -334,12 +342,13 @@ async function generatePreview(event) {
<div>
<p
style="
max-height:40px;
margin: 0 !important;
color: #6b6b6b;
font-size: 13px !important;
-webkit-line-clamp: 2;
max-height: 40px;
-webkit-box-orient:vertical;
text-overflow: ellipsis;
font-size: 13px !important;
color: #6b6b6b;
margin: 0 !important;
"
>
${data.domain}
Expand Down
Loading