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

when rendering index.html, the variable page.content has different value when exec hexo g and hexo s #2902

Closed
pspgbhu opened this issue Dec 11, 2017 · 2 comments
Labels

Comments

@pspgbhu
Copy link

pspgbhu commented Dec 11, 2017

Environment Info

hexo: 3.4.3
hexo-cli: 1.0.4
os: Darwin 16.7.0 darwin x64
http_parser: 2.7.0
node: 8.1.2
v8: 5.8.283.41
uv: 1.12.0
zlib: 1.2.11
ares: 1.10.1-DEV
modules: 57
openssl: 1.0.2l
icu: 59.1
unicode: 9.0
cldr: 31.0.1
tz: 2017b

Your site _config.yml (Optional):

permalink: :title/
permalink_defaults:

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

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
auto_spacing: true
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:

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

default_category: uncategorized
category_map:
tag_map:

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

per_page: 10
pagination_dir: page

marked:
  gfm: true
  pe/antic: false
  sanitize: false
  tables: true
  breaks: true
  smartLists: true
  smartypants: true
  modifyAnchors: ''
  autolink: true

theme: landscape

Your theme _config.yml (Optional):

# Header
menu:
  Home: /
  Archives: /archives
rss: /atom.xml

# Content
excerpt_link: Read More
fancybox: true

# Sidebar
sidebar: right
widgets:
- category
- tag
- tagcloud
- archive
- recent_posts

# display widgets at the bottom of index pages (pagination == 2)
index_widgets:
# - category
# - tagcloud
# - archive

# widget behavior
archive_type: 'monthly'
show_count: false

# Miscellaneous
google_analytics:
favicon: /favicon.png
twitter:
google_plus:
fb_admins:
fb_app_id:

Hexo and Plugin version(npm ls --depth 0):

hexo-site@0.0.0 /Users/pspgbhu/code/local/website/blog
├── cross-env@5.1.1
├── gulp@3.9.1
├── gulp-autoprefixer@4.0.0
├── gulp-htmlclean@2.7.16
├── gulp-htmlmin@3.0.0
├── gulp-jshint@2.0.4
├── gulp-less@3.3.2
├── gulp-minify-css@1.2.4
├── gulp-notify@3.0.0
├── gulp-plumber@1.1.0
├── gulp-rename@1.2.2
├── gulp-rev-append@0.1.8
├── gulp-sequence@0.4.6
├── gulp-uglify@3.0.0
├── hexo@3.4.3
├── hexo-deployer-git@0.3.1
├── hexo-generator-archive@0.1.5
├── hexo-generator-category@0.1.3
├── hexo-generator-index@0.2.1
├── hexo-generator-json-content@2.2.0
├── hexo-generator-tag@0.2.0
├── hexo-renderer-ejs@0.3.1
├── hexo-renderer-less@0.2.0
├── hexo-renderer-marked@0.3.0
├── hexo-renderer-stylus@0.3.3
├── hexo-server@0.2.2
├── UNMET PEER DEPENDENCY jshint@2.x
└── jshint-stylish@2.2.1

For BUG

To exec hexo g to generate public files, the value of variable page.content has a value and the value is my lastest article content when rendering index.html. But when i exec hexo s in cli and open webpage localhost:4000 in broswer, the value of page.content is undefined.

i think this is a bug. It shouldn't give a value to page.content when rendering index.html.


There are more details about this bug:

In the layout.ejs, i import sidebar.ejs like that:

<!--  layout.ejs  -->
<%- partial('_partial/sidebar', null, {cache: !config.relative_link}) %>

In _config.yml, i am sure that i set the value of relative_link to false.

when i develop in local, there is no problem. But when i deploy my project, i got a wrong variable page in the sidebar, page.content has value in index page.

@pspgbhu pspgbhu changed the title In index page, the variable page.content has different value when exec hexo g and hexo s when rendering index.html, the variable page.content has different value when exec hexo g and hexo s Dec 11, 2017
@pspgbhu pspgbhu changed the title when rendering index.html, the variable page.content has different value when exec hexo g and hexo s when rendering index.html, the variable page.content has different value when exec hexo g and hexo s Dec 11, 2017
@NoahDragon
Copy link
Member

NoahDragon commented Dec 16, 2017

Similar issue to #2897 #2503
This is a known issue that hexo s has different behavior than hexo g while rendering a file. Need time to dig into this.

@NoahDragon NoahDragon mentioned this issue Dec 16, 2017
53 tasks
@stale
Copy link

stale bot commented Feb 14, 2018

This issue has been automatically marked as stale because lack of recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Feb 14, 2018
@stale stale bot closed this as completed Feb 21, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants