hexo-asset-image icon indicating copy to clipboard operation
hexo-asset-image copied to clipboard

本地测试无法显示图片

Open wylu opened this issue 6 years ago • 13 comments

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

wylu avatar Jun 04 '19 07:06 wylu

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

xcodebuild avatar Jun 04 '19 09:06 xcodebuild

嗯,我执行了 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:

wylu avatar Jun 04 '19 14:06 wylu

看起来和 https://github.com/xcodebuild/hexo-asset-image/issues/32#issuecomment-498626924 是同一个问题,可能和 Windows 有关,先关闭这个 issue 统一在 #32 中处理

xcodebuild avatar Jun 05 '19 02:06 xcodebuild

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

我用的是 Ubuntu 18.04 呀

wylu avatar Jun 05 '19 02:06 wylu

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

xcodebuild avatar Jun 05 '19 03:06 xcodebuild

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

有的。blog.tar.gz

wylu avatar Jun 05 '19 13:06 wylu

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

xcodebuild avatar Jun 05 '19 14:06 xcodebuild

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

0.0.1 可以

wylu avatar Jun 06 '19 06:06 wylu

@wylu 但是 1.0.0 不行么

xcodebuild avatar Jun 06 '19 07:06 xcodebuild

@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

wylu avatar Jun 06 '19 08:06 wylu

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

februarysea avatar Jun 08 '19 07:06 februarysea

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

wlqunr avatar Nov 03 '19 14:11 wlqunr

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

wlqunr avatar Nov 03 '19 14:11 wlqunr