Skip to content

为什么我的博客不显示任何帖子? #15

Open

Description

@briteming

hi。

$ git clone https://github.com/briteming/iib iib-by-briteming
$ cd iib-by-briteming
$ yarn
/iib-by-briteming (master)$ node build/build.js
显示:
...
ERROR in static/js/vendor.94901980225ce0f44782.js from UglifyJs
Unexpected token: operator (>) [./
/vue-ga/dist/vue-ga.esm.js:30,0][static/js/ve
ndor.94901980225ce0f44782.js:37682,16]

Build complete.

Tip: built files are meant to be served over an HTTP server.
Opening index.html over file:// won't work.

~/iib-by-briteming (master)$ ls
Dockerfile build/ dist/ node_modules/ server/ src/ yarn.lock
README.md config/ index.html package.json server.js static/

~/iib-by-briteming (master)$ cd dist
~/iib-by-briteming/dist (master)$ ls
favicon.ico index.html static/
~/iib-by-briteming/dist (master)$ python3 -m http.server 2134

在浏览器里访问127.0.0.1:2134 ,我的博客不显示任何帖子.如图:

Image 为什么呢?感觉是你的程序好像根本没去fetch github issues? 我确实提交了一个issue: https://github.com/briteming/issues/1 谢谢回复!

Activity

  1. impasse commented on Feb 1, 2025

    @impasse
    Owner

    https://github.com/impasse/IssueBlog/blob/master/src/model.js#L37

    我试了一下api还是能用的,可能你没有设置repo和owner?

  2. briteming commented on Feb 1, 2025

    @briteming
    Author

    hello.

    现在 好了:https://iib.netlify.app/, 不过博客里面的帖子,比如
    https://iib.netlify.app/post/11 ,是不能直接访问的。必须先访问主页https://iib.netlify.app/ ,然后点击“
    古代中国最早的情诗,只有四个字-候人兮猗”,才能打开该帖子。这个问题怎么解决?
    非常感谢!

  3. impasse commented on Feb 2, 2025

    @impasse
    Owner

    netlify 应该能设置类似 rewrite 的规则,把其他地址重定向到 /index.html

  4. briteming commented on Feb 2, 2025

    @briteming
    Author

    hi.
    在 app.netlify.com 网站,来到添加 build命令那一栏时,添加命令:
    npm run build && cd dist && echo '/* /index.html 200' > _redirects

    点击页面底部的deploy按钮,等待部署完成,部署完成后,我得到网址https://iib-2.netlify.app/ 。现在,即可直接访问帖子的 网址了,比如https://iib-2.netlify.app/post/12

    https://iib.netlify.app/ 好像没法设置直接访问其帖子的网址了,我只好重新部署一遍,在获得的新网址https://iib-2.netlify.app/ 里,解决了问题

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions