Go Top
顯示具有 blogger設計 標籤的文章。 顯示所有文章
顯示具有 blogger設計 標籤的文章。 顯示所有文章

2019年10月3日 星期四

[Blogger] 2019.10.04 How to Install AddThis on a Blogger Website

Installing AddThis tools on your Blogger website is simple! In this article

How to Install AddThis on a Blogger Website

  1. If you haven’t already, you will first want to create an AddThis account. If you have already created an AddThis account, log in to your dashboard here.
  2. Navigate to the Tools tab and activate and customize the tool(s) that you would like to use on your website.
  3. From the Get the Code page, grab your unique code snippet under the HTML Website tab.
  4. Paste the code snippet that you copied earlier from your AddThis dashboard into above the closing</body> of the HTML in your website on every page you want AddThis to work.
  5. Click Save Template.

Adding Inline Tools at the bottom of a post

  1. Place the Inline code before the <div class="post-footer"> tag.
  2. Click Save Template.
Here are other examples of where you can place your Inline tools as following
This article is quoted from How to Install AddThis on a Blogger Website

閱讀更多 »

2019年8月25日 星期日

[Blogger] 2019.08.25 How To Remove the Atom In Blogger

[Blogger] 2019.08.25 How To Remove the Atom In Blogger

This article is quoted form 如何移除 Blogger 討人厭的「訂閱:文章(Atom)」?超簡單教學!
Bloggers hangout presents a simple blogger trick for "How To Remove the Atom In Blogger". It makes blogs look professional.

Step 1: Sign into your blogger account.

Step 2: Choose the blog from your dashboard and then select design.

Step 3: Now select edit html and then check expand widget template which is present on right
side corner.

Step 4: Now add below Css definition above this tag ]]></b:skin> in your template.

.blog-feeds {display :none;}
.post-feeds {display :none;}

Step 5: Preview the blog and save the template.

We successfully completed the blogger trick.

閱讀更多 »

[Blogger] 2019.08.25 How To Hide Widget Title In Blogger

[Blogger] 2019.08.25 How To Hide Widget Title In Blogger

This article is quoted form How To Hide Widget Title In Blogger
Bloggers hangout presents a simple blogger trick for "How To Hide Widget Title In Blogger". It makes blogs look professional.

Step 1: Sign into your blogger account.

Step 2: Choose the blog from your dashboard and then select design.

Step 3: You will be navigated to page elements page and add a gadget to your blog. Add a
widget with title as Advertisements and then select design.

Step 4: Now select edit html and then check expand widget template which is present on right
side corner.

Step 5: If you are using mozilla firefox then press Ctrl +F and search for widget title as
Advertisements.
(or)

If you are using google chrome then press F3 function key and search for widget title as
advertisements.

Step 6: Check for the line below in your code
<b:widget id='HTML2' locked='false' title='Advertisements' type='HTML'/>

Step 7: Get the id of widget that is written in blue in the above code. In the above example it is HTML2.

Step 8: Now add below Css definition above this tag ]]></b:skin> in your template.

#HTML2 h2{
display: none;
}

Step 9: Preview the blog and save the template.

We successfully completed the blogger trick.

If you have any doubt about this blogger trick don't hesitate to comment.

閱讀更多 »

2019年8月23日 星期五

[Blogger] 2019.08.23 Loops, loop positions, and isFirst variables in Blogger



Looping through the listing of blog posts

<b:loop values='data:posts' var='post'>
Inside the loop data:posts changes to data.post (determined by the value of var, set here as var='post')

We can reference the id of the current post in the loop as <data:post.id />
</b:loop>


Looping through the listing of blog posts with an additional index

<b:loop values='data:posts' var='post' index='i'>
The id of the current post in the look is <data:post.id />

The position of this post in the loop index is <data:i />

We can run a IF statement against this value like so:

  <b:if cond='data:i == 2'>
    This is the post contained in the loop at position 2, which in an array is Post #3 (arrays start counting at 0)
  </b:if>

</b:loop>

To do a greater-than and less-than you need to use the HTML code for greater/less, otherwise it will throw a Blogger template error.

<b:if cond='data:i &#60;=2'> for i is less than or equal to

<b:if cond='data:i &#62;=2'> for i is greater than or equal to


"is first" variables

There are a number of "is first" variables in Blogger that are unfortunately not declared on the official variable list.

data:post.isFirstPost
This variable can be used to show a different behavior on an index page for the first post, by placing it within the data:posts loop, like so:
<b:loop values='data:posts' var='post'>
   <b:if cond='data:post.isFirstPost == &quot;true&quot;'>
first psot!
   </b:if>
</b:loop>

data:post.isDateStart
This variable is used to group posts by date, often found on a Blogger site's index pages, where it shows all posts under one day/date, then moves to the next day/date without repeating that value.

data:post.firstImageUrl
This variable shows the URL of the first image used in the blog post. This is often handy for creating an index page of image thumbnails. But while the "thumbnail" variable (data:post.thumbnailUrl) only shows a 72 pixel square and only works for Google hosted images, this firstImageUrl variable shows the full image url and can be used for non-Google-hosted images.

data:post.sharePostUrl
This variable displays the absolute url for a blog post in question. Used in the social media share buttons, but can certainly be used in other cases.

data:post.snippet
This variable displays the first 140 characters of a blog post, or what comes before a jump break, whichever is first.

Example, albeit not for this usage:

<b:if cond='data:blog.metaDescription != &quot;&quot;'>
   <meta expr:content='data:blog.metaDescription' name='og:description'/>
<b:else/>
   <meta expr:content='data:post.snippet' property='og:description'/>
</b:if>
<meta expr:content='data:post.thumbnailUrl' itemprop='image_url'/>

The above code will show the first image URL as the snippet's thumbnail, along with either the post's meta description (search description in the blog post) or, if none, the 140 character snippet.


Social sharing thumbnail variable that you need

We all wanted to add a larger thumbnail image for social sharing, for example for Facebook and now Google+, but had no way to do so since the other thumbnail was only 72 pixels. Yes, there is now a new variable...

data:blog.postImageUrl
This variable, available to you in the HEAD of your template, if used on item page types, will display the first image from your blog post in all of its glory.

This article is quoted form Loops, loop positions, and isFirst variables in Blogger
閱讀更多 »

2019年2月18日 星期一

[Blogger設計] 2019.02.18 Change the Blog Title and Description

[Blogger設計] 2019.02.18 Change the Blog Title and Description
Embed from Getty Images

[Image Source:Getty Images]

Change Items

Blog Title

Change Bert Chien Life to BCL BLOG

Blog Description

Revise the content as following

Bert Chien Life blog mainly based on share my music creative work, programming learning and implementation articles. sometimes will share English learning articles.

閱讀更多 »

2019年2月15日 星期五

[blogger設計] 保護網頁文章著作權(超連結偽裝術)

[blogger設計] 保護網頁文章著作權(超連結偽裝術)

經由這篇 [blogger設計] 文字選取、文字複製及滑鼠右鍵鎖住

缺點在於,只能防範初階複製者(防君子不防小人,懂得程式技術背景的人仍有方法可破解),這只是簡單阻礙增加複製上的難度, 讓一般人放棄直接複製內容去使用的小技巧。


但這只是造成使用者的想分享的困擾,網路的本質本來就是資訊共享,如果我自己在網路搜尋到一篇實用的文章,卻發現無法複製文字內容, 那麼資訊不方便再利用或再創造,其實就只是孤芳自賞。



看了[教學]如何用語法保護網頁文章著作權__(3) 超連結偽裝術這篇文章

也想這樣做, 但GitHub的外連我看了實在有看沒有懂,無法使用在我的Blogger上有點遺憾。



從 CODEPEN 載入 JavaScript 檔案

CODEPEN 也是另一個方便管理程式碼片段的線上工具,假設我們要取得

https://codepen.io/bertchien/pen/dagEOg

這個 PEN 的 JavaScript 內容,則可以將網址列最後加上 .js 即可:

https://codepen.io/bertchien/pen/dagEOg.js

在 CODEPEN 輸出的 JavaScript,其 HTTP 回應的 Content-Type 是 text/javascript,是各瀏覽器可以接受的內容型態, 所以直接用來載入網頁基本上沒啥問題。


閱讀更多 »

2019年2月14日 星期四

[blogger設計] 文字選取、文字複製及滑鼠右鍵鎖住

[blogger設計] 文字選取、文字複製及滑鼠右鍵鎖住

使用google blog(即blogger)要如何讓blog的「右鍵功能」被取消呢?

在此介紹一下如何設定,至於您的Blogger是否要使用這樣的限制,請自行決定

1、從blogger管理後台,點擊「範本」→「編輯HTML」


2、找到"",並在""的「前面」加上下列語法:

直接複製的語法如下:

  <script type="text/javascript">
  		document.oncontextmenu = function(){return false;}
  		document.onselectstart = function(){return false;}
  		document.onmousedown = function(){return false;}
  </script>
  

3、按下儲存範本即可。

這僅是簡易防止網頁內容被複製的JavaScript語法(一般網頁設計也適用), 當然這只是初步的做限制(防君子不防小人,懂得程式技術背景的人仍有方法可破解) ,這只是簡單阻礙增加複製上的難度,讓一般人放棄直接複製內容去使用的小技巧。

閱讀更多 »

2019年2月10日 星期日

Blogger 要如何設定版面寬度呢?

目前市場主流的螢幕大部份都是寬螢幕了,
17吋的螢幕寬度1280x1024 等
19吋的螢幕寬度1280x1024 或 1366x768 等
20吋的螢幕寬度1440x990 等

螢幕寬度都已經來到1280為基本的配備了,部落格當然也要跟著調整寬度,讓使用者可以更舒適的在沙發上看文章了。

以下來就教學 Blogger 如何更改版面寬度
Step 1
  1. 先選擇左邊選單的「主題」
  2. 點選右邊「自訂」的選項



Step 2
  1.設定「整篇網誌」的寬度1280像素,我的習慣會多個20的寬度,避免文章旁邊的字會因為螢幕造成看不到的情況發生。
  2.設定右側欄的寬度。


或是假設是用code來修改的話, 搜尋<b:template-skin>如下圖, 修改value的pixel值為1260

閱讀更多 »

2019年2月2日 星期六

[轉載] 如何在Blogger中加入「繼續閱讀」(Read more)

Google的Blogger預設首頁會把文章所有的內容顯示出來,遇到較長文章的時候,後面的文章就會被排到非常下面的位置,如果可以快速預覽部份內容,對文章有興趣的人再自行點進去閱讀全文,對使用者的操作體驗是比較好的做法。如下圖整篇文章都顯示出來,首頁就會變得很長。
閱讀更多 »

2019年1月30日 星期三

[Test][網頁高亮程式碼] codeblock prettyprint linenums

<pre class="codeblock">
public class HelloWorld {

    public static void main (String[] args) {
        System.out.println("Hello, world!");
    }
}

閱讀更多 »

2019年1月27日 星期日

隱藏 Blogger 上方的導覽列







Blogger 上方的導覽列,可在後台 --> 版面配置 --> 導覽列 --> 編輯 --> 選擇"關閉", 不必改範本程式碼。







閱讀更多 »

2019年1月14日 星期一

[test] 顯示 GitHub Gist 程式碼,並且套用(比較)一致的顯示風格

GitHub 是現在很熱門的程式碼管理工具,它甚至也提供了純粹用來分享程式碼片段的功能: Gist。甚至不需要註冊,就可以使用,也支援版本管理。當然,它也提供了在網頁上顯示程式碼的功能,只要複製要 分享的程式碼片段的頁面 左邊的 Embed this gist 內容,貼到 html 上即可。 貼上的 html 程式碼,長得像這個樣子: <script src="https://gist.github.com/tsaiid/6b4b20242367425726fb.js"></script>
閱讀更多 »

[教學] 如何在網頁blogger中插入程式碼

轉貼自: https://pjchender.blogspot.com/2015/03/blogger.html

有時候,我們會想在文章中插入語法,讓其他人可以比較清楚的瞭解,過去我常常是透過截圖的方式,但這麼做的缺點是,對方並不能直接複製貼上,那麼我們要怎麼在文章中插入語法呢?



像這樣:<pre class="codeblock prettyprint">
</pre>



首先在版面配置區插入HTML/JavaScript小工具的方式

STEP 1:


STEP 2:

STEP 3:

STEP 4:接著在HTML/JavaScript中貼入以下語法

在小工具中貼入以下程式碼

<style>
.post .codeblock {
display: block; /* fixes a strange ie margin bug */
font-family: Courier New;
font-size: 10pt;
overflow:auto;
background: #f0f0f0 url(data:image/gif;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAASwCAYAAAAt7rCDAAAABHNCSVQICAgIfAhkiAAAAQJJREFUeJzt0kEKhDAMBdA4zFmbM+W0upqFOhXrDILwsimFR5pfMrXW5jhZr7PwRlxVX8//jNHrGhExjXzdu9c5IiIz+7iqVmB7Hwp4OMa2nhhwN/PRGEMBh3Zjt6KfpzPztxW9MSAMwzAMwzAMwzAMwzAMwzAMwzAMwzAMwzAMwzAMwzAMwzAMwzAMwzAMwzAMwzAMwzAMwzAMwzAMwzAMwzAMwzAMwzAMwzAMwzAMwzAMwzAMwzAMwzAMwzAMwzAMwzAMwzAMwzAMwzAMwzAMwzAMwzAMwzAMwzAMwzAMwzAMwzAMwzAMwzAMwzAMwzAMwzAMwzAMwzAMwzAMwzB8HS+J9kUTvzEDMwAAAABJRU5ErkJggg==) left top repeat-y;
border: 1px solid #ccc;
padding: 10px 10px 10px 21px;
max-height:1000px;
line-height: 1.2em;
}
</style>

如圖所示

STEP 5:
接著只要把想要放在code裡面的語法用,開頭用: 
<pre class="codeblock ">
結尾用這個: 
</pre>
像是這樣
<pre class="codeblock">
中間可以插入你想放入的程式碼
</pre>

這樣就可以了 

STEP 6:當程式碼中包含「<>」時,需轉碼
如果程式碼中包含方角時,需要先把原本的程式碼轉碼,透過這個網站即可以輕易完成。


補充:自動將程式碼上色

我們除了可以用上方的色盤將自己的程式碼套色外,
像這樣
結果會像這樣
<pre class="codeblock ">

我們也可以另外安裝一段JavaScript讓他自己幫我們上色,
安裝的方法很簡單,一樣透過最上面所說的方法新增「HTML/JavaScript」,新增下述這段語法:
<script src="https://cdn.rawgit.com/google/code-prettify/master/loader/run_prettify.js"></script>
這時候只要在原本的class後面在新增一段prettyprint,程式碼就會自動套色了, 像是這樣: 
<pre class="codeblock prettyprint">
中間可以插入你想放入的程式碼
</pre>

閱讀更多 »
Copyright © BCL BLOG | Powered by Blogger