内核恐慌

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

    55 ratings


    More shows like 内核恐慌

    View all
    UX Coffee 设计咖 by UX Coffee

    UX Coffee 设计咖

    137 Listeners

    疯投圈 by 黄海、Rio

    疯投圈

    113 Listeners

    无聊斋 by 教主_单口喜剧

    无聊斋

    252 Listeners

    大内密谈 by 大内密谈

    大内密谈

    429 Listeners

    声动早咖啡 by 声动活泼

    声动早咖啡

    291 Listeners

    Web3 101 by Web3 101

    Web3 101

    24 Listeners

    李诞 by 李诞

    李诞

    251 Listeners

    小Lin说 by 小Lin说

    小Lin说

    51 Listeners