Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Footer 中备案位置的一个小问题 #722

Closed
3 tasks done
Leao9203 opened this issue Nov 28, 2023 · 6 comments
Closed
3 tasks done

Footer 中备案位置的一个小问题 #722

Leao9203 opened this issue Nov 28, 2023 · 6 comments
Labels
Bug Something isn't working Solved

Comments

@Leao9203
Copy link
Contributor

Issue Checklist

Expected behavior

  1. gongan_icon_urlgongan_num 显示于同一行;
  2. gongan_id 所指向的链接为 https://beian.mps.gov.cn/#/query/webSearch?code=

Actual behavior

问题1的截图
图片

问题2的截图
图片

Steps to reproduce the behavior

_config.yaml 中设定 gongan_id gongan_num gongan_icon_url

Node.js and NPM Information

v18.13.0
9.2.0

Package dependencies Information

[email protected] /home/leao9203/blog
├── [email protected] -> ./node_modules/.store/[email protected]/node_modules/cjs
├── [email protected] -> ./node_modules/.store/[email protected]/node_modules/css
├── [email protected] -> ./node_modules/.store/[email protected]/node_modules/hexo-baidu-url-submit
├── [email protected] -> ./node_modules/.store/[email protected]/node_modules/hexo-deployer-git
├── [email protected] -> ./node_modules/.store/[email protected]/node_modules/hexo-deployer-rsync
├── [email protected] -> ./node_modules/.store/[email protected]/node_modules/hexo-generator-archive
├── [email protected] -> ./node_modules/.store/[email protected]/node_modules/hexo-generator-feed
├── [email protected] -> ./node_modules/.store/[email protected]/node_modules/hexo-generator-index
├── [email protected] -> ./node_modules/.store/[email protected]/node_modules/hexo-generator-sitemap
├── [email protected] -> ./node_modules/.store/[email protected]/node_modules/hexo-generator-tag
├── [email protected] -> ./node_modules/.store/[email protected]/node_modules/hexo-migrator-rss
├── [email protected] -> ./node_modules/.store/[email protected]/node_modules/hexo-renderer-ejs
├── [email protected] -> ./node_modules/.store/[email protected]/node_modules/hexo-renderer-marked
├── [email protected] -> ./node_modules/.store/[email protected]/node_modules/hexo-renderer-stylus
├── [email protected] -> ./node_modules/.store/[email protected]/node_modules/hexo-seo-autopush
├── [email protected] -> ./node_modules/.store/[email protected]/node_modules/hexo-server
├── [email protected] -> ./node_modules/.store/[email protected]/node_modules/hexo-theme-next
├── [email protected] -> ./node_modules/.store/[email protected]/node_modules/hexo-url-submission
├── [email protected] -> ./node_modules/.store/[email protected]/node_modules/hexo-util
├── [email protected] -> ./node_modules/.store/[email protected]/node_modules/hexo
├── [email protected] -> ./node_modules/.store/[email protected]/node_modules/js-yaml
├── [email protected] -> ./node_modules/.store/[email protected]/node_modules/mongoose
└── [email protected] -> ./node_modules/.store/[email protected]/node_modules/stylus

Hexo Configuration

恕无法提供完整内容。
  footer:
    since: 2020
    beian:
      enable: true
      icp: 一个 ICP 备案号
      gongan_id: 联网备案号
      gongan_num: 一个 gongan 备案号
      gongan_icon_url: 指向了一个 gongan icon

NexT Configuration

同上

Other Information

"hexo-theme-next": "^8.18.2"
通过 NPM 安装的包

@Leao9203 Leao9203 added the Bug Something isn't working label Nov 28, 2023
Copy link

welcome bot commented Nov 28, 2023

Thanks for opening this issue, maintainers will get back to you as soon as possible!

@Leao9203
Copy link
Contributor Author

是想要修改 layout/_partials/footer.njk 来提一个 PR 的,但是由于不太懂 next_url 函数所代表的含义及其语法,就没有提。

有关指向链接的问题,目前 MPS 的查询方式已经修改了,因次其访问链接也有所不同。虽然目前的链接会被正常重定向到新的访问链接,但是不知道未来 MPS 会不会去除掉,而且对于已经备案过的网站,不及时修改“可能”会有一些风险。修改方式如下:
将第 8 行中的
http://www.beian.gov.cn/portal/registerSystemInfo?recordcode= 修改为 https://beian.mps.gov.cn/#/query/webSearch?code= 既可。

@stevenjoezhang
Copy link
Member

好的,谢谢反馈

@stevenjoezhang
Copy link
Member

@Leao9203 我无法复现问题1,gongan_icon_urlgongan_num 默认是显示于同一行的,你能帮忙确认一下吗?

@Leao9203
Copy link
Contributor Author

@Leao9203 我无法复现问题1,gongan_icon_urlgongan_num 默认是显示于同一行的,你能帮忙确认一下吗?

当然可以!
通过在 _config.yaml 中配置 gongan_icon_urlgongan_num

图片

hexo s 临时运行博客,并访问,便会在页面底部呈现出这样的情况,icon 的比例为 36x40 px

图片

但是如果我通过自定义 footer.njk 手动写 HTML 代码的话,是能够正常显示在同一行的,icon 通过 css 缩放为 18x20 px

图片

所提到的内容如下:

  1. icon 图片,格式为 WebP,尺寸为 36x40 px

mps_beian.zip

  1. HTML 代码
<div>
  <img src="图片链接" alt="" style="display: inline-block; vertical-align: middle; width: 18px; height: 20px">
  <a href="https://beian.mps.gov.cn/#/query/webSearch?code=*********" rel="noreferrer" target="_blank">*公网安备********</a>
</div>

@Leao9203
Copy link
Contributor Author

Leao9203 commented Nov 29, 2023

草 我好像找到问题所在了,原因十分甚至九分的荒谬(

原因是因为我的博客网站为了加速,将 CSS 之类的文件和 post 进行了分离,所引用的 CSS 为今年 5 月份时 NexT 的 CSS,当 NexT 更新的时候, 我并没有及时跟进,导致出现了这个问题。

图片

更糟糕的是,我还在 _config.yaml 中让 Hexo 忽略了 CSS 等文件,以至于 CSS 文件一直没有被更新。

图片

目前通过跟进 CSS 文件之后,目前博客网站的显示已恢复正常。

图片

在此感谢 @stevenjoezhang 的热心测试

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working Solved
Projects
None yet
Development

No branches or pull requests

2 participants