Pacman

Pacman 是一个不错的 Hexo 主题,一直有冲动把这个主题转成 Hugo 的,再加上 Hugo 交流群里有朋友也提到了这个主题,于是利用周末的时间制作了这个主题:hugo-pacman-theme

演示地址:http://coderzh.github.io/hugo-pacman-theme/

截图

主页:

hugo-pacman-tn

文章页面:

hugo-pacman-theme

支持功能

  1. 分类
  2. 标签(标签云)
  3. 归档
  4. RSS
  5. 文章大纲(Table Of Content)
  6. 文章分享功能
  7. 图片点击预览(FancyBox)
  8. 多说评论(及 Disqus 评论)
  9. Google Analytics
  10. 代码高亮优化(GitHub 配色)
  11. 高度配置化,你要的东西都可以通过 config.toml 进行配置。

使用方法

  1. 首先,确保安装了最新版 Hugo。下载地址:Hugo Release,如果使用 Mac ,直接用 Homebrew 安装:

    1
    $ brew install hugo
  2. 把 hugo-pacman-theme clone 下来,放到你的 Hugo 站点的 themes 目录里(Hugo 的使用方法详见:http://www.gohugo.org/)。

    1
    2
    $ cd themes
    $ git clone https://github.com/coderzh/hugo-pacman-theme
  3. 配置文件,拷贝一份或者参考:hugo-pacman-theme/exampleSite/config.toml,配置如下:

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    BaseURL = "http://coderzh.github.io/"
    LanguageCode = "zh-CN"
    HasCJKLanguage = true
    Title = "Hugo PacMan Theme Demo"
    Theme = "hugo-pacman-theme"
    pygmentsStyle = "default"
    pygmentsUseClasses = true
    RSSUri = "feed.xml"

    [Author]
    Name = "coderzh"

    [Params]
    AuthorHomepage = "http://blog.coderzh.com"
    BottomIntroduce = "Introduce1 <br/> Introduce2"
    Description = ""
    Subtitle = "subtitle"
    Weibo = "coderzh"
    WeiboID = 1816308191
    Twitter = "coderzh"
    GitHub = "coderzh"
    Facebook = "coderzh"
    LinkIn = "coderzh"
    Imglogo = "img/logo.svg"
    AuthorImg = "img/author.jpg"
    # 日期时间格式
    DateFormat = "2006年01月02日"
    MonthFormat = "2006年01月"
    FancyBox = true

    # 使用多说评论
    #[Params.DuoShuo]
    # ShortName = "coderzh"

    # 使用 Disqus 评论
    [Params.Disqus]
    ShortName = "coderzh"

    # Google 统计
    [Params.GoogleAnalytics]
    ID = "UA-10147768-2"

    # 多语言字符串
    [Params.Strings]
    Search = "搜索"
    PageNotFound = "你访问的页面不存在"
    ShowSideBar = "显示侧边栏"
    HideSideBar = "隐藏侧边栏"
    Categories = "分类"
    Archive = "归档"
    Tags = "标签"
    TagCloud = "标签云"
    Rss = "RSS 订阅"
    TableOfContents = "文章目录"

    [Menu]
    [[Menu.Main]]
    Name = "首页"
    URL = "/"
    Weight = 1
    [[Menu.Main]]
    Name = "关于"
    URL = "/about"
    Weight = 2

    最后

该主题参考的 Pacman,使用 Hugo 的模板语法纯手工一行一行打造。有需要的朋友尽管拿去使用,有问题欢迎反馈:

GitHub 地址:https://github.com/coderzh/hugo-pacman-theme

Hugo 中文文档:http://www.gohugo.org/