<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Keri T on Medium]]></title>
        <description><![CDATA[Stories by Keri T on Medium]]></description>
        <link>https://medium.com/@keri08230?source=rss-876736a98e7c------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*2E2zn-AEGrEq8xElrR3afQ.jpeg</url>
            <title>Stories by Keri T on Medium</title>
            <link>https://medium.com/@keri08230?source=rss-876736a98e7c------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 03 Dec 2026 23:01:13 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@keri08230/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Nightwatch—環境建置]]></title>
            <link>https://medium.com/i-%E7%99%BC%E5%AE%A2/nightwatch-%E7%92%B0%E5%A2%83%E5%BB%BA%E7%BD%AE-fa99178bbae5?source=rss-876736a98e7c------2</link>
            <guid isPermaLink="false">https://medium.com/p/fa99178bbae5</guid>
            <dc:creator><![CDATA[Keri T]]></dc:creator>
            <pubDate>Mon, 13 Jan 2020 09:44:02 GMT</pubDate>
            <atom:updated>2020-01-13T09:44:02.410Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9xv8X9df2wojULtL4Gx9sg.jpeg" /></figure><p>本篇文章將介紹如何利用 npm 在 macOS 底下建立一個 Nightwatch 專案，這邊只會講到環境建置的部分，至於 Config 檔如何設定以後會另外寫一篇文章做講解。</p><h4>Step 1: 建立專案</h4><p>在專案目錄下安裝 npm，安裝完成後你會看到你的專案下多了一個 package.json 的檔案，表示安裝成功。</p><pre>npm init</pre><h4>Step 2: 安裝 Nightwatch</h4><p>在專案目錄下安裝 Nightwatch，若你想要全域安裝可使用 -g 取代 --save-dev 。</p><pre>npm install nightwatch --save-dev</pre><p>當安裝完成後會在專案目錄底下出現 nightwatch.conf.js 這是 Nightwatch的設定檔，等環境建置完成後會再回來設定這個部分。</p><h4>Step 3: 安裝 Java JDK</h4><p>到 <a href="https://www.oracle.com/technetwork/java/javase/downloads/index.html">這邊</a> 選則你想要安裝的版本，按下Download(安裝版本需為7以上)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GLLoTdJVyB8bsF7YTl-zow.png" /></figure><p>在正式下載前，必須先同意他們的協議，然後下載 macOS的 .dmg 檔</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JGVzcZ5Pl06TZcerwOFxAg.png" /></figure><p>下載完成後開啟你的 .dmg 檔，再開啟 .pkg 檔，進入安裝程序</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UGPu-jADJVRDE_EiAf7pTQ.png" /></figure><p>安裝完成後可以使用 java -version 來檢查是否安裝成功</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qmolE_2DCOjLsupuncer_w.png" /></figure><h4>Step 4: 安裝 Selenium</h4><pre>npm install selenium-server --save-dev</pre><p>安裝完成後一樣可以使用 selenium-server -version 檢查是否安裝成功</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/894/1*jH-mEAYtidJtD_c-qf2OXQ.png" /></figure><h4>Step 5: 安裝 ChromeDriver</h4><pre>npm install chromedriver --save-dev</pre><p>完成後可以在 node_modules &gt; .bin 底下找到 chromedriver 這隻檔案</p><ul><li><strong>備註：</strong>如果你在跑測試時遇到以類似下錯誤</li></ul><pre>Error: An error occurred while retrieving a new session: “session not created: This version of ChromeDriver only supports Chrome version 77”</pre><p>表示你的 Chrome 瀏覽器版本與 chromedriver 版本不一致，若是 Chrom 版本為 79 以上 chromedriver就也必須使用 79 以上。這時只要將 Package.json 裡 chromedriver 的版本號修改成 79.0.0 ，再把 node_modules &gt; .bin 底下的 chromedriver 刪掉後，重新下 npm install chromedriver --save-dev 就可以修好囉。</p><p>以上是 Nightwatch 環境建置的流程，這樣還不算可以跑測試，還需要在編輯 Config 才行，這個部分留到下一次分享。</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fa99178bbae5" width="1" height="1" alt=""><hr><p><a href="https://medium.com/i-%E7%99%BC%E5%AE%A2/nightwatch-%E7%92%B0%E5%A2%83%E5%BB%BA%E7%BD%AE-fa99178bbae5">Nightwatch—環境建置</a> was originally published in <a href="https://medium.com/i-%E7%99%BC%E5%AE%A2">i 發客</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[用中文教你 Shopify Liquid 怎麼寫02：型別與宣告]]></title>
            <link>https://medium.com/i-%E7%99%BC%E5%AE%A2/%E7%94%A8%E4%B8%AD%E6%96%87%E6%95%99%E4%BD%A0-shopify-liquid-%E6%80%8E%E9%BA%BC%E5%AF%AB02-%E5%9E%8B%E5%88%A5%E8%88%87%E5%AE%A3%E5%91%8A-de133a0ec28d?source=rss-876736a98e7c------2</link>
            <guid isPermaLink="false">https://medium.com/p/de133a0ec28d</guid>
            <category><![CDATA[shopify]]></category>
            <category><![CDATA[liquid]]></category>
            <dc:creator><![CDATA[Keri T]]></dc:creator>
            <pubDate>Fri, 15 Nov 2019 01:23:13 GMT</pubDate>
            <atom:updated>2019-11-15T01:23:13.168Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HKru9urHK6ywE91ZZhPbig.jpeg" /></figure><h3>Liquid 的型別</h3><p>和一般的 JS 的認知一樣，Liquid 的基本型別可分為 String 、 Number 、 Boolean 、 Array ，和比較特別的Nil 、 EmptyDrop 。</p><h4>String</h4><p>可以利用 assign 宣告一個字串</p><pre>{% assign shirtColor <strong>=</strong> &quot;blue&quot; %}</pre><h4>Number</h4><p>亦可宣告整數或浮點數</p><pre>{% assign shirtNumber <strong>=</strong> 100 %}<br>{% assign shirtDiscount <strong>=</strong> 0.8 %}</pre><h4>Boolean</h4><p>或是宣告一個布林值</p><pre>{% assign shirtAvailable <strong>=</strong> true %}<br>{% assign skirtAvailable <strong>=</strong> false %}</pre><h4>Array</h4><p>也可以宣告一個陣列，但宣告陣列的方法不像我們習慣的直接使用 []：</p><pre>{% assign shirtColors <strong>= [&quot;</strong>blue&quot;, &quot;red&quot;, &quot;yellow&quot;]<strong> </strong>%}</pre><p>而是：</p><pre>{% assign shirtColors <strong>= </strong>&quot;blue,red,yellow&quot;<strong> </strong>| split: &#39;,&#39; %}</pre><h4>Nil</h4><p>Nil 有點類似 JS 世界的 undefine ，當一個變數被呼叫卻沒有被賦予值則會回傳 Nil ，如果在判斷式中則會判斷為 false 。</p><pre>&lt;p&gt;I like {{ color }} shirt.&lt;/p&gt;</pre><p>輸出</p><pre>I like  shirt.</pre><h3>變數宣告</h3><p>Liquid 中變數的宣告有 assign 和 capture 兩種。</p><h4>assign</h4><p>assign 是使用單一個 tag 做宣告，通常用於像是 number 、 string、 boolean 這種比較簡單的變數。</p><pre>{% assign myFruit= &quot;Apple&quot; %}</pre><h4>capture</h4><p>capture 則是使用兩個 tags 包住要宣告的內容，通常用於結構較為複雜的變數。</p><pre>{% capture myDescription %}<br>  I love banana.<br>{% endcapture %}</pre><pre>{{ myDescription }}</pre><p>輸出：</p><pre>I love banana.</pre><p>另外也可以在 capture 內使用 filter 或是變數來宣告：</p><pre>{% assign myFruit = &quot;banana&quot; %}<br>{% assign isLoveFruit = true%}</pre><pre>{% capture fruitDescription %}<br>  {% if isLoveFruit == true %}<br>    My favourite fruit is {{ myFruit }}.<br>  {% else %}<br>    I don&#39;t like fruit.<br>  {% endif %}<br>{% endcapture %}</pre><pre>{{ fruitDescription }}</pre><p>輸出：</p><pre>My favourite fruit is banana.</pre><h3>參考資料</h3><ul><li><a href="https://help.shopify.com/en/themes/liquid">Shopify Help Center</a></li><li><a href="https://shopify.github.io/liquid/">Liquid Template Language</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=de133a0ec28d" width="1" height="1" alt=""><hr><p><a href="https://medium.com/i-%E7%99%BC%E5%AE%A2/%E7%94%A8%E4%B8%AD%E6%96%87%E6%95%99%E4%BD%A0-shopify-liquid-%E6%80%8E%E9%BA%BC%E5%AF%AB02-%E5%9E%8B%E5%88%A5%E8%88%87%E5%AE%A3%E5%91%8A-de133a0ec28d">用中文教你 Shopify Liquid 怎麼寫02：型別與宣告</a> was originally published in <a href="https://medium.com/i-%E7%99%BC%E5%AE%A2">i 發客</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[用中文教你 Shopify Liquid 怎麼寫01：基本介紹]]></title>
            <link>https://medium.com/i-%E7%99%BC%E5%AE%A2/%E7%94%A8%E4%B8%AD%E6%96%87%E6%95%99%E4%BD%A0-shopify-liquid-%E6%80%8E%E9%BA%BC%E5%AF%AB01-%E5%9F%BA%E6%9C%AC%E4%BB%8B%E7%B4%B9-2dbef4961a57?source=rss-876736a98e7c------2</link>
            <guid isPermaLink="false">https://medium.com/p/2dbef4961a57</guid>
            <category><![CDATA[shopify]]></category>
            <category><![CDATA[shopify-development]]></category>
            <category><![CDATA[liquid]]></category>
            <dc:creator><![CDATA[Keri T]]></dc:creator>
            <pubDate>Thu, 17 Oct 2019 12:21:02 GMT</pubDate>
            <atom:updated>2019-10-17T12:21:02.292Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/945/1*aOfKLD46encvvAQpm0bg5A.jpeg" /></figure><p>現在的電子商務平台五花八門，Shopify 是目前市佔率蠻高的一個平台 ，如果懂得撰寫 Liquid 可以更靈活的應用Shopify 所提供的各種功能，做出一個客製化程度很高的網站。</p><p>這個系列主要整理基本的 Liquid 介紹與語法，至於如何結合 Shopify 的各種功能這種的進階教學，之後有空的話會再另外開篇章講解。</p><h3>什麼是 Liquid？</h3><p>Liquid 是由 Shopify 創造的模板引擎，目前能夠在 GitHub 上找到相關的開源資源（<a href="https://github.com/Shopify/liquid">https://github.com/Shopify/liquid</a>）。開發者可以利用 Liquid 呼叫儲存在 Shopify後台的各種資料，再利用前端語法（html、css、js…等）客製化成自己所需要的網頁。</p><p>像是以下範例利用 liquid + HTML 的方式，呼叫出 Shopify 後台所設定的 pages 資料，再利用這些資料客製化成需要的樣式。</p><pre>{% assign indexPage = pages[&quot;index&quot;] %}<br>&lt;h1 class=&quot;title&quot;&gt;{{ indexPage.title }}&lt;/h1&gt;<br>&lt;div class=&quot;content&quot;&gt;{{ indexPage.content }}&lt;/div&gt;</pre><h3>Liquid 的基本語法</h3><blockquote>Liquid 分成以下三種類型，每種類型都有它固定的語法，包括呼叫資料、邏輯運算和一些方法…等等。基本的結構是使用大括弧包住語法{{ some Object }}，而使用運算符時則是使用大括弧＋%的方式 {% if %}。</blockquote><h4><strong>(1) Objects</strong></h4><p>Objects 是用來呼叫 Shopify 後台的資料，呼叫時用 {{和}} 包住物件的名稱，主要的表達方式如下：</p><pre>{{ product.title }}</pre><p>輸出：</p><pre>素色襯衫</pre><h4><strong>(2) Tags</strong></h4><p>就如同常見語言，在Liquid的世界裡也是可以使用運算符的，包括 for、if、或是宣告變數等等，而這類的用法則統稱為 Tags，在使用運算符時是使用 {% %} 包住語法，並且根據不同的 Tag 可能會需要使用 {% %} 包住需要用到的區段，聽起來好像很複雜，我們直接來看例子最清楚：</p><pre>{% assign shirt_color <strong>=</strong> &#39;yellow&#39; %}<br>{% if shirt_color == &#39;red&#39; %}<br>  &lt;p&gt;Buy one get one free&lt;/p&gt;<br>{% else %}<br>  &lt;p&gt;Sale on to 50% off&lt;/p&gt;<br>{% endif %}</pre><p>輸出：</p><pre>Sale on to 50% off</pre><h4><strong>(3) Filters</strong></h4><p>Filters 是一些 Liquid 的方法，通常結合 Objects 一同使用，它可以改變字串、數字、物件…等等的內容。使用方法是在 Object 的 Key 後方加上 | 和 你要的 Filter，範例如下：</p><pre>{% assign my_shirt = &#39;I love pink shirt.&#39;%}<br>{{ my_shirt | prepend: &quot;Oh! &quot; }}</pre><p>輸出：</p><pre>Oh! I love pink shirt.</pre><h4>同場加映：去除多餘的空白</h4><p>有時我們會為了排版做縮排，但 Liquid 無法自動辨認空格是否要留著，所以另外產生出了一種用法，利用 {%- -%} 這種寫法可以去除前後多餘的空格。</p><p>一般未使用時：</p><pre>{% assign shirt_color = &#39;blue&#39; %}<br>{% if shirt_color == &#39;blue %}<br>  Oh! I love {{ shirt_color }} shirt.<br>{% else %}<br>  I don&#39;t like it.<br>{% endif %}</pre><p>輸出：</p><pre>  Oh! I love blue shirt.</pre><p>使用 {%- -%} 時：</p><pre>{%- assign shirt_color = &#39;blue&#39; -%}<br>{%- if shirt_color == &#39;blue -%}<br>  Oh! I love {{ shirt_color }} shirt.<br>{%- else -%}<br>  I don&#39;t like it.<br>{%- endif -%}</pre><p>輸出：</p><pre>Oh! I love blue shirt.</pre><h3>參考資料</h3><ul><li><a href="https://help.shopify.com/en/themes/liquid">Shopify Help Center</a></li><li><a href="https://shopify.github.io/liquid/">Liquid Template Language</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2dbef4961a57" width="1" height="1" alt=""><hr><p><a href="https://medium.com/i-%E7%99%BC%E5%AE%A2/%E7%94%A8%E4%B8%AD%E6%96%87%E6%95%99%E4%BD%A0-shopify-liquid-%E6%80%8E%E9%BA%BC%E5%AF%AB01-%E5%9F%BA%E6%9C%AC%E4%BB%8B%E7%B4%B9-2dbef4961a57">用中文教你 Shopify Liquid 怎麼寫01：基本介紹</a> was originally published in <a href="https://medium.com/i-%E7%99%BC%E5%AE%A2">i 發客</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>