(Squarespace) How to show full post in blog excerpt

You can follow these steps to show full post in blog excerpt. This thread apply for Blog Basic Grid Blog Only.

#1. First, you need to enable Excerpt

#2. Next, use this code to Code Injection > Footer (or Blog Page Header Injection)

<script>
$(document).ready(function() {
    $('.blog-basic-grid--container').each(function() {
        const blogItem = $(this);
        const blogLink = blogItem.find('.blog-title a').attr('href');
        
        if (blogLink) {
            const jsonUrl = blogLink + '?format=json-pretty';
            
            $.ajax({
                url: jsonUrl,
                method: 'GET',
                dataType: 'json',
                success: function(data) {
                    if (data && data.item && data.item.body) {
                        const fullContent = data.item.body;
                        const excerptWrapper = blogItem.find('.blog-excerpt-wrapper');
                        
                        excerptWrapper.html(fullContent);
                        
                        setTimeout(function() {
                            excerptWrapper.find('img').each(function() {
                                const $img = $(this);
                                if ($img.attr('data-src')) {
                                    $img.attr('src', $img.attr('data-src'));
                                }
                                $img.css({
                                    'max-width': '100%',
                                    'height': 'auto',
                                    'display': 'block',
                                    'margin': '10px 0',
                                    'object-fit': 'cover'
                                });
                                $img.addClass('loaded');
                            });
                            
                            excerptWrapper.find('.sqs-block-content').css({
                                'margin': '10px 0',
                                'line-height': '1.6'
                            });
                            
                            excerptWrapper.find('.sqs-block').css({
                                'margin-bottom': '15px'
                            });
                            
                            excerptWrapper.find('p').css({
                                'margin-bottom': '10px'
                            });
                            
                            excerptWrapper.find('[data-loader="sqs"]').each(function() {
                                const $element = $(this);
                                if ($element.attr('data-src')) {
                                    $element.attr('src', $element.attr('data-src'));
                                }
                            });
                            
                            excerptWrapper.find('.custom-blog-title').css({
                                'font-size': '18px',
                                'font-weight': 'bold',
                                'margin': '15px 0'
                            });
                            
                            excerptWrapper.find('.custom-field a').css({
                                'display': 'inline-block',
                                'text-decoration': 'none'
                            });
                        }, 100);
                        
                        blogItem.find('.blog-more-link').hide();
                    }
                },
                error: function() {
                    console.log('Could not load full content for: ' + blogLink);
                }
            });
        }
    });
});
</script>