Skip to content
This repository has been archived by the owner on Feb 18, 2020. It is now read-only.

本地测试无法显示图片 #44

Open
wylu opened this issue Jun 4, 2019 · 13 comments
Open

本地测试无法显示图片 #44

wylu opened this issue Jun 4, 2019 · 13 comments

Comments

@wylu
Copy link

wylu commented Jun 4, 2019

请问在本地进行测试时,是不能看到图片的吗?

@xcodebuild
Copy link
Owner

如果本地测试指的是 hexo s 的话应该是可以看到图片的

@wylu
Copy link
Author

wylu commented Jun 4, 2019

嗯,我执行了 hexo clean && hexo g && hexo s -o,效果如下,不知道为什么链接这么奇怪。

DeepinScreenshot_select-area_20190604223858

package.json

{
  "name": "hexo-site",
  "version": "0.0.0",
  "private": true,
  "hexo": {
    "version": "3.8.0"
  },
  "dependencies": {
    "hexo": "^3.8.0",
    "hexo-asset-image": "0.0.4",
    "hexo-generator-archive": "^0.1.5",
    "hexo-generator-category": "^0.1.3",
    "hexo-generator-index": "^0.2.1",
    "hexo-generator-tag": "^0.2.0",
    "hexo-renderer-ejs": "^0.3.1",
    "hexo-renderer-marked": "^1.0.1",
    "hexo-renderer-stylus": "^0.3.3",
    "hexo-server": "^0.3.3"
  }
}

hexo 配置文件

# Site
title: Hexo
subtitle:
description:
keywords:
author: John Doe
language:
timezone:

# URL
## If your site is put in a subdirectory, set url as 'http://yoursite.com/child' and root as '/child/'
url: http://yoursite.com
root: /
permalink: :year/:month/:day/:title/
permalink_defaults:

# Directory
source_dir: source
public_dir: public
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: true
relative_link: false
future: true
highlight:
  enable: true
  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: landscape

# Deployment
## Docs: https://hexo.io/docs/deployment.html
deploy:
  type:

@xcodebuild
Copy link
Owner

看起来和 #32 (comment) 是同一个问题,可能和 Windows 有关,先关闭这个 issue 统一在 #32 中处理

@wylu
Copy link
Author

wylu commented Jun 5, 2019

看起来和 #32 (comment) 是同一个问题,可能和 Windows 有关,先关闭这个 issue 统一在 #32 中处理

我用的是 Ubuntu 18.04 呀

@xcodebuild
Copy link
Owner

这样,那看来不是一个问题。。然而在 macOS 并没有复现出来,你有更完整的复现代码么

@xcodebuild xcodebuild reopened this Jun 5, 2019
@wylu
Copy link
Author

wylu commented Jun 5, 2019

这样,那看来不是一个问题。。然而在 macOS 并没有复现出来,你有更完整的复现代码么

有的。blog.tar.gz

@xcodebuild
Copy link
Owner

试一下 1.0.0,我之前 publish 错了代码 😢

@wylu
Copy link
Author

wylu commented Jun 6, 2019

试一下 1.0.0,我之前 publish 错了代码

0.0.1 可以

@xcodebuild
Copy link
Owner

@wylu 但是 1.0.0 不行么

@wylu
Copy link
Author

wylu commented Jun 6, 2019

@wylu 但是 1.0.0 不行么

是的,老铁。

测试了一下,对于下面这种结构:

$ tree source/_posts 
source/_posts
├── assetsTest
│   └── example.png
└── assetsTest.md

![example](example.png)![example](assetsTest/example.png) 这两写法在 "hexo-asset-image": "0.0.1" 都能正常工作,在主页和文章中图片都能正常显示。

$ hexo -v
hexo: 3.8.0
hexo-cli: 1.1.0
os: Linux 4.15.0-50-generic linux x64
http_parser: 2.8.0
node: 10.15.3
v8: 6.8.275.32-node.51
uv: 1.23.2
zlib: 1.2.11
ares: 1.15.0
modules: 64
nghttp2: 1.34.0
napi: 3
openssl: 1.1.0j
icu: 62.1
unicode: 11.0
cldr: 33.1
tz: 2018e

@februarysea
Copy link

在Mac下我也遇到了类似的问题,在Typora可以正常显示图片,但是hexo s网页上却无法显示图片
image
image

@wlqunr
Copy link

wlqunr commented Nov 3, 2019

可能是生成的目标网页没有图片。

@wlqunr
Copy link

wlqunr commented Nov 3, 2019

把图片copy到目标网页所在文件夹,再直接执行hexo s试一下,定位一下是不是这个问题

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants