内核恐慌

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

    机核游戏频道

    299 Listeners

    一席 by 一席

    一席

    103 Listeners

    津津乐道 by DAO

    津津乐道

    119 Listeners

    疯投圈 by 黄海、Rio

    疯投圈

    109 Listeners

    日谈公园 by 日谈公园

    日谈公园

    437 Listeners

    声东击西 by ETW Studio

    声东击西

    316 Listeners

    三五环 by 刘飞Lufy

    三五环

    44 Listeners

    科技乱炖 by DAO

    科技乱炖

    24 Listeners

    忽左忽右 by JustPod

    忽左忽右

    446 Listeners

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

    What's Next|科技早知道

    176 Listeners

    硅谷101 by 硅谷101

    硅谷101

    164 Listeners

    硅谷101|中国版 by 泓君Jane

    硅谷101|中国版

    52 Listeners

    东亚观察局 by 东亚观察局

    东亚观察局

    199 Listeners

    FView Friday by 爱否科技

    FView Friday

    81 Listeners

    半拿铁 | 商业沉浮录 by 潇磊&刘飞

    半拿铁 | 商业沉浮录

    289 Listeners