Showing posts with label blogger. Show all posts
Showing posts with label blogger. Show all posts

Sep 15, 2020

how to add code highlight in new version of Blogger 如何在新版的 Blogger 中上色程式碼

如果要在 Blogger 中將程式碼排版並上色,需要安裝第三方的工具


Resolution 解決方案

1. Open "Theme" >  click arrow from "CUSTOMIZE" menu > "Edit HTML"

打開 "主題" >  點擊"自訂"旁的箭頭 > "編輯 HTML"

 


 2.add code below after </title> tag then click save button

在 </title> 標籤後面加入以下的程式碼後按下儲存按鈕

<title><data:blog.pageTitle/></title>

<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/10.2.0/styles/agate.min.css"></link>
<script src='https://cdnjs.cloudflare.com/ajax/libs/highlight.js/10.2.0/highlight.min.js'></script>
<script>hljs.initHighlightingOnLoad();</script>    

3. in "HTML view" mode, add your code between <pre><code> and </pre></code>

在 "HTML 檢視" 模式中,將程式碼放在在標籤<pre><code> 與 </pre></code> 的中間


 

Reference 參考

https://therealweblog.blogspot.com/2019/05/how-to-format-code-snippets-in-blogger.html

 





Nov 17, 2011

Add Google Analytics to Blogger 將 Google 分析加入部落格中

Although Blogger and Google Analytics both belong to Google Inc., Blogger cannot automatically get Google Analytics function.
As like the way Google Analytics works for others blog, you should add Google Analytics tracking code to your Blogger.

雖然 Blogger 與 Google 分析同屬於 Google,不過 Blogger 無法自動使用 Google 分析的功能。
與其他部落格相同,您需要在 Blogger 中貼上追蹤程式碼以結合Google 分析。


Step 1. connect to https://www.google.com/analytics/web/#management/Accounts/ and enter your account.
步驟1. 連接至 https://www.google.com/analytics/web/#management/Accounts/ 點擊進入帳號

p.s. if you don't see any accounts yet, you should create one first.
如果您看不見任何帳號,請先建立一個帳號。