Meta-Network / meta-hexo-starter-custom

meta-hexo-starter-custom.vercel.app
2 stars 3 forks source link

[BUG]Failed to start hexo server in the process of adding theme Wikitten #9

Closed Cloudifold closed 2 years ago

Cloudifold commented 2 years ago

Describe the bug A html page can't be shown at localhost:4000

To Reproduce Follow the step of "Submitting a new theme template" in https://github.com/Meta-Network/meta-hexo-starter-custom/blob/main/CONTRIBUTING.md

  1. Create a theme branch.

    $ git checkout -b theme/<theme_name>
  2. Edit install_theme.sh:

    #!/bin/bash
    git clone https://github.com/zthxxx/hexo-theme-Wikitten.git themes/Wikitten
  3. Install dependencies:

    # optional, check the theme's official documentation
    $ yarn add hexo hexo-autonofollow hexo-directory-category hexo-generator-archive hexo-generator-category hexo-generator-feed hexo-generator-index hexo-generator-json-content hexo-generator-sitemap hexo-generator-tag hexo-renderer-ejs hexo-renderer-marked hexo-renderer-stylus
    # see the section 'Add meta-space-config-filter'
    $ yarn add hexo-filter-meta-space 
  4. Create _config.Wikitten.yml and delete the existed one. Edit _config.yml :

    theme: Wikitten
  5. Test :

    $ ./install.sh
    $ yarn server --debug

Expected behavior A html page can be shown at localhost:4000

Screenshots XXX

Desktop (please complete the following information):

Smartphone (please complete the following information):

Additional context Add any other context about the problem here.

remi-guan commented 2 years ago

The problem is due to the lack of configuration file content for the theme. Refer to the official document:

  1. Rename the _config.yml.example to _config.yml so you can config theme
$ cp -f themes/Wikitten/_config.yml.example themes/Wikitten/_config.yml
# edit and customize it
$ vim themes/Wikitten/_config.yml

To this problem, you can run this command:

$ cp -f themes/Wikitten/_config.yml.example _config.Wikitten.yml

But, we should have mentioned this in the documentation, so I'll update the CONTRIBUTING.md later.