<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Aporia Zone on Aporia Zone</title>
    <link>https://gokwok.github.io/</link>
    <description>Recent content in Aporia Zone on Aporia Zone</description>
    <generator>Hugo -- gohugo.io</generator>
    <language>en-us</language>
    <lastBuildDate>Thu, 18 Jul 2019 21:30:03 +0000</lastBuildDate>
    <atom:link href="/" rel="self" type="application/rss+xml" />
    
    <item>
      <title>设定集</title>
      <link>https://gokwok.github.io/2019/%E8%AE%BE%E5%AE%9A%E9%9B%86/</link>
      <pubDate>Thu, 18 Jul 2019 21:30:03 +0000</pubDate>
      
      <guid>https://gokwok.github.io/2019/%E8%AE%BE%E5%AE%9A%E9%9B%86/</guid>
      <description>

&lt;blockquote&gt;
&lt;p&gt;&amp;ldquo;毁灭即诞生，我们的临斋之地和我们的荣誉之事，将皆由此诞生。&amp;rdquo;
                                                      ——泰拉创世纪 第一章18节&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3 id=&#34;1-大陆架构&#34;&gt;1. 大陆架构&lt;/h3&gt;

&lt;p&gt;英雄联盟世界观的瓦罗兰大陆艾欧尼亚越过世界之树的北侧和地下城世界观的阿拉德大陆最北测的斯顿雪域相连。
故事的舞台由两个世界的交界，艾欧尼亚和斯顿雪域展开。
英雄联盟的世界：&lt;/p&gt;

&lt;p&gt;&lt;img src=&#34;http://wx1.sinaimg.cn/mw690/cf7ae241ly1g25p8zd851j218p0u0tde.jpg&#34; alt=&#34;英雄联盟&#34; /&gt;
地下城与勇士的世界：&lt;/p&gt;

&lt;p&gt;&lt;img src=&#34;http://wx4.sinaimg.cn/mw690/cf7ae241ly1g25p8t7f5ej21d60u0dq9.jpg&#34; alt=&#34;dnf&#34; /&gt;&lt;/p&gt;

&lt;h3 id=&#34;2-两个大陆各自的历史进程&#34;&gt;2. 两个大陆各自的历史进程&lt;/h3&gt;

&lt;p&gt;瓦罗兰大陆：三权分立的诺克萨斯为了获取艾欧尼亚的生命之树，大举入侵艾欧尼亚，恕瑞玛沙漠沙皇还未从沉睡中醒来，暗影岛深处的鬼魂向比尔吉沃特的海港伸出獠牙，自诩正义的德玛西亚中法师团体开始反抗压迫。&lt;/p&gt;

&lt;p&gt;阿拉德大陆：名为冒险家的生物刚踏足坎纳克山，暗精灵王国的邪龙已经苏醒，诺伊佩拉的第五使徒瘟疫还在蔓延，德洛斯帝国和玛尔公国在边境产生冲突，万年雪山的班图族神谕中揭示着冰龙的复苏。&lt;/p&gt;

&lt;h3 id=&#34;3-故事的主舞台&#34;&gt;3. 故事的主舞台&lt;/h3&gt;

&lt;h4 id=&#34;3-1-艾欧尼亚&#34;&gt;3.1 艾欧尼亚&lt;/h4&gt;

&lt;p&gt;艾欧尼亚所在的岛屿脱离瓦罗兰主大陆，它的土地上充盈着未遭破坏的自然之美和原生魔法。这座庞大的岛屿上四散着人类的定居点，这是一群充满灵性的人，追求着平静和谐、与世无争的生活。艾欧尼亚境内存在许多教派和社团，每一派都遵循各自（常常是彼此冲突的）的教义与理念。艾欧尼亚自给自足、闭关锁国，在数世纪以来瓦洛兰大陆上的多次战争中大多保持中立姿态——直到诺克萨斯的入侵。这次野蛮的侵略强迫艾欧尼亚重新审视自己在这个世界上的位置。它会采取怎样的措施、它未来的路何去何从，一切都未可预知。但无论艾欧尼亚的选择如何，符文之地的命运都必将因此而改变。&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;初生之土
魔法充盈于艾欧尼亚的一切，人民、历史，还有大部分土地。各种形式的生命处于平衡之中，同时又有许多秘密等待探索和发现，他们的历史远比符文之地大多数种族更加古老。&lt;/li&gt;
&lt;li&gt;万物归一的生活
艾欧尼亚诸多省份的居民一直将自己视为自然世界的一部分，因此他们的生活方式与周围各种神奇的动植物和谐共存。&lt;/li&gt;
&lt;li&gt;宏伟的修道院
虽然这里是许多武术流派的发源地，但艾欧尼亚始终没有常备的军队。相反，不同的战斗技法在这里代表着彼此相左的哲学理念，在人们的敬仰和维护下代代相传。在东北方的山区，希拉娜修道院是一座古老的避难所，接纳所有为了探寻自我与精神领域连接的人。&lt;/li&gt;
&lt;li&gt;均衡教派
均衡教派是一个以维护艾欧尼亚神圣平衡为己任的团体。教派的信徒们行走于精神与物质两个世界之中，协调两界之间的冲突，而且有必要的时候，也会使用强制力介入。在对诺克萨斯战争期间，均衡教派的人被迫离流离失所，而夺走他们自古传承的庙堂的，正是曾经的均衡信徒，劫。&lt;/li&gt;
&lt;li&gt;挺立之战
普雷西典是艾欧尼亚人首次奋起反抗强敌诺克萨斯的地方。但那一天的胜利也伴随着巨大的代价，如今甚至有人开始质疑武力还击是否是正确的抉择，因为他们的家园已经永远丧失了和谐的平衡。&lt;/li&gt;
&lt;li&gt;生命之树
虽然艾欧尼亚教派众多，但是大部分教派的神明都可以由生命之树追溯而来，那是艾欧尼亚北方的一座巨型山体，形状像极了一颗巨大的树，据说是整个符文之地迎来第一缕阳光的地方，也是符文之地除了巨神峰外的最高处，普遍认为生命之树是艾欧尼亚魔法力量的源头，藏着能起死回生的力量。&lt;/li&gt;
&lt;/ul&gt;

&lt;h4 id=&#34;3-2-斯顿雪域-万年雪山&#34;&gt;3.2 斯顿雪域-万年雪山&lt;/h4&gt;

&lt;blockquote&gt;
&lt;p&gt;当冒险者们正在阿法利亚营地奋战时，斯顿雪域传来的消息让他们停下了前进的脚步，原本与世无争的班图族突然开始进犯公国的地域，当冒险者赶到的时候发现威胁根本就不是班图族的斗士，而是雪山深处传来的咆哮声……&lt;/p&gt;

&lt;p&gt;斯顿雪域位于万年雪山，是班图族的首都。为了躲避每30年苏醒一次的雪山冰龙斯卡萨，班图族不得不周期性的越过国境入侵他国，以求得生存空间。对于时常迁移的班图族而言，首都这个词可能不太恰当，但班图族们将首都定在了斯顿雪域后，并没有继续往南撤退。这里距离雪山并不远，从这儿可以很清晰得看到雪山。&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;斯顿雪域是指斯特鲁山脉西北一带的地区。这里海拔较高，气候寒冷干燥，并不适宜居住。&lt;/p&gt;

&lt;p&gt;但是依然有一些民族群居在这里，其中以班图族的势力最为强大。每三十年，冰龙斯卡萨从沉睡中苏醒，班图族人就必须翻越斯特鲁山脉到达大陆腹地，以解决冰龙带来的严寒与饥荒问题。&lt;/p&gt;

&lt;p&gt;但是斯特鲁山脉常年被冰雪覆盖，地势险峻，要想以一己之力翻越这座山峰，几乎是不可能的，所以每到这时候，各族间会团结一致，互相扶持。&lt;/p&gt;

&lt;p&gt;斯顿雪域地区的发展相对于内陆国家而言，较为落后。主要原因在于那里偏远的地理位置和恶劣的生存环境，使得族人们无法与内陆地区进行频繁地往来交流，从而导致了物质、文化上的闭塞，这也是班图族文明与阿拉德大陆的主流文明存在明显差异的最主要原因。&lt;/p&gt;

&lt;p&gt;直到某天班图族人发现雪山的尽头仿佛有一棵树的影子……&lt;/p&gt;

&lt;h3 id=&#34;4-两个世界的交错-异世界的螺旋&#34;&gt;4. 两个世界的交错，异世界的螺旋&lt;/h3&gt;

&lt;p&gt;长久以来，很多使世界陷入混乱的事……&lt;/p&gt;

&lt;p&gt;还有那些看起来毫无关联的灾难片段，在谁都无法察觉的瞬间，以‘命运’之名自行联系起来……而那些被命运之指选中的人，可能会认为那些灾难是偶然发生的悲剧……&lt;/p&gt;

&lt;p&gt;但……&lt;/p&gt;

&lt;p&gt;这其实是巨大的命运齿轮，按早已契合的轨道，开始缓缓旋转的信号……&lt;/p&gt;

&lt;p&gt;生命之树的更北侧出现了雪山的轮廓，而万年雪山的尽头出现了神树的影子，班图族认为神树是彻底消灭冰龙斯卡萨的神谕，于是越过雪山，入侵了艾欧尼亚的领地，寻找神树的秘密……&lt;/p&gt;

&lt;p&gt;而处于战火之中的艾欧尼亚苦苦抵挡着诺克萨斯的入侵，班图族的入侵更是让瓦罗兰的局势乱成了一锅粥，英雄和勇士的命运，在此处交错。&lt;/p&gt;

&lt;h3 id=&#34;5-人物设定&#34;&gt;5. 人物设定&lt;/h3&gt;

&lt;h4 id=&#34;5-1-英雄侧&#34;&gt;5.1 英雄侧&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;艾瑞莉娅&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;在艾欧尼亚各地游历的游侠，将家乡的古老舞艺化为战技，以精心修习的优雅姿态操控着致命的刀刃。此时的她还没有加入战争，在各处寻找哥哥的足迹，尚未成为那位刀锋意志。&lt;/p&gt;

&lt;p&gt;&lt;em&gt;利刃冲击，距破之舞，比翼双刄，至尊锋刄&lt;/em&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;杰里柯·斯维因&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;作为诺克萨斯高瞻远瞩的策士统领，执掌一个独尊力量的扩张主义国度。在艾欧尼亚的战争中被斩去了左臂，但仍然在前线亲自指挥着，对抗着只有他才能看到的压境黑暗，只有他才能通过黑影般的渡鸦窥见周围死尸的秘密。&lt;/p&gt;

&lt;p&gt;&lt;em&gt;解脱之触，帝国视界，永不复行，恶魔升华&lt;/em&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;伯纳姆·达克威尔&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;青春永驻的诺克萨斯最高统帅，他已经统帅了诺克萨斯无数年，已经远远超出正常人类的平均寿命，谣传他通过死灵法术才活了这么多年，为了长生的秘密大举入侵艾欧尼亚。&lt;/p&gt;

&lt;h4 id=&#34;5-2-冒险家侧&#34;&gt;5.2 冒险家侧&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;萝塔(ROTA)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;来自赫顿玛尔冒险家工会的战斗法师，看起来像个未成年的少女，但因为是魔族的原因，真实年龄已经达到25岁了，她有一头红色的双马尾，但是没有魔族标志性的用来感应魔力的双角，擅长使用长矛进行战斗，有成为魔法师的梦想但是因为没有角的缘故魔法天赋很弱，有着超乎寻常的战斗意识，会使用简单的元素炫纹辅助战斗。&lt;/p&gt;

&lt;p&gt;&lt;img src=&#34;http://wx4.sinaimg.cn/mw690/cf7ae241ly1g25p91k7aqj20le0ihdhp.jpg&#34; alt=&#34;人设图&#34; /&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;潘多拉(Pandora)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;属赫顿玛尔冒险家工会的冰结师，同为没有双角的魔族，心脏被名为黑暗之眼的结晶所代替，年龄未知。不擅长与人交流，使用特殊的冰系魔法进行战斗，因为黑暗之眼的特殊性，有快速恢复伤口的能力。&lt;/p&gt;

&lt;p&gt;&lt;img src=&#34;http://wx2.sinaimg.cn/mw690/cf7ae241ly1g25p8wkejtj208c08cwep.jpg&#34; alt=&#34;人设图&#34; /&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;敏泰&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;来自班图族的少女，16岁，棕发绿瞳，戴着有兔儿的帽子，是部落中的带了库尼莱的启示的巫师，雪崩拉比纳的妹妹。父亲是信奉狼的沃克族，母亲是信奉兔的库尼族。天真浪漫，纯洁无瑕，拥有一颗不为世俗污染的纯洁心灵。虽然年纪很小，但已是班图族内认可的优秀萨满。&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;雪崩拉比纳&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;敏泰的哥哥，在雪山山脊上与班图族的战士们一起肩负着阻截外人擅自进入雪山的使命.他那狮吼般的嚎叫经常引起山体雪崩，同时也使对手心生恐惧，因而便有了“雪崩”的外号.和其他班图族战士一样，拉比纳虽然对异族人非常粗鲁，但对那些战胜自己的对手却极其尊重。&lt;/p&gt;

&lt;h3 id=&#34;6-备用资料&#34;&gt;6. 备用资料&lt;/h3&gt;

&lt;h4 id=&#34;6-1-冰结师背景故事&#34;&gt;6.1 冰结师背景故事&lt;/h4&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;“我出生的地方由于太寒冷甚至连使徒都不敢来这里。我从小就跟冰相处的很好，难道那时候已经注定我会成为最强冰结师么？”&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;​   在所有能源被使徒抢走后，这里变成了极冰世界。在接近绝对零度的这里，生命绝对是禁忌的存在。&lt;/p&gt;

&lt;p&gt;　　除了冰属性精灵外，只有少数追求冰属性魔法极限的高级魔法师敢于接近这里。这些人自称为“冰结师”。
　　
　　人如其名，他们对冰属性魔法有着特别的天赋与造诣。但是与其他冰系元素魔法师不同的是，他们直接用寒冰做出各种形态的武器来打击目标。
　　
　　只会使用冰系单一系的魔法，对冰结师来说是致命的缺点。但由于用“黑暗之眼”大幅强化了冰系魔法，他们的冰变得坚不可摧，甚至任何火焰都不能融化掉他们用寒冰做出来的武器。&lt;/p&gt;

&lt;hr /&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;“在替换心脏的黑暗之眼上，凝成了一朵小小的霜花。”&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;　　它表明着原没有固定形态的“黑暗之眼”，正在逐渐结晶化。
　　
　　这看起来是件不可思议的事情。 不过他们所做的这一切，本来就违背了自然的规律。
　　
　　你看“黑暗之眼”已经开始结晶化，
　　
　　他们双脚踏上的每一寸土地、呼吸的每一口空气，
　　
　　甚至身体中流淌的每一滴血液，都在慢慢凝成结晶。
　　
　　他们虽然活着，却等同于死亡。
　　
　　若要问他们为什么还宁愿残喘于这个世界上，
　　
　　答案只有一个——魔法。
　　
　　为了魔法，他们可以不惜舍弃部分的身体……
　　
　　这是身为男魔法师的悲哀吗？
　　
　　他们的感情已经完全消逝，性格变得极度冷漠，
　　
　　身体的周围还散发着令人毛骨悚然的寒气。
　　
　　他们放弃了人类之躯，就像那些消失的精灵一样，渐渐地远离了人类。
　　
　　为了魔法，他们已然舍弃了一切。
　　
　　在他们的心中，或许只剩下那像雪之花一般绽放着的“黑暗之眼”。
　　
　　他们，就是冰冻之心。&lt;/p&gt;

&lt;hr /&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;刹那永恒&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;​   冰冻的心脏，在刹那间粉碎，散落一地。&lt;/p&gt;

&lt;p&gt;　　少女将碎片一一拾起，即使感到疼痛，也不皱一下眉头。
　　
　　问她是否感到寒冷，她却回答，这是温暖的。
　　
　　柔软的小手其实已经麻木，再无触觉了吧。
　　
　　深渊之花将时间冻结，
　　
　　万物皆被染上冰雪的厉色。
　　
　　唯有那少女，还在对我绽放微笑。
　　
　　那温暖绮丽的色彩，渐渐填满了我的世界。
　　
　　冰冻之心，慢慢融化成为流淌的逝水，
　　
　　长发从此未再修剪，蓄成银白色的瀑布。
　　
　　而离去之人，连背影都无法留住。
　　
　　唤醒我的那位少女，我会将她永远刻在心上。
　　
　　即使时光短暂，
　　
　　双手的温暖触感，如今还依稀残留。
　　
　　这一次，轮到我来守护你，直到永恒。
　　
　　少女啊，在封冻的回忆中安息吧……&lt;/p&gt;

&lt;h4 id=&#34;6-2-战斗法师背景故事&#34;&gt;6.2 战斗法师背景故事&lt;/h4&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;一位“贝亚娜斗神”的自述&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;炫纹是什么？贝亚娜又是什么？
想要了解这些，我们必须先要了解那段被遗忘的神话故事——一段连《泰拉创世纪》都没有记载的传说。
那是在泰拉星依然完整的太古时代，魔法的力量还没有被发明出来，以先进的科学技术为基础，十二个“贝亚娜”被创造出来了。
闪耀着金色光芒的贝亚娜，拥有着贤者的智慧和战神的力量，她们光辉的形象受到所有泰拉人的崇拜，每一个泰拉人最大的梦想就是成为贝亚娜一般的存在。
这种狂热的崇拜也影响到了泰拉星上的科学家，他们开始通过各种研究探究人类变成如同贝亚娜一样强大的可能性。
简单来说，如果把创造贝亚娜的那种未知的力量注入到人的身体里，人类“贝亚娜化”就极有可能实现。
但创造出贝亚娜的那种未知的力量已经再也无法获得了，所以在无奈之下，泰拉的科学家只能用一种盘旋在宇宙中的微弱力量来代替，那就是“元素”。元素本身并不具备很强大的能量，但把众多元素聚在一起就能够凝聚成仅次于未知力量的能量。科学家们想想这种能量一定能给泰拉人带来改变，并对它进行不懈的研究。
结果大家已经知道了，古代科学家们成功了，被注入元素能量的人类散发出和贝亚娜同样的金色光芒，并获得了强大的力量。但是由于对元素的理解不足，试验人体的负荷太过沉重，最终狂暴的元素之力在人体内暴走，所有的实验体都死去了。
这就是贝亚娜的秘密，元素的发现以及炫纹诞生的起源，为什么要突然说起这段无聊的事情，自然是有原因的。那就是因为比炫纹更加浓缩的魔力……也就是创造贝亚娜的那种未知的力量又再次出现了。
有人推测，这是由于阿拉德大陆最近发生的异变现象导致的，也有人说不是。但这显然已经不重要了，在这种神奇的力量面前，深究出现的理由已然没有任何意义。
尽管这种力量渗透出来得黑暗与邪恶让人感到恐惧，但对于强大力量的渴望在这时已经压制了我心中的一切，前所未有的兴奋感让我全身颤栗，我能将这种力量收为己用吗？
成败已经不重要了，这种刺激的挑战已经足以让我不顾一切。&lt;/p&gt;

&lt;h4 id=&#34;6-3-班图族&#34;&gt;6.3 班图族&lt;/h4&gt;

&lt;p&gt;班图族并非指一个单纯的氏族，准确的来说这就像是中国人和和汉族这样的说法一样。班图族实则是对居住在斯特鲁山脉以北地区的所有氏族的总称。而族名“班图”是源自古代英雄“班图”，他以着绝强的实力翻越了斯特鲁山脉并占领了现在的贝尔玛尔。班图族的内部是由三个较小的部族主导，他们分别是沃克族（狼）、库尼族（兔子）和图卢斯族（野牛）。&lt;/p&gt;

&lt;h4 id=&#34;6-4-三十年前查理的故事&#34;&gt;6.4 三十年前查理的故事&lt;/h4&gt;

&lt;p&gt;30年前的某一夜，当年幼的巴尔雷娜还在熟睡时，比她大一岁的哥哥查理在帐篷外看到了神奇的一幕：一条漂亮的巨龙拖着绚烂的冰晶粉末略过天际，在黑暗的夜空里转了一圈又一圈，最后终于消失在坎纳克山的另一边。
对于班图族人而言，这意味着折磨他们许久的冰龙斯卡萨已经再次苏醒，这绝对是个恐怖的坏消息，但仍是个小孩子的查理并不这么认为，因为那亮晶晶的粉末已经紧紧地抓住了他的心，迫使他去一探究竟。
查理回到帐篷里，摇醒了巴尔雷娜并向她绘声绘色地讲了自己刚才的见闻，他还说去斯特鲁山脉的深处，去找那条令人着迷的巨龙。
巴尔雷娜本以为他只是说着玩的，并没有放在心上，但第二天查理就失踪了……&lt;/p&gt;

&lt;h4 id=&#34;6-5-洛丝之歌&#34;&gt;6.5 洛丝之歌&lt;/h4&gt;

&lt;p&gt;漆黑的夜，没有月光照耀的深谷
积累千年的雪球在孤独的叹息
好想念太阳的光芒……
偶尔，闪过的记忆片段里
那些被珍藏在心底的金黄光芒
像一束一束晃动跳跃的欢快音符&lt;/p&gt;

&lt;p&gt;狭隘而长长的峡谷里吹来哀怨的风
它叹息着峡谷的荒芜
聚集了千年的时间
在寒冷的雪地上刻出了自己的模样
悠长而孤独的雪之香烟
从此拥有了晶莹的面容&lt;/p&gt;

&lt;p&gt;在地底下轻轻呼吸的雪球
一点一点积累了千年
它无法忘掉冷酷又孤独的风
再次一点一点出现，与风相伴
两个孤独的灵魂在缠绕中沉淀
峡谷里渐渐出现了冰之柱
单纯为照亮世界而存的洁净之光
冰之柱很孤单
它想念那些金黄的光芒
但它的双手永远无法碰触它们
看着那些光芒一点一点从心里消失
最后陪伴冰之柱的，只剩下风孤独的叹息
终于，某一天
在对面，伸手可触的地方
它看到了和自己一样寂寞的冰柱&lt;/p&gt;

&lt;p&gt;悠长的岁月里
冰之柱和那些同样寂寞的冰柱为伴
它们渴望那些金黄的光芒
它们分享彼此的寂寞和孤独
因为心里有着共同的渴望
它们扶持着走过了漫长的岁月&lt;/p&gt;

&lt;p&gt;冰之柱以为自己终于摆脱了孤单和寂寞
但或许是注定
它失去了相伴的朋友
从此心底多了另一个痛
心底的渴望永远无法满足
只好把千年寂寞埋在心底
冰之柱又跟往常一样
它细心的积累着雪、风还有冰
把它们积成又薄又长的屋顶
一如它千年来的渴望&lt;/p&gt;

&lt;p&gt;一块结晶掉了下来
嵌在看不见的冰冷细缝里
几千年的等待
终于长出了完整的手
冰之柱高兴地留下了眼泪&lt;/p&gt;

&lt;p&gt;在漫长的等待中
眼泪形成了细细的河流，流淌了千年
然后，将自己托付给神最初创造的河流
一点点，流向低处
这样过了一千年
雪球又一次回到了自己原先生活的细缝
它下定决心从此不再离开
柔软晶莹的眼泪，有着坚硬的外壳
如同孤单的人有着坚强的外表
习惯寂寞是这个世界的生存法则
但是，自己却再也无法一个人生活下去
因为想起和其他柱子为伴的日子
心里就有了永远无法填补的空缺&lt;/p&gt;

&lt;p&gt;过了很久，很久……
雪球做了一个梦
梦见自己温暖地抱着凉凉的风
一个小小的生命体在上面走动
那气息与风一起筑起了坚固的梦晶体
像风一样来到自己身边的少女
有着和风一样的声音
但风吹过
声音却仍然静静地停留着
雪球便把她称为洛丝
洛丝是风不停的呼唤
是小小梦想停驻的摇篮
几百，成千个梦聚在这里
筑起巢
形成房间
形成床
形成器皿
形成鞋
…………
最后出现了颜色&lt;/p&gt;

&lt;p&gt;又过了一千年
梦有了自己的意识，她可以思考了
为了永远活在自己熟悉的地方
梦筑起了自己的宫殿&lt;/p&gt;

&lt;p&gt;…………
天空飘落的雪白冰之结晶
与梦结合一起便有了新的模样
从此不再毫无意义地埋藏千年
它成了冰雪宫殿里的点点荧光
无法拥有所以珍贵
无法停留所以哀怨
白雪茫茫
朦胧的一片
冰之女神就在我身边
到处都能听到她歌声
只要倾听就能听见的歌声
闭上双眼就能看到的模样
紧握着如梦般冰凉的你的双手
我想就这样，香甜地睡着
…………&lt;/p&gt;

&lt;p&gt;甜美而雪白的旋律幽幽响起
雪球知道这个旋律会永远跳动
为了留住洛丝
温暖的旋律会自己融化
将那梦般寒凉而香甜的冰之歌
融进洛丝的心里
就这样，洛丝之歌开始吟唱
洛丝之歌嵌在一个冰雪的结晶里
直到幽深寂寞的峡谷不再存在
洛丝之歌藏在渴望获得光的欲望里
直到寒冷美丽的雪花不再飘落
洛丝之歌溶入孤单而寂寞的风里
直到飘渺不定的风不再刮起
…………
只要少女心中有梦
洛丝之歌就不会停止&lt;/p&gt;

&lt;h4 id=&#34;6-6-渡鸦&#34;&gt;6.6 渡鸦&lt;/h4&gt;

&lt;p&gt;一种全身黑色的大型雀形目鸦属鸟类，俗称胖头鸟。是雀形目中体体型最大的鸟类，共有12个&lt;a href=&#34;https://baike.baidu.com/item/%E4%BA%9A%E7%A7%8D/6290944&#34; rel=&#34;nofollow noreferrer&#34; target=&#34;_blank&#34;&gt;亚种&lt;/a&gt;。通体黑色，并闪紫蓝色金属光泽；尤以两翅为最显著。喉与胸前的羽毛长且呈披针状；鼻须长而发达，几乎盖到上嘴的一半。虹膜暗褐色；嘴、跗蹠和趾黑色。
集群性强，常结群营巢，并在秋冬季节混群游荡。行为复杂，表现有较强的智力和社会性活动。鸣声简单粗厉。栖息于高山草甸和山区林缘地带。杂食性，主要取食小型啮齿类、小型鸟类、爬行类、昆虫和腐肉等，也取食植物的果实等，甚至人类活动的剩食等。&lt;/p&gt;

&lt;h3 id=&#34;7-大纲&#34;&gt;7. 大纲&lt;/h3&gt;

&lt;p&gt;序-起-承-转-合&lt;/p&gt;

&lt;h4 id=&#34;7-1-序&#34;&gt;7.1 序&lt;/h4&gt;

&lt;p&gt;为了解决公国边境班图族的来犯，冒险家们来到了斯顿雪域之中，却发现部落中发生了一位少女失踪的事件，于是两位冒险家和少女的哥哥一起踏入雪山，却在找到少女敏泰的同时意外发现了在雪山那端的巨大树影。&lt;/p&gt;

&lt;h4 id=&#34;7-2-起&#34;&gt;7.2 起&lt;/h4&gt;

&lt;p&gt;为了抵抗诺克萨斯的入侵，在艾欧尼亚各处寻找哥哥的艾瑞莉娅来到了艾欧尼亚神树生命之树的附近，她在生命之树山脚下被诺克萨斯人毁灭的瓦斯塔亚部落中找到了哥哥的踪迹，却在登上生命之树的路上意外遇到了策士统领斯维因率领的小队，一番激战过后艾瑞莉娅借着地形的掩护逃脱到了生命之树的更北方，艾欧尼亚自古以来的一片禁地。和充满生命力的艾欧尼亚不同，越过生命之树后的徒弟显得荒无人烟，被白茫茫的雪原所覆盖。而斯维因并没有放弃追击艾瑞莉娅，借助渡鸦的力量追上了艾瑞莉娅，命悬一线之际，遇上了来自阿拉德的四人小队，四人救下了艾瑞莉娅，敏泰认定艾瑞莉娅就是神谕中的宿命之人，于是四人将受重伤的艾瑞莉娅待会雪山另一边的斯顿雪域。斯维因却也跟着四人来到了万年雪山中。&lt;/p&gt;

&lt;h4 id=&#34;7-3-承&#34;&gt;7.3 承&lt;/h4&gt;

&lt;p&gt;艾瑞莉娅醒来发现自己已经身处在班图族的部落，敏泰向众人诉说了神谕的内容。
另一边，因为阿法利亚营地传来更为严重的事态，冒险者们先一步赶去了阿法利亚营地，艾瑞莉娅希望雪山的众人协助自己越过雪山帮助艾欧尼亚抵抗诺克萨斯的入侵，作为交换，艾瑞莉娅依照神谕的指示，和冒险家一起帮助班图族除掉冰龙斯卡萨。
而在雪山中失去方向的斯维因意外进入了斯卡萨的洞穴，和冰龙斯卡萨展开对峙，双方没有分出胜负，斯维因却在洞穴中意外遇到了一个神秘的吟游诗人，吟游诗人一眼看破他的所想，并且告诉了斯维因达克威尔长生不老的秘密。&lt;/p&gt;

&lt;h4 id=&#34;7-4-转&#34;&gt;7.4 转&lt;/h4&gt;

&lt;p&gt;冰龙斯卡萨因为被斯维因所惹怒，对斯顿雪域展开袭击，艾瑞莉娅家族世代相传的舞蹈其实是一种类似屠龙术的舞蹈，斯卡萨在大闹一番后对艾瑞莉娅产生了恐惧，但是这次突袭还是对斯顿雪域造成了巨大的损失。
经过众人的商量，决定以艾瑞莉娅的屠龙舞作为杀手锏，主动出击消灭斯卡萨，三位冒险家、班图族的勇士和艾瑞莉娅一起踏入雪山。
等待他们的第一个难关是一位冰巨人，竟然是三十年前就已经失踪的查理。
第二个是雪山下洞穴利库天井中的寒冰巨人巴斯尔。
第三个是本应死去的冰雪女王洛丝。&lt;/p&gt;

&lt;h4 id=&#34;7-5-合&#34;&gt;7.5 合&lt;/h4&gt;

&lt;p&gt;终于见到的冰龙斯卡萨，斯卡萨在雪山之中的能力远超众人的想象，在一番激战后艾瑞莉娅的屠龙之舞将斯卡萨击成重伤，斯卡萨感受到了屠龙舞中的危机，这次并不是三十年一次的沉睡就可以恢复力量，可能会彻底死去，于是斯卡萨使出全力反扑，斯卡萨的绝境中的反扑带给了冒险家们巨大的损失，在付出巨大的代价后终于将冰龙斯卡萨斩杀，再无复活的可能。
最后艾瑞莉娅将前往阿法利亚营地帮助冒险家们对抗邪龙的苏醒，同时班图族和公国也决定出兵越过雪山，帮助艾欧尼亚对抗诺克萨斯的侵略。&lt;/p&gt;
</description>
    </item>
    
    <item>
      <title>Welcome to my blog</title>
      <link>https://gokwok.github.io/2019/welcome/</link>
      <pubDate>Mon, 15 Jul 2019 15:49:44 +0800</pubDate>
      
      <guid>https://gokwok.github.io/2019/welcome/</guid>
      <description>&lt;p&gt;Welcome!&lt;/p&gt;
</description>
    </item>
    
    <item>
      <title>記第一次天池大數據競賽</title>
      <link>https://gokwok.github.io/2019/%E7%AC%AC%E4%B8%80%E6%AC%A1%E5%A4%A9%E6%B1%A0%E5%A4%A7%E6%95%B8%E6%93%9A%E7%AB%B6%E8%B3%BD%E8%A8%98%E9%8C%84/</link>
      <pubDate>Wed, 10 Jul 2019 21:30:03 +0000</pubDate>
      
      <guid>https://gokwok.github.io/2019/%E7%AC%AC%E4%B8%80%E6%AC%A1%E5%A4%A9%E6%B1%A0%E5%A4%A7%E6%95%B8%E6%93%9A%E7%AB%B6%E8%B3%BD%E8%A8%98%E9%8C%84/</guid>
      <description>&lt;p&gt;這幾天參加了一下阿里的天池大數據競賽，初賽已經結束了，雖然差了一個百分點很遺憾沒有晉級下一輪，不過第一次參加這種比賽，能達到144/2522這樣的成績，我感覺也算過的去，关键是在4-5天的比赛里，确实学到了许多的东西，在此對這一次比賽的過程做一個記錄。
比賽地址：&lt;a href=&#34;https://tianchi.aliyun.com/competition/introduction.htm?spm=5176.100066.0.0.5a8e8242Uuqy64&amp;amp;raceId=231638&#34; rel=&#34;nofollow noreferrer&#34; target=&#34;_blank&#34;&gt;天池精準醫療大賽——人工智能輔助糖尿病遺傳風險預測&lt;/a&gt;
1. 數據集的處理
首先看到比賽題目最直觀的能馬上得到的是主辦方給的測試集，入手以後看了下測試集，缺失內容非常之多，數據處理用*python*進行，主要使用*pandas*來查看數據。&lt;/p&gt;

&lt;pre&gt;&lt;code class=&#34;language-python&#34;&gt;data_train = pd.read_csv(&amp;quot;.......csv&amp;quot;)
data_train.columns 
data = pd.concat([train,test],axis=0)
print(data.isnull().sum()/len(data))    #查看數據的缺失比例
&lt;/code&gt;&lt;/pre&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;模型的選用
這次比賽選用的是baseline的lighGBM，一開始用了nn效果不是很好，代碼如下：
```python
def make_feat(train,test):
train_id = train.id.values.copy()
test_id = test.id.values.copy()
data = pd.concat([train,test])&lt;/p&gt;

&lt;p&gt;data[&amp;lsquo;性别&amp;rsquo;] = data[&amp;lsquo;性别&amp;rsquo;].map({&amp;lsquo;男&amp;rsquo;:1,&amp;lsquo;女&amp;rsquo;:0,&amp;lsquo;??&amp;rsquo;:1})
data[&amp;lsquo;体检日期&amp;rsquo;] = (pd.to_datetime(data[&amp;lsquo;体检日期&amp;rsquo;]) - parse(&amp;lsquo;2017-10-09&amp;rsquo;)).dt.days&lt;/p&gt;

&lt;p&gt;data.fillna(data.median(axis=0),inplace=True)&lt;/p&gt;

&lt;p&gt;train_feat = data[data.id.isin(train_id)]
test_feat = data[data.id.isin(train_id)]&lt;/p&gt;

&lt;p&gt;return train_feat,test_feat&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;train_feat,test_feat = make_feat(train,test)&lt;/p&gt;

&lt;p&gt;predictors = [f for f in test_feat.columns if f not in [&amp;lsquo;血糖&amp;rsquo;]]&lt;/p&gt;

&lt;p&gt;def evalerror(pred, df):
    label = df.get_label().values.copy()
    score = mean_squared_error(label,pred)*0.5
    return (&amp;lsquo;0.5mse&amp;rsquo;,score,False)&lt;/p&gt;

&lt;p&gt;print(&amp;lsquo;开始训练&amp;hellip;&amp;rsquo;)
params = {
    &amp;lsquo;learning_rate&amp;rsquo;: 0.01,
    &amp;lsquo;boosting_type&amp;rsquo;: &amp;lsquo;gbdt&amp;rsquo;,
    &amp;lsquo;objective&amp;rsquo;: &amp;lsquo;regression&amp;rsquo;,
    &amp;lsquo;metric&amp;rsquo;: &amp;lsquo;mse&amp;rsquo;,
    &amp;lsquo;sub_feature&amp;rsquo;: 0.7,
    &amp;lsquo;num_leaves&amp;rsquo;: 60,
    &amp;lsquo;colsample_bytree&amp;rsquo;: 0.7,
    &amp;lsquo;min_data&amp;rsquo;: 100,
    &amp;lsquo;min_hessian&amp;rsquo;: 1,
    &amp;lsquo;verbose&amp;rsquo;: -1,
}&lt;/p&gt;

&lt;p&gt;print(&amp;lsquo;开始CV 5折训练&amp;hellip;&amp;rsquo;)
t0 = time.time()
train_preds = np.zeros(train_feat.shape[0])
test_preds = np.zeros((test_feat.shape[0],5))
kf = KFold(len(train_feat),n_folds=5,shuffle=True,random_state=520)
for i,(train_index,test_index) in enumerate(kf):
    print(&amp;lsquo;第{}次训练&amp;hellip;&amp;rsquo;.format(i))
    train_feat1 = train_feat.iloc[train_index]
    train_feat2 = train_feat.iloc[test_index]
    lgb_train1 = lgb.Dataset(train_feat1[predictors],train_feat1[&amp;lsquo;血糖&amp;rsquo;])#,categorical_feature=[&amp;lsquo;性别&amp;rsquo;])
    lgb_train2 = lgb.Dataset(train_feat2[predictors],train_feat2[&amp;lsquo;血糖&amp;rsquo;])
    gbm = lgb.train(
        params,
        lgb_train1,
        num_boost_round=3000,
        valid_sets=lgb_train2,
        verbose_eval=100,
        feval=evalerror,
        early_stopping_rounds=100
    )
    feat_imp = pd.Series(gbm.feature_importance(),index=predictors).sort_values(ascending=False)
    train_preds[test_index] += gbm.predict(train_feat2[predictors])
    test_preds[:,i] = gbm.predict(test_feat[predictors])
print(&amp;lsquo;线下得分：    {}&amp;rsquo;.format(mean_squared_error(train_feat[&amp;lsquo;血糖&amp;rsquo;],train_preds)*0.5))
print(&amp;lsquo;CV训练用时{}秒&amp;rsquo;.format(time.time() - t0))&lt;/p&gt;

&lt;p&gt;submission = pd.DataFrame({&amp;lsquo;pred&amp;rsquo;:test_preds.mean(axis=1)})
submission.to&lt;em&gt;csv(r&amp;rsquo;sub{}.csv&amp;rsquo;.format(datetime.datetime.now().strftime(&amp;lsquo;%Y%m%d&lt;/em&gt;%H%M%S&amp;rsquo;)),header=None,
                  index=False,float_format=&amp;lsquo;%.4f&amp;rsquo;)
```
3. 展望
數據的缺失補全，特征提取都有了一定的了解，不過沒進複賽很不甘心，下次再接再厲。&lt;/p&gt;
</description>
    </item>
    
    <item>
      <title>hexo deplay失敗的解決方案</title>
      <link>https://gokwok.github.io/2018/hexo-deplay%E5%A4%B1%E6%95%97%E7%9A%84%E8%A7%A3%E6%B1%BA%E6%96%B9%E6%A1%88/</link>
      <pubDate>Sun, 21 Jan 2018 20:33:56 +0000</pubDate>
      
      <guid>https://gokwok.github.io/2018/hexo-deplay%E5%A4%B1%E6%95%97%E7%9A%84%E8%A7%A3%E6%B1%BA%E6%96%B9%E6%A1%88/</guid>
      <description>&lt;p&gt;*今晚突然&lt;strong&gt;hexo deplay&lt;/strong&gt;跳出了一大片錯誤，但檢查了下網絡是沒有問題的，repository也是存在的，並且能正常與github通信，使用&lt;strong&gt;hexo server&lt;/strong&gt;部署在本地也沒有問題，報錯如下：*&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;INFO  Deploying: git
INFO  Clearing .deploy_git folder...
INFO  Copying files from public folder...
INFO  Copying files from extend dirs...
[master bbb080a] Site updated: 2018-01-21 20:27:34
 7 files changed, 8 insertions(+), 8 deletions(-)
ssh_exchange_identification: Connection closed by remote host
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
FATAL Something&#39;s wrong. Maybe you can find the solution here: http://hexo.io/docs/troubleshooting.html
Error: ssh_exchange_identification: Connection closed by remote host
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
    at ChildProcess.&amp;lt;anonymous&amp;gt; (/Users/gaowei/gokwok.github.io/node_modules/hexo-util/lib/spawn.js:37:17)
    at ChildProcess.emit (events.js:159:13)
    at maybeClose (internal/child_process.js:943:16)
    at Socket.stream.socket.on (internal/child_process.js:363:11)
    at Socket.emit (events.js:159:13)
    at Pipe._handle.close [as _onclose] (net.js:568:12)
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;&lt;strong&gt;試了很多辦法都沒有成功，後來看見&lt;a href=&#34;https://www.cnblogs.com/xsilence/p/6001938.html&#34; rel=&#34;nofollow noreferrer&#34; target=&#34;_blank&#34;&gt;這篇博客&lt;/a&gt;，把hexo根目錄下的*.deploy_git*文件夾刪除，重新部署一遍，解決了問題&lt;/strong&gt;&lt;/p&gt;
</description>
    </item>
    
    <item>
      <title>numpy初步使用指南</title>
      <link>https://gokwok.github.io/2018/numpy%E5%88%9D%E6%AD%A5%E4%BD%BF%E7%94%A8%E6%8C%87%E5%8D%97_ver2/</link>
      <pubDate>Sun, 21 Jan 2018 18:22:11 +0000</pubDate>
      
      <guid>https://gokwok.github.io/2018/numpy%E5%88%9D%E6%AD%A5%E4%BD%BF%E7%94%A8%E6%8C%87%E5%8D%97_ver2/</guid>
      <description>

&lt;h2 id=&#34;一-概述&#34;&gt;一、概述&lt;/h2&gt;

&lt;p&gt;Numpy是Python中的一個科學計算庫，提供了矩陣運算的功能，由於numpy提供了更多方便了函數，在實際的使用中numpy要優於python中的list。&lt;strong&gt;本文將會著重於機器學習過程中對numpy的使用需要了解的大致操作，來介紹numpy的初步使用指南。&lt;/strong&gt;&lt;/p&gt;

&lt;h2 id=&#34;二-安裝和導入&#34;&gt;二、安裝和導入&lt;/h2&gt;

&lt;p&gt;普通的pip操作即可完成安裝&lt;strong&gt;(若同時安裝了python2和python3想在python3中安裝請使用pip3)：&lt;/strong&gt;&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;pip install numpy
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;導入numpy：&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;import numpy as np
&lt;/code&gt;&lt;/pre&gt;

&lt;h2 id=&#34;三-數據結構&#34;&gt;三、數據結構&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;numpy&lt;/strong&gt;的主要對象是同種元素的多維數組。這是一個所有的元素都是一種類型、通過一個正整數元組索引的元素表格（通常是數字表格）。在&lt;strong&gt;numpy&lt;/strong&gt;中維度叫做軸（&lt;strong&gt;axes&lt;/strong&gt;），軸的個數叫做秩（&lt;strong&gt;rank&lt;/strong&gt;）。
打個比方，在三維空間中一個點的坐標*[1，2，3]*就是一個秩為1的數組，因為它軸的個數為1，該軸的長度為3。&lt;strong&gt;numpy&lt;/strong&gt;的數組類叫做&lt;strong&gt;ndarry&lt;/strong&gt;，通常被稱作&lt;strong&gt;數組&lt;/strong&gt;，它與標準Python庫類array.array並不相同，後者只處理一維數組和提供少量功能。&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;ndarry&lt;/strong&gt;的主要對象屬性有：&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;ndarray.ndim&lt;/strong&gt;：軼的值&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;&lt;strong&gt;ndarray.shape&lt;/strong&gt;：數組的維度。這是一個指示數組在每個維度上大小的整數元組。例如一個n排m列的矩陣，他的&lt;strong&gt;shape&lt;/strong&gt;屬性就是（2，3），這個元組的長度是軼，即維度或是ndim屬性&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;&lt;strong&gt;ndarray.size&lt;/strong&gt;：數組元素的總個數，等於shape屬性中元組元素的乘積&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;&lt;strong&gt;ndarray.dtype&lt;/strong&gt;：一個用來描述數組中元素類型的對象，可以通過創造或指定&lt;strong&gt;dtype&lt;/strong&gt;使用標準的Python類型，也可以使用&lt;strong&gt;numpy&lt;/strong&gt;自己提供的數據類型&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;&lt;strong&gt;ndarray.itemsize&lt;/strong&gt;：數組中每個元素的字節大小。例如，一個元素類型為float64的數組itemsiz屬性值為*（64/8=）*8&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;&lt;strong&gt;ndarray.data&lt;/strong&gt;：包含實際數組元素的緩衝區，通常不使用這個屬性&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&#34;四-使用numpy&#34;&gt;四、使用numpy&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;4.1 創建數組&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;使用array函數從常規的Python列表和元組創造數組。所創建的數組類型由原序列中的元素類型推導而來。&lt;/p&gt;

&lt;pre&gt;&lt;code class=&#34;language-python&#34;&gt;&amp;gt;&amp;gt;&amp;gt; a = array([2,3,4])  #RIGHT
&amp;gt;&amp;gt;&amp;gt; a = array(2,3,4)    #WRONG
&lt;/code&gt;&lt;/pre&gt;

&lt;ol&gt;
&lt;li&gt;數組將序列包含序列轉化為二維的數組，序列包含序列包含序列轉化成三維數組。
&lt;code&gt;python
&amp;gt;&amp;gt;&amp;gt; b = array([(1,2,3,4),(1,2,3,4)])
&lt;/code&gt;&lt;/li&gt;
&lt;/ol&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;數組類型可以在創建的時候指定&lt;/p&gt;

&lt;pre&gt;&lt;code class=&#34;language-python&#34;&gt;&amp;gt;&amp;gt;&amp;gt; c = array([[1,2],[3,4]],dtype=complex)
&lt;/code&gt;&lt;/pre&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;一般來說，數組的元素開始都是未知的，但是它的大小是已知的。&lt;strong&gt;numpy&lt;/strong&gt;提供了一些使用佔位符創建數組的函數。函數&lt;strong&gt;zeros&lt;/strong&gt;創建一個全是0的數組，函數&lt;strong&gt;ones&lt;/strong&gt;創建一個全1的數組，函數&lt;strong&gt;empty&lt;/strong&gt;創建一個內容隨機並且依賴於內存狀態的數組。默認創建的數組類型（dtype）都是float64.&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;為了創建一個數列，&lt;strong&gt;numpy&lt;/strong&gt;提供了一個類似&lt;strong&gt;arrange&lt;/strong&gt;的函數返回數組而不是列表：&lt;/p&gt;

&lt;pre&gt;&lt;code class=&#34;language-python&#34;&gt;&amp;gt;&amp;gt;&amp;gt; arange(10,30,5)
array([10,15,20,25])
&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;
&lt;/ol&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;4.2 打印數組&lt;/strong&gt;
當你打印一個數組，&lt;strong&gt;numpy&lt;/strong&gt;以類似嵌套列表的形式顯示它，但是呈以下布局：&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;最後的軸從左到右打印&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;次後的軸從頂向下打印&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;剩下的軸從頂向下打印，每個切片通過一個空行與下一個隔開&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;pre&gt;&lt;code class=&#34;language-python&#34;&gt;&amp;gt;&amp;gt;&amp;gt;a = array(6)
&amp;gt;&amp;gt;&amp;gt;print(a)
[0 1 2 3 4 5]
&amp;gt;&amp;gt;&amp;gt;b = arange(12).reshape(4,3)
&amp;gt;&amp;gt;&amp;gt;print(b)
[[ 0 1 2 ]
  [ 3 4 5 ]
  [ 6 7 8 ]
  [9 10 11]]
&amp;gt;&amp;gt;&amp;gt; c = arange(24).reshape(2,3,4)      
&amp;gt;&amp;gt;&amp;gt; print c
[[[ 0  1  2  3]
  [ 4  5  6  7]
  [ 8  9 10 11]]

 [[12 13 14 15]
  [16 17 18 19]
  [20 21 22 23]]]
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;如果一個數組用來打印太大了，&lt;strong&gt;numpy&lt;/strong&gt;自動省略中間部分只打印角落&lt;/p&gt;

&lt;p&gt;如果想要禁用這種行為並強制打印整個數組，可以設置printoptions參數來更改打印選項&lt;/p&gt;

&lt;pre&gt;&lt;code class=&#34;language-python&#34;&gt;&amp;gt;&amp;gt;&amp;gt; set_printoptions(threshold=&#39;nan&#39;)
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;&lt;strong&gt;4.3 基本運算&lt;/strong&gt;
1. 數組的算是運算時按元素的。新的數組被創建而且結果被填充
2. &lt;strong&gt;numpy&lt;/strong&gt;中乘法運算符*指示按元素運算，矩陣乘法可以用&lt;strong&gt;dot&lt;/strong&gt;函數或創建舉證對象實現
3. 有些操作符像&lt;strong&gt;+=&lt;/strong&gt;和*&lt;strong&gt;=&lt;/strong&gt;被用來更改已存在數組而不是創建一個新的數組
4. 通用函數，&lt;strong&gt;numpy&lt;/strong&gt;中提供常用的數學函數如*sin*，*cos*，*tan*，這些叫做通用函數，常用的通用函數之後會開個單篇介紹。&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4.4 索引、切片和迭代&lt;/strong&gt;
一維數組可以被索引、切片和迭代，就像列表和其他python序列。
多維數組可以每個軸有一個所有。這些索引由一個逗號分隔的元組給出。&lt;/p&gt;

&lt;pre&gt;&lt;code class=&#34;language-python&#34;&gt;&amp;gt;&amp;gt;&amp;gt; def f(x,y):
...         return 10*x+y
...
&amp;gt;&amp;gt;&amp;gt; b = fromfunction(f,(5,4),dtype=int)
&amp;gt;&amp;gt;&amp;gt; b
array([[ 0,  1,  2,  3],
       [10, 11, 12, 13],
       [20, 21, 22, 23],
       [30, 31, 32, 33],
       [40, 41, 42, 43]])
&amp;gt;&amp;gt;&amp;gt; b[2,3]
23
&amp;gt;&amp;gt;&amp;gt; b[0:5, 1]                       # each row in the second column of b
array([ 1, 11, 21, 31, 41])
&amp;gt;&amp;gt;&amp;gt; b[ : ,1]                        # equivalent to the previous example
array([ 1, 11, 21, 31, 41])
&amp;gt;&amp;gt;&amp;gt; b[1:3, : ]                      # each column in the second and third row of b
array([[10, 11, 12, 13],
       [20, 21, 22, 23]])
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;當少於軸數的索引被提供時，缺失的索引默認為整個切片。&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4.5 形狀操作&lt;/strong&gt;
一個數組的形狀由它每個軸上的元素的個數給出。
一個數組的形狀可以被多種命令修改：&lt;/p&gt;

&lt;pre&gt;&lt;code class=&#34;language-python&#34;&gt;&amp;gt;&amp;gt;&amp;gt; a = floor(10*random.random((3,4)))
&amp;gt;&amp;gt;&amp;gt; a
array([[ 7.,  5.,  9.,  3.],
       [ 7.,  2.,  7.,  8.],
       [ 6.,  8.,  3.,  2.]])
&amp;gt;&amp;gt;&amp;gt; a.shape
(3, 4)
&amp;gt;&amp;gt;&amp;gt; a.ravel() # flatten the array
array([ 7.,  5.,  9.,  3.,  7.,  2.,  7.,  8.,  6.,  8.,  3.,  2.])
&amp;gt;&amp;gt;&amp;gt; a.shape = (6, 2)
&amp;gt;&amp;gt;&amp;gt; a.transpose()
array([[ 7.,  9.,  7.,  7.,  6.,  3.],
       [ 5.,  3.,  2.,  8.,  8.,  2.]])
&amp;gt;&amp;gt;&amp;gt; a
array([[ 7.,  5.],
       [ 9.,  3.],
       [ 7.,  2.],
       [ 7.,  8.],
       [ 6.,  8.],
       [ 3.,  2.]])
&amp;gt;&amp;gt;&amp;gt; a.resize((2,6))
&amp;gt;&amp;gt;&amp;gt; a
array([[ 7.,  5.,  9.,  3.,  7.,  2.],
       [ 7.,  8.,  6.,  8.,  3.,  2.]])
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;&lt;strong&gt;reshape&lt;/strong&gt;函數改變的改變shape參數形狀返回它，而&lt;strong&gt;resize&lt;/strong&gt;函數是改變數組自身&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4.6 組合不同的數組&lt;/strong&gt;
&lt;strong&gt;vstack&lt;/strong&gt;和&lt;strong&gt;hstack&lt;/strong&gt;可以沿不用軸將數組堆疊在一起。
&lt;strong&gt;column_stack&lt;/strong&gt;以列的形式將一維數組合成二維數組，它等同於&lt;strong&gt;vstack&lt;/strong&gt;函數對一維數組。
&lt;strong&gt;row_stack&lt;/strong&gt;則是以行將一維數組合成二維數組。
&lt;strong&gt;hsplit&lt;/strong&gt;能將數組沿水平軸分割成幾個數組，可以指定返回相同形狀的數組的個數，也可以指定那些列發生分割，同理&lt;strong&gt;vsplit&lt;/strong&gt;沿縱軸分割，&lt;strong&gt;array split&lt;/strong&gt;允許指定沿哪個軸分割。&lt;/p&gt;

&lt;h2 id=&#34;五-總結&#34;&gt;五、總結&lt;/h2&gt;

&lt;p&gt;做個常用的&lt;strong&gt;numpy&lt;/strong&gt;操作函數總結：&lt;/p&gt;

&lt;p&gt;創建數組
&lt;code&gt;arange, array, copy, empty, empty_like, eye, fromfile, fromfunction,identity, linspace, logspace, mgrid, ogrid, ones, ones_like, r , zeros, zeros_like&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;轉化
&lt;code&gt;astype, atleast 1d, atleast 2d, atleast 3d, mat&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;操作
&lt;code&gt;array split, column stack, concatenate, diagonal, dsplit, dstack, hsplit, hstack, item, newaxis, ravel, repeat, reshape, resize, squeeze, swapaxes, take, transpose, vsplit, vstack&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;詢問
&lt;code&gt;all, any, nonzero, where&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;排序
&lt;code&gt;argmax, argmin, argsort, max, min, ptp, searchsorted, sort&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;運算
&lt;code&gt;choose, compress, cumprod, cumsum, inner, fill, imag, prod, put, putmask, real, sum&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;基本統計
&lt;code&gt;cov, mean, std, var&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;基本線性代數
&lt;code&gt;cross, dot, outer, svd, vdot&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;numpy&lt;/strong&gt;在機器學習中的應用主要還是在算法階段，在數據處理階段&lt;strong&gt;pandas&lt;/strong&gt;庫使用得更多。熟悉&lt;strong&gt;numpy&lt;/strong&gt;庫有助於我們更好得自己實現各種機器學習的算法。&lt;/p&gt;

&lt;hr /&gt;

&lt;p&gt;&lt;em&gt;參考博客：&lt;a href=&#34;http://blog.csdn.net/lsjseu/article/details/20359201?utm_source=tuicool&#34; rel=&#34;nofollow noreferrer&#34; target=&#34;_blank&#34;&gt;NumPy的詳細教程&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;
</description>
    </item>
    
    <item>
      <title>python實現簡繁體轉換腳本</title>
      <link>https://gokwok.github.io/2018/python%E5%AF%A6%E7%8F%BE%E7%B0%A1%E7%B9%81%E9%AB%94%E8%BD%89%E6%8F%9B%E8%85%B3%E6%9C%AC/</link>
      <pubDate>Tue, 16 Jan 2018 15:46:24 +0000</pubDate>
      
      <guid>https://gokwok.github.io/2018/python%E5%AF%A6%E7%8F%BE%E7%B0%A1%E7%B9%81%E9%AB%94%E8%BD%89%E6%8F%9B%E8%85%B3%E6%9C%AC/</guid>
      <description>&lt;p&gt;因為本博客使用的字體是&lt;strong&gt;明朝&lt;/strong&gt;（*HiraMinProN*），該字體頗有古風，很符合個人的口味，Apple的設備無論是ios還是mac都內置了該字體。但是在使用中它對於簡體中文的支持很差，存在很多未覆蓋的字符。如果使用繁體中文書寫博客，應用該字體的效果還是不錯的。所以為了對中文的博文進行處理，使用*python*編寫了以下輕量級的簡繁體中文轉化腳本。&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;所需要的Python庫：&lt;/strong&gt;&lt;a href=&#34;https://github.com/csdz/nstools/blob/master/zhtools/zh_wiki.py&#34; rel=&#34;nofollow noreferrer&#34; target=&#34;_blank&#34;&gt;zh_wiki.py&lt;/a&gt;,&lt;a href=&#34;https://github.com/csdz/nstools/blob/master/zhtools/langconv.py&#34; rel=&#34;nofollow noreferrer&#34; target=&#34;_blank&#34;&gt;langconv&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;代碼編寫：&lt;/strong&gt;&lt;/p&gt;

&lt;hr /&gt;

&lt;pre&gt;&lt;code class=&#34;language-python&#34;&gt;from langconv import *
class article:
    &#39;&#39;&#39;
    图片处理类
    参数
    -------------
    infile: 输入文件路径
    outfile： 输出文件路径
    &#39;&#39;&#39;
    def __init__(self,infile,outfile):
        self.infile = infile
        self.outfile = outfile
    #简体转繁体
    def simple2traditon(self):
        fp = open(self.outfile,&#39;w&#39;)
        with open(self.infile) as t:
            for line in t:
                print(line)
                line = Converter(&#39;zh-hant&#39;).convert(line)
                print(line)
                fp.write(line)
        fp.close()
    #繁体转简体
    def tradition2simple(self):
        fp = open(self.outfile, &#39;w&#39;)
        with open(self.infile) as t:
            for line in t:
                line = Converter(&#39;zh-hans&#39;).convert(line)
                fp.write(line)
        fp.close()
&lt;/code&gt;&lt;/pre&gt;

&lt;hr /&gt;

&lt;p&gt;實現效果：
&lt;strong&gt;轉換前:&lt;/strong&gt; 唐僧为什么要取经——《西游记》中的政治路线图
&lt;strong&gt;轉換后:&lt;/strong&gt; 唐僧為什麼要取經——《西遊記》中的政治路線圖
單行較長時速度一般，處理大文件速度一般，但是足夠輕量級，處理博文已經完全夠用&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;寫在最後：&lt;/strong&gt;希望能體會到更多文字本身的美，深藏于文字內部的美。&lt;/p&gt;

&lt;hr /&gt;

&lt;p&gt;&lt;em&gt;參考博客：&lt;a href=&#34;http://blog.csdn.net/tab_space/article/details/50823073&#34; rel=&#34;nofollow noreferrer&#34; target=&#34;_blank&#34;&gt;简体中文转繁体的python简单实现&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;
</description>
    </item>
    
    <item>
      <title>項脊軒記</title>
      <link>https://gokwok.github.io/2018/%E9%A0%85%E8%84%8A%E8%BB%92%E8%A8%98/</link>
      <pubDate>Tue, 16 Jan 2018 15:00:46 +0000</pubDate>
      
      <guid>https://gokwok.github.io/2018/%E9%A0%85%E8%84%8A%E8%BB%92%E8%A8%98/</guid>
      <description>&lt;p&gt;項脊軒，舊南閣子也。室僅方丈，可容壹人居。百年老屋，塵泥滲漉，雨澤下註；每移案，顧視，無可置者。又北向，不能得日，日過午已昏。余稍為修葺，使不上漏。前辟四窗，垣墻周庭，以當南日，日影反照，室始洞然。又雜植蘭桂竹木於庭，舊時欄楯，亦遂增勝。借書滿架，偃仰嘯歌，冥然兀坐，萬籟有聲；而庭堦寂寂，小鳥時來啄食，人至不去。三五之夜，明月半墻，桂影斑駁，風移影動，珊珊可愛。
然余居於此，多可喜，亦多可悲。先是庭中通南北為壹。迨諸父異爨，內外多置小門，墻往往而是。東犬西吠，客逾庖而宴，雞棲於廳。庭中始為籬，已為墻，凡再變矣。家有老嫗，嘗居於此。嫗，先大母婢也，乳二世，先妣撫之甚厚。室西連於中閨，先妣嘗壹至。嫗每謂余曰：”某所，而母立於茲。”嫗又曰：”汝姊在吾懷，瓜瓜而泣；娘以指叩門扉曰：‘兒寒乎？欲食乎？’吾從板外相為應答。”語未畢，余泣，嫗亦泣。余自束發，讀書軒中，壹日，大母過余曰：”吾兒，久不見若影，何竟日默默在此，大類女郎也？”比去，以手闔門，自語曰：”吾家讀書久不效，兒之成，則可待乎！”頃之，持壹象笏至，曰：”此吾祖太常公宣德間執此以朝，他日汝當用之！”瞻顧遺跡，如在昨日，令人長號不自禁。
軒東，故嘗為廚，人往，從軒前過。余扃牖而居，久之，能以足音辨人。軒凡四遭火，得不焚，殆有神護者。
項脊生曰：”蜀清守丹穴，利甲天下，其後秦皇帝築女懷清臺；劉玄德與曹操爭天下，諸葛孔明起隴中。方二人之昧昧於壹隅也，世何足以知之，余區區處敗屋中，方揚眉、瞬目，謂有奇景。人知之者，其謂與坎井之蛙何異？”
余既為此誌，後五年，吾妻來歸，時至軒中，從余問古事，或憑幾學書。吾妻歸寧，述諸小妹語曰：”聞姊家有閣子，且何謂閣子也？”其後六年，吾妻死，室壞不修。其後二年，余久臥病無聊，乃使人復葺南閣子，其制稍異於前。然自後余多在外，不常居。
庭有枇杷樹，吾妻死之年所手植也，今已亭亭如蓋矣。&lt;/p&gt;
</description>
    </item>
    
    <item>
      <title>markdown測試</title>
      <link>https://gokwok.github.io/2017/markdown%E6%B8%AC%E8%A9%A6/</link>
      <pubDate>Mon, 18 Dec 2017 09:59:46 +0000</pubDate>
      
      <guid>https://gokwok.github.io/2017/markdown%E6%B8%AC%E8%A9%A6/</guid>
      <description>&lt;p&gt;&lt;strong&gt;馬克飛象&lt;/strong&gt;是一款專為印象筆記（Evernote）打造的Markdown編輯器，通過精心的設計與技術實現，配合印象筆記強大的存儲和同步功能，帶來前所未有的書寫體驗。特點概述：&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;功能豐富&lt;/strong&gt; ：支持高亮代碼塊、&lt;em&gt;LaTeX&lt;/em&gt; 公式、流程圖，本地圖片以及附件上傳，甚至截圖粘貼，工作學習好幫手；&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;得心應手&lt;/strong&gt; ：簡潔高效的編輯器，提供&lt;a href=&#34;http://maxiang.info/client_zh&#34; rel=&#34;nofollow noreferrer&#34; target=&#34;_blank&#34;&gt;桌面客戶端&lt;/a&gt;以及&lt;a href=&#34;https://chrome.google.com/webstore/detail/kidnkfckhbdkfgbicccmdggmpgogehop&#34; rel=&#34;nofollow noreferrer&#34; target=&#34;_blank&#34;&gt;離線Chrome App&lt;/a&gt;，支持移動端 Web；&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;深度整合&lt;/strong&gt; ：支持選擇筆記本和添加標籤，支持從印象筆記跳轉編輯，輕鬆管理。&lt;/li&gt;
&lt;/ul&gt;

&lt;hr /&gt;

&lt;p&gt;[TOC]&lt;/p&gt;

&lt;h2 id=&#34;markdown簡介&#34;&gt;Markdown簡介&lt;/h2&gt;

&lt;blockquote&gt;
&lt;p&gt;Markdown 是一種輕量級標記語言，它允許人們使用易讀易寫的純文本格式編寫文檔，然後轉換成格式豐富的HTML頁面。    —— &lt;a href=&#34;https://zh.wikipedia.org/wiki/Markdown&#34; rel=&#34;nofollow noreferrer&#34; target=&#34;_blank&#34;&gt;維基百科&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;正如您在閱讀的這份文檔，它使用簡單的符號標識不同的標題，將某些文字標記為&lt;strong&gt;粗體&lt;/strong&gt;或者*斜體*，創建一個&lt;a href=&#34;http://www.example.com&#34; rel=&#34;nofollow noreferrer&#34; target=&#34;_blank&#34;&gt;鏈接&lt;/a&gt;或一個腳註&lt;sup class=&#34;footnote-ref&#34; id=&#34;fnref:demo&#34;&gt;&lt;a href=&#34;#fn:demo&#34;&gt;1&lt;/a&gt;&lt;/sup&gt;。下面列舉了幾個高級功能，更多語法請按&lt;code&gt;Ctrl + /&lt;/code&gt;查看幫助。&lt;/p&gt;

&lt;h3 id=&#34;代碼塊&#34;&gt;代碼塊&lt;/h3&gt;

&lt;pre&gt;&lt;code class=&#34;language-python&#34;&gt;@requires_authorization
def somefunc(param1=&#39;&#39;, param2=0):
    &#39;&#39;&#39;A docstring&#39;&#39;&#39;
    if param1 &amp;gt; param2: # interesting
        print &#39;Greater&#39;
    return (param2 - param1 + 1) or None
class SomeClass:
    pass
&amp;gt;&amp;gt;&amp;gt; message = &#39;&#39;&#39;interpreter
... prompt&#39;&#39;&#39;
&lt;/code&gt;&lt;/pre&gt;

&lt;h3 id=&#34;latex-公式&#34;&gt;LaTeX 公式&lt;/h3&gt;

&lt;p&gt;可以創建行內公式，例如 $\Gamma(n) = (n-1)!\quad\forall n\in\mathbb N$。或者塊級公式：&lt;/p&gt;

&lt;p&gt;$$  x = \dfrac{-b \pm \sqrt{b^2 - 4ac}}{2a} $$&lt;/p&gt;

&lt;h3 id=&#34;表格&#34;&gt;表格&lt;/h3&gt;

&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th align=&#34;left&#34;&gt;Item&lt;/th&gt;
&lt;th align=&#34;right&#34;&gt;Value&lt;/th&gt;
&lt;th align=&#34;center&#34;&gt;Qty&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;

&lt;tbody&gt;
&lt;tr&gt;
&lt;td align=&#34;left&#34;&gt;Computer&lt;/td&gt;
&lt;td align=&#34;right&#34;&gt;1600 USD&lt;/td&gt;
&lt;td align=&#34;center&#34;&gt;5&lt;/td&gt;
&lt;/tr&gt;

&lt;tr&gt;
&lt;td align=&#34;left&#34;&gt;Phone&lt;/td&gt;
&lt;td align=&#34;right&#34;&gt;12 USD&lt;/td&gt;
&lt;td align=&#34;center&#34;&gt;12&lt;/td&gt;
&lt;/tr&gt;

&lt;tr&gt;
&lt;td align=&#34;left&#34;&gt;Pipe&lt;/td&gt;
&lt;td align=&#34;right&#34;&gt;1 USD&lt;/td&gt;
&lt;td align=&#34;center&#34;&gt;234&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;

&lt;h3 id=&#34;流程圖&#34;&gt;流程圖&lt;/h3&gt;

&lt;pre&gt;&lt;code class=&#34;language-flow&#34;&gt;st=&amp;gt;start: Start
e=&amp;gt;end
op=&amp;gt;operation: My Operation
cond=&amp;gt;condition: Yes or No?

st-&amp;gt;op-&amp;gt;cond
cond(yes)-&amp;gt;e
cond(no)-&amp;gt;op
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;以及時序圖:&lt;/p&gt;

&lt;pre&gt;&lt;code class=&#34;language-sequence&#34;&gt;Alice-&amp;gt;Bob: Hello Bob, how are you?
Note right of Bob: Bob thinks
Bob--&amp;gt;Alice: I am good thanks!
&lt;/code&gt;&lt;/pre&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;提示：&lt;/strong&gt;想了解更多，請查看&lt;strong&gt;流程圖&lt;/strong&gt;&lt;a href=&#34;http://adrai.github.io/flowchart.js/&#34; rel=&#34;nofollow noreferrer&#34; target=&#34;_blank&#34;&gt;語法&lt;/a&gt;以及&lt;strong&gt;時序圖&lt;/strong&gt;&lt;a href=&#34;http://bramp.github.io/js-sequence-diagrams/&#34; rel=&#34;nofollow noreferrer&#34; target=&#34;_blank&#34;&gt;語法&lt;/a&gt;。&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3 id=&#34;複選框&#34;&gt;複選框&lt;/h3&gt;

&lt;p&gt;使用 &lt;code&gt;- [ ]&lt;/code&gt; 和 &lt;code&gt;- [x]&lt;/code&gt; 語法可以創建複選框，實現 todo-list 等功能。例如：&lt;/p&gt;

&lt;ul class=&#34;task-list&#34;&gt;
&lt;li&gt;&lt;label&gt;&lt;input type=&#34;checkbox&#34; checked disabled class=&#34;task-list-item&#34;&gt; 已完成事項&lt;/label&gt;&lt;/li&gt;
&lt;li&gt;&lt;label&gt;&lt;input type=&#34;checkbox&#34; disabled class=&#34;task-list-item&#34;&gt; 待辦事項1&lt;/label&gt;&lt;/li&gt;
&lt;li&gt;&lt;label&gt;&lt;input type=&#34;checkbox&#34; disabled class=&#34;task-list-item&#34;&gt; 待辦事項2&lt;/label&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;注意：&lt;/strong&gt;目前支持尚不完全，在印象筆記中勾選複選框是無效、不能同步的，所以必須在&lt;strong&gt;馬克飛象&lt;/strong&gt;中修改 Markdown 原文才可生效。下個版本將會全面支持。&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2 id=&#34;印象筆記相關&#34;&gt;印象筆記相關&lt;/h2&gt;

&lt;h3 id=&#34;筆記本和標籤&#34;&gt;筆記本和標籤&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;馬克飛象&lt;/strong&gt;增加了&lt;code&gt;@(筆記本)[標籤A|標籤B]&lt;/code&gt;語法, 以選擇筆記本和添加標籤。 &lt;strong&gt;綁定賬號後&lt;/strong&gt;， 輸入&lt;code&gt;(&lt;/code&gt;自動會出現筆記本列表，請從中選擇。&lt;/p&gt;

&lt;h3 id=&#34;筆記標題&#34;&gt;筆記標題&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;馬克飛象&lt;/strong&gt;會自動使用文檔內出現的第一個標題作為筆記標題。例如本文，就是第一行的 &lt;code&gt;歡迎使用馬克飛象&lt;/code&gt;。&lt;/p&gt;

&lt;h3 id=&#34;快捷編輯&#34;&gt;快捷編輯&lt;/h3&gt;

&lt;p&gt;保存在印象筆記中的筆記，右上角會有一個紅色的編輯按鈕，點擊後會回到&lt;strong&gt;馬克飛象&lt;/strong&gt;中打開並編輯該筆記。
&amp;gt;&lt;strong&gt;注意：&lt;/strong&gt;目前用戶在印象筆記中單方面做的任何修改，馬克飛象是無法自動感知和更新的。所以請務必回到馬克飛象編輯。&lt;/p&gt;

&lt;h3 id=&#34;數據同步&#34;&gt;數據同步&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;馬克飛象&lt;/strong&gt;通過&lt;strong&gt;將Markdown原文以隱藏內容保存在筆記中&lt;/strong&gt;的精妙設計，實現了對Markdown的存儲和再次編輯。既解決了其他產品只是單嚮導出HTML的單薄，又規避了服務端存儲Markdown帶來的隱私安全問題。這樣，服務端僅作為對印象筆記 API調用和數據轉換之用。&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;隱私聲明：用戶所有的筆記數據，均保存在印象筆記中。馬克飛象不存儲用戶的任何筆記數據。&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3 id=&#34;離線存儲&#34;&gt;離線存儲&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;馬克飛象&lt;/strong&gt;使用瀏覽器離線存儲將內容實時保存在本地，不必擔心網絡斷掉或瀏覽器崩潰。為了節省空間和避免衝突，已同步至印象筆記並且不再修改的筆記將刪除部分本地緩存，不過依然可以隨時通過&lt;code&gt;文檔管理&lt;/code&gt;打開。&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;注意：&lt;/strong&gt;雖然瀏覽器存儲大部分時候都比較可靠，但印象筆記作為專業雲存儲，更值得信賴。以防萬一，&lt;strong&gt;請務必經常及時同步到印象筆記&lt;/strong&gt;。&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2 id=&#34;編輯器相關&#34;&gt;編輯器相關&lt;/h2&gt;

&lt;h3 id=&#34;設置&#34;&gt;設置&lt;/h3&gt;

&lt;p&gt;右側系統菜單（快捷鍵&lt;code&gt;Ctrl + M&lt;/code&gt;）的&lt;code&gt;設置&lt;/code&gt;中，提供了界面字體、字號、自定義CSS、vim/emacs 鍵盤模式等高級選項。&lt;/p&gt;

&lt;h3 id=&#34;快捷鍵&#34;&gt;快捷鍵&lt;/h3&gt;

&lt;p&gt;幫助    &lt;code&gt;Ctrl + /&lt;/code&gt;
同步文檔    &lt;code&gt;Ctrl + S&lt;/code&gt;
創建文檔    &lt;code&gt;Ctrl + Alt + N&lt;/code&gt;
最大化編輯器    &lt;code&gt;Ctrl + Enter&lt;/code&gt;
預覽文檔 &lt;code&gt;Ctrl + Alt + Enter&lt;/code&gt;
文檔管理    &lt;code&gt;Ctrl + O&lt;/code&gt;
系統菜單    &lt;code&gt;Ctrl + M&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;加粗    &lt;code&gt;Ctrl + B&lt;/code&gt;
插入圖片    &lt;code&gt;Ctrl + G&lt;/code&gt;
插入鏈接    &lt;code&gt;Ctrl + L&lt;/code&gt;
提升標題    &lt;code&gt;Ctrl + H&lt;/code&gt;&lt;/p&gt;

&lt;h2 id=&#34;關於收費&#34;&gt;關於收費&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;馬克飛象&lt;/strong&gt;為新用戶提供 10 天的試用期，試用期過後需要&lt;a href=&#34;maxiang.info/vip.html&#34; rel=&#34;nofollow noreferrer&#34; target=&#34;_blank&#34;&gt;續費&lt;/a&gt;才能繼續使用。未購買或者未及時續費，將不能同步新的筆記。之前保存過的筆記依然可以編輯。&lt;/p&gt;

&lt;h2 id=&#34;反饋與建議&#34;&gt;反饋與建議&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;微博：&lt;a href=&#34;http://weibo.com/u/2788354117&#34; rel=&#34;nofollow noreferrer&#34; target=&#34;_blank&#34;&gt;@馬克飛象&lt;/a&gt;，&lt;a href=&#34;http://weibo.com/ggock&#34; title=&#34;開發者個人賬號&#34; rel=&#34;nofollow noreferrer&#34; target=&#34;_blank&#34;&gt;@GGock&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;郵箱：&lt;a href=&#34;mailto:hustgock@gmail.com&#34; rel=&#34;nofollow noreferrer&#34; target=&#34;_blank&#34;&gt;hustgock@gmail.com&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;hr /&gt;

&lt;p&gt;感謝閱讀這份幫助文檔。請點擊右上角，綁定印象筆記賬號，開啟全新的記錄與分享體驗吧。&lt;/p&gt;
&lt;div class=&#34;footnotes&#34;&gt;

&lt;hr /&gt;

&lt;ol&gt;
&lt;li id=&#34;fn:demo&#34;&gt;這是一個示例腳註。請查閱 &lt;a href=&#34;https://github.com/fletcher/MultiMarkdown/wiki/MultiMarkdown-Syntax-Guide#footnotes&#34; rel=&#34;nofollow noreferrer&#34; target=&#34;_blank&#34;&gt;MultiMarkdown 文檔&lt;/a&gt; 關於腳註的說明。 &lt;strong&gt;限制：&lt;/strong&gt; 印象筆記的筆記內容使用 &lt;a href=&#34;https://dev.yinxiang.com/doc/articles/enml.php&#34; rel=&#34;nofollow noreferrer&#34; target=&#34;_blank&#34;&gt;ENML&lt;/a&gt; 格式，基於 HTML，但是不支持某些標籤和屬性，例如id，這就導致&lt;code&gt;腳註&lt;/code&gt;和&lt;code&gt;TOC&lt;/code&gt;無法正常點擊。
 &lt;a class=&#34;footnote-return&#34; href=&#34;#fnref:demo&#34;&gt;&lt;sup&gt;[return]&lt;/sup&gt;&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;</description>
    </item>
    
    <item>
      <title>Creating a New Theme</title>
      <link>https://gokwok.github.io/2014/creating-a-new-theme/</link>
      <pubDate>Sun, 28 Sep 2014 00:00:00 +0000</pubDate>
      
      <guid>https://gokwok.github.io/2014/creating-a-new-theme/</guid>
      <description>

&lt;h2 id=&#34;introduction&#34;&gt;Introduction&lt;/h2&gt;

&lt;p&gt;This tutorial will show you how to create a simple theme in Hugo. I assume that you are familiar with HTML, the bash command line, and that you are comfortable using Markdown to format content. I&amp;rsquo;ll explain how Hugo uses templates and how you can organize your templates to create a theme. I won&amp;rsquo;t cover using CSS to style your theme.&lt;/p&gt;

&lt;p&gt;We&amp;rsquo;ll start with creating a new site with a very basic template. Then we&amp;rsquo;ll add in a few pages and posts. With small variations on that, you will be able to create many different types of web sites.&lt;/p&gt;

&lt;p&gt;In this tutorial, commands that you enter will start with the &amp;ldquo;$&amp;rdquo; prompt. The output will follow. Lines that start with &amp;ldquo;#&amp;rdquo; are comments that I&amp;rsquo;ve added to explain a point. When I show updates to a file, the &amp;ldquo;:wq&amp;rdquo; on the last line means to save the file.&lt;/p&gt;

&lt;p&gt;Here&amp;rsquo;s an example:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;## this is a comment
$ echo this is a command
this is a command

## edit the file
$vi foo.md
+++
date = &amp;quot;2014-09-28&amp;quot;
title = &amp;quot;creating a new theme&amp;quot;
+++

bah and humbug
:wq

## show it
$ cat foo.md
+++
date = &amp;quot;2014-09-28&amp;quot;
title = &amp;quot;creating a new theme&amp;quot;
+++

bah and humbug
$
&lt;/code&gt;&lt;/pre&gt;

&lt;h2 id=&#34;some-definitions&#34;&gt;Some Definitions&lt;/h2&gt;

&lt;p&gt;There are a few concepts that you need to understand before creating a theme.&lt;/p&gt;

&lt;h3 id=&#34;skins&#34;&gt;Skins&lt;/h3&gt;

&lt;p&gt;Skins are the files responsible for the look and feel of your site. It’s the CSS that controls colors and fonts, it’s the Javascript that determines actions and reactions. It’s also the rules that Hugo uses to transform your content into the HTML that the site will serve to visitors.&lt;/p&gt;

&lt;p&gt;You have two ways to create a skin. The simplest way is to create it in the &lt;code&gt;layouts/&lt;/code&gt; directory. If you do, then you don’t have to worry about configuring Hugo to recognize it. The first place that Hugo will look for rules and files is in the &lt;code&gt;layouts/&lt;/code&gt; directory so it will always find the skin.&lt;/p&gt;

&lt;p&gt;Your second choice is to create it in a sub-directory of the &lt;code&gt;themes/&lt;/code&gt; directory. If you do, then you must always tell Hugo where to search for the skin. It’s extra work, though, so why bother with it?&lt;/p&gt;

&lt;p&gt;The difference between creating a skin in &lt;code&gt;layouts/&lt;/code&gt; and creating it in &lt;code&gt;themes/&lt;/code&gt; is very subtle. A skin in &lt;code&gt;layouts/&lt;/code&gt; can’t be customized without updating the templates and static files that it is built from. A skin created in &lt;code&gt;themes/&lt;/code&gt;, on the other hand, can be and that makes it easier for other people to use it.&lt;/p&gt;

&lt;p&gt;The rest of this tutorial will call a skin created in the &lt;code&gt;themes/&lt;/code&gt; directory a theme.&lt;/p&gt;

&lt;p&gt;Note that you can use this tutorial to create a skin in the &lt;code&gt;layouts/&lt;/code&gt; directory if you wish to. The main difference will be that you won’t need to update the site’s configuration file to use a theme.&lt;/p&gt;

&lt;h3 id=&#34;the-home-page&#34;&gt;The Home Page&lt;/h3&gt;

&lt;p&gt;The home page, or landing page, is the first page that many visitors to a site see. It is the index.html file in the root directory of the web site. Since Hugo writes files to the public/ directory, our home page is public/index.html.&lt;/p&gt;

&lt;h3 id=&#34;site-configuration-file&#34;&gt;Site Configuration File&lt;/h3&gt;

&lt;p&gt;When Hugo runs, it looks for a configuration file that contains settings that override default values for the entire site. The file can use TOML, YAML, or JSON. I prefer to use TOML for my configuration files. If you prefer to use JSON or YAML, you’ll need to translate my examples. You’ll also need to change the name of the file since Hugo uses the extension to determine how to process it.&lt;/p&gt;

&lt;p&gt;Hugo translates Markdown files into HTML. By default, Hugo expects to find Markdown files in your &lt;code&gt;content/&lt;/code&gt; directory and template files in your &lt;code&gt;themes/&lt;/code&gt; directory. It will create HTML files in your &lt;code&gt;public/&lt;/code&gt; directory. You can change this by specifying alternate locations in the configuration file.&lt;/p&gt;

&lt;h3 id=&#34;content&#34;&gt;Content&lt;/h3&gt;

&lt;p&gt;Content is stored in text files that contain two sections. The first section is the “front matter,” which is the meta-information on the content. The second section contains Markdown that will be converted to HTML.&lt;/p&gt;

&lt;h4 id=&#34;front-matter&#34;&gt;Front Matter&lt;/h4&gt;

&lt;p&gt;The front matter is information about the content. Like the configuration file, it can be written in TOML, YAML, or JSON. Unlike the configuration file, Hugo doesn’t use the file’s extension to know the format. It looks for markers to signal the type. TOML is surrounded by “&lt;code&gt;+++&lt;/code&gt;”, YAML by “&lt;code&gt;---&lt;/code&gt;”, and JSON is enclosed in curly braces. I prefer to use TOML, so you’ll need to translate my examples if you prefer YAML or JSON.&lt;/p&gt;

&lt;p&gt;The information in the front matter is passed into the template before the content is rendered into HTML.&lt;/p&gt;

&lt;h4 id=&#34;markdown&#34;&gt;Markdown&lt;/h4&gt;

&lt;p&gt;Content is written in Markdown which makes it easier to create the content. Hugo runs the content through a Markdown engine to create the HTML which will be written to the output file.&lt;/p&gt;

&lt;h3 id=&#34;template-files&#34;&gt;Template Files&lt;/h3&gt;

&lt;p&gt;Hugo uses template files to render content into HTML. Template files are a bridge between the content and presentation. Rules in the template define what content is published, where it&amp;rsquo;s published to, and how it will rendered to the HTML file. The template guides the presentation by specifying the style to use.&lt;/p&gt;

&lt;p&gt;There are three types of templates: single, list, and partial. Each type takes a bit of content as input and transforms it based on the commands in the template.&lt;/p&gt;

&lt;p&gt;Hugo uses its knowledge of the content to find the template file used to render the content. If it can’t find a template that is an exact match for the content, it will shift up a level and search from there. It will continue to do so until it finds a matching template or runs out of templates to try. If it can’t find a template, it will use the default template for the site.&lt;/p&gt;

&lt;p&gt;Please note that you can use the front matter to influence Hugo’s choice of templates.&lt;/p&gt;

&lt;h4 id=&#34;single-template&#34;&gt;Single Template&lt;/h4&gt;

&lt;p&gt;A single template is used to render a single piece of content. For example, an article or post would be a single piece of content and use a single template.&lt;/p&gt;

&lt;h4 id=&#34;list-template&#34;&gt;List Template&lt;/h4&gt;

&lt;p&gt;A list template renders a group of related content. That could be a summary of recent postings or all articles in a category. List templates can contain multiple groups.&lt;/p&gt;

&lt;p&gt;The homepage template is a special type of list template. Hugo assumes that the home page of your site will act as the portal for the rest of the content in the site.&lt;/p&gt;

&lt;h4 id=&#34;partial-template&#34;&gt;Partial Template&lt;/h4&gt;

&lt;p&gt;A partial template is a template that can be included in other templates. Partial templates must be called using the “partial” template command. They are very handy for rolling up common behavior. For example, your site may have a banner that all pages use. Instead of copying the text of the banner into every single and list template, you could create a partial with the banner in it. That way if you decide to change the banner, you only have to change the partial template.&lt;/p&gt;

&lt;h2 id=&#34;create-a-new-site&#34;&gt;Create a New Site&lt;/h2&gt;

&lt;p&gt;Let&amp;rsquo;s use Hugo to create a new web site. I&amp;rsquo;m a Mac user, so I&amp;rsquo;ll create mine in my home directory, in the Sites folder. If you&amp;rsquo;re using Linux, you might have to create the folder first.&lt;/p&gt;

&lt;p&gt;The &amp;ldquo;new site&amp;rdquo; command will create a skeleton of a site. It will give you the basic directory structure and a useable configuration file.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;$ hugo new site ~/Sites/zafta
$ cd ~/Sites/zafta
$ ls -l
total 8
drwxr-xr-x  7 quoha  staff  238 Sep 29 16:49 .
drwxr-xr-x  3 quoha  staff  102 Sep 29 16:49 ..
drwxr-xr-x  2 quoha  staff   68 Sep 29 16:49 archetypes
-rw-r--r--  1 quoha  staff   82 Sep 29 16:49 config.toml
drwxr-xr-x  2 quoha  staff   68 Sep 29 16:49 content
drwxr-xr-x  2 quoha  staff   68 Sep 29 16:49 layouts
drwxr-xr-x  2 quoha  staff   68 Sep 29 16:49 static
$
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Take a look in the content/ directory to confirm that it is empty.&lt;/p&gt;

&lt;p&gt;The other directories (archetypes/, layouts/, and static/) are used when customizing a theme. That&amp;rsquo;s a topic for a different tutorial, so please ignore them for now.&lt;/p&gt;

&lt;h3 id=&#34;generate-the-html-for-the-new-site&#34;&gt;Generate the HTML For the New Site&lt;/h3&gt;

&lt;p&gt;Running the &lt;code&gt;hugo&lt;/code&gt; command with no options will read all the available content and generate the HTML files. It will also copy all static files (that&amp;rsquo;s everything that&amp;rsquo;s not content). Since we have an empty site, it won&amp;rsquo;t do much, but it will do it very quickly.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;$ hugo --verbose
INFO: 2014/09/29 Using config file: config.toml
INFO: 2014/09/29 syncing from /Users/quoha/Sites/zafta/static/ to /Users/quoha/Sites/zafta/public/
WARN: 2014/09/29 Unable to locate layout: [index.html _default/list.html _default/single.html]
WARN: 2014/09/29 Unable to locate layout: [404.html]
0 draft content 
0 future content 
0 pages created 
0 tags created
0 categories created
in 2 ms
$ 
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;The &amp;ldquo;&lt;code&gt;--verbose&lt;/code&gt;&amp;rdquo; flag gives extra information that will be helpful when we build the template. Every line of the output that starts with &amp;ldquo;INFO:&amp;rdquo; or &amp;ldquo;WARN:&amp;rdquo; is present because we used that flag. The lines that start with &amp;ldquo;WARN:&amp;rdquo; are warning messages. We&amp;rsquo;ll go over them later.&lt;/p&gt;

&lt;p&gt;We can verify that the command worked by looking at the directory again.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;$ ls -l
total 8
drwxr-xr-x  2 quoha  staff   68 Sep 29 16:49 archetypes
-rw-r--r--  1 quoha  staff   82 Sep 29 16:49 config.toml
drwxr-xr-x  2 quoha  staff   68 Sep 29 16:49 content
drwxr-xr-x  2 quoha  staff   68 Sep 29 16:49 layouts
drwxr-xr-x  4 quoha  staff  136 Sep 29 17:02 public
drwxr-xr-x  2 quoha  staff   68 Sep 29 16:49 static
$
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;See that new public/ directory? Hugo placed all generated content there. When you&amp;rsquo;re ready to publish your web site, that&amp;rsquo;s the place to start. For now, though, let&amp;rsquo;s just confirm that we have what we&amp;rsquo;d expect from a site with no content.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;$ ls -l public
total 16
-rw-r--r--  1 quoha  staff  416 Sep 29 17:02 index.xml
-rw-r--r--  1 quoha  staff  262 Sep 29 17:02 sitemap.xml
$ 
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Hugo created two XML files, which is standard, but there are no HTML files.&lt;/p&gt;

&lt;h3 id=&#34;test-the-new-site&#34;&gt;Test the New Site&lt;/h3&gt;

&lt;p&gt;Verify that you can run the built-in web server. It will dramatically shorten your development cycle if you do. Start it by running the &amp;ldquo;server&amp;rdquo; command. If it is successful, you will see output similar to the following:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;$ hugo server --verbose
INFO: 2014/09/29 Using config file: /Users/quoha/Sites/zafta/config.toml
INFO: 2014/09/29 syncing from /Users/quoha/Sites/zafta/static/ to /Users/quoha/Sites/zafta/public/
WARN: 2014/09/29 Unable to locate layout: [index.html _default/list.html _default/single.html]
WARN: 2014/09/29 Unable to locate layout: [404.html]
0 draft content 
0 future content 
0 pages created 
0 tags created
0 categories created
in 2 ms
Serving pages from /Users/quoha/Sites/zafta/public
Web Server is available at http://localhost:1313
Press Ctrl+C to stop
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Connect to the listed URL (it&amp;rsquo;s on the line that starts with &amp;ldquo;Web Server&amp;rdquo;). If everything is working correctly, you should get a page that shows the following:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;index.xml
sitemap.xml
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;That&amp;rsquo;s a listing of your public/ directory. Hugo didn&amp;rsquo;t create a home page because our site has no content. When there&amp;rsquo;s no index.html file in a directory, the server lists the files in the directory, which is what you should see in your browser.&lt;/p&gt;

&lt;p&gt;Let’s go back and look at those warnings again.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;WARN: 2014/09/29 Unable to locate layout: [index.html _default/list.html _default/single.html]
WARN: 2014/09/29 Unable to locate layout: [404.html]
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;That second warning is easier to explain. We haven’t created a template to be used to generate “page not found errors.” The 404 message is a topic for a separate tutorial.&lt;/p&gt;

&lt;p&gt;Now for the first warning. It is for the home page. You can tell because the first layout that it looked for was “index.html.” That’s only used by the home page.&lt;/p&gt;

&lt;p&gt;I like that the verbose flag causes Hugo to list the files that it&amp;rsquo;s searching for. For the home page, they are index.html, _default/list.html, and _default/single.html. There are some rules that we&amp;rsquo;ll cover later that explain the names and paths. For now, just remember that Hugo couldn&amp;rsquo;t find a template for the home page and it told you so.&lt;/p&gt;

&lt;p&gt;At this point, you&amp;rsquo;ve got a working installation and site that we can build upon. All that’s left is to add some content and a theme to display it.&lt;/p&gt;

&lt;h2 id=&#34;create-a-new-theme&#34;&gt;Create a New Theme&lt;/h2&gt;

&lt;p&gt;Hugo doesn&amp;rsquo;t ship with a default theme. There are a few available (I counted a dozen when I first installed Hugo) and Hugo comes with a command to create new themes.&lt;/p&gt;

&lt;p&gt;We&amp;rsquo;re going to create a new theme called &amp;ldquo;zafta.&amp;rdquo; Since the goal of this tutorial is to show you how to fill out the files to pull in your content, the theme will not contain any CSS. In other words, ugly but functional.&lt;/p&gt;

&lt;p&gt;All themes have opinions on content and layout. For example, Zafta uses &amp;ldquo;post&amp;rdquo; over &amp;ldquo;blog&amp;rdquo;. Strong opinions make for simpler templates but differing opinions make it tougher to use themes. When you build a theme, consider using the terms that other themes do.&lt;/p&gt;

&lt;h3 id=&#34;create-a-skeleton&#34;&gt;Create a Skeleton&lt;/h3&gt;

&lt;p&gt;Use the hugo &amp;ldquo;new&amp;rdquo; command to create the skeleton of a theme. This creates the directory structure and places empty files for you to fill out.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;$ hugo new theme zafta

$ ls -l
total 8
drwxr-xr-x  2 quoha  staff   68 Sep 29 16:49 archetypes
-rw-r--r--  1 quoha  staff   82 Sep 29 16:49 config.toml
drwxr-xr-x  2 quoha  staff   68 Sep 29 16:49 content
drwxr-xr-x  2 quoha  staff   68 Sep 29 16:49 layouts
drwxr-xr-x  4 quoha  staff  136 Sep 29 17:02 public
drwxr-xr-x  2 quoha  staff   68 Sep 29 16:49 static
drwxr-xr-x  3 quoha  staff  102 Sep 29 17:31 themes

$ find themes -type f | xargs ls -l
-rw-r--r--  1 quoha  staff  1081 Sep 29 17:31 themes/zafta/LICENSE.md
-rw-r--r--  1 quoha  staff     0 Sep 29 17:31 themes/zafta/archetypes/default.md
-rw-r--r--  1 quoha  staff     0 Sep 29 17:31 themes/zafta/layouts/_default/list.html
-rw-r--r--  1 quoha  staff     0 Sep 29 17:31 themes/zafta/layouts/_default/single.html
-rw-r--r--  1 quoha  staff     0 Sep 29 17:31 themes/zafta/layouts/index.html
-rw-r--r--  1 quoha  staff     0 Sep 29 17:31 themes/zafta/layouts/partials/footer.html
-rw-r--r--  1 quoha  staff     0 Sep 29 17:31 themes/zafta/layouts/partials/header.html
-rw-r--r--  1 quoha  staff    93 Sep 29 17:31 themes/zafta/theme.toml
$ 
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;The skeleton includes templates (the files ending in .html), license file, a description of your theme (the theme.toml file), and an empty archetype.&lt;/p&gt;

&lt;p&gt;Please take a minute to fill out the theme.toml and LICENSE.md files. They&amp;rsquo;re optional, but if you&amp;rsquo;re going to be distributing your theme, it tells the world who to praise (or blame). It&amp;rsquo;s also nice to declare the license so that people will know how they can use the theme.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;$ vi themes/zafta/theme.toml
author = &amp;quot;michael d henderson&amp;quot;
description = &amp;quot;a minimal working template&amp;quot;
license = &amp;quot;MIT&amp;quot;
name = &amp;quot;zafta&amp;quot;
source_repo = &amp;quot;&amp;quot;
tags = [&amp;quot;tags&amp;quot;, &amp;quot;categories&amp;quot;]
:wq

## also edit themes/zafta/LICENSE.md and change
## the bit that says &amp;quot;YOUR_NAME_HERE&amp;quot;
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Note that the the skeleton&amp;rsquo;s template files are empty. Don&amp;rsquo;t worry, we&amp;rsquo;ll be changing that shortly.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;$ find themes/zafta -name &#39;*.html&#39; | xargs ls -l
-rw-r--r--  1 quoha  staff  0 Sep 29 17:31 themes/zafta/layouts/_default/list.html
-rw-r--r--  1 quoha  staff  0 Sep 29 17:31 themes/zafta/layouts/_default/single.html
-rw-r--r--  1 quoha  staff  0 Sep 29 17:31 themes/zafta/layouts/index.html
-rw-r--r--  1 quoha  staff  0 Sep 29 17:31 themes/zafta/layouts/partials/footer.html
-rw-r--r--  1 quoha  staff  0 Sep 29 17:31 themes/zafta/layouts/partials/header.html
$
&lt;/code&gt;&lt;/pre&gt;

&lt;h3 id=&#34;update-the-configuration-file-to-use-the-theme&#34;&gt;Update the Configuration File to Use the Theme&lt;/h3&gt;

&lt;p&gt;Now that we&amp;rsquo;ve got a theme to work with, it&amp;rsquo;s a good idea to add the theme name to the configuration file. This is optional, because you can always add &amp;ldquo;-t zafta&amp;rdquo; on all your commands. I like to put it the configuration file because I like shorter command lines. If you don&amp;rsquo;t put it in the configuration file or specify it on the command line, you won&amp;rsquo;t use the template that you&amp;rsquo;re expecting to.&lt;/p&gt;

&lt;p&gt;Edit the file to add the theme, add a title for the site, and specify that all of our content will use the TOML format.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;$ vi config.toml
theme = &amp;quot;zafta&amp;quot;
baseurl = &amp;quot;&amp;quot;
languageCode = &amp;quot;en-us&amp;quot;
title = &amp;quot;zafta - totally refreshing&amp;quot;
MetaDataFormat = &amp;quot;toml&amp;quot;
:wq

$
&lt;/code&gt;&lt;/pre&gt;

&lt;h3 id=&#34;generate-the-site&#34;&gt;Generate the Site&lt;/h3&gt;

&lt;p&gt;Now that we have an empty theme, let&amp;rsquo;s generate the site again.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;$ hugo --verbose
INFO: 2014/09/29 Using config file: /Users/quoha/Sites/zafta/config.toml
INFO: 2014/09/29 syncing from /Users/quoha/Sites/zafta/themes/zafta/static/ to /Users/quoha/Sites/zafta/public/
INFO: 2014/09/29 syncing from /Users/quoha/Sites/zafta/static/ to /Users/quoha/Sites/zafta/public/
WARN: 2014/09/29 Unable to locate layout: [404.html theme/404.html]
0 draft content 
0 future content 
0 pages created 
0 tags created
0 categories created
in 2 ms
$
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Did you notice that the output is different? The warning message for the home page has disappeared and we have an additional information line saying that Hugo is syncing from the theme&amp;rsquo;s directory.&lt;/p&gt;

&lt;p&gt;Let&amp;rsquo;s check the public/ directory to see what Hugo&amp;rsquo;s created.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;$ ls -l public
total 16
drwxr-xr-x  2 quoha  staff   68 Sep 29 17:56 css
-rw-r--r--  1 quoha  staff    0 Sep 29 17:56 index.html
-rw-r--r--  1 quoha  staff  407 Sep 29 17:56 index.xml
drwxr-xr-x  2 quoha  staff   68 Sep 29 17:56 js
-rw-r--r--  1 quoha  staff  243 Sep 29 17:56 sitemap.xml
$
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Notice four things:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Hugo created a home page. This is the file public/index.html.&lt;/li&gt;
&lt;li&gt;Hugo created a css/ directory.&lt;/li&gt;
&lt;li&gt;Hugo created a js/ directory.&lt;/li&gt;
&lt;li&gt;Hugo claimed that it created 0 pages. It created a file and copied over static files, but didn&amp;rsquo;t create any pages. That&amp;rsquo;s because it considers a &amp;ldquo;page&amp;rdquo; to be a file created directly from a content file. It doesn&amp;rsquo;t count things like the index.html files that it creates automatically.&lt;/li&gt;
&lt;/ol&gt;

&lt;h4 id=&#34;the-home-page-1&#34;&gt;The Home Page&lt;/h4&gt;

&lt;p&gt;Hugo supports many different types of templates. The home page is special because it gets its own type of template and its own template file. The file, layouts/index.html, is used to generate the HTML for the home page. The Hugo documentation says that this is the only required template, but that depends. Hugo&amp;rsquo;s warning message shows that it looks for three different templates:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;WARN: 2014/09/29 Unable to locate layout: [index.html _default/list.html _default/single.html]
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;If it can&amp;rsquo;t find any of these, it completely skips creating the home page. We noticed that when we built the site without having a theme installed.&lt;/p&gt;

&lt;p&gt;When Hugo created our theme, it created an empty home page template. Now, when we build the site, Hugo finds the template and uses it to generate the HTML for the home page. Since the template file is empty, the HTML file is empty, too. If the template had any rules in it, then Hugo would have used them to generate the home page.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;$ find . -name index.html | xargs ls -l
-rw-r--r--  1 quoha  staff  0 Sep 29 20:21 ./public/index.html
-rw-r--r--  1 quoha  staff  0 Sep 29 17:31 ./themes/zafta/layouts/index.html
$ 
&lt;/code&gt;&lt;/pre&gt;

&lt;h4 id=&#34;the-magic-of-static&#34;&gt;The Magic of Static&lt;/h4&gt;

&lt;p&gt;Hugo does two things when generating the site. It uses templates to transform content into HTML and it copies static files into the site. Unlike content, static files are not transformed. They are copied exactly as they are.&lt;/p&gt;

&lt;p&gt;Hugo assumes that your site will use both CSS and JavaScript, so it creates directories in your theme to hold them. Remember opinions? Well, Hugo&amp;rsquo;s opinion is that you&amp;rsquo;ll store your CSS in a directory named css/ and your JavaScript in a directory named js/. If you don&amp;rsquo;t like that, you can change the directory names in your theme directory or even delete them completely. Hugo&amp;rsquo;s nice enough to offer its opinion, then behave nicely if you disagree.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;$ find themes/zafta -type d | xargs ls -ld
drwxr-xr-x  7 quoha  staff  238 Sep 29 17:38 themes/zafta
drwxr-xr-x  3 quoha  staff  102 Sep 29 17:31 themes/zafta/archetypes
drwxr-xr-x  5 quoha  staff  170 Sep 29 17:31 themes/zafta/layouts
drwxr-xr-x  4 quoha  staff  136 Sep 29 17:31 themes/zafta/layouts/_default
drwxr-xr-x  4 quoha  staff  136 Sep 29 17:31 themes/zafta/layouts/partials
drwxr-xr-x  4 quoha  staff  136 Sep 29 17:31 themes/zafta/static
drwxr-xr-x  2 quoha  staff   68 Sep 29 17:31 themes/zafta/static/css
drwxr-xr-x  2 quoha  staff   68 Sep 29 17:31 themes/zafta/static/js
$ 
&lt;/code&gt;&lt;/pre&gt;

&lt;h2 id=&#34;the-theme-development-cycle&#34;&gt;The Theme Development Cycle&lt;/h2&gt;

&lt;p&gt;When you&amp;rsquo;re working on a theme, you will make changes in the theme&amp;rsquo;s directory, rebuild the site, and check your changes in the browser. Hugo makes this very easy:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Purge the public/ directory.&lt;/li&gt;
&lt;li&gt;Run the built in web server in watch mode.&lt;/li&gt;
&lt;li&gt;Open your site in a browser.&lt;/li&gt;
&lt;li&gt;Update the theme.&lt;/li&gt;
&lt;li&gt;Glance at your browser window to see changes.&lt;/li&gt;
&lt;li&gt;Return to step 4.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;I’ll throw in one more opinion: never work on a theme on a live site. Always work on a copy of your site. Make changes to your theme, test them, then copy them up to your site. For added safety, use a tool like Git to keep a revision history of your content and your theme. Believe me when I say that it is too easy to lose both your mind and your changes.&lt;/p&gt;

&lt;p&gt;Check the main Hugo site for information on using Git with Hugo.&lt;/p&gt;

&lt;h3 id=&#34;purge-the-public-directory&#34;&gt;Purge the public/ Directory&lt;/h3&gt;

&lt;p&gt;When generating the site, Hugo will create new files and update existing ones in the &lt;code&gt;public/&lt;/code&gt; directory. It will not delete files that are no longer used. For example, files that were created in the wrong directory or with the wrong title will remain. If you leave them, you might get confused by them later. I recommend cleaning out your site prior to generating it.&lt;/p&gt;

&lt;p&gt;Note: If you&amp;rsquo;re building on an SSD, you should ignore this. Churning on a SSD can be costly.&lt;/p&gt;

&lt;h3 id=&#34;hugo-s-watch-option&#34;&gt;Hugo&amp;rsquo;s Watch Option&lt;/h3&gt;

&lt;p&gt;Hugo&amp;rsquo;s &amp;ldquo;&lt;code&gt;--watch&lt;/code&gt;&amp;rdquo; option will monitor the content/ and your theme directories for changes and rebuild the site automatically.&lt;/p&gt;

&lt;h3 id=&#34;live-reload&#34;&gt;Live Reload&lt;/h3&gt;

&lt;p&gt;Hugo&amp;rsquo;s built in web server supports live reload. As pages are saved on the server, the browser is told to refresh the page. Usually, this happens faster than you can say, &amp;ldquo;Wow, that&amp;rsquo;s totally amazing.&amp;rdquo;&lt;/p&gt;

&lt;h3 id=&#34;development-commands&#34;&gt;Development Commands&lt;/h3&gt;

&lt;p&gt;Use the following commands as the basis for your workflow.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;## purge old files. hugo will recreate the public directory.
##
$ rm -rf public
##
## run hugo in watch mode
##
$ hugo server --watch --verbose
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Here&amp;rsquo;s sample output showing Hugo detecting a change to the template for the home page. Once generated, the web browser automatically reloaded the page. I&amp;rsquo;ve said this before, it&amp;rsquo;s amazing.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;$ rm -rf public
$ hugo server --watch --verbose
INFO: 2014/09/29 Using config file: /Users/quoha/Sites/zafta/config.toml
INFO: 2014/09/29 syncing from /Users/quoha/Sites/zafta/themes/zafta/static/ to /Users/quoha/Sites/zafta/public/
INFO: 2014/09/29 syncing from /Users/quoha/Sites/zafta/static/ to /Users/quoha/Sites/zafta/public/
WARN: 2014/09/29 Unable to locate layout: [404.html theme/404.html]
0 draft content 
0 future content 
0 pages created 
0 tags created
0 categories created
in 2 ms
Watching for changes in /Users/quoha/Sites/zafta/content
Serving pages from /Users/quoha/Sites/zafta/public
Web Server is available at http://localhost:1313
Press Ctrl+C to stop
INFO: 2014/09/29 File System Event: [&amp;quot;/Users/quoha/Sites/zafta/themes/zafta/layouts/index.html&amp;quot;: MODIFY|ATTRIB]
Change detected, rebuilding site

WARN: 2014/09/29 Unable to locate layout: [404.html theme/404.html]
0 draft content 
0 future content 
0 pages created 
0 tags created
0 categories created
in 1 ms
&lt;/code&gt;&lt;/pre&gt;

&lt;h2 id=&#34;update-the-home-page-template&#34;&gt;Update the Home Page Template&lt;/h2&gt;

&lt;p&gt;The home page is one of a few special pages that Hugo creates automatically. As mentioned earlier, it looks for one of three files in the theme&amp;rsquo;s layout/ directory:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;index.html&lt;/li&gt;
&lt;li&gt;_default/list.html&lt;/li&gt;
&lt;li&gt;_default/single.html&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;We could update one of the default templates, but a good design decision is to update the most specific template available. That&amp;rsquo;s not a hard and fast rule (in fact, we&amp;rsquo;ll break it a few times in this tutorial), but it is a good generalization.&lt;/p&gt;

&lt;h3 id=&#34;make-a-static-home-page&#34;&gt;Make a Static Home Page&lt;/h3&gt;

&lt;p&gt;Right now, that page is empty because we don&amp;rsquo;t have any content and we don&amp;rsquo;t have any logic in the template. Let&amp;rsquo;s change that by adding some text to the template.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;$ vi themes/zafta/layouts/index.html
&amp;lt;!DOCTYPE html&amp;gt; 
&amp;lt;html&amp;gt; 
&amp;lt;body&amp;gt; 
  &amp;lt;p&amp;gt;hugo says hello!&amp;lt;/p&amp;gt; 
&amp;lt;/body&amp;gt; 
&amp;lt;/html&amp;gt; 
:wq

$
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Build the web site and then verify the results.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;$ hugo --verbose
INFO: 2014/09/29 Using config file: /Users/quoha/Sites/zafta/config.toml
INFO: 2014/09/29 syncing from /Users/quoha/Sites/zafta/themes/zafta/static/ to /Users/quoha/Sites/zafta/public/
INFO: 2014/09/29 syncing from /Users/quoha/Sites/zafta/static/ to /Users/quoha/Sites/zafta/public/
WARN: 2014/09/29 Unable to locate layout: [404.html theme/404.html]
0 draft content 
0 future content 
0 pages created 
0 tags created
0 categories created
in 2 ms

$ find public -type f -name &#39;*.html&#39; | xargs ls -l
-rw-r--r--  1 quoha  staff  78 Sep 29 21:26 public/index.html

$ cat public/index.html 
&amp;lt;!DOCTYPE html&amp;gt; 
&amp;lt;html&amp;gt; 
&amp;lt;body&amp;gt; 
  &amp;lt;p&amp;gt;hugo says hello!&amp;lt;/p&amp;gt; 
&amp;lt;/html&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;h4 id=&#34;live-reload-1&#34;&gt;Live Reload&lt;/h4&gt;

&lt;p&gt;Note: If you&amp;rsquo;re running the server with the &lt;code&gt;--watch&lt;/code&gt; option, you&amp;rsquo;ll see different content in the file:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;$ cat public/index.html 
&amp;lt;!DOCTYPE html&amp;gt; 
&amp;lt;html&amp;gt; 
&amp;lt;body&amp;gt; 
  &amp;lt;p&amp;gt;hugo says hello!&amp;lt;/p&amp;gt; 
&amp;lt;script&amp;gt;document.write(&#39;&amp;lt;script src=&amp;quot;http://&#39; 
        + (location.host || &#39;localhost&#39;).split(&#39;:&#39;)[0] 
    + &#39;:1313/livereload.js?mindelay=10&amp;quot;&amp;gt;&amp;lt;/&#39; 
        + &#39;script&amp;gt;&#39;)&amp;lt;/script&amp;gt;&amp;lt;/body&amp;gt; 
&amp;lt;/html&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;When you use &lt;code&gt;--watch&lt;/code&gt;, the Live Reload script is added by Hugo. Look for live reload in the documentation to see what it does and how to disable it.&lt;/p&gt;

&lt;h3 id=&#34;build-a-dynamic-home-page&#34;&gt;Build a &amp;ldquo;Dynamic&amp;rdquo; Home Page&lt;/h3&gt;

&lt;p&gt;&amp;ldquo;Dynamic home page?&amp;rdquo; Hugo&amp;rsquo;s a static web site generator, so this seems an odd thing to say. I mean let&amp;rsquo;s have the home page automatically reflect the content in the site every time Hugo builds it. We&amp;rsquo;ll use iteration in the template to do that.&lt;/p&gt;

&lt;h4 id=&#34;create-new-posts&#34;&gt;Create New Posts&lt;/h4&gt;

&lt;p&gt;Now that we have the home page generating static content, let&amp;rsquo;s add some content to the site. We&amp;rsquo;ll display these posts as a list on the home page and on their own page, too.&lt;/p&gt;

&lt;p&gt;Hugo has a command to generate a skeleton post, just like it does for sites and themes.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;$ hugo --verbose new post/first.md
INFO: 2014/09/29 Using config file: /Users/quoha/Sites/zafta/config.toml
INFO: 2014/09/29 attempting to create  post/first.md of post
INFO: 2014/09/29 curpath: /Users/quoha/Sites/zafta/themes/zafta/archetypes/default.md
ERROR: 2014/09/29 Unable to Cast &amp;lt;nil&amp;gt; to map[string]interface{}

$ 
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;That wasn&amp;rsquo;t very nice, was it?&lt;/p&gt;

&lt;p&gt;The &amp;ldquo;new&amp;rdquo; command uses an archetype to create the post file. Hugo created an empty default archetype file, but that causes an error when there&amp;rsquo;s a theme. For me, the workaround was to create an archetypes file specifically for the post type.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;$ vi themes/zafta/archetypes/post.md
+++
Description = &amp;quot;&amp;quot;
Tags = []
Categories = []
+++
:wq

$ find themes/zafta/archetypes -type f | xargs ls -l
-rw-r--r--  1 quoha  staff   0 Sep 29 21:53 themes/zafta/archetypes/default.md
-rw-r--r--  1 quoha  staff  51 Sep 29 21:54 themes/zafta/archetypes/post.md

$ hugo --verbose new post/first.md
INFO: 2014/09/29 Using config file: /Users/quoha/Sites/zafta/config.toml
INFO: 2014/09/29 attempting to create  post/first.md of post
INFO: 2014/09/29 curpath: /Users/quoha/Sites/zafta/themes/zafta/archetypes/post.md
INFO: 2014/09/29 creating /Users/quoha/Sites/zafta/content/post/first.md
/Users/quoha/Sites/zafta/content/post/first.md created

$ hugo --verbose new post/second.md
INFO: 2014/09/29 Using config file: /Users/quoha/Sites/zafta/config.toml
INFO: 2014/09/29 attempting to create  post/second.md of post
INFO: 2014/09/29 curpath: /Users/quoha/Sites/zafta/themes/zafta/archetypes/post.md
INFO: 2014/09/29 creating /Users/quoha/Sites/zafta/content/post/second.md
/Users/quoha/Sites/zafta/content/post/second.md created

$ ls -l content/post
total 16
-rw-r--r--  1 quoha  staff  104 Sep 29 21:54 first.md
-rw-r--r--  1 quoha  staff  105 Sep 29 21:57 second.md

$ cat content/post/first.md 
+++
Categories = []
Description = &amp;quot;&amp;quot;
Tags = []
date = &amp;quot;2014-09-29T21:54:53-05:00&amp;quot;
title = &amp;quot;first&amp;quot;

+++
my first post

$ cat content/post/second.md 
+++
Categories = []
Description = &amp;quot;&amp;quot;
Tags = []
date = &amp;quot;2014-09-29T21:57:09-05:00&amp;quot;
title = &amp;quot;second&amp;quot;

+++
my second post

$ 
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Build the web site and then verify the results.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;$ rm -rf public
$ hugo --verbose
INFO: 2014/09/29 Using config file: /Users/quoha/Sites/zafta/config.toml
INFO: 2014/09/29 syncing from /Users/quoha/Sites/zafta/themes/zafta/static/ to /Users/quoha/Sites/zafta/public/
INFO: 2014/09/29 syncing from /Users/quoha/Sites/zafta/static/ to /Users/quoha/Sites/zafta/public/
INFO: 2014/09/29 found taxonomies: map[string]string{&amp;quot;category&amp;quot;:&amp;quot;categories&amp;quot;, &amp;quot;tag&amp;quot;:&amp;quot;tags&amp;quot;}
WARN: 2014/09/29 Unable to locate layout: [404.html theme/404.html]
0 draft content 
0 future content 
2 pages created 
0 tags created
0 categories created
in 4 ms
$
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;The output says that it created 2 pages. Those are our new posts:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;$ find public -type f -name &#39;*.html&#39; | xargs ls -l
-rw-r--r--  1 quoha  staff  78 Sep 29 22:13 public/index.html
-rw-r--r--  1 quoha  staff   0 Sep 29 22:13 public/post/first/index.html
-rw-r--r--  1 quoha  staff   0 Sep 29 22:13 public/post/index.html
-rw-r--r--  1 quoha  staff   0 Sep 29 22:13 public/post/second/index.html
$
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;The new files are empty because because the templates used to generate the content are empty. The homepage doesn&amp;rsquo;t show the new content, either. We have to update the templates to add the posts.&lt;/p&gt;

&lt;h3 id=&#34;list-and-single-templates&#34;&gt;List and Single Templates&lt;/h3&gt;

&lt;p&gt;In Hugo, we have three major kinds of templates. There&amp;rsquo;s the home page template that we updated previously. It is used only by the home page. We also have &amp;ldquo;single&amp;rdquo; templates which are used to generate output for a single content file. We also have &amp;ldquo;list&amp;rdquo; templates that are used to group multiple pieces of content before generating output.&lt;/p&gt;

&lt;p&gt;Generally speaking, list templates are named &amp;ldquo;list.html&amp;rdquo; and single templates are named &amp;ldquo;single.html.&amp;rdquo;&lt;/p&gt;

&lt;p&gt;There are three other types of templates: partials, content views, and terms. We will not go into much detail on these.&lt;/p&gt;

&lt;h3 id=&#34;add-content-to-the-homepage&#34;&gt;Add Content to the Homepage&lt;/h3&gt;

&lt;p&gt;The home page will contain a list of posts. Let&amp;rsquo;s update its template to add the posts that we just created. The logic in the template will run every time we build the site.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;$ vi themes/zafta/layouts/index.html 
&amp;lt;!DOCTYPE html&amp;gt;
&amp;lt;html&amp;gt;
&amp;lt;body&amp;gt;
  {{ range first 10 .Data.Pages }}
    &amp;lt;h1&amp;gt;{{ .Title }}&amp;lt;/h1&amp;gt;
  {{ end }}
&amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;
:wq

$
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Hugo uses the Go template engine. That engine scans the template files for commands which are enclosed between &amp;ldquo;{{&amp;rdquo; and &amp;ldquo;}}&amp;rdquo;. In our template, the commands are:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;range&lt;/li&gt;
&lt;li&gt;.Title&lt;/li&gt;
&lt;li&gt;end&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The &amp;ldquo;range&amp;rdquo; command is an iterator. We&amp;rsquo;re going to use it to go through the first ten pages. Every HTML file that Hugo creates is treated as a page, so looping through the list of pages will look at every file that will be created.&lt;/p&gt;

&lt;p&gt;The &amp;ldquo;.Title&amp;rdquo; command prints the value of the &amp;ldquo;title&amp;rdquo; variable. Hugo pulls it from the front matter in the Markdown file.&lt;/p&gt;

&lt;p&gt;The &amp;ldquo;end&amp;rdquo; command signals the end of the range iterator. The engine loops back to the top of the iteration when it finds &amp;ldquo;end.&amp;rdquo; Everything between the &amp;ldquo;range&amp;rdquo; and &amp;ldquo;end&amp;rdquo; is evaluated every time the engine goes through the iteration. In this file, that would cause the title from the first ten pages to be output as heading level one.&lt;/p&gt;

&lt;p&gt;It&amp;rsquo;s helpful to remember that some variables, like .Data, are created before any output files. Hugo loads every content file into the variable and then gives the template a chance to process before creating the HTML files.&lt;/p&gt;

&lt;p&gt;Build the web site and then verify the results.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;$ rm -rf public
$ hugo --verbose
INFO: 2014/09/29 Using config file: /Users/quoha/Sites/zafta/config.toml
INFO: 2014/09/29 syncing from /Users/quoha/Sites/zafta/themes/zafta/static/ to /Users/quoha/Sites/zafta/public/
INFO: 2014/09/29 syncing from /Users/quoha/Sites/zafta/static/ to /Users/quoha/Sites/zafta/public/
INFO: 2014/09/29 found taxonomies: map[string]string{&amp;quot;tag&amp;quot;:&amp;quot;tags&amp;quot;, &amp;quot;category&amp;quot;:&amp;quot;categories&amp;quot;}
WARN: 2014/09/29 Unable to locate layout: [404.html theme/404.html]
0 draft content 
0 future content 
2 pages created 
0 tags created
0 categories created
in 4 ms
$ find public -type f -name &#39;*.html&#39; | xargs ls -l 
-rw-r--r--  1 quoha  staff  94 Sep 29 22:23 public/index.html
-rw-r--r--  1 quoha  staff   0 Sep 29 22:23 public/post/first/index.html
-rw-r--r--  1 quoha  staff   0 Sep 29 22:23 public/post/index.html
-rw-r--r--  1 quoha  staff   0 Sep 29 22:23 public/post/second/index.html
$ cat public/index.html 
&amp;lt;!DOCTYPE html&amp;gt;
&amp;lt;html&amp;gt;
&amp;lt;body&amp;gt;
  
    &amp;lt;h1&amp;gt;second&amp;lt;/h1&amp;gt;
  
    &amp;lt;h1&amp;gt;first&amp;lt;/h1&amp;gt;
  
&amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;
$
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Congratulations, the home page shows the title of the two posts. The posts themselves are still empty, but let&amp;rsquo;s take a moment to appreciate what we&amp;rsquo;ve done. Your template now generates output dynamically. Believe it or not, by inserting the range command inside of those curly braces, you&amp;rsquo;ve learned everything you need to know to build a theme. All that&amp;rsquo;s really left is understanding which template will be used to generate each content file and becoming familiar with the commands for the template engine.&lt;/p&gt;

&lt;p&gt;And, if that were entirely true, this tutorial would be much shorter. There are a few things to know that will make creating a new template much easier. Don&amp;rsquo;t worry, though, that&amp;rsquo;s all to come.&lt;/p&gt;

&lt;h3 id=&#34;add-content-to-the-posts&#34;&gt;Add Content to the Posts&lt;/h3&gt;

&lt;p&gt;We&amp;rsquo;re working with posts, which are in the content/post/ directory. That means that their section is &amp;ldquo;post&amp;rdquo; (and if we don&amp;rsquo;t do something weird, their type is also &amp;ldquo;post&amp;rdquo;).&lt;/p&gt;

&lt;p&gt;Hugo uses the section and type to find the template file for every piece of content. Hugo will first look for a template file that matches the section or type name. If it can&amp;rsquo;t find one, then it will look in the _default/ directory. There are some twists that we&amp;rsquo;ll cover when we get to categories and tags, but for now we can assume that Hugo will try post/single.html, then _default/single.html.&lt;/p&gt;

&lt;p&gt;Now that we know the search rule, let&amp;rsquo;s see what we actually have available:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;$ find themes/zafta -name single.html | xargs ls -l
-rw-r--r--  1 quoha  staff  132 Sep 29 17:31 themes/zafta/layouts/_default/single.html
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;We could create a new template, post/single.html, or change the default. Since we don&amp;rsquo;t know of any other content types, let&amp;rsquo;s start with updating the default.&lt;/p&gt;

&lt;p&gt;Remember, any content that we haven&amp;rsquo;t created a template for will end up using this template. That can be good or bad. Bad because I know that we&amp;rsquo;re going to be adding different types of content and we&amp;rsquo;re going to end up undoing some of the changes we&amp;rsquo;ve made. It&amp;rsquo;s good because we&amp;rsquo;ll be able to see immediate results. It&amp;rsquo;s also good to start here because we can start to build the basic layout for the site. As we add more content types, we&amp;rsquo;ll refactor this file and move logic around. Hugo makes that fairly painless, so we&amp;rsquo;ll accept the cost and proceed.&lt;/p&gt;

&lt;p&gt;Please see the Hugo documentation on template rendering for all the details on determining which template to use. And, as the docs mention, if you&amp;rsquo;re building a single page application (SPA) web site, you can delete all of the other templates and work with just the default single page. That&amp;rsquo;s a refreshing amount of joy right there.&lt;/p&gt;

&lt;h4 id=&#34;update-the-template-file&#34;&gt;Update the Template File&lt;/h4&gt;

&lt;pre&gt;&lt;code&gt;$ vi themes/zafta/layouts/_default/single.html 
&amp;lt;!DOCTYPE html&amp;gt;
&amp;lt;html&amp;gt;
&amp;lt;head&amp;gt;
  &amp;lt;title&amp;gt;{{ .Title }}&amp;lt;/title&amp;gt;
&amp;lt;/head&amp;gt;
&amp;lt;body&amp;gt;
  &amp;lt;h1&amp;gt;{{ .Title }}&amp;lt;/h1&amp;gt;
  {{ .Content }}
&amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;
:wq

$
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Build the web site and verify the results.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;$ rm -rf public
$ hugo --verbose
INFO: 2014/09/29 Using config file: /Users/quoha/Sites/zafta/config.toml
INFO: 2014/09/29 syncing from /Users/quoha/Sites/zafta/themes/zafta/static/ to /Users/quoha/Sites/zafta/public/
INFO: 2014/09/29 syncing from /Users/quoha/Sites/zafta/static/ to /Users/quoha/Sites/zafta/public/
INFO: 2014/09/29 found taxonomies: map[string]string{&amp;quot;tag&amp;quot;:&amp;quot;tags&amp;quot;, &amp;quot;category&amp;quot;:&amp;quot;categories&amp;quot;}
WARN: 2014/09/29 Unable to locate layout: [404.html theme/404.html]
0 draft content 
0 future content 
2 pages created 
0 tags created
0 categories created
in 4 ms

$ find public -type f -name &#39;*.html&#39; | xargs ls -l
-rw-r--r--  1 quoha  staff   94 Sep 29 22:40 public/index.html
-rw-r--r--  1 quoha  staff  125 Sep 29 22:40 public/post/first/index.html
-rw-r--r--  1 quoha  staff    0 Sep 29 22:40 public/post/index.html
-rw-r--r--  1 quoha  staff  128 Sep 29 22:40 public/post/second/index.html

$ cat public/post/first/index.html 
&amp;lt;!DOCTYPE html&amp;gt;
&amp;lt;html&amp;gt;
&amp;lt;head&amp;gt;
  &amp;lt;title&amp;gt;first&amp;lt;/title&amp;gt;
&amp;lt;/head&amp;gt;
&amp;lt;body&amp;gt;
  &amp;lt;h1&amp;gt;first&amp;lt;/h1&amp;gt;
  &amp;lt;p&amp;gt;my first post&amp;lt;/p&amp;gt;

&amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;

$ cat public/post/second/index.html 
&amp;lt;!DOCTYPE html&amp;gt;
&amp;lt;html&amp;gt;
&amp;lt;head&amp;gt;
  &amp;lt;title&amp;gt;second&amp;lt;/title&amp;gt;
&amp;lt;/head&amp;gt;
&amp;lt;body&amp;gt;
  &amp;lt;h1&amp;gt;second&amp;lt;/h1&amp;gt;
  &amp;lt;p&amp;gt;my second post&amp;lt;/p&amp;gt;

&amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;
$
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Notice that the posts now have content. You can go to localhost:1313/post/first to verify.&lt;/p&gt;

&lt;h3 id=&#34;linking-to-content&#34;&gt;Linking to Content&lt;/h3&gt;

&lt;p&gt;The posts are on the home page. Let&amp;rsquo;s add a link from there to the post. Since this is the home page, we&amp;rsquo;ll update its template.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;$ vi themes/zafta/layouts/index.html
&amp;lt;!DOCTYPE html&amp;gt;
&amp;lt;html&amp;gt;
&amp;lt;body&amp;gt;
  {{ range first 10 .Data.Pages }}
    &amp;lt;h1&amp;gt;&amp;lt;a href=&amp;quot;{{ .Permalink }}&amp;quot;&amp;gt;{{ .Title }}&amp;lt;/a&amp;gt;&amp;lt;/h1&amp;gt;
  {{ end }}
&amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Build the web site and verify the results.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;$ rm -rf public
$ hugo --verbose
INFO: 2014/09/29 Using config file: /Users/quoha/Sites/zafta/config.toml
INFO: 2014/09/29 syncing from /Users/quoha/Sites/zafta/themes/zafta/static/ to /Users/quoha/Sites/zafta/public/
INFO: 2014/09/29 syncing from /Users/quoha/Sites/zafta/static/ to /Users/quoha/Sites/zafta/public/
INFO: 2014/09/29 found taxonomies: map[string]string{&amp;quot;tag&amp;quot;:&amp;quot;tags&amp;quot;, &amp;quot;category&amp;quot;:&amp;quot;categories&amp;quot;}
WARN: 2014/09/29 Unable to locate layout: [404.html theme/404.html]
0 draft content 
0 future content 
2 pages created 
0 tags created
0 categories created
in 4 ms

$ find public -type f -name &#39;*.html&#39; | xargs ls -l
-rw-r--r--  1 quoha  staff  149 Sep 29 22:44 public/index.html
-rw-r--r--  1 quoha  staff  125 Sep 29 22:44 public/post/first/index.html
-rw-r--r--  1 quoha  staff    0 Sep 29 22:44 public/post/index.html
-rw-r--r--  1 quoha  staff  128 Sep 29 22:44 public/post/second/index.html

$ cat public/index.html 
&amp;lt;!DOCTYPE html&amp;gt;
&amp;lt;html&amp;gt;
&amp;lt;body&amp;gt;
  
    &amp;lt;h1&amp;gt;&amp;lt;a href=&amp;quot;/post/second/&amp;quot;&amp;gt;second&amp;lt;/a&amp;gt;&amp;lt;/h1&amp;gt;
  
    &amp;lt;h1&amp;gt;&amp;lt;a href=&amp;quot;/post/first/&amp;quot;&amp;gt;first&amp;lt;/a&amp;gt;&amp;lt;/h1&amp;gt;
  
&amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;

$
&lt;/code&gt;&lt;/pre&gt;

&lt;h3 id=&#34;create-a-post-listing&#34;&gt;Create a Post Listing&lt;/h3&gt;

&lt;p&gt;We have the posts displaying on the home page and on their own page. We also have a file public/post/index.html that is empty. Let&amp;rsquo;s make it show a list of all posts (not just the first ten).&lt;/p&gt;

&lt;p&gt;We need to decide which template to update. This will be a listing, so it should be a list template. Let&amp;rsquo;s take a quick look and see which list templates are available.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;$ find themes/zafta -name list.html | xargs ls -l
-rw-r--r--  1 quoha  staff  0 Sep 29 17:31 themes/zafta/layouts/_default/list.html
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;As with the single post, we have to decide to update _default/list.html or create post/list.html. We still don&amp;rsquo;t have multiple content types, so let&amp;rsquo;s stay consistent and update the default list template.&lt;/p&gt;

&lt;h2 id=&#34;creating-top-level-pages&#34;&gt;Creating Top Level Pages&lt;/h2&gt;

&lt;p&gt;Let&amp;rsquo;s add an &amp;ldquo;about&amp;rdquo; page and display it at the top level (as opposed to a sub-level like we did with posts).&lt;/p&gt;

&lt;p&gt;The default in Hugo is to use the directory structure of the content/ directory to guide the location of the generated html in the public/ directory. Let&amp;rsquo;s verify that by creating an &amp;ldquo;about&amp;rdquo; page at the top level:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;$ vi content/about.md 
+++
title = &amp;quot;about&amp;quot;
description = &amp;quot;about this site&amp;quot;
date = &amp;quot;2014-09-27&amp;quot;
slug = &amp;quot;about time&amp;quot;
+++

## about us

i&#39;m speechless
:wq
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Generate the web site and verify the results.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;$ find public -name &#39;*.html&#39; | xargs ls -l
-rw-rw-r--  1 mdhender  staff   334 Sep 27 15:08 public/about-time/index.html
-rw-rw-r--  1 mdhender  staff   527 Sep 27 15:08 public/index.html
-rw-rw-r--  1 mdhender  staff   358 Sep 27 15:08 public/post/first-post/index.html
-rw-rw-r--  1 mdhender  staff     0 Sep 27 15:08 public/post/index.html
-rw-rw-r--  1 mdhender  staff   342 Sep 27 15:08 public/post/second-post/index.html
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Notice that the page wasn&amp;rsquo;t created at the top level. It was created in a sub-directory named &amp;lsquo;about-time/&amp;rsquo;. That name came from our slug. Hugo will use the slug to name the generated content. It&amp;rsquo;s a reasonable default, by the way, but we can learn a few things by fighting it for this file.&lt;/p&gt;

&lt;p&gt;One other thing. Take a look at the home page.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;$ cat public/index.html
&amp;lt;!DOCTYPE html&amp;gt;
&amp;lt;html&amp;gt;
&amp;lt;body&amp;gt;
    &amp;lt;h1&amp;gt;&amp;lt;a href=&amp;quot;http://localhost:1313/post/theme/&amp;quot;&amp;gt;creating a new theme&amp;lt;/a&amp;gt;&amp;lt;/h1&amp;gt;
    &amp;lt;h1&amp;gt;&amp;lt;a href=&amp;quot;http://localhost:1313/about-time/&amp;quot;&amp;gt;about&amp;lt;/a&amp;gt;&amp;lt;/h1&amp;gt;
    &amp;lt;h1&amp;gt;&amp;lt;a href=&amp;quot;http://localhost:1313/post/second-post/&amp;quot;&amp;gt;second&amp;lt;/a&amp;gt;&amp;lt;/h1&amp;gt;
    &amp;lt;h1&amp;gt;&amp;lt;a href=&amp;quot;http://localhost:1313/post/first-post/&amp;quot;&amp;gt;first&amp;lt;/a&amp;gt;&amp;lt;/h1&amp;gt;
&amp;lt;script&amp;gt;document.write(&#39;&amp;lt;script src=&amp;quot;http://&#39;
        + (location.host || &#39;localhost&#39;).split(&#39;:&#39;)[0]
        + &#39;:1313/livereload.js?mindelay=10&amp;quot;&amp;gt;&amp;lt;/&#39;
        + &#39;script&amp;gt;&#39;)&amp;lt;/script&amp;gt;&amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Notice that the &amp;ldquo;about&amp;rdquo; link is listed with the posts? That&amp;rsquo;s not desirable, so let&amp;rsquo;s change that first.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;$ vi themes/zafta/layouts/index.html
&amp;lt;!DOCTYPE html&amp;gt;
&amp;lt;html&amp;gt;
&amp;lt;body&amp;gt;
  &amp;lt;h1&amp;gt;posts&amp;lt;/h1&amp;gt;
  {{ range first 10 .Data.Pages }}
    {{ if eq .Type &amp;quot;post&amp;quot;}}
      &amp;lt;h2&amp;gt;&amp;lt;a href=&amp;quot;{{ .Permalink }}&amp;quot;&amp;gt;{{ .Title }}&amp;lt;/a&amp;gt;&amp;lt;/h2&amp;gt;
    {{ end }}
  {{ end }}

  &amp;lt;h1&amp;gt;pages&amp;lt;/h1&amp;gt;
  {{ range .Data.Pages }}
    {{ if eq .Type &amp;quot;page&amp;quot; }}
      &amp;lt;h2&amp;gt;&amp;lt;a href=&amp;quot;{{ .Permalink }}&amp;quot;&amp;gt;{{ .Title }}&amp;lt;/a&amp;gt;&amp;lt;/h2&amp;gt;
    {{ end }}
  {{ end }}
&amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;
:wq
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Generate the web site and verify the results. The home page has two sections, posts and pages, and each section has the right set of headings and links in it.&lt;/p&gt;

&lt;p&gt;But, that about page still renders to about-time/index.html.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;$ find public -name &#39;*.html&#39; | xargs ls -l
-rw-rw-r--  1 mdhender  staff    334 Sep 27 15:33 public/about-time/index.html
-rw-rw-r--  1 mdhender  staff    645 Sep 27 15:33 public/index.html
-rw-rw-r--  1 mdhender  staff    358 Sep 27 15:33 public/post/first-post/index.html
-rw-rw-r--  1 mdhender  staff      0 Sep 27 15:33 public/post/index.html
-rw-rw-r--  1 mdhender  staff    342 Sep 27 15:33 public/post/second-post/index.html
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Knowing that hugo is using the slug to generate the file name, the simplest solution is to change the slug. Let&amp;rsquo;s do it the hard way and change the permalink in the configuration file.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;$ vi config.toml
[permalinks]
    page = &amp;quot;/:title/&amp;quot;
    about = &amp;quot;/:filename/&amp;quot;
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Generate the web site and verify that this didn&amp;rsquo;t work. Hugo lets &amp;ldquo;slug&amp;rdquo; or &amp;ldquo;URL&amp;rdquo; override the permalinks setting in the configuration file. Go ahead and comment out the slug in content/about.md, then generate the web site to get it to be created in the right place.&lt;/p&gt;

&lt;h2 id=&#34;sharing-templates&#34;&gt;Sharing Templates&lt;/h2&gt;

&lt;p&gt;If you&amp;rsquo;ve been following along, you probably noticed that posts have titles in the browser and the home page doesn&amp;rsquo;t. That&amp;rsquo;s because we didn&amp;rsquo;t put the title in the home page&amp;rsquo;s template (layouts/index.html). That&amp;rsquo;s an easy thing to do, but let&amp;rsquo;s look at a different option.&lt;/p&gt;

&lt;p&gt;We can put the common bits into a shared template that&amp;rsquo;s stored in the themes/zafta/layouts/partials/ directory.&lt;/p&gt;

&lt;h3 id=&#34;create-the-header-and-footer-partials&#34;&gt;Create the Header and Footer Partials&lt;/h3&gt;

&lt;p&gt;In Hugo, a partial is a sugar-coated template. Normally a template reference has a path specified. Partials are different. Hugo searches for them along a TODO defined search path. This makes it easier for end-users to override the theme&amp;rsquo;s presentation.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;$ vi themes/zafta/layouts/partials/header.html
&amp;lt;!DOCTYPE html&amp;gt;
&amp;lt;html&amp;gt;
&amp;lt;head&amp;gt;
    &amp;lt;title&amp;gt;{{ .Title }}&amp;lt;/title&amp;gt;
&amp;lt;/head&amp;gt;
&amp;lt;body&amp;gt;
:wq

$ vi themes/zafta/layouts/partials/footer.html
&amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;
:wq
&lt;/code&gt;&lt;/pre&gt;

&lt;h3 id=&#34;update-the-home-page-template-to-use-the-partials&#34;&gt;Update the Home Page Template to Use the Partials&lt;/h3&gt;

&lt;p&gt;The most noticeable difference between a template call and a partials call is the lack of path:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;{{ template &amp;quot;theme/partials/header.html&amp;quot; . }}
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;versus&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;{{ partial &amp;quot;header.html&amp;quot; . }}
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Both pass in the context.&lt;/p&gt;

&lt;p&gt;Let&amp;rsquo;s change the home page template to use these new partials.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;$ vi themes/zafta/layouts/index.html
{{ partial &amp;quot;header.html&amp;quot; . }}

  &amp;lt;h1&amp;gt;posts&amp;lt;/h1&amp;gt;
  {{ range first 10 .Data.Pages }}
    {{ if eq .Type &amp;quot;post&amp;quot;}}
      &amp;lt;h2&amp;gt;&amp;lt;a href=&amp;quot;{{ .Permalink }}&amp;quot;&amp;gt;{{ .Title }}&amp;lt;/a&amp;gt;&amp;lt;/h2&amp;gt;
    {{ end }}
  {{ end }}

  &amp;lt;h1&amp;gt;pages&amp;lt;/h1&amp;gt;
  {{ range .Data.Pages }}
    {{ if or (eq .Type &amp;quot;page&amp;quot;) (eq .Type &amp;quot;about&amp;quot;) }}
      &amp;lt;h2&amp;gt;&amp;lt;a href=&amp;quot;{{ .Permalink }}&amp;quot;&amp;gt;{{ .Type }} - {{ .Title }} - {{ .RelPermalink }}&amp;lt;/a&amp;gt;&amp;lt;/h2&amp;gt;
    {{ end }}
  {{ end }}

{{ partial &amp;quot;footer.html&amp;quot; . }}
:wq
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Generate the web site and verify the results. The title on the home page is now &amp;ldquo;your title here&amp;rdquo;, which comes from the &amp;ldquo;title&amp;rdquo; variable in the config.toml file.&lt;/p&gt;

&lt;h3 id=&#34;update-the-default-single-template-to-use-the-partials&#34;&gt;Update the Default Single Template to Use the Partials&lt;/h3&gt;

&lt;pre&gt;&lt;code&gt;$ vi themes/zafta/layouts/_default/single.html
{{ partial &amp;quot;header.html&amp;quot; . }}

  &amp;lt;h1&amp;gt;{{ .Title }}&amp;lt;/h1&amp;gt;
  {{ .Content }}

{{ partial &amp;quot;footer.html&amp;quot; . }}
:wq
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Generate the web site and verify the results. The title on the posts and the about page should both reflect the value in the markdown file.&lt;/p&gt;

&lt;h2 id=&#34;add-date-published-to-posts&#34;&gt;Add “Date Published” to Posts&lt;/h2&gt;

&lt;p&gt;It&amp;rsquo;s common to have posts display the date that they were written or published, so let&amp;rsquo;s add that. The front matter of our posts has a variable named &amp;ldquo;date.&amp;rdquo; It&amp;rsquo;s usually the date the content was created, but let&amp;rsquo;s pretend that&amp;rsquo;s the value we want to display.&lt;/p&gt;

&lt;h3 id=&#34;add-date-published-to-the-template&#34;&gt;Add “Date Published” to the Template&lt;/h3&gt;

&lt;p&gt;We&amp;rsquo;ll start by updating the template used to render the posts. The template code will look like:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;{{ .Date.Format &amp;quot;Mon, Jan 2, 2006&amp;quot; }}
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Posts use the default single template, so we&amp;rsquo;ll change that file.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;$ vi themes/zafta/layouts/_default/single.html
{{ partial &amp;quot;header.html&amp;quot; . }}

  &amp;lt;h1&amp;gt;{{ .Title }}&amp;lt;/h1&amp;gt;
  &amp;lt;h2&amp;gt;{{ .Date.Format &amp;quot;Mon, Jan 2, 2006&amp;quot; }}&amp;lt;/h2&amp;gt;
  {{ .Content }}

{{ partial &amp;quot;footer.html&amp;quot; . }}
:wq
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Generate the web site and verify the results. The posts now have the date displayed in them. There&amp;rsquo;s a problem, though. The &amp;ldquo;about&amp;rdquo; page also has the date displayed.&lt;/p&gt;

&lt;p&gt;As usual, there are a couple of ways to make the date display only on posts. We could do an &amp;ldquo;if&amp;rdquo; statement like we did on the home page. Another way would be to create a separate template for posts.&lt;/p&gt;

&lt;p&gt;The &amp;ldquo;if&amp;rdquo; solution works for sites that have just a couple of content types. It aligns with the principle of &amp;ldquo;code for today,&amp;rdquo; too.&lt;/p&gt;

&lt;p&gt;Let&amp;rsquo;s assume, though, that we&amp;rsquo;ve made our site so complex that we feel we have to create a new template type. In Hugo-speak, we&amp;rsquo;re going to create a section template.&lt;/p&gt;

&lt;p&gt;Let&amp;rsquo;s restore the default single template before we forget.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;$ mkdir themes/zafta/layouts/post
$ vi themes/zafta/layouts/_default/single.html
{{ partial &amp;quot;header.html&amp;quot; . }}

  &amp;lt;h1&amp;gt;{{ .Title }}&amp;lt;/h1&amp;gt;
  {{ .Content }}

{{ partial &amp;quot;footer.html&amp;quot; . }}
:wq
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Now we&amp;rsquo;ll update the post&amp;rsquo;s version of the single template. If you remember Hugo&amp;rsquo;s rules, the template engine will use this version over the default.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;$ vi themes/zafta/layouts/post/single.html
{{ partial &amp;quot;header.html&amp;quot; . }}

  &amp;lt;h1&amp;gt;{{ .Title }}&amp;lt;/h1&amp;gt;
  &amp;lt;h2&amp;gt;{{ .Date.Format &amp;quot;Mon, Jan 2, 2006&amp;quot; }}&amp;lt;/h2&amp;gt;
  {{ .Content }}

{{ partial &amp;quot;footer.html&amp;quot; . }}
:wq

&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Note that we removed the date logic from the default template and put it in the post template. Generate the web site and verify the results. Posts have dates and the about page doesn&amp;rsquo;t.&lt;/p&gt;

&lt;h3 id=&#34;don-t-repeat-yourself&#34;&gt;Don&amp;rsquo;t Repeat Yourself&lt;/h3&gt;

&lt;p&gt;DRY is a good design goal and Hugo does a great job supporting it. Part of the art of a good template is knowing when to add a new template and when to update an existing one. While you&amp;rsquo;re figuring that out, accept that you&amp;rsquo;ll be doing some refactoring. Hugo makes that easy and fast, so it&amp;rsquo;s okay to delay splitting up a template.&lt;/p&gt;
</description>
    </item>
    
    <item>
      <title>(Hu)go Template Primer</title>
      <link>https://gokwok.github.io/2014/goisforlovers/</link>
      <pubDate>Mon, 28 Jul 2014 00:00:00 +0000</pubDate>
      
      <guid>https://gokwok.github.io/2014/goisforlovers/</guid>
      <description>

&lt;p&gt;Hugo uses the excellent &lt;a href=&#34;http://golang.org/&amp;gt;&#34; rel=&#34;nofollow noreferrer&#34; target=&#34;_blank&#34;&gt;go&lt;/a&gt; &lt;a href=&#34;http://golang.org/pkg/html/template/&amp;gt;&#34; rel=&#34;nofollow noreferrer&#34; target=&#34;_blank&#34;&gt;html/template&lt;/a&gt; library for
its template engine. It is an extremely lightweight engine that provides a very
small amount of logic. In our experience that it is just the right amount of
logic to be able to create a good static website. If you have used other
template systems from different languages or frameworks you will find a lot of
similarities in go templates.&lt;/p&gt;

&lt;p&gt;This document is a brief primer on using go templates. The &lt;a href=&#34;http://golang.org/pkg/html/template/&amp;gt;&#34; rel=&#34;nofollow noreferrer&#34; target=&#34;_blank&#34;&gt;go docs&lt;/a&gt;
provide more details.&lt;/p&gt;

&lt;h2 id=&#34;introduction-to-go-templates&#34;&gt;Introduction to Go Templates&lt;/h2&gt;

&lt;p&gt;Go templates provide an extremely simple template language. It adheres to the
belief that only the most basic of logic belongs in the template or view layer.
One consequence of this simplicity is that go templates parse very quickly.&lt;/p&gt;

&lt;p&gt;A unique characteristic of go templates is they are content aware. Variables and
content will be sanitized depending on the context of where they are used. More
details can be found in the &lt;a href=&#34;http://golang.org/pkg/html/template/&amp;gt;&#34; rel=&#34;nofollow noreferrer&#34; target=&#34;_blank&#34;&gt;go docs&lt;/a&gt;.&lt;/p&gt;

&lt;h2 id=&#34;basic-syntax&#34;&gt;Basic Syntax&lt;/h2&gt;

&lt;p&gt;Go lang templates are html files with the addition of variables and
functions.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Go variables and functions are accessible within {{ }}&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Accessing a predefined variable &amp;ldquo;foo&amp;rdquo;:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;{{ foo }}
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;&lt;strong&gt;Parameters are separated using spaces&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Calling the add function with input of 1, 2:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;{{ add 1 2 }}
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;&lt;strong&gt;Methods and fields are accessed via dot notation&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Accessing the Page Parameter &amp;ldquo;bar&amp;rdquo;&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;{{ .Params.bar }}
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;&lt;strong&gt;Parentheses can be used to group items together&lt;/strong&gt;&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;{{ if or (isset .Params &amp;quot;alt&amp;quot;) (isset .Params &amp;quot;caption&amp;quot;) }} Caption {{ end }}
&lt;/code&gt;&lt;/pre&gt;

&lt;h2 id=&#34;variables&#34;&gt;Variables&lt;/h2&gt;

&lt;p&gt;Each go template has a struct (object) made available to it. In hugo each
template is passed either a page or a node struct depending on which type of
page you are rendering. More details are available on the
&lt;a href=&#34;https://gokwok.github.io/layout/variables&#34;&gt;variables&lt;/a&gt; page.&lt;/p&gt;

&lt;p&gt;A variable is accessed by referencing the variable name.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;&amp;lt;title&amp;gt;{{ .Title }}&amp;lt;/title&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Variables can also be defined and referenced.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;{{ $address := &amp;quot;123 Main St.&amp;quot;}}
{{ $address }}
&lt;/code&gt;&lt;/pre&gt;

&lt;h2 id=&#34;functions&#34;&gt;Functions&lt;/h2&gt;

&lt;p&gt;Go template ship with a few functions which provide basic functionality. The go
template system also provides a mechanism for applications to extend the
available functions with their own. &lt;a href=&#34;https://gokwok.github.io/layout/functions&#34;&gt;Hugo template
functions&lt;/a&gt; provide some additional functionality we believe
are useful for building websites. Functions are called by using their name
followed by the required parameters separated by spaces. Template
functions cannot be added without recompiling hugo.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Example:&lt;/strong&gt;&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;{{ add 1 2 }}
&lt;/code&gt;&lt;/pre&gt;

&lt;h2 id=&#34;includes&#34;&gt;Includes&lt;/h2&gt;

&lt;p&gt;When including another template you will pass to it the data it will be
able to access. To pass along the current context please remember to
include a trailing dot. The templates location will always be starting at
the /layout/ directory within Hugo.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Example:&lt;/strong&gt;&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;{{ template &amp;quot;chrome/header.html&amp;quot; . }}
&lt;/code&gt;&lt;/pre&gt;

&lt;h2 id=&#34;logic&#34;&gt;Logic&lt;/h2&gt;

&lt;p&gt;Go templates provide the most basic iteration and conditional logic.&lt;/p&gt;

&lt;h3 id=&#34;iteration&#34;&gt;Iteration&lt;/h3&gt;

&lt;p&gt;Just like in go, the go templates make heavy use of range to iterate over
a map, array or slice. The following are different examples of how to use
range.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Example 1: Using Context&lt;/strong&gt;&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;{{ range array }} 
    {{ . }}
{{ end }}
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;&lt;strong&gt;Example 2: Declaring value variable name&lt;/strong&gt;&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;{{range $element := array}} 
    {{ $element }} 
{{ end }}
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;&lt;strong&gt;Example 2: Declaring key and value variable name&lt;/strong&gt;&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;{{range $index, $element := array}}
    {{ $index }} 
    {{ $element }} 
{{ end }}
&lt;/code&gt;&lt;/pre&gt;

&lt;h3 id=&#34;conditionals&#34;&gt;Conditionals&lt;/h3&gt;

&lt;p&gt;If, else, with, or, &amp;amp; and provide the framework for handling conditional
logic in Go Templates. Like range, each statement is closed with &lt;code&gt;end&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Go Templates treat the following values as false:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;false&lt;/li&gt;
&lt;li&gt;0&lt;/li&gt;
&lt;li&gt;any array, slice, map, or string of length zero&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Example 1: If&lt;/strong&gt;&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;{{ if isset .Params &amp;quot;title&amp;quot; }}&amp;lt;h4&amp;gt;{{ index .Params &amp;quot;title&amp;quot; }}&amp;lt;/h4&amp;gt;{{ end }}
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;&lt;strong&gt;Example 2: If -&amp;gt; Else&lt;/strong&gt;&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;{{ if isset .Params &amp;quot;alt&amp;quot; }} 
    {{ index .Params &amp;quot;alt&amp;quot; }}
{{else}}
    {{ index .Params &amp;quot;caption&amp;quot; }}
{{ end }}
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;&lt;strong&gt;Example 3: And &amp;amp; Or&lt;/strong&gt;&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;{{ if and (or (isset .Params &amp;quot;title&amp;quot;) (isset .Params &amp;quot;caption&amp;quot;)) (isset .Params &amp;quot;attr&amp;quot;)}}
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;&lt;strong&gt;Example 4: With&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;An alternative way of writing &amp;ldquo;if&amp;rdquo; and then referencing the same value
is to use &amp;ldquo;with&amp;rdquo; instead. With rebinds the context &lt;code&gt;.&lt;/code&gt; within its scope,
and skips the block if the variable is absent.&lt;/p&gt;

&lt;p&gt;The first example above could be simplified as:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;{{ with .Params.title }}&amp;lt;h4&amp;gt;{{ . }}&amp;lt;/h4&amp;gt;{{ end }}
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;&lt;strong&gt;Example 5: If -&amp;gt; Else If&lt;/strong&gt;&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;{{ if isset .Params &amp;quot;alt&amp;quot; }} 
    {{ index .Params &amp;quot;alt&amp;quot; }}
{{ else if isset .Params &amp;quot;caption&amp;quot; }}
    {{ index .Params &amp;quot;caption&amp;quot; }}
{{ end }}
&lt;/code&gt;&lt;/pre&gt;

&lt;h2 id=&#34;pipes&#34;&gt;Pipes&lt;/h2&gt;

&lt;p&gt;One of the most powerful components of go templates is the ability to
stack actions one after another. This is done by using pipes. Borrowed
from unix pipes, the concept is simple, each pipeline&amp;rsquo;s output becomes the
input of the following pipe.&lt;/p&gt;

&lt;p&gt;Because of the very simple syntax of go templates, the pipe is essential
to being able to chain together function calls. One limitation of the
pipes is that they only can work with a single value and that value
becomes the last parameter of the next pipeline.&lt;/p&gt;

&lt;p&gt;A few simple examples should help convey how to use the pipe.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Example 1 :&lt;/strong&gt;&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;{{ if eq 1 1 }} Same {{ end }}
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;is the same as&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;{{ eq 1 1 | if }} Same {{ end }}
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;It does look odd to place the if at the end, but it does provide a good
illustration of how to use the pipes.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Example 2 :&lt;/strong&gt;&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;{{ index .Params &amp;quot;disqus_url&amp;quot; | html }}
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Access the page parameter called &amp;ldquo;disqus_url&amp;rdquo; and escape the HTML.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Example 3 :&lt;/strong&gt;&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;{{ if or (or (isset .Params &amp;quot;title&amp;quot;) (isset .Params &amp;quot;caption&amp;quot;)) (isset .Params &amp;quot;attr&amp;quot;)}}
Stuff Here
{{ end }}
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Could be rewritten as&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;{{  isset .Params &amp;quot;caption&amp;quot; | or isset .Params &amp;quot;title&amp;quot; | or isset .Params &amp;quot;attr&amp;quot; | if }}
Stuff Here 
{{ end }}
&lt;/code&gt;&lt;/pre&gt;

&lt;h2 id=&#34;context-aka-the-dot&#34;&gt;Context (aka. the dot)&lt;/h2&gt;

&lt;p&gt;The most easily overlooked concept to understand about go templates is that {{ . }}
always refers to the current context. In the top level of your template this
will be the data set made available to it. Inside of a iteration it will have
the value of the current item. When inside of a loop the context has changed. .
will no longer refer to the data available to the entire page. If you need to
access this from within the loop you will likely want to set it to a variable
instead of depending on the context.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Example:&lt;/strong&gt;&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;  {{ $title := .Site.Title }}
  {{ range .Params.tags }}
    &amp;lt;li&amp;gt; &amp;lt;a href=&amp;quot;{{ $baseurl }}/tags/{{ . | urlize }}&amp;quot;&amp;gt;{{ . }}&amp;lt;/a&amp;gt; - {{ $title }} &amp;lt;/li&amp;gt;
  {{ end }}
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Notice how once we have entered the loop the value of {{ . }} has changed. We
have defined a variable outside of the loop so we have access to it from within
the loop.&lt;/p&gt;

&lt;h1 id=&#34;hugo-parameters&#34;&gt;Hugo Parameters&lt;/h1&gt;

&lt;p&gt;Hugo provides the option of passing values to the template language
through the site configuration (for sitewide values), or through the meta
data of each specific piece of content. You can define any values of any
type (supported by your front matter/config format) and use them however
you want to inside of your templates.&lt;/p&gt;

&lt;h2 id=&#34;using-content-page-parameters&#34;&gt;Using Content (page) Parameters&lt;/h2&gt;

&lt;p&gt;In each piece of content you can provide variables to be used by the
templates. This happens in the &lt;a href=&#34;https://gokwok.github.io/content/front-matter&#34;&gt;front matter&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;An example of this is used in this documentation site. Most of the pages
benefit from having the table of contents provided. Sometimes the TOC just
doesn&amp;rsquo;t make a lot of sense. We&amp;rsquo;ve defined a variable in our front matter
of some pages to turn off the TOC from being displayed.&lt;/p&gt;

&lt;p&gt;Here is the example front matter:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;---
title: &amp;quot;Permalinks&amp;quot;
date: &amp;quot;2013-11-18&amp;quot;
aliases:
  - &amp;quot;/doc/permalinks/&amp;quot;
groups: [&amp;quot;extras&amp;quot;]
groups_weight: 30
notoc: true
---
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Here is the corresponding code inside of the template:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;  {{ if not .Params.notoc }}
    &amp;lt;div id=&amp;quot;toc&amp;quot; class=&amp;quot;well col-md-4 col-sm-6&amp;quot;&amp;gt;
    {{ .TableOfContents }}
    &amp;lt;/div&amp;gt;
  {{ end }}
&lt;/code&gt;&lt;/pre&gt;

&lt;h2 id=&#34;using-site-config-parameters&#34;&gt;Using Site (config) Parameters&lt;/h2&gt;

&lt;p&gt;In your top-level configuration file (eg, &lt;code&gt;config.yaml&lt;/code&gt;) you can define site
parameters, which are values which will be available to you in chrome.&lt;/p&gt;

&lt;p&gt;For instance, you might declare:&lt;/p&gt;

&lt;pre&gt;&lt;code class=&#34;language-yaml&#34;&gt;params:
  CopyrightHTML: &amp;quot;Copyright &amp;amp;#xA9; 2013 John Doe. All Rights Reserved.&amp;quot;
  TwitterUser: &amp;quot;spf13&amp;quot;
  SidebarRecentLimit: 5
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Within a footer layout, you might then declare a &lt;code&gt;&amp;lt;footer&amp;gt;&lt;/code&gt; which is only
provided if the &lt;code&gt;CopyrightHTML&lt;/code&gt; parameter is provided, and if it is given,
you would declare it to be HTML-safe, so that the HTML entity is not escaped
again.  This would let you easily update just your top-level config file each
January 1st, instead of hunting through your templates.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;{{if .Site.Params.CopyrightHTML}}&amp;lt;footer&amp;gt;
&amp;lt;div class=&amp;quot;text-center&amp;quot;&amp;gt;{{.Site.Params.CopyrightHTML | safeHtml}}&amp;lt;/div&amp;gt;
&amp;lt;/footer&amp;gt;{{end}}
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;An alternative way of writing the &amp;ldquo;if&amp;rdquo; and then referencing the same value
is to use &amp;ldquo;with&amp;rdquo; instead. With rebinds the context &lt;code&gt;.&lt;/code&gt; within its scope,
and skips the block if the variable is absent:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;{{with .Site.Params.TwitterUser}}&amp;lt;span class=&amp;quot;twitter&amp;quot;&amp;gt;
&amp;lt;a href=&amp;quot;https://twitter.com/{{.}}&amp;quot; rel=&amp;quot;author&amp;quot;&amp;gt;
&amp;lt;img src=&amp;quot;/images/twitter.png&amp;quot; width=&amp;quot;48&amp;quot; height=&amp;quot;48&amp;quot; title=&amp;quot;Twitter: {{.}}&amp;quot;
 alt=&amp;quot;Twitter&amp;quot;&amp;gt;&amp;lt;/a&amp;gt;
&amp;lt;/span&amp;gt;{{end}}
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Finally, if you want to pull &amp;ldquo;magic constants&amp;rdquo; out of your layouts, you can do
so, such as in this example:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;&amp;lt;nav class=&amp;quot;recent&amp;quot;&amp;gt;
  &amp;lt;h1&amp;gt;Recent Posts&amp;lt;/h1&amp;gt;
  &amp;lt;ul&amp;gt;{{range first .Site.Params.SidebarRecentLimit .Site.Recent}}
    &amp;lt;li&amp;gt;&amp;lt;a href=&amp;quot;{{.RelPermalink}}&amp;quot;&amp;gt;{{.Title}}&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;
  {{end}}&amp;lt;/ul&amp;gt;
&amp;lt;/nav&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
</description>
    </item>
    
    <item>
      <title>About</title>
      <link>https://gokwok.github.io/about/</link>
      <pubDate>Wed, 09 Apr 2014 00:00:00 +0000</pubDate>
      
      <guid>https://gokwok.github.io/about/</guid>
      <description>&lt;p&gt;这是我的ABOUT。&lt;/p&gt;
</description>
    </item>
    
    <item>
      <title>Getting Started with Hugo</title>
      <link>https://gokwok.github.io/2014/hugoisforlovers/</link>
      <pubDate>Wed, 02 Apr 2014 00:00:00 +0000</pubDate>
      
      <guid>https://gokwok.github.io/2014/hugoisforlovers/</guid>
      <description>

&lt;h2 id=&#34;step-1-install-hugo&#34;&gt;Step 1. Install Hugo&lt;/h2&gt;

&lt;p&gt;Goto &lt;a href=&#34;https://github.com/spf13/hugo/releases&#34; rel=&#34;nofollow noreferrer&#34; target=&#34;_blank&#34;&gt;hugo releases&lt;/a&gt; and download the
appropriate version for your os and architecture.&lt;/p&gt;

&lt;p&gt;Save it somewhere specific as we will be using it in the next step.&lt;/p&gt;

&lt;p&gt;More complete instructions are available at &lt;a href=&#34;https://gokwok.github.io/overview/installing/&#34;&gt;installing hugo&lt;/a&gt;&lt;/p&gt;

&lt;h2 id=&#34;step-2-build-the-docs&#34;&gt;Step 2. Build the Docs&lt;/h2&gt;

&lt;p&gt;Hugo has its own example site which happens to also be the documentation site
you are reading right now.&lt;/p&gt;

&lt;p&gt;Follow the following steps:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Clone the &lt;a href=&#34;http://github.com/spf13/hugo&#34; rel=&#34;nofollow noreferrer&#34; target=&#34;_blank&#34;&gt;hugo repository&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Go into the repo&lt;/li&gt;
&lt;li&gt;Run hugo in server mode and build the docs&lt;/li&gt;
&lt;li&gt;Open your browser to &lt;a href=&#34;http://localhost:1313&#34; rel=&#34;nofollow noreferrer&#34; target=&#34;_blank&#34;&gt;http://localhost:1313&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Corresponding pseudo commands:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;git clone https://github.com/spf13/hugo
cd hugo
/path/to/where/you/installed/hugo server --source=./docs
&amp;gt; 29 pages created
&amp;gt; 0 tags index created
&amp;gt; in 27 ms
&amp;gt; Web Server is available at http://localhost:1313
&amp;gt; Press ctrl+c to stop
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Once you&amp;rsquo;ve gotten here, follow along the rest of this page on your local build.&lt;/p&gt;

&lt;h2 id=&#34;step-3-change-the-docs-site&#34;&gt;Step 3. Change the docs site&lt;/h2&gt;

&lt;p&gt;Stop the Hugo process by hitting ctrl+c.&lt;/p&gt;

&lt;p&gt;Now we are going to run hugo again, but this time with hugo in watch mode.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;/path/to/hugo/from/step/1/hugo server --source=./docs --watch
&amp;gt; 29 pages created
&amp;gt; 0 tags index created
&amp;gt; in 27 ms
&amp;gt; Web Server is available at http://localhost:1313
&amp;gt; Watching for changes in /Users/spf13/Code/hugo/docs/content
&amp;gt; Press ctrl+c to stop
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Open your &lt;a href=&#34;http://vim.spf13.com&#34; rel=&#34;nofollow noreferrer&#34; target=&#34;_blank&#34;&gt;favorite editor&lt;/a&gt; and change one of the source
content pages. How about changing this very file to &lt;em&gt;fix the typo&lt;/em&gt;. How about changing this very file to &lt;em&gt;fix the typo&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;Content files are found in &lt;code&gt;docs/content/&lt;/code&gt;. Unless otherwise specified, files
are located at the same relative location as the url, in our case
&lt;code&gt;docs/content/overview/quickstart.md&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Change and save this file.. Notice what happened in your terminal.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;&amp;gt; Change detected, rebuilding site

&amp;gt; 29 pages created
&amp;gt; 0 tags index created
&amp;gt; in 26 ms
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Refresh the browser and observe that the typo is now fixed.&lt;/p&gt;

&lt;p&gt;Notice how quick that was. Try to refresh the site before it&amp;rsquo;s finished building.. I double dare you.
Having nearly instant feedback enables you to have your creativity flow without waiting for long builds.&lt;/p&gt;

&lt;h2 id=&#34;step-4-have-fun&#34;&gt;Step 4. Have fun&lt;/h2&gt;

&lt;p&gt;The best way to learn something is to play with it.&lt;/p&gt;
</description>
    </item>
    
    <item>
      <title>Migrate to Hugo from Jekyll</title>
      <link>https://gokwok.github.io/2014/migrate-from-jekyll/</link>
      <pubDate>Mon, 10 Mar 2014 00:00:00 +0000</pubDate>
      
      <guid>https://gokwok.github.io/2014/migrate-from-jekyll/</guid>
      <description>

&lt;h2 id=&#34;move-static-content-to-static&#34;&gt;Move static content to &lt;code&gt;static&lt;/code&gt;&lt;/h2&gt;

&lt;p&gt;Jekyll has a rule that any directory not starting with &lt;code&gt;_&lt;/code&gt; will be copied as-is to the &lt;code&gt;_site&lt;/code&gt; output. Hugo keeps all static content under &lt;code&gt;static&lt;/code&gt;. You should therefore move it all there.
With Jekyll, something that looked like&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;▾ &amp;lt;root&amp;gt;/
    ▾ images/
        logo.png
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;should become&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;▾ &amp;lt;root&amp;gt;/
    ▾ static/
        ▾ images/
            logo.png
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Additionally, you&amp;rsquo;ll want any files that should reside at the root (such as &lt;code&gt;CNAME&lt;/code&gt;) to be moved to &lt;code&gt;static&lt;/code&gt;.&lt;/p&gt;

&lt;h2 id=&#34;create-your-hugo-configuration-file&#34;&gt;Create your Hugo configuration file&lt;/h2&gt;

&lt;p&gt;Hugo can read your configuration as JSON, YAML or TOML. Hugo supports parameters custom configuration too. Refer to the &lt;a href=&#34;https://gokwok.github.io/overview/configuration/&#34;&gt;Hugo configuration documentation&lt;/a&gt; for details.&lt;/p&gt;

&lt;h2 id=&#34;set-your-configuration-publish-folder-to-site&#34;&gt;Set your configuration publish folder to &lt;code&gt;_site&lt;/code&gt;&lt;/h2&gt;

&lt;p&gt;The default is for Jekyll to publish to &lt;code&gt;_site&lt;/code&gt; and for Hugo to publish to &lt;code&gt;public&lt;/code&gt;. If, like me, you have &lt;a href=&#34;http://blog.blindgaenger.net/generate_github_pages_in_a_submodule.html&#34; rel=&#34;nofollow noreferrer&#34; target=&#34;_blank&#34;&gt;&lt;code&gt;_site&lt;/code&gt; mapped to a git submodule on the &lt;code&gt;gh-pages&lt;/code&gt; branch&lt;/a&gt;, you&amp;rsquo;ll want to do one of two alternatives:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Change your submodule to point to map &lt;code&gt;gh-pages&lt;/code&gt; to public instead of &lt;code&gt;_site&lt;/code&gt; (recommended).&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;git submodule deinit _site
git rm _site
git submodule add -b gh-pages git@github.com:your-username/your-repo.git public
&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;Or, change the Hugo configuration to use &lt;code&gt;_site&lt;/code&gt; instead of &lt;code&gt;public&lt;/code&gt;.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;{
    ..
    &amp;quot;publishdir&amp;quot;: &amp;quot;_site&amp;quot;,
    ..
}
&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h2 id=&#34;convert-jekyll-templates-to-hugo-templates&#34;&gt;Convert Jekyll templates to Hugo templates&lt;/h2&gt;

&lt;p&gt;That&amp;rsquo;s the bulk of the work right here. The documentation is your friend. You should refer to &lt;a href=&#34;http://jekyllrb.com/docs/templates/&#34; rel=&#34;nofollow noreferrer&#34; target=&#34;_blank&#34;&gt;Jekyll&amp;rsquo;s template documentation&lt;/a&gt; if you need to refresh your memory on how you built your blog and &lt;a href=&#34;https://gokwok.github.io/layout/templates/&#34;&gt;Hugo&amp;rsquo;s template&lt;/a&gt; to learn Hugo&amp;rsquo;s way.&lt;/p&gt;

&lt;p&gt;As a single reference data point, converting my templates for &lt;a href=&#34;http://heyitsalex.net/&#34; rel=&#34;nofollow noreferrer&#34; target=&#34;_blank&#34;&gt;heyitsalex.net&lt;/a&gt; took me no more than a few hours.&lt;/p&gt;

&lt;h2 id=&#34;convert-jekyll-plugins-to-hugo-shortcodes&#34;&gt;Convert Jekyll plugins to Hugo shortcodes&lt;/h2&gt;

&lt;p&gt;Jekyll has &lt;a href=&#34;http://jekyllrb.com/docs/plugins/&#34; rel=&#34;nofollow noreferrer&#34; target=&#34;_blank&#34;&gt;plugins&lt;/a&gt;; Hugo has &lt;a href=&#34;https://gokwok.github.io/doc/shortcodes/&#34;&gt;shortcodes&lt;/a&gt;. It&amp;rsquo;s fairly trivial to do a port.&lt;/p&gt;

&lt;h3 id=&#34;implementation&#34;&gt;Implementation&lt;/h3&gt;

&lt;p&gt;As an example, I was using a custom &lt;a href=&#34;https://github.com/alexandre-normand/alexandre-normand/blob/74bb12036a71334fdb7dba84e073382fc06908ec/_plugins/image_tag.rb&#34; rel=&#34;nofollow noreferrer&#34; target=&#34;_blank&#34;&gt;&lt;code&gt;image_tag&lt;/code&gt;&lt;/a&gt; plugin to generate figures with caption when running Jekyll. As I read about shortcodes, I found Hugo had a nice built-in shortcode that does exactly the same thing.&lt;/p&gt;

&lt;p&gt;Jekyll&amp;rsquo;s plugin:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;module Jekyll
  class ImageTag &amp;lt; Liquid::Tag
    @url = nil
    @caption = nil
    @class = nil
    @link = nil
    // Patterns
    IMAGE_URL_WITH_CLASS_AND_CAPTION =
    IMAGE_URL_WITH_CLASS_AND_CAPTION_AND_LINK = /(\w+)(\s+)((https?:\/\/|\/)(\S+))(\s+)&amp;quot;(.*?)&amp;quot;(\s+)-&amp;gt;((https?:\/\/|\/)(\S+))(\s*)/i
    IMAGE_URL_WITH_CAPTION = /((https?:\/\/|\/)(\S+))(\s+)&amp;quot;(.*?)&amp;quot;/i
    IMAGE_URL_WITH_CLASS = /(\w+)(\s+)((https?:\/\/|\/)(\S+))/i
    IMAGE_URL = /((https?:\/\/|\/)(\S+))/i
    def initialize(tag_name, markup, tokens)
      super
      if markup =~ IMAGE_URL_WITH_CLASS_AND_CAPTION_AND_LINK
        @class   = $1
        @url     = $3
        @caption = $7
        @link = $9
      elsif markup =~ IMAGE_URL_WITH_CLASS_AND_CAPTION
        @class   = $1
        @url     = $3
        @caption = $7
      elsif markup =~ IMAGE_URL_WITH_CAPTION
        @url     = $1
        @caption = $5
      elsif markup =~ IMAGE_URL_WITH_CLASS
        @class = $1
        @url   = $3
      elsif markup =~ IMAGE_URL
        @url = $1
      end
    end
    def render(context)
      if @class
        source = &amp;quot;&amp;lt;figure class=&#39;#{@class}&#39;&amp;gt;&amp;quot;
      else
        source = &amp;quot;&amp;lt;figure&amp;gt;&amp;quot;
      end
      if @link
        source += &amp;quot;&amp;lt;a href=\&amp;quot;#{@link}\&amp;quot;&amp;gt;&amp;quot;
      end
      source += &amp;quot;&amp;lt;img src=\&amp;quot;#{@url}\&amp;quot;&amp;gt;&amp;quot;
      if @link
        source += &amp;quot;&amp;lt;/a&amp;gt;&amp;quot;
      end
      source += &amp;quot;&amp;lt;figcaption&amp;gt;#{@caption}&amp;lt;/figcaption&amp;gt;&amp;quot; if @caption
      source += &amp;quot;&amp;lt;/figure&amp;gt;&amp;quot;
      source
    end
  end
end
Liquid::Template.register_tag(&#39;image&#39;, Jekyll::ImageTag)
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;is written as this Hugo shortcode:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;&amp;lt;!-- image --&amp;gt;
&amp;lt;figure {{ with .Get &amp;quot;class&amp;quot; }}class=&amp;quot;{{.}}&amp;quot;{{ end }}&amp;gt;
    {{ with .Get &amp;quot;link&amp;quot;}}&amp;lt;a href=&amp;quot;{{.}}&amp;quot;&amp;gt;{{ end }}
        &amp;lt;img src=&amp;quot;{{ .Get &amp;quot;src&amp;quot; }}&amp;quot; {{ if or (.Get &amp;quot;alt&amp;quot;) (.Get &amp;quot;caption&amp;quot;) }}alt=&amp;quot;{{ with .Get &amp;quot;alt&amp;quot;}}{{.}}{{else}}{{ .Get &amp;quot;caption&amp;quot; }}{{ end }}&amp;quot;{{ end }} /&amp;gt;
    {{ if .Get &amp;quot;link&amp;quot;}}&amp;lt;/a&amp;gt;{{ end }}
    {{ if or (or (.Get &amp;quot;title&amp;quot;) (.Get &amp;quot;caption&amp;quot;)) (.Get &amp;quot;attr&amp;quot;)}}
    &amp;lt;figcaption&amp;gt;{{ if isset .Params &amp;quot;title&amp;quot; }}
        {{ .Get &amp;quot;title&amp;quot; }}{{ end }}
        {{ if or (.Get &amp;quot;caption&amp;quot;) (.Get &amp;quot;attr&amp;quot;)}}&amp;lt;p&amp;gt;
        {{ .Get &amp;quot;caption&amp;quot; }}
        {{ with .Get &amp;quot;attrlink&amp;quot;}}&amp;lt;a href=&amp;quot;{{.}}&amp;quot;&amp;gt; {{ end }}
            {{ .Get &amp;quot;attr&amp;quot; }}
        {{ if .Get &amp;quot;attrlink&amp;quot;}}&amp;lt;/a&amp;gt; {{ end }}
        &amp;lt;/p&amp;gt; {{ end }}
    &amp;lt;/figcaption&amp;gt;
    {{ end }}
&amp;lt;/figure&amp;gt;
&amp;lt;!-- image --&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;h3 id=&#34;usage&#34;&gt;Usage&lt;/h3&gt;

&lt;p&gt;I simply changed:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;{% image full http://farm5.staticflickr.com/4136/4829260124_57712e570a_o_d.jpg &amp;quot;One of my favorite touristy-type photos. I secretly waited for the good light while we were &amp;quot;having fun&amp;quot; and took this. Only regret: a stupid pole in the top-left corner of the frame I had to clumsily get rid of at post-processing.&amp;quot; -&amp;gt;http://www.flickr.com/photos/alexnormand/4829260124/in/set-72157624547713078/ %}
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;to this (this example uses a slightly extended version named &lt;code&gt;fig&lt;/code&gt;, different than the built-in &lt;code&gt;figure&lt;/code&gt;):&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;{{% fig class=&amp;quot;full&amp;quot; src=&amp;quot;http://farm5.staticflickr.com/4136/4829260124_57712e570a_o_d.jpg&amp;quot; title=&amp;quot;One of my favorite touristy-type photos. I secretly waited for the good light while we were having fun and took this. Only regret: a stupid pole in the top-left corner of the frame I had to clumsily get rid of at post-processing.&amp;quot; link=&amp;quot;http://www.flickr.com/photos/alexnormand/4829260124/in/set-72157624547713078/&amp;quot; %}}
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;As a bonus, the shortcode named parameters are, arguably, more readable.&lt;/p&gt;

&lt;h2 id=&#34;finishing-touches&#34;&gt;Finishing touches&lt;/h2&gt;

&lt;h3 id=&#34;fix-content&#34;&gt;Fix content&lt;/h3&gt;

&lt;p&gt;Depending on the amount of customization that was done with each post with Jekyll, this step will require more or less effort. There are no hard and fast rules here except that &lt;code&gt;hugo server --watch&lt;/code&gt; is your friend. Test your changes and fix errors as needed.&lt;/p&gt;

&lt;h3 id=&#34;clean-up&#34;&gt;Clean up&lt;/h3&gt;

&lt;p&gt;You&amp;rsquo;ll want to remove the Jekyll configuration at this point. If you have anything else that isn&amp;rsquo;t used, delete it.&lt;/p&gt;

&lt;h2 id=&#34;a-practical-example-in-a-diff&#34;&gt;A practical example in a diff&lt;/h2&gt;

&lt;p&gt;&lt;a href=&#34;http://heyitsalex.net/&#34; rel=&#34;nofollow noreferrer&#34; target=&#34;_blank&#34;&gt;Hey, it&amp;rsquo;s Alex&lt;/a&gt; was migrated in less than a &lt;em&gt;father-with-kids day&lt;/em&gt; from Jekyll to Hugo. You can see all the changes (and screw-ups) by looking at this &lt;a href=&#34;https://github.com/alexandre-normand/alexandre-normand/compare/869d69435bd2665c3fbf5b5c78d4c22759d7613a...b7f6605b1265e83b4b81495423294208cc74d610&#34; rel=&#34;nofollow noreferrer&#34; target=&#34;_blank&#34;&gt;diff&lt;/a&gt;.&lt;/p&gt;
</description>
    </item>
    
  </channel>
</rss>