Blender-org web-assets v2 upgrade #104116

Merged
Márton Lente merged 56 commits from web-assets-v2-upgrade into main 2024-08-13 17:27:59 +02:00
4 changed files with 35 additions and 48 deletions
Showing only changes of commit 9da53a0e80 - Show all commits

View File

@ -44,7 +44,10 @@ function get_posts_as_cards($atts) {
"site" => '',
"per_page" => '4',
"categories" => '70',
"utm_medium" => 'homepage'
"utm_medium" => 'homepage',
"show_title" => '1',
"show_excerpt" => '1',
"open_new_tab" => '1',
);
extract(shortcode_atts($defaults, $atts));
@ -53,7 +56,10 @@ function get_posts_as_cards($atts) {
"site" => $site,
"per_page" => $per_page,
"categories" => $categories,
"utm_medium" => $utm_medium
"utm_medium" => $utm_medium,
"show_title" => $show_title,
"show_excerpt" => $show_excerpt,
"open_new_tab" => $open_new_tab,
);
/* Custom feed treatment for Blender Studio. */
@ -103,13 +109,18 @@ function get_posts_as_cards($atts) {
$allposts .= '<div class="cards-item-content">';
if ($item['thumbnail']) {
$allposts .= '<a href="' . $item['link'] . '?utm_medium=' . $utm_medium . '" target="_blank" class="cards-item-thumbnail">';
$allposts .= '<a href="' . $item['link'] . '?utm_medium=' . $utm_medium . '" ' . ($open_new_tab ? ' target="_blank" ' : '') . 'class="cards-item-thumbnail m-0">';
$allposts .= '<img src="' . $item['thumbnail'] . '" alt="' . $item['title'] . '">';
$allposts .= '</a>';
}
$allposts .= '<a href="' . $item['link'] . '?utm_medium=' . $utm_medium . '" target="_blank" class="cards-item-title">' . $item['title'] . '</a>';
$allposts .= '<a href="' . $item['link'] . '?utm_medium=' . $utm_medium . '" target="_blank" class="cards-item-excerpt">' . $item['description'] . '</a>';
if ($show_title) {
$allposts .= '<a href="' . $item['link'] . '?utm_medium=' . $utm_medium . '" ' . ($open_new_tab ? ' target="_blank" ' : '') . 'class="cards-item-title mt-2">' . $item['title'] . '</a>';
}
if ($show_excerpt) {
$allposts .= '<a href="' . $item['link'] . '?utm_medium=' . $utm_medium . '" ' . ($open_new_tab ? ' target="_blank" ' : '') . 'class="cards-item-excerpt">' . $item['description'] . '</a>';
}
$allposts .= '</div>';
$allposts .= '</div>';

View File

@ -16,7 +16,13 @@ function register_menus() {
// Sidebar Registration.
if (function_exists('register_sidebar')) {
register_sidebar(array( 'name' => 'Banner Widgets', 'id' => 'banner-widgets'));
register_sidebar(
array(
'name' => 'Single Post Footer',
'id' => 'posts-single-footer',
'before_widget' => '<section>',
'after_widget' => '</section>',
));
}

View File

@ -53,14 +53,11 @@ $page_width = get_field('page_width');
<div class="cards-item-thumbnail">
<span class="cards-item-title mt-3">Preview</span>
</div>
<span class="cards-item-excerpt pb-3">
This is how your post will look when listed.
<br/>
The featured image <strong>must be 16:9</strong>.
<hr/>
The excerpt is a 20-ish word version of the post.
To write your own excerpt enable the panel in <i class="i-more-vertical"></i> (top-right corner),
<em>Preferences</em>, <em>Panels</em>, while editing the post.
<span class="cards-list-item-excerpt pb-3">
The Featured Image <strong>must be 16:9</strong>.
<br><br>
The excerpt is a ~20 word summary.
Click on <strong>Add an excerpt…</strong> in the sidebar.
</span>
</div>
</div>
@ -142,40 +139,14 @@ $page_width = get_field('page_width');
</div>
<div class="blog-bottom">
<div class="container">
<?php dynamic_sidebar('posts-single-footer'); ?>
<?php if (comments_open() || get_comments_number() ): ?>
<div class="row blog">
<div class="col-md-8 mx-auto blog">
<?php
if (comments_open() || get_comments_number() ) :
comments_template();
endif;
?>
<div class="blog-social">
<span class="blog-social-text">SHARE THIS STORY ON</span>
<ul>
<li>
<a href="https://www.facebook.com/sharer/sharer.php?u=<?php the_permalink(); ?>">
<i class="i-facebook"/></i> Facebook
</a>
</li>
<li>
<a href="https://twitter.com/home?status=<?php the_title(); ?>&nbsp;@blender_org&nbsp;<?php the_permalink(); ?>&nbsp;%23b3d">
<i class="i-twitter"/></i> X
</a>
</li>
<li>
<a href="http://www.reddit.com/submit?url=<?php the_permalink(); ?>">
<i class="i-reddit"/></i> Reddit
</a>
</li>
<li>
<a href="https://www.linkedin.com/shareArticle?mini=true&url=<?php the_permalink(); ?>&title=<?php the_title(); ?>&source=Blender">
<i class="i-linkedin"/></i> LinkedIn
</a>
</li>
</ul>
</div>
<?php comments_template(); ?>
</div>
</div>
<?php endif; ?>
</div>
</div>
</div>

View File

@ -549,8 +549,7 @@
span
overflow: hidden
+padding(3, y)
+padding(3, right)
+padding(3)
text-overflow: ellipsis
white-space: nowrap