[halo-dev/halo]自带的markdown缺失

2024-04-02 475 views
0
是什么版本出现了此问题?

2.6.0

使用的什么数据库?

MySQL 8.x

使用的哪种方式部署?

Docker

发生了什么?

最开始是在家里内网服务器中使用1panel搭建了halo,后来租了个云服务器(ubuntu系统),也使用1panel搭建了halo。 当时想将家里内网服务器中的halo同步到云服务器的halo上,使用的是内网服务器备份然后传到云服务器上恢复备份的方法,但是报错失败了。 当时强行把相关的文件夹(插件、主题等)通过scp给传到了云服务器上,然后就可以正常访问了。 今天第一次对转到云服务器上的博客进行编辑时(使用ByteMD插件),发现 ! [ ] ( ) 格式插入的图片无法显示。我还去电脑本地的typora试了一下,可以显示,说明url没问题。 我觉得是ByteMD的问题,所以把它卸载了。卸载之后再点进文章编辑页面,报错如下:

回答

7

建议先把 ByteMD 插件装回来或者安装 StackEdit

4

StackEdit感觉加载有点慢,而且界面不好看[捂脸]。。。刚才试过下回来,试了一下用StackEdit也无法显示图片

ByteMD下回来了,可以正常使用。。。

刚刚发现这个问题好像只针对csdn的图片,如下图。csdn的图片在typora中和github中可以显示出来,但是在文章编辑页中显示不出来,很奇怪

0

CSDN 限制了图片的 Referrer,具体请看访问详情:

  • 包含 Referer Header

    curl 'https://img-blog.csdnimg.cn/b73c727692ee415faf71d043859da8cb.png' \
      -H 'authority: img-blog.csdnimg.cn' \
      -H 'accept: image/avif,image/webp,image/apng,image/svg+xml,image/*,*/*;q=0.8' \
      -H 'accept-language: en-US,en;q=0.9,zh-CN;q=0.8,zh;q=0.7' \
      -H 'dnt: 1' \
      -H 'referer: http://localhost:8090/' \
      -H 'sec-ch-ua: "Not.A/Brand";v="8", "Chromium";v="114"' \
      -H 'sec-ch-ua-mobile: ?0' \
      -H 'sec-ch-ua-platform: "macOS"' \
      -H 'sec-fetch-dest: image' \
      -H 'sec-fetch-mode: no-cors' \
      -H 'sec-fetch-site: cross-site' \
      -H 'user-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36' \
      --compressed -v
    *   Trying 125.64.3.147:443...
    * Connected to img-blog.csdnimg.cn (125.64.3.147) port 443 (#0)
    * ALPN: offers h2,http/1.1
    * (304) (OUT), TLS handshake, Client hello (1):
    *  CAfile: /etc/ssl/cert.pem
    *  CApath: none
    * (304) (IN), TLS handshake, Server hello (2):
    * (304) (IN), TLS handshake, Unknown (8):
    * (304) (IN), TLS handshake, Certificate (11):
    * (304) (IN), TLS handshake, CERT verify (15):
    * (304) (IN), TLS handshake, Finished (20):
    * (304) (OUT), TLS handshake, Finished (20):
    * SSL connection using TLSv1.3 / AEAD-AES256-GCM-SHA384
    * ALPN: server accepted h2
    * Server certificate:
    *  subject: CN=*.csdnimg.cn
    *  start date: Oct 11 00:00:00 2022 GMT
    *  expire date: Oct 11 23:59:59 2023 GMT
    *  subjectAltName: host "img-blog.csdnimg.cn" matched cert's "*.csdnimg.cn"
    *  issuer: C=US; O=DigiCert Inc; OU=www.digicert.com; CN=RapidSSL RSA CA 2018
    *  SSL certificate verify ok.
    * using HTTP/2
    * h2h3 [:method: GET]
    * h2h3 [:path: /b73c727692ee415faf71d043859da8cb.png]
    * h2h3 [:scheme: https]
    * h2h3 [:authority: img-blog.csdnimg.cn]
    * h2h3 [accept-encoding: deflate, gzip]
    * h2h3 [authority: img-blog.csdnimg.cn]
    * h2h3 [accept: image/avif,image/webp,image/apng,image/svg+xml,image/*,*/*;q=0.8]
    * h2h3 [accept-language: en-US,en;q=0.9,zh-CN;q=0.8,zh;q=0.7]
    * h2h3 [dnt: 1]
    * h2h3 [referer: http://localhost:8090/]
    * h2h3 [sec-ch-ua: "Not.A/Brand";v="8", "Chromium";v="114"]
    * h2h3 [sec-ch-ua-mobile: ?0]
    * h2h3 [sec-ch-ua-platform: "macOS"]
    * h2h3 [sec-fetch-dest: image]
    * h2h3 [sec-fetch-mode: no-cors]
    * h2h3 [sec-fetch-site: cross-site]
    * h2h3 [user-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36]
    * Using Stream ID: 1 (easy handle 0x14680a800)
    > GET /b73c727692ee415faf71d043859da8cb.png HTTP/2
    > Host: img-blog.csdnimg.cn
    > accept-encoding: deflate, gzip
    > authority: img-blog.csdnimg.cn
    > accept: image/avif,image/webp,image/apng,image/svg+xml,image/*,*/*;q=0.8
    > accept-language: en-US,en;q=0.9,zh-CN;q=0.8,zh;q=0.7
    > dnt: 1
    > referer: http://localhost:8090/
    > sec-ch-ua: "Not.A/Brand";v="8", "Chromium";v="114"
    > sec-ch-ua-mobile: ?0
    > sec-ch-ua-platform: "macOS"
    > sec-fetch-dest: image
    > sec-fetch-mode: no-cors
    > sec-fetch-site: cross-site
    > user-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36
    >
    < HTTP/2 403
    < server: openresty
    < date: Wed, 14 Jun 2023 09:35:59 GMT
    < content-type: text/html
    < content-length: 552
    < via: CHN-SCchengdu-AREACT11-CACHE3[1]
    < access-control-allow-origin: *
    < cache-control: max-age=0
    <
    <html>
    <head><title>403 Forbidden</title></head>
    <body>
    <center><h1>403 Forbidden</h1></center>
    <hr><center>openresty</center>
    </body>
    </html>
    <!-- a padding to disable MSIE and Chrome friendly error page -->
    <!-- a padding to disable MSIE and Chrome friendly error page -->
    <!-- a padding to disable MSIE and Chrome friendly error page -->
    <!-- a padding to disable MSIE and Chrome friendly error page -->
    <!-- a padding to disable MSIE and Chrome friendly error page -->
    <!-- a padding to disable MSIE and Chrome friendly error page -->
    * Connection #0 to host img-blog.csdnimg.cn left intact
  • 不包含 Referer Header

    curl 'https://img-blog.csdnimg.cn/b73c727692ee415faf71d043859da8cb.png' \
      -H 'authority: img-blog.csdnimg.cn' \
      -H 'accept: image/avif,image/webp,image/apng,image/svg+xml,image/*,*/*;q=0.8' \
      -H 'accept-language: en-US,en;q=0.9,zh-CN;q=0.8,zh;q=0.7' \
      -H 'dnt: 1' \
      -H 'sec-ch-ua: "Not.A/Brand";v="8", "Chromium";v="114"' \
      -H 'sec-ch-ua-mobile: ?0' \
      -H 'sec-ch-ua-platform: "macOS"' \
      -H 'sec-fetch-dest: image' \
      -H 'sec-fetch-mode: no-cors' \
      -H 'sec-fetch-site: cross-site' \
      -H 'user-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36' \
      --compressed -v
    *   Trying 125.64.3.146:443...
    * Connected to img-blog.csdnimg.cn (125.64.3.146) port 443 (#0)
    * ALPN: offers h2,http/1.1
    * (304) (OUT), TLS handshake, Client hello (1):
    *  CAfile: /etc/ssl/cert.pem
    *  CApath: none
    * (304) (IN), TLS handshake, Server hello (2):
    * (304) (IN), TLS handshake, Unknown (8):
    * (304) (IN), TLS handshake, Certificate (11):
    * (304) (IN), TLS handshake, CERT verify (15):
    * (304) (IN), TLS handshake, Finished (20):
    * (304) (OUT), TLS handshake, Finished (20):
    * SSL connection using TLSv1.3 / AEAD-AES256-GCM-SHA384
    * ALPN: server accepted h2
    * Server certificate:
    *  subject: CN=*.csdnimg.cn
    *  start date: Oct 11 00:00:00 2022 GMT
    *  expire date: Oct 11 23:59:59 2023 GMT
    *  subjectAltName: host "img-blog.csdnimg.cn" matched cert's "*.csdnimg.cn"
    *  issuer: C=US; O=DigiCert Inc; OU=www.digicert.com; CN=RapidSSL RSA CA 2018
    *  SSL certificate verify ok.
    * using HTTP/2
    * h2h3 [:method: GET]
    * h2h3 [:path: /b73c727692ee415faf71d043859da8cb.png]
    * h2h3 [:scheme: https]
    * h2h3 [:authority: img-blog.csdnimg.cn]
    * h2h3 [accept-encoding: deflate, gzip]
    * h2h3 [authority: img-blog.csdnimg.cn]
    * h2h3 [accept: image/avif,image/webp,image/apng,image/svg+xml,image/*,*/*;q=0.8]
    * h2h3 [accept-language: en-US,en;q=0.9,zh-CN;q=0.8,zh;q=0.7]
    * h2h3 [dnt: 1]
    * h2h3 [sec-ch-ua: "Not.A/Brand";v="8", "Chromium";v="114"]
    * h2h3 [sec-ch-ua-mobile: ?0]
    * h2h3 [sec-ch-ua-platform: "macOS"]
    * h2h3 [sec-fetch-dest: image]
    * h2h3 [sec-fetch-mode: no-cors]
    * h2h3 [sec-fetch-site: cross-site]
    * h2h3 [user-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36]
    * Using Stream ID: 1 (easy handle 0x12480a800)
    > GET /b73c727692ee415faf71d043859da8cb.png HTTP/2
    > Host: img-blog.csdnimg.cn
    > accept-encoding: deflate, gzip
    > authority: img-blog.csdnimg.cn
    > accept: image/avif,image/webp,image/apng,image/svg+xml,image/*,*/*;q=0.8
    > accept-language: en-US,en;q=0.9,zh-CN;q=0.8,zh;q=0.7
    > dnt: 1
    > sec-ch-ua: "Not.A/Brand";v="8", "Chromium";v="114"
    > sec-ch-ua-mobile: ?0
    > sec-ch-ua-platform: "macOS"
    > sec-fetch-dest: image
    > sec-fetch-mode: no-cors
    > sec-fetch-site: cross-site
    > user-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36
    >
    < HTTP/2 200
    < date: Wed, 14 Jun 2023 09:36:55 GMT
    < content-type: image/png
    < content-length: 73965
    < server: openresty
    < content-md5: Eq5BQjd28OvYBrLGC0BggQ==
    < etag: "12AE41423776F0EBD806B2C60B406081"
    < last-modified: Fri, 02 Dec 2022 08:48:30 GMT
    < x-oss-hash-crc64ecma: 16919009278509492470
    < x-oss-object-type: Normal
    < x-oss-request-id: 63F627F3C0D4493937C4CFA1
    < x-oss-server-time: 48
    < x-oss-storage-class: Standard
    < x-ccdn-expires: 30610317
    < via: CHN-SCchengdu-AREACT11-CACHE60[2],CHN-SCchengdu-AREACT11-CACHE23[0,TCP_HIT,0],CHN-GDdongguan-GLOBAL1-CACHE30[19],CHN-GDdongguan-GLOBAL1-CACHE23[0,TCP_HIT,18]
    < x-hcs-proxy-type: 1
    < x-ccdn-cachettl: 31104000
    < nginx-hit: 1
    < accept-ranges: bytes
    < access-control-allow-origin: *
    < cache-control: max-age=31104000
    <
    Warning: Binary output can mess up your terminal. Use "--output -" to tell
    Warning: curl to output it to your terminal anyway, or consider "--output
    Warning: <FILE>" to save to a file.
    * Failure writing output to destination
    * Connection #0 to host img-blog.csdnimg.cn left intact
6

那我只能把csdn上的图片下载下来保存到自己的OSS中来使用了 [捂脸] 不想在csdn写文章了。。