Hexo: Hexo works perfectly locally but cannot build when pushed to github

Created on 19 Jul 2018  ·  8Comments  ·  Source: hexojs/hexo

Environment Info

Node version(node -v): v8.9.4

Your site _config.yml (Optional):
````

Hexo Configuration

Docs: https://hexo.io/docs/configuration.html

Source: https://github.com/hexojs/hexo/

Site

title: Edwin Nyawoli's Blog
subtitle: Personal Blog
description:
keywords: blog
author: Edwin Nyawoli
language:
timezone:

URL

If your site is put in a subdirectory, set url as 'http://yoursite.com/child' and root as '/child/'

url: http://edwinnyawoli.com/blog
root: /blog/
permalink: :year/:month/:day/:title/
permalink_defaults:

Directory

source_dir: source
public_dir: blog
tag_dir: tags
archive_dir: archives
category_dir: categories
code_dir: downloads/code
i18n_dir: :lang
skip_render:

Writing

new_post_name: :title.md # File name of new posts
default_layout: post
titlecase: false # Transform title into titlecase
external_link: true # Open external links in new tab
filename_case: 0
render_drafts: false
post_asset_folder: false
relative_link: false
future: true
highlight:
enable: false
line_number: true
auto_detect: false
tab_replace:

Home page setting

path: Root path for your blogs index page. (default = '')

per_page: Posts displayed per page. (0 = disable pagination)

order_by: Posts order. (Order by date descending by default)

index_generator:
path: ''
per_page: 10
order_by: -date

Category & Tag

default_category: uncategorized
category_map:
tag_map:

Date / Time format

Hexo uses Moment.js to parse and display date

You can customize the date format as defined in

http://momentjs.com/docs/#/displaying/format/

date_format: YYYY-MM-DD
time_format: HH:mm:ss

Pagination

Set per_page to 0 to disable pagination

per_page: 10
pagination_dir: page

Extensions

Plugins: https://hexo.io/plugins/

Themes: https://hexo.io/themes/

theme: clexy

Deployment

Docs: https://hexo.io/docs/deployment.html

deploy:
type:

prism_plugin:
mode: 'preprocess' # realtime/preprocess
theme: 'default'
line_number: false # default false
````

Your theme _config.yml (Optional):

Hexo and Plugin version(npm ls --depth 0):
"hexo": { "version": "3.7.1" }, "dependencies": { "hexo": "^3.2.0", "hexo-generator-archive": "^0.1.4", "hexo-generator-category": "^0.1.3", "hexo-generator-index": "^0.2.0", "hexo-generator-tag": "^0.2.0", "hexo-prism-plugin": "^2.2.0", "hexo-renderer-jade": "^0.4.1", "hexo-renderer-marked": "^0.3.0", "hexo-renderer-stylus": "^0.3.1", "hexo-server": "^0.2.0" }

How do I get project running on github successfully?


When i serve the hexo project locally, i'm able to see my blog by navigating to localhost:4000, but when i deploy the project to github pages, i get the error
Your site is having problems building: The tag fancybox on line 77 in themes/landscape/README.md is not a recognized Liquid tag. For more information, see https://help.github.com/articles/page-build-failed-unknown-tag-error/.

Most helpful comment

Github was processing my repo as a jekyll blog, probably because of the presence of the __config.yml file and jekyll being the default generator on Github. So I added a .nojekyll file to the root so that Github doesn't try to process it as a jekyll blog.

All 8 comments

Hi Edwin. Which directory is themes/landscape in? If it got put into source might be trying to render it.

The themes/landscape is in the same parent directory of the source directory. The repository is at this link

In one of my previous attempts to get it working, It also gave a similar error saying
tag set on line 217 in node_modules/nunjucks/CHANGELOG.md was not a valid Liquid tag.

Is it possible you can try this?

npm install --global --no-cache npm-check-updates hexo-cli@latest
ncu -an
npm install
hexo clean
hexo serve --debug

I just tried 👆 and everything works fine locally, but I'm still getting the error when I push to github.

Found the solution. I put a .nojekyll file in the root of the directory and pushed it to github. Everything works perfectly now 👌

Thank you @edwinnyawoli for the update. Can you explain what happened and why that fixed it?

Github was processing my repo as a jekyll blog, probably because of the presence of the __config.yml file and jekyll being the default generator on Github. So I added a .nojekyll file to the root so that Github doesn't try to process it as a jekyll blog.

Was this page helpful?
0 / 5 - 0 ratings