Open heytxz opened 9 years ago
Do you have https://github.com/hexojs/hexo-renderer-jade installed as a plugin as well as https://github.com/knksmith57/hexo-renderer-sass?
If you provide your _config.yml file, I can try to see what's going on.
i pushed it to my github repo named book.
after i installed hexo-renderer-jade it works like this http://dpast.org/book/.
then i installed hexo-renderer-sass but it does not change anything. the step i installed is:
npm install node-sass
cd node-sass
git submodule update --init --recursive
npm install
npm install -g node-gyp
node-gyp rebuild
and i add below into ~/_config.yml
not book/_config.yml
node_sass:
outputStyle: nested ('nested' and 'compressed' are supported)
precision: 8
imagePath: images
sourceComments: none (can be one of 'none', 'normal', 'map')
i almost have no konwleage about these. sorry to bother you with such simple question.
In you ~/_config.yml file, do you have "root: /book"? Because you aren't installing to the root of the domain, you need to make sure root is set because the css is linked with "#{config.root}/..." urls
here? theme: book root: /book exclude_generator: node_sass: outputStyle: nested ('nested' and 'compressed' are supported) precision: 8 imagePath: images sourceComments: none (can be one of 'none', 'normal', 'map')
or here? root: /book page_name: Chapter author_pic_url: http://placekitten.com/g/231/289 author_bio: it is a test
It should not be in the theme _config, but in the main hexo theme. Here is the config that runs the demo site, the important lines are:
# URL
## If your site is put in a subdirectory, set url as 'http://yoursite.com/child' and root as '/child/'
url: http://themes.russellhay.com/book
root: /book/
# Hexo Configuration
## Docs: http://hexo.io/docs/configuration.html
## Source: https://github.com/hexojs/hexo/
# Site
title: Sample Novel
subtitle:
description:
author: Russell Hay
email: xxxxxxxxxxx
language:
# URL
## If your site is put in a subdirectory, set url as 'http://yoursite.com/child' and root as '/child/'
url: http://themes.russellhay.com/book
root: /book/
permalink: :title/
tag_dir: tags
archive_dir: archives
category_dir: categories
code_dir: downloads/code
permalink_defaults:
# Directory
source_dir: source
public_dir: public
# Writing
new_post_name: :title.md # File name of new posts
default_layout: post
titlecase: true # Transform title into titlecase
external_link: true # Open external links in new tab
filename_case: 1
render_drafts: false
post_asset_folder: false
relative_link: false
highlight:
enable: false
line_number: true
tab_replace:
# Category & Tag
default_category: uncategorized
category_map:
tag_map:
# Archives
## 2: Enable pagination
## 1: Disable pagination
## 0: Fully Disable
archive: 2
category: 2
tag: 2
# Server
## Hexo uses Connect as a server
## You can customize the logger format as defined in
## http://www.senchalabs.org/connect/logger.html
port: 4000
server_ip: localhost
logger: false
logger_format: dev
# 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: MMM D YYYY
time_format: H:mm:ss
# Pagination
## Set per_page to 0 to disable pagination
per_page: 1
pagination_dir: page
reverse_order: true
# Disqus
disqus_shortname:
# Extensions
## Plugins: https://github.com/hexojs/hexo/wiki/Plugins
## Themes: https://github.com/hexojs/hexo/wiki/Themes
theme: book
exclude_generator:
# Deployment
## Docs: http://hexo.io/docs/deployment.html
deploy:
type: rsync
host: russellhay.com
user: rhay
root: /home/www/themes/book
delete: true
verbose: true
ignore_errors: false
marked:
gfm: true
breaks: false
smartLists: true
smartypants: true
it doesn't work. :-( may i clone your book demo repo directly? it is difficult for me : -(
book
# Hexo Configuration
## Docs: http://hexo.io/docs/configuration.html
## Source: https://github.com/hexojs/hexo/
# Site
title: book
subtitle:
description:
author: Julian
email: tjuzl@icloud.com
language: zh-CN
# URL
## If your site is put in a subdirectory, set url as 'http://yoursite.com/child' and root as '/child/'
url: http://guide.dpast.org
root: /book/
permalink: :title/
tag_dir: tags
archive_dir: archives
category_dir: categories
code_dir: downloads/code
permalink_defaults:
# Directory
source_dir: source
public_dir: public
# 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: 1
render_drafts: false
post_asset_folder: false
relative_link: false
highlight:
enable: true
line_number: true
tab_replace:
# Category & Tag
default_category: uncategorized
category_map:
tag_map:
# Archives
## 2: Enable pagination
## 1: Disable pagination
## 0: Fully Disable
archive: 2
category: 2
tag: 2
# Server
## Hexo uses Connect as a server
## You can customize the logger format as defined in
## http://www.senchalabs.org/connect/logger.html
port: 4000
server_ip: localhost
logger: false
logger_format: dev
# 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: H:mm:ss
# Pagination
## Set per_page to 0 to disable pagination
per_page: 1
pagination_dir: page
reverse_order: true
# Disqus
disqus_shortname:
# Extensions
## Plugins: https://github.com/hexojs/hexo/wiki/Plugins
## Themes: https://github.com/hexojs/hexo/wiki/Themes
theme: book
root: /book
exclude_generator:
# Deployment
## Docs: http://hexo.io/docs/deployment.html
deploy:
type: github
repo: git@dpast:dpast/book.git
branch: gh-pages
themes ▸ book
page_name: Chapter author_pic_url: http://placekitten.com/g/231/289 author_bio: it is a test
Sure, let me get it up on a github repro, but I think the problem is that you have root specified twice:
# Extensions
## Plugins: https://github.com/hexojs/hexo/wiki/Plugins
## Themes: https://github.com/hexojs/hexo/wiki/Themes
theme: book
root: /book
exclude_generator:
If you remove the root here, it might start working.
I made the demo site available here: https://github.com/RussTheAerialist/hexo-theme-book-demo-site
i cloned the demo site and apply the book theme (there is something wrong and i clone a new one), but it still does work. maybe it is something wrong with the plugins i installed?
Do you have https://github.com/hexojs/hexo-renderer-jade installed as a plugin as well as https://github.com/knksmith57/hexo-renderer-sass?`
├── node_modules
| |----- hexo-renderer-ejs
| |----- hexo-renderer-marked
| |----- hexo-renderer-stylus
| |----- hexo-renderer-jade
| |----- node-sass
I made the whole folder available here: http://jianguoyun.com/p/DVPV-_UQ9ermBRiYvAo
You don't have hexo-renderer-sass installed.
This is what my node_modules looks like
.
├── hexo
├── hexo-livereload
├── hexo-renderer-ejs
├── hexo-renderer-jade
├── hexo-renderer-marked
├── hexo-renderer-sass
└── hexo-renderer-stylus
I have followed every step you stated above, but still unable to get it work with hexo 3.0 :(
try hexo 2.8.x which is what I was using when I developed it. I haven't tried 3.0 yet.
i clone it and apply it. it does not work. thank you.
http://localhost:4000/ content: extends base.jade block content != partial("_partials/nav.jade", {page: page}) - page.posts.each(function(chapter) { article.article.clear header.header h1= chapter.title !=chapter.content - }) != partial("_partials/nav.jade", {page: page}) if !page.prev || !page.next != partial("_partials/author.jade")