vuepress / vuepress-theme-blog

Default blog theme for VuePress.
https://vuepress-theme-blog.billyyyyy3320.com/
MIT License
211 stars 129 forks source link

How to use #5

Closed cfjedimaster closed 5 years ago

cfjedimaster commented 5 years ago

The docs explain how to add the theme, how to set it in config.js, but then what do you do? After I did this and reran vuepress dev, my home page is now blank.

ulivz commented 5 years ago

Why do not see the example to know how to use?

https://github.com/ulivz/vuepress-theme-blog/tree/master/example

cfjedimaster commented 5 years ago

Ok, there is an example, but shouldn't the docs explain this? Also, the example shows posts. I have no posts. But why don't I get a blog home page saying there are no posts - or any output? Basically I'm getting a white screen now and nothing more. If you are saying that by adding one post it would start working, I'd like to see that called out in docs, and I'd expect the default home page to at least say something, "Nothing published yet."

ulivz commented 5 years ago

Hmmm, you can submit pull request if you like.

cfjedimaster commented 5 years ago

Heh I'd love to - but I don't know how. Do you understand I'm asking for help? If you explain it roughly to me, I'd be happy to do a PR to write it up nicely. Does that make sense?

BoltDoggy commented 5 years ago

一个插件应该是开箱即用的, 很遗憾, 这个插件并不能直接运行起来. 我相信我不是第二个遇到问题的人, issues 没有人反馈, 应该是大家在第一次尝试就放弃了吧. 作为 VuePress @1.0 正式版首页推荐的插件, 并且被奉为亮点之一真的很遗憾.


通过运行示例, 寻找差异, 发现 modifyBlogPluginOptions 配置是必须的, 但是文档中并没有给出提示.

modifyBlogPluginOptions(blogPlugnOptions) {
      return blogPlugnOptions
},

当然, 这是不合理的, 异常原因出自源码实现

https://github.com/ulivz/vuepress-theme-blog/blob/master/index.js#L56

const blogPluginOptions = typeof modifyBlogPluginOptions === 'function'
    ? modifyBlogPluginOptions(defaultBlogPluginOptions)
    : themeConfig

我们需要 defaultBlogPluginOptions 才能正常运行 plugin-blog, 但仅 modifyBlogPluginOptions 项被配置的前提下才会初始化显然是不合理的.

ulivz commented 5 years ago

一个插件应该是开箱即用的, 很遗憾, 这个插件并不能直接运行起来.

你用的什么版本?

通过运行示例, 寻找差异, 发现 modifyBlogPluginOptions 配置是必须的

这个已经不需要了。建议 clone 这个 repo 然后 run 一下 yarn example:dev 看看。

BoltDoggy commented 5 years ago

建议 clone 这个 repo 然后 run 一下 yarn example:dev 看看。

@ulivz 抱歉, 很负责任的告诉您, 我已经 "通过运行示例" 帮您把错误代码处贴出来了

这个已经不需要了

您自测过吗

你用的什么版本?

如果您认真看一下我贴的代码, 这个在最新版本中仍然没有被修改. 如果已经修复, 请告知被修复的版本号.

ulivz commented 5 years ago

@BoltDoggy 刚刚才修的,1.2.2。

此外,这个 issue 我在 20 天以前就创建了:https://github.com/ulivz/vuepress-plugin-blog/issues/1 , 贴了大大的 contribution welcome,可惜的是,20 天来,没有任何人提交 PR。

做开源就是这样,用户只愿意用,用的好什么都不会说,出了问题只会抱怨,而不会帮忙解决。

BoltDoggy commented 5 years ago

总的来说, 体验很差, 真的很砸 vuepress 招牌

vuepress 已经算正式版了, theme-blog 如果还不稳定, 建议从 vuepress 首页标注一下

ulivz commented 5 years ago

我给你一个建议,不要用 VuePress。