Skip to content

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

@pspgbhu

Description

@pspgbhu

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):

[email protected] /Users/pspgbhu/code/local/website/blog
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── UNMET PEER DEPENDENCY [email protected]
└── [email protected]

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions