Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hugo 主题迁移 #234

Open
ghost opened this issue Jun 16, 2018 · 14 comments
Open

Hugo 主题迁移 #234

ghost opened this issue Jun 16, 2018 · 14 comments

Comments

@ghost
Copy link

ghost commented Jun 16, 2018

你好, 非常喜欢这款主题,但是我是GO语言爱好者,使用Hugo, 作者这款主题可以迁移到Hugo吗

@NightFarmer
Copy link

@sanghai @MOxFIVE

  • 作者是否有支持hugo的计划?
  • 因为非常喜欢这个主题,所以最近打算在hugo环境高仿一个,是否会涉及版权问题?

@NightFarmer
Copy link

老铁 我大致防了一版 基本的功能满足我个人使用了
地址:https://github.com/NightFarmer/hugo-theme-yelee

我博客已经从hexo换到hugo了 效果就是这样https://www.nightfarmer.top/

@ghost
Copy link
Author

ghost commented Aug 9, 2018

多谢老铁啊, 终于可以使用这个主题了
有一个问题:
我Hugo server -D 的时候提示
uilding sites … ERROR 2018/08/09 21:24:23 Failed to render "taxonomy/tag.terms.html": reflect: Zero(nil) ERROR 2018/08/09 21:24:23 Stack Trace: goroutine 58 [running]: github.com/gohugoio/hugo/hugolib.stackTrace(0x4b0, 0x4c95113, 0x17) /private/tmp/hugo-20180801-41150-1lexkxf/hugo-0.46/src/github.com/gohugoio/hugo/hugolib/page.go:280 +0x76 github.com/gohugoio/hugo/hugolib.(*Site).renderForLayouts.func1(0xc42098b8a0, 0xc420510300) /private/tmp/hugo-20180801-41150-1lexkxf/hugo-0.46/src/github.com/gohugoio/hugo/hugolib/site.go:1742 +0x135

另外我点击所有文章和关于我(/post/ /about/)显示404错误。
能帮忙再看一下吗?

@NightFarmer
Copy link

@sanghai 这个错看上去有点迷 我猜是有些文档的tag格式和hugo不太匹配 hexo中tag:xxx这样没问题 hugo只能[xxx]这样写

post的话需要把博客文档放在/content/post下才能显示
about需要/content/about/index.md或者/content/about.md 要不然找不着

还有就是<!--more-->的写法
hexo中<!-- more -->这样写没问题 但是hugo不允许有空格 而且上下需要存在空行 要不然识别不到
hugo的markdown应该是要比hexo的要严格一些 ,图片、列表这些语法都需要前后有空行要不然会存在格式错乱或者识别不到的问题

@ghost
Copy link
Author

ghost commented Aug 10, 2018

@NightFarmer 你好
我的博客是放在/content/post目录下的(hugo new post/first.md)
点击左侧标题栏的时候还是提示404
我的文件组织目录是
content/post/
public/MY_GIT
你的config.toml文件配置能展示一下吗,我在想是不是我的这个配置文件有哪里不正确?

@NightFarmer
Copy link

我用的json格式 你可以用你习惯的格式来写

{
	"languageCode" : "zh-cnzh-cn",
	"theme" : "hugo-theme-yelee",
	"title" : "NightFarmer's Blog",
    "disablePathToLower" : true,
    "params": {
      "aboutme": "全栈扫地工",
     "friends": {
      "ice1000": "http://ice1000.org/",
      "yeungkc": "https://yeungkc.com/",
      "GitHub": "https://pages.github.com/"
     },
     "subnav": {
      "Email": "mailto:nightfarmer@163.com",
      "GitHub": "https://github.com/NightFarmer"
     },
      "menu": [
        {
          "label": "主页",
          "link": "/"
        },
        {
          "label": "所有文章",
          "link": "/archives/"
        },
        {
          "label": "标签云",
          "link": "/tags/"
        },
        {
          "label": "关于我",
          "link": "/about/"
        }
      ]
    }
}

@ghost
Copy link
Author

ghost commented Aug 11, 2018

你好
我运行hugo server --theme=hugo-theme-yelee --buildDrafts 报错如下:
Building sites … ERROR 2018/08/11 13:34:57 Failed to render "taxonomy/tag.terms.html": reflect: Zero(nil) ERROR 2018/08/11 13:34:57 Stack Trace: goroutine 196 [running]: github.com/gohugoio/hugo/hugolib.stackTrace(0x4b0, 0x4c95113, 0x17) /private/tmp/hugo-20180801-41150-1lexkxf/hugo-0.46/src/github.com/gohugoio/hugo/hugolib/page.go:280 +0x76 github.com/gohugoio/hugo/hugolib.(*Site).renderForLayouts.func1(0xc42088d8a0, 0xc420228300) /private/tmp/hugo-20180801-41150-1lexkxf/hugo-0.46/src/github.com/gohugoio/hugo/hugolib/site.go:1742 +0x135 panic(0x4b12440, 0x4e17240) /usr/local/Cellar/go/1.10.3/libexec/src/runtime/panic.go:502 +0x229 text/template.errRecover(0xc42088d790) /usr/local/Cellar/go/1.10.3/libexec/src/text/template/exec.go:143 +0x1ba panic(0x4b12440, 0x4e17240) /usr/local/Cellar/go/1.10.3/libexec/src/runtime/panic.go:502 +0x229 reflect.Zero(0x0, 0x0, 0x0, 0x0, 0x0) /usr/local/Cellar/go/1.10.3/libexec/src/reflect/value.go:2171 +0x107 text/template.(*state).validateType(0xc42088d710, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xc4205fcda0) /usr/local/Cellar/go/1.10.3/libexec/src/text/template/exec.go:696 +0x6b2 text/template.(*state).evalArg(0xc42088d710, 0x4c43cc0, 0xc4203bc000, 0x16, 0x0, 0x0, 0x4e28d80, 0xc4205dfb80, 0x94, 0x0, ...) /usr/local/Cellar/go/1.10.3/libexec/src/text/template/exec.go:745 +0x751 text/templ Total in 20 ms Error: Error building site: logged 2 error(s)
尝试着在layouts/目录下添加post目录,添加index.html也不起作用.

@NightFarmer
Copy link

@sanghai 确实看不出来什么问题 或者你创建一个新项目然后把md文件逐一放进去 看看到底是哪个文件出了问题?或者把我博客的工程文件发你参考一下?

@ghost
Copy link
Author

ghost commented Aug 13, 2018 via email

@NightFarmer
Copy link

@sanghai 我把blog托管放开了 你直接clone吧 主题也需要重新clone
https://gitee.com/NightFarmer/hugoblog

@ghost
Copy link
Author

ghost commented Aug 14, 2018

你好,邮件我收到了,我运行过程中遇到了如下问题:
`hugo new site github.io
cd github.io & git clone https://github.com/${MYGIT} ./public
git clone https://github.com/NightFarmer/hugo-theme-yelee ./themes
hugo new post/first.md

hugo server --theme=hugo-theme-yelee --buildDrafts
邮件我收到了, 你的工程目录运行良好,但是对你的content目录下修改下,mv content content_bck && mkdir content hugo server --theme=${THEME} --buildDrafts` 就会出现一样的问题
你能按照hugo官方的流程尝试一下吗?
·

  • hugo new site mysite && cd mysite
  • hugo clone ${THEME}
  • hugo new post/first.md
  • configure your hugo config file to set theme = ${THEME}
  • hugo server --theme=${THEME} --buildDrafts
    `

@NightFarmer
Copy link

@sanghai
你的问题我这边重现了,原因是标签云页面出现了空指针,也就是博文的tags属性没有设置,我刚刚修复了这个问题,你重新pull一下应该就可以了。

@ghost
Copy link
Author

ghost commented Aug 14, 2018

你好,博客列表显示正常了,效果非常棒,很喜欢这个效果
还有个习惯问题,打开博客如何修改为当前页面打开?我的习惯还是当前页面打开显示文章。
另外about me 页面404,如何解决?
还有这个怎么清空?
本站到访数: 437728 , 本页阅读量: 2933

@NightFarmer
Copy link

当前页打开需要设置open_in_new为false
aboutme页面可以尝试新增文件/content/about/index.md
本站到访数量是根据url自动获取的 localhost是所有人共享的 发布到服务器上就会根据域名重新计算了。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant