Pen Settings



CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ add another resource


Babel is required to process package imports. If you need a different preprocessor remove all packages first.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource


Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.


                <body class="bg-light">
<div class="container mt-5 pt-5" id="medium">
        <div class="jumbotron text-center">
            <div id="logo"></div>
            <h1 class="display-4 mb-3">@mediumstaff's Posts</h1>
            <a class="btn btn-outline-primary btn-lg" href="" target="_blank" role="button">View all posts</a>
        <div class="row" id="jsonContent">

        <ul id="pagin" class="pagination justify-content-center">

    <div class="text-center">
        <div class="mb-5">
            <a class="btn btn-outline-primary btn-lg mb-5" href="">View all Posts</a>




                 $(function () {
            var mediumPromise = new Promise(function (resolve) {
            var $content = $('#jsonContent');
            var data = {
                rss: ''
            $.get('', data, function (response) {
                if (response.status == 'ok') {
                    $("#logo").append(`<img src="${response.feed["image"]}" class="rounded mx-auto d-block">`)
                    var output = '';
                    $.each(response.items, function (k, item) {
                        output += `<div class="card mb-3 mx-auto mr-5 " style="width: 20rem;">`;
                        var tagIndex = item.description.indexOf('<img'); // Find where the img tag starts
                        var srcIndex = item.description.substring(tagIndex).indexOf('src=') + tagIndex; // Find where the src attribute starts
                        var srcStart = srcIndex + 5; // Find where the actual image URL starts; 5 for the length of 'src="'
                        var srcEnd = item.description.substring(srcStart).indexOf('"') + srcStart; // Find where the URL ends
                        var src = item.description.substring(srcStart, srcEnd); // Extract just the URL
                        output += `<img src="${src}" class="card-img-top" alt="Cover image">`;
                        output += `<div class="card-body">`;
                        output += `<h5 class="card-title"><a href="${}">${item.title}</a></h5>`;
                        var yourString = item.description.replace(/<img[^>]*>/g,""); //replace with your string.
                        yourString = yourString.replace('h4', 'p');
                        yourString = yourString.replace('h3', 'p');
                        var maxLength = 120; // maximum number of characters to extract
                        //trim the string to the maximum length
                        var trimmedString = yourString.substr(0, maxLength);
                        //re-trim if we are in the middle of a word
                        trimmedString = trimmedString.substr(0, Math.min(trimmedString.length, trimmedString.lastIndexOf(" ")))
                        output += `<p class="card-text">${trimmedString}...</p>`;
                        output += `<a href="${}" class="btn btn-outline-success">Read More</a>`;
                        output += '</div></div>';
                        return k < 10;

                pageSize = 3;

                var pageCount = $(".card").length / pageSize;

                for (var i = 0; i < pageCount; i++) {
                    $("#pagin").append(`<li class="page-item"><a class="page-link" href="#">${(i + 1)}</a></li> `);
                $("#pagin li:nth-child(1)").addClass("active");
                showPage = function (page) {
                    $(".card").each(function (n) {
                        if (n >= pageSize * (page - 1) && n < pageSize * page)


                $("#pagin li").click(function () {
                    $("#pagin li").removeClass("active");