内核恐慌

3. 静态网站生成器


Listen Later

动态网站太重了。轻量级的静态网站生成工具一时蔚然成风,至少在开发者圈子里如此。它是什么,解决了怎样的问题,为什么流行,效果如何?

吴涛希望 Rio 转写成 Go 的 Python 代码:

import datetime
print datetime.datetime.now().strftime('北京时间 %H 点 %M 分')

Rio 的回复:

import (
"fmt"
"time"
)
func main() {
fmt.Println(time.Now().Format("北京时间 15 点 04 分"))
}

简单来说,Go 使用「2006」、「Jan」、「2」、「15」、「04」等字面值来代替 strftime 中的「%Y」、「%b」、「%d」、「%H」、「%M」作为格式化日期时的占位符。延伸阅读: Parsing and formatting date/time in Gohttp://golang.org/pkg/time/#pkg-constants

相关链接
  • @horse_mans 的推特帐号
  • Static site generator 列表及 Github 关注度排名
  • Jekyll
  • Jekyll Bootstrap
  • Octopress
  • Middleman
  • Pelican
  • Hyde
  • Hugo
  • spf13 的 The Ultimate Vim Distribution
  • Code kata
  • GIF: Demonstrating end-to-end automation to new employees
  • ...more
    View all episodesView all episodes
    Download on the App Store

    内核恐慌By 吴涛、Rio

    • 4.7
    • 4.7
    • 4.7
    • 4.7
    • 4.7

    4.7

    54 ratings


    More shows like 内核恐慌

    View all
    机核游戏频道 by 机核网 www.gcores.com

    机核游戏频道

    304 Listeners

    新闻酸菜馆 by 新闻酸菜馆

    新闻酸菜馆

    211 Listeners

    一席 by 一席

    一席

    104 Listeners

    博物志 by 小黄鱼播客

    博物志

    92 Listeners

    津津乐道 by DAO

    津津乐道

    119 Listeners

    疯投圈 by 黄海、Rio

    疯投圈

    109 Listeners

    科技乱炖 by DAO

    科技乱炖

    24 Listeners

    忽左忽右 by JustPod

    忽左忽右

    456 Listeners

    What's Next|科技早知道 by 声动活泼

    What's Next|科技早知道

    176 Listeners

    硅谷101 by 硅谷101

    硅谷101

    184 Listeners

    硅谷101|中国版 by 泓君Jane

    硅谷101|中国版

    53 Listeners

    东亚观察局 by 东亚观察局

    东亚观察局

    208 Listeners

    FView Friday by 爱否科技

    FView Friday

    82 Listeners

    Web3 101 by Web3 101

    Web3 101

    24 Listeners

    边角聊 by Leftover Talk

    边角聊

    42 Listeners