Full scripting walkthrough with some explanation for the Bootstrap Jekyll Github blog plus some js modifications

in utopian-io •  6 years ago 

Selection_028.png

Yesterday I took another short marathon (lol) and installed yet another topical blog on my Github website. I used to explore a lot about the various myths and mythological creatures, so I thought it will be a great idea to install my previous video blog into the Github and make it all flashy with some nifty scripts and Bootstrap.

I was met with a few demands, but all of them were resolved rather fast. It could be a few demands that still have to be resolved, device-wise and a few things to add here and there. But, it has a final shape and all scripts are working.

The front page of my new sub-blog is shown in the cover image, and I have to say I am extremely satisfied with the result. The Bootstrap is amazing.

The posts thumbnails are all made with the Bootstap's cards incorporated with the grid layout ( columns).

Preview available here:
https://aschatria.github.io/mythology/norse-mythology/
Link to Github repository here:
https://github.com/aschatria/aschatria.github.io/blob/master/mythology/norse-mythology.html

The header of a page requires some script to make the whole Bootstrap work smoothly. Recently I upgraded to the latest version, so some pages might not have all the same scripts in their headers.

<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css">
    <script src="https://code.jquery.com/jquery-3.2.1.slim.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js"></script>

The cards are placed inside of a col-sm div components and responsive change to a device width is made with the fluid containers.

<div class="card" style="width:100%;background:black; color: white;">
  <img class="card-img-top" src="https://img.youtube.com/vi/ra5Qi7hb30E/sddefault.jpg" alt="Card image cap">
  <div class="card-body">
    <h5 class="card-title">Top 10 Creatures</h5>
    <a href="https://aschatria.github.io/top-10-coolest-creatures-from-norse-mythology/" class="btn btn-primary">Watch</a>
  </div>
</div></div>
<br/>

Styling can be modified with the additional .css stylesheet but I decided to use the easier method, in-HTML styling to add a necessary gap between vertical cards in the mobile layout.

The images for the cards are pulled out of the YouTube videos with the thumbnail link.

Example:

src="https://img.youtube.com/vi/49525PlcObc/sddefault.jpg"

An actual source is :

src="https://img.youtube.com/vi/YOUTUBE-VIDEO-CODE/sddefault.jpg"

Selection_031.png

I made a separate layout for the post pages featuring a responsive video display with the:


<style>
       .video-container {
position: relative;
padding-bottom: 56.25%;
padding-top: 30px; height: 0; overflow: hidden;
}
.video-container iframe,
.video-container object,
.video-container embed {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
}
  </style>

Or in case I wish to use a cover image, a responsive image programmatically cut-out to a default height with the:

 <style>
  #myfluid {
  object-fit: none; /* Do not scale the image */
  object-position: center; /* Center the image within the element */
  width: 100%;
  max-height: 450px;
  margin-bottom: 1rem;
}
  </style>

Both scripts are called into a Bootstrap jumbotron above the post's title and excerpt.

{% if page.image %}
<div class="jumbotron-fluid" style="padding: 5px;">
  <img src="{{ page.image}}" class="img-fluid" id="myfluid" alt="Responsive image">
  </div> <br/>
   {% else %}
      {% endif %}
  
    {% if page.video %}
    <div class="jumbotron-fluid" style="padding: 5px;">
      <div class="video-container">
      <iframe  width="560" height="315" src="https://www.youtube.com/embed/{{page.video}}?rel=0&amp;controls=0&amp;showinfo=0&amp;modestbranding=1" frameborder="0" allowfullscreen></iframe>
      </div></div> <br/>
      
    {% else %}
{% endif %}

Preview of a post page here: https://aschatria.github.io/top-10-coolest-creatures-from-norse-mythology/
Github post layout source: https://github.com/aschatria/aschatria.github.io/blob/master/_layouts/myth.html

A post page has a comment section and a sidebar featuring list of recent posts in that category cut to correspond a final number of the posts shown, in this case, two posts but I will add more when I add more texts to the posts.

Selection_030.png

<div class="posts">
    
    {% assign count = 0 %}
  {% for post in site.posts %}
    {% if post.mythology == 'mythology' %}
    
     {% assign count = count | plus:1 %}
      <div class="post">
        {% if post.video %} <img style="width:95%; height:auto;" src="https://img.youtube.com/vi/{{post.video}}/sddefault.jpg"/> {% else %} {% endif %} 
        {% if post.image %} <img style="width:95%; height:auto;" src="{{post.image}}"/> {% else %} {% endif %}<br/>
        <b class="post-title"><a href="{{ post.url }}">{{ post.title }}</a></b> <br/><span class="text-muted">{{ post.date | date_to_string }}</span>
</div>
     {% if count == 2 %}{% break %}
  {% endif %}
  
  
    {% endif %}
  {% endfor %}
</div>

All posts are published through the Jekyll and use the front meter to build necessary parts of a page, including image, video, excerpt, title, date, and content written in the post body.

Soon I will upgrade my page with more interesting parts and more tools for everyone to use.
To preview all parts of my page go to the https://aschatria.github.io/ and take a look at it and what I have there.


I know that what I wrote in here is pretty complex, so if you need something for your own Github ( or any blog ) please let me know.


Other interesting tutorials




Love, joy and perpetual happiness to all good people.







🛠Contact on Github - Chat, Blog, Instructions 🛠
◀️ 🐠 ~ 🐟 🐟 🐟 This account pulls the upvote trail || 🛠 Join Trail || 💻 Join Group || Post with App 🍀 🌞 💜 #Steemit4World 🇭🇷 🇮🇩 🇵🇭 🇳🇬 🇧🇩

Authors get paid when people like you upvote their post.
If you enjoyed what you read here, create your account today and start earning FREE STEEM!
Sort Order:  

This was an interesting and potentially useful post, but I had a few issues and have a few comments.

I would have liked to see some elaboration on what Bootstrap and Jekyll are, some introduction for users who are not familiar with them. It is possible to understand from context, and from googling, but it would be preferable if the information was in the post itself.

I would also have liked to see more editorial content, more of your own experience with the projects.

By using the "blog" tag first, you put this post for moderation in the Utopian "Blog" category. As I am not a tutorial moderator, I can't really judge how well it would work in that category, and if it would be a better fit. It may be a good idea to jump on discord and have a chat with moderators of that category about that.

Finally, while this post was well written overall, greater attention to details and proofreading could have elevated it.

Your contribution has been evaluated according to Utopian policies and guidelines, as well as a predefined set of questions pertaining to the category.

To view those questions and the relevant answers related to your post, click here.


Need help? Write a ticket on https://support.utopian.io/.
Chat with us on Discord.
[utopian-moderator]

The tutorial for the Bootstrap and Jekyll would make a small Bible, and an each can take a small book to explain, and this was a bare instruction how I updated my blog ( for my version and for my preset parameters) , not Basics of the Bootstrap and Jekyll.
I can make separate tutorials for the both, I think that is a great idea.

I posted under #blog and #tutorial because I personally find this to fit in both category. Rules for posting can be quite different, of course, but from the Utopian page I got that impression, that's all.

Thanks for stopping by.

I'm not talking about a tutorial, just a bit of "these are the tools I'm using," because promoting said tools is what makes it a valid Utopian blog post.

Yes, those are the tools I am using, the title says so. Yes, I will make an additional 2 posts and link them here for the audience who is new both to the Jekyll and Bootstrap, I didn't expect the Utopian requires the intro to those scripts as they are very common. Once more, a great recommendation.

Thank you for your review, @didic!

So far this week you've reviewed 25 contributions. Keep up the good work!

His review was off-topic with this:

I would also have liked to see more editorial content, more of your own experience with the projects.

If the content doesn't fit the blog or tutorial category, I wish to know where it does. Otherwise I don't want to see a scabby review like this one from a person who doesn't have a clue about the basics what I am talking about. It doesn't serve me any justice, and I doubt it is worth-vile reading either.

Hello @aschatria,

As the community manager of Blog category, I saw the need of a clarification for the ongoing discussion about the post.

First, the decision of the moderator is right and the post doesn't fit any of our categories. You can find detailed information about what kind of content fits in Utopian categories in our guidelines or you can directly ask for help in #help channel in our Discord server. You will be able to find these links in each review comment.

Besides, Utopian cannot afford a moderator for every topic in every category but moderators are usually acknowledged to have a general grasp of open source projects.

In your case, you have shared your experience and recent work on the project in the post. Generally speaking, it's enough to make the post a blog post. But Utopian has a certain vision for rewarding open source contributions and several quality measures for each category.

In order to be considered for a reward, the contribution must add value to the Open Source project. Submissions that offer little to no added value to the project will not be eligible for a potential reward.

To be considered for potential reward, the blog post must contain unique and insightful editorial content presented in a professional format, ideally with high-quality visual supplements.

Considering the project here is your blog using Jekyll and Bootstrap, and value expected from a blog post is editorial content promoting or expanding its borders, it is not wrong to say that the post has a little value as a blog post.

About reviews, moderators' attitude and wording are not the measures of your reward or anything in review process, the contributions are scored objectively by the questions determined by Utopian moderation teams. Moderator comments are only feedback to help our contributors to improve the quality of their contributions and rewards consequently.

In a nutshell, there is no problem affecting justice for your case and the moderator has pointed out well the needs of your post to be considered as valuable in Utopian vision.

Have a good day and keep working with Utopian for a better future of open source community.

Saying it doesn't fit to any category and excluding it as such would be enough. The rest of the review is in that case unnecessary. If no category is available, he should say so.

Utopian cannot afford a moderator for every topic...

I will not tell you what to do or how, but I personally find that the 25 submission priced 6.5 sbd upvote per week is a bit of an overpay for a single reviewer. You can pay more people under affordable sum.

Thank you for the clarification, it is enough.

  ·  6 years ago Reveal Comment

Oh, this ia interesting as I enjoyed reading Mythology stories. I tried to use Gkthub before but wont let me I had know Idea why.

Btw: looks like we both have the same spammer on the comments. (Photo inserted)
6338E262-66E2-4BBF-96B3-CC12892340FE.jpeg

Yes, he posted that almost instantly after I published. I have no idea what he is trying to achieve.

Hey @aschatria
Thanks for contributing on Utopian.
We’re already looking forward to your next contribution!

Want to chat? Join us on Discord https://discord.gg/h52nFrV.

Vote for Utopian Witness!