Showing posts with label Advanced Blogger Tutorial. Show all posts
Showing posts with label Advanced Blogger Tutorial. Show all posts

April 27, 2020

URL Image Parameter for Custom Blogger Images

URL Image Parameter for Custom Blogger Images
URL Image Parameter for Custom Blogger Images. How to compress image blogger, convert to webp, and many more


URL Image Parameter for Custom Blogger Images

Blogger.com is a blogging platform provided free by Google. And the space provided is unlimited, including for image storage.
But there are some bloggers who have not even utilized the unlimited and free image hosting facilities from this blogger. There are still bloggers who still save their pictures in third parties.
Of course this is actually not a big problem, but there are some Blogger codes that do not support hosting other party images such as code for thumbnail post.
For that, it is recommended to post pictures please upload directly to the post. No need to worry about storage space because Blogger image hoster gas unlimited space.
Likewise for images for other purposes such as favicons, manifest.json, blog logos, and others, please upload them on Blogger.
If you do not understand how to take the URL of an image hosted on Blogger, I have made a video, please watch it to better understand.
And in the image URL that is stored on Blogger, there are several parameters that can make it easier for us to modify the image.
Usually the image URL that is hosted on Blogger or uploaded on the post will look like this.
https://1.bp.blogspot.com/xxxxxxxx/xxxxxxxx/xxxxxxxx/s..../imagepng
Blogger provides 4 domains for hosting images, namely https://1.bp.blogspot.com, https://2.bp.blogspot.com, https://3.bp.blogspot.com, and https: / /4.bp.blogspot.com.
Note the s.... code which is marked, in that code we can modify the image with the following parameters.

List of parameters for modifying Blogger images

1. s (square or maybe size), meaning square. By default, Blogger uses param s for images uploaded in posts. Param s is usually followed by a value that indicates the size of the image in pixels, taken from the largest side. If the square is horizontal, then the width value is taken. If the vertical square, the high value is taken.
Example: s320
If you want the size according to the original you can use the value according to the original width or height which has the largest value, for example s3250 or can use s0.
2. w (width), meaning width. To determine the desired width, for example w320.
3. h (height), meaning height. To determine the desired height, for example h320.
If w and h are combined, then what is taken is the value of h, for example w500-h100 then the benchmark is the value of h and the width of w will follow the comparison.
4. c (crop), meaning to cut. To crop the image at the top according to the value specified by the other param in front of it. For example: s320-c will cut a square with a width and height of 320px at the top of the image, w320-h100-c will cut with a width of 320px and a height of 100px at the top of the image.
5. n is the same as c but cuts it right in the middle.
6. p is the same as n and c but cut from the midpoint of the image.
7. cc (circle crop), meaning to cut round and the outer side will be a white area. s320-cc is a circle with a diameter of 320px, w500-h750-cc is a circle with a diameter of 500px (the smallest value is taken).
8. It's useful to prevent changes in image size that is larger than the original dimensions. For example, if the width of the original image is 600 pixels, then even if it determines a wider width such as w1600-nu, the image will not be larger than the original width.
9. fv (vertical flip) reverses the image vertically, for example s320-fv
10. fh (flip horizontal) flips the image horizontally, for example s320-fh
11. r (rotate) rotates the image to a value of 90, 180, or 270, for example s320-r90 then the image will tilt to the right 90 degrees.
12. rj to change the image format from PNG or GIF to JPG.
13. rp to change the image format from JPG or GIF to PNG.
14. rw to change the image format from JPG or PNG to WEBP.
15. rh to change the GIF format to MP4 so that it can be a source in the HTML5 <video> tag.
Example:
<video controls>
<source src="https://1.bp.blogspot.com/xxxxxxxx/xxxxxxxx/xxxxxxxx/s500-rh/video.gif" type="video/mp4">
</video>
16. l to compress image quality, for example, s320-rj-l85, the image will be a JPG format with 85% quality with a size of 320px.
17. d (download) functions to download images when the image URL is used as a link, for example: s320-d.
Those are some parameters that might be useful for modifying images uploaded in posts.
Maybe useful.

How to Make Recent Post Widget for AMP Blogger Template

How to Make Recent Post Widget for AMP Blogger Template



Tutorial how to make Widget Recent Post for Blogger Template valid AMP HTML. Read this article. Recent Post widget developed by Kompi Ajaib, valid Google AMP HTML for Blogger/Blogspot

Table of Contents:
Recent Post for AMP Blogger
Demo

Tutorial how to make Widget Recent Post for AMP Blogger Template

Blogger widgets become one of the important components in a blog. A widget function to beautify the appearance of the template and aim to make navigating a Website easy.


Even widgets like Popular Post Widget and Recent Post can reduce the bounce rate of a Blog. This is usually what will improve the performance of the Website and ad revenue.

This time, I will share the tutorial on making Recent Post Widget that can display the latest articles on a Blogger blog. This widget is valid AMP HTML, so it fits you apply to AMP Blogger Template.

Recent Post for AMP Blogger

This widget was developed by Kompi Ajaib, a famous blog that discusses a lot of Blogging Tutorial contents. This Recent Post widget uses the amp-iframe component, so make sure you have placed the amp-iframe component on <head>.

<script async='' custom-element="amp-iframe" src="https://cdn.ampproject.org/v0/amp-iframe-0.1.js"></script>

Kompi Ajaib has prepared Javascript and HTML that has been hosted on Github, so you can simply embed using amp-iframe. I have prepared it.

Copy this following code in Sidebar, please Edit your template, and paste this following code.
          <b:widget id='HTML97' locked='false' title='' type='HTML' version='1'>
            <b:widget-settings>
              <b:widget-setting name='content'><![CDATA[<!--recentpost-->]]></b:widget-setting>
            </b:widget-settings>
            <b:includable id='main'>
  <!-- only display title if it's non-empty -->
  <b:if cond='data:title != &quot;&quot;'>
    <h2 class='title'><data:title/></h2>
  </b:if>
  <div class='widget-content'>
    <data:content/>
<b:if cond='data:blog.pageType == &quot;item&quot;'>
<amp-iframe expr:src='&quot;https://cdn.staticaly.com/gh/KompiAjaib/kompi-html/master/recentpost-amp.html?fontSize=16px&amp;color=333&amp;url=&quot; + data:blog.homepageUrl' frameborder='0' height='488' layout='fixed-height' noloading='' sandbox='allow-forms allow-scripts allow-same-origin allow-modals allow-popups' title='Recent Posts'>
    <amp-img height='488' layout='fixed-height' noloading='' placeholder='' src='https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiaqa7Q5P7TfDt_FvpkQV-X0rBPfCqVKzY5G2QpL9kYXBs8acUvZevkFgAa9yNcqfrtUMOBWGi1O0dOprbWCShQh2R9KR5QE9RnNkijoRNuH5sc44YMf_QY2Fq-FGT1-ht8iOz_UlS2rdo/s1600/back-iframe.png' width='auto'>
    </amp-img>
  </amp-iframe>
  </b:if>
  </div>
</b:includable>
          </b:widget>

If you are confused about how to place the code, you can use the manual method. Click Layout on the Blogger.com dashboard, then Add Gadget, and choose HTML / JavaScript.


<amp-iframe frameborder="0"
    height="500"
    layout="fixed-height"
    sandbox='allow-forms allow-scripts allow-same-origin allow-modals allow-popups' 
    src="https://cdn.staticaly.com/gh/KompiAjaib/kompi-html/master/recentpost-amp.html?url=https://www.amp-blogger.com/">
    </amp-iframe>

Paste the code below, then replace the yellow mark with the address of your blog.

Tutorial on How to Bring up Thumbnails on AMP HTML Blogger Template

How To Bring Up Thumbnails On AMP HTML Blogger Template

rial on How to Bring up Thumbnails on AMP HTML Blogger Template
I used the AMP blogger template and changed all the articles including the <img> code to <amp-img>, but how come the thumbnails don't appear? I wonder why?

It turns out that the blogger template will not read thumbnails if all the images in an article are converted into <amp-img> code.

thumbnail does not appear


As we know, that the IMG tag in AMP HTML changes to amp-img. If we write in posts like this:
<img alt = 'image' src = 'url-image' />
it will result in an AMP HTML validation error. The correct writing like here is:
<amp-img src = "url-image-here.png"
    width = "1080"
    height = "610"
    layout = "responsive"
    alt = "AMP HTML"> </amp-img>
Image will appear well on the post. However, it will not appear on the thumbnail on the main page / homepage. To outsmart it, so that the image appears on the Homepage add a noscript tag so the code becomes like this:

<Noscript> <Img Alt = 'Image' Src = 'Url-Image-You' /> </Noscript>

Good luck ...

Thus the Tutorial Article How to Bring up Thumbnails on AMP HTML Blogger Template. Hopefully the solution of your "confusion": D

Change AMP Blogger Parameter URL from m=1 to amp=1

Change AMP Blogger Parameter URL from m=1 to amp=1



Step by Step: How to Change AMP Blogger Parameter URL from m=1 to amp=1. and All benefits you gets from amp=1


Change Blogger AMP Parameter URL from m=1 to amp=1

The template that I use on this blog is called Alinux AMP, where there are some visitors who are "aware" that the URL for my AMP page is valid using the parameter 'amp = 1, isn't it? M = 1 . 

Then there are some blogger friends who send messages via Facebook, asking how to change the URL parameters for the Blogger AMP page to be ?amp=1. I try to explain in this article. 

I have tried changing it using conditional data 'data:blog.url + &quot;?amp=1&quot'but it seems to be ineffective and encounters some errors. Until finally I found out a more effective way. I got this method from one of my blogger acquaintances.

Benefits of AMP Pages in parameters amp=1



Before I explain, I will mention some of the advantages that will be obtained when implementing AMP HTML in the Blogger parameter amp= 1
  • Can apply AdSense Anchor Ad on the mobile page by using AdSense Auto Ads.
  • Can add JavaScript in mobile mode template.
  • AMP pages (amp = 1) will only be accessed if visitors come from AMP viewer such as Google or Twitter. 

Here are the steps to change the custom parameters AMP Blogspot pages, from m=1 to amp=1

Change the AMP special page from m=1 to amp=1

This method can be done by using the Blogger Operator URL data tag with the syntax params 
Go to the menu Edit HTML on Themes. Then follow the steps below

Find this:
<HTML expr:dir='data:blog.languageDirection' lang='id'>

<b:attr cond='data:blog.isMobileRequest == &quot;true&quot;' name='amp' value='amp'/>


or the code below, for those of you who haven't changed the special parameter amp to m=1

<HTML amp='amp' expr:dir='data:blog.languageDirection' lang='id'>


And then replace with below code :
<HTML expr:dir='data:blog.languageDirection' lang='id'>

<b:attr cond='data:view.url == data:view.url params { amp: &quot;1&quot; }' name='amp' value='amp'/>
Pay attention to the yellow code, it is the use Blogger Operator URL to make the new parameter to be amp=1.

Next, we will set the canonical for the main page and the special page for AMP HTML.

Find below code:
<b:if cond='data:blog.isMobileRequest == &quot;false&quot;'>
<link expr:href='data:blog.url' rel='canonical'/>
<link expr:href='data:blog.url + &quot;?m=1&quot;' rel='amphtml'/>
</b:if>

<b:if cond='data:blog.isMobileRequest == &quot;true&quot;'>
<link expr:href='data:blog.url' rel='canonical'/>
</b:if>

Or if it's not found, just look for the canonical section like this:

<link expr:href='data:blog.url' rel='canonical'/>

Delete the code, and replace it with what I made below:
<b:if cond='data:view.url != data:view.url params { amp: &quot;1&quot; }'>
<link expr:href='data:blog.canonicalUrl' rel='canonical'/>
<link expr:href='data:blog.canonicalUrl + &quot;?amp=1&quot;' rel='amphtml'/>
  </b:if>
<b:if cond='data:view.url == data:view.url params { amp: &quot;1&quot; }'>
<link expr:href='data:blog.canonicalUrl' rel='canonical'/>
  </b:if>

Up here, the actual process is complete. But if you previously used the parameter m=1 for special pages of AMP HTML, you must follow the steps below because usually there will be a slight error.

Final Process

Look for all blogger tag code for mobile m=1 as below:

<b:if cond='data:blog.isMobileRequest == &quot;true&quot;'>
Change with below data tag:
<b:if cond='data:view.url == data:view.url params { amp: &quot;1&quot; }'>

Find this:
<b:if cond='data:blog.isMobileRequest == &quot;false&quot;'>

and change with:
<b:if cond='data:view.url != data:view.url params { amp: &quot;1&quot; }'>

Showing Element on AMP Pages only

To display all elements or widgets only on the AMP HTML page, then you only need to wrap them with the new AMP  tag conditional. Example:
<b:if cond='data:view.url == data:view.url params { amp: &quot;1&quot; }'>

   <!-- Contents -->

</b:if>
If you want to display elements in other than AMP pages, use this conditional tag:
<b:if cond='data:view.url != data:view.url params { amp: &quot;1&quot; }'>

   <!-- Contents -->

</b:if>

That's the article about the trick for Changing Blogger AMP Parameters from m=1 to amp=1. You still have to achieve the performance of your special AMP page in the Search Console.