Skip to content

Conversation

ZnPdCo
Copy link

@ZnPdCo ZnPdCo commented Sep 7, 2024

fix(*): 将 first-child 替换为 first-of-type,last-child 替换为 last-of-type,以此避免 feedback-sys 插入 div 后样式出错 OI-wiki/feedback-sys#71 (comment)

@Enter-tainer
Copy link
Member

话说我们现在是不是要把构建产物也提交上来?抓两个可能懂这里是怎么work的人: cc @Menci @billchenchina

@ZnPdCo
Copy link
Author

ZnPdCo commented Sep 7, 2024

build不出来/wul

@Enter-tainer
Copy link
Member

你是卡在哪个地方了

@ZnPdCo
Copy link
Author

ZnPdCo commented Sep 7, 2024

你是卡在哪个地方了

刚刚有点事,我先转成草稿吧,明天再看看

@ZnPdCo ZnPdCo marked this pull request as draft September 7, 2024 15:16
@ZnPdCo
Copy link
Author

ZnPdCo commented Sep 7, 2024

我好像 build 成功了,等一下测试一下 @Enter-tainer

@ZnPdCo ZnPdCo marked this pull request as ready for review September 7, 2024 22:38
@ZnPdCo ZnPdCo marked this pull request as draft September 7, 2024 22:44
@ZnPdCo
Copy link
Author

ZnPdCo commented Sep 7, 2024

我不懂,为什么在material/templates/base.html文件中,引用的css后缀会丢失

@ZnPdCo
Copy link
Author

ZnPdCo commented Sep 7, 2024

build好像确实出错了,会把本地绝对路径build进去

不应该啊,我按着文档做的

@ZnPdCo
Copy link
Author

ZnPdCo commented Sep 8, 2024

哭了,build路径还是有问题,直接修改build产物把那几个路径修复了。

然后之前几次commit都没有build,帮忙也build了一下。

现在在本地测试可以成功了,如果merge了要更新一下主站的submodule版本。PTAL @Enter-tainer

@ZnPdCo ZnPdCo marked this pull request as ready for review September 8, 2024 01:36
@Enter-tainer
Copy link
Member

@ZnPdCo action应该无所谓 不需要管

@ZnPdCo
Copy link
Author

ZnPdCo commented Sep 8, 2024

这玩意windows下build太痛苦了,什么时候和上游合并一下

@Enter-tainer
Copy link
Member

能大概写一下您build的时候都干了啥吗,下次再有人来build可以参考一下

@ZnPdCo
Copy link
Author

ZnPdCo commented Sep 8, 2024

能大概写一下您build的时候都干了啥吗,下次再有人来build可以参考一下

https://squidfunk.github.io/mkdocs-material/customization/#theme-development

按着来就好了

@Enter-tainer
Copy link
Member

按着来就好了

那merge上游是怎么说,会有一些问题吗

@ZnPdCo
Copy link
Author

ZnPdCo commented Sep 8, 2024

按着来就好了

那merge上游是怎么说,会有一些问题吗

这个东西在windows下build不知道有什么问题会出bug,但是linux下不会。

我觉得应该是bug,可能上游修好过。

不过目前能用就行了

@Enter-tainer
Copy link
Member

okk,话说之前提到的需要手工介入来修改的部分是什么情况。这个也在那个文档里面有写吗

@ZnPdCo
Copy link
Author

ZnPdCo commented Sep 8, 2024

okk,话说之前提到的需要手工介入来修改的部分是什么情况。这个也在那个文档里面有写吗

没有在文档中写。

需要修改的部分是 material/overrides/main.htmlmaterial/templates/base.html,这两个文件里引用的 cssjs 文件路径全是错的,修改即可。

以及每个 map.css 文件里面的绝对路径改成相对路径。

后者我找到原因是 windows 下路径分隔符的问题,前者不知是什么原因。

不过在linux下就没问题了。

@ZnPdCo
Copy link
Author

ZnPdCo commented Sep 8, 2024

@Enter-tainer 是不是应该让bot自己build然后commit过来,如果不是的话感觉会有一点危险?

@Enter-tainer
Copy link
Member

这个只能之后再看了。。我等下会在本地跑一次build看一看

@Enter-tainer
Copy link
Member

我在本地基于这个pr又build了一次,diff如下:
image

  (use "git restore <file>..." to discard changes in working directory)
        modified:   docs/schema/assets/icons.json
        deleted:    material/overrides/assets/javascripts/iconsearch_index.json
        modified:   material/templates/.icons/material/LICENSE

可能license不太重要,比较奇怪的是两个icon index

@ZnPdCo
Copy link
Author

ZnPdCo commented Sep 8, 2024

我在本地基于这个pr又build了一次,diff如下: image

  (use "git restore <file>..." to discard changes in working directory)
        modified:   docs/schema/assets/icons.json
        deleted:    material/overrides/assets/javascripts/iconsearch_index.json
        modified:   material/templates/.icons/material/LICENSE

可能license不太重要,比较奇怪的是两个icon index

记得使用 npm run build:all

@Enter-tainer
Copy link
Member

mgt@arch-white ~/p/O/mkdocs-material (patch-1)> npm run build:all

> [email protected] build:all
> rimraf material && ts-node -T tools/build --all --optimize

Browserslist: caniuse-lite is outdated. Please run:
  npx update-browserslist-db@latest
  Why you should do it regularly: https://github.com/browserslist/update-db#readme
mgt@arch-white ~/p/O/mkdocs-material (patch-1)> git status
On branch patch-1
Changes not staged for commit:
  (use "git add/rm <file>..." to update what will be committed)
  (use "git restore <file>..." to discard changes in working directory)
        modified:   docs/schema/assets/icons.json
        deleted:    material/overrides/assets/javascripts/iconsearch_index.json
        modified:   material/templates/.icons/material/LICENSE

no changes added to commit (use "git add" and/or "git commit -a")

@ZnPdCo
Copy link
Author

ZnPdCo commented Sep 8, 2024

依旧没有生成iconsearch_index.json吗

@Enter-tainer
Copy link
Member

依旧没有生成iconsearch_index.json吗

您可以在本地再跑一下build试试吗,我猜你现在的代码不是一个干净的状态。比如上面提到的 icon json 里面的 window 分隔符

@ZnPdCo
Copy link
Author

ZnPdCo commented Sep 8, 2024

依旧没有生成iconsearch_index.json吗

您可以在本地再跑一下build试试吗,我猜你现在的代码不是一个干净的状态。比如上面提到的 icon json 里面的 window 分隔符

您是在linux下跑的吗

@Enter-tainer
Copy link
Member

依旧没有生成iconsearch_index.json吗

您可以在本地再跑一下build试试吗,我猜你现在的代码不是一个干净的状态。比如上面提到的 icon json 里面的 window 分隔符

您是在linux下跑的吗

mgt@arch-white ~/p/O/mkdocs-material (patch-1)> uname -a
Linux arch-white 6.10.8-arch1-1 #1 SMP PREEMPT_DYNAMIC Wed, 04 Sep 2024 15:16:37 +0000 x86_64 GNU/Linux

@ZnPdCo
Copy link
Author

ZnPdCo commented Sep 8, 2024

我尝试用上游的代码跑一下

@Enter-tainer
Copy link
Member

image

似乎css魔改之后,搜索列表出问题了

@Enter-tainer
Copy link
Member

Enter-tainer commented Sep 8, 2024

image

在点击一次details块的折叠/展开后, 往上滚动,会发现tab消失。。不知道是不是新引入的问题

@Enter-tainer
Copy link
Member

我试一下能不能把feedback sys改成伪元素吧。。插一堆div感觉还挺怪的

@ZnPdCo
Copy link
Author

ZnPdCo commented Sep 8, 2024

image

在点击一次details块的折叠/展开后, 往上滚动,会发现tab消失。。不知道是不是新引入的问题

ts文件里的first-child不能改,原本的代码利用了first-child的特性,所以不能单纯的全局替换。

只把css里面的全局替换就行了

@ZnPdCo
Copy link
Author

ZnPdCo commented Sep 8, 2024

但是我累了,好像把按钮插到第一个元素真的能够解决问题,不行的话再捣鼓这个吧

@ZnPdCo
Copy link
Author

ZnPdCo commented Sep 8, 2024

mgt@arch-white ~/p/O/mkdocs-material (patch-1)> npm run build:all

> [email protected] build:all
> rimraf material && ts-node -T tools/build --all --optimize

Browserslist: caniuse-lite is outdated. Please run:
  npx update-browserslist-db@latest
  Why you should do it regularly: https://github.com/browserslist/update-db#readme
mgt@arch-white ~/p/O/mkdocs-material (patch-1)> git status
On branch patch-1
Changes not staged for commit:
  (use "git add/rm <file>..." to update what will be committed)
  (use "git restore <file>..." to discard changes in working directory)
        modified:   docs/schema/assets/icons.json
        deleted:    material/overrides/assets/javascripts/iconsearch_index.json
        modified:   material/templates/.icons/material/LICENSE

no changes added to commit (use "git add" and/or "git commit -a")

要执行 npx update-browserslist-db@latest 更新版本

@ZnPdCo
Copy link
Author

ZnPdCo commented Sep 8, 2024

@Enter-tainer 我修改了一下,你看一下能不能跑

@Enter-tainer
Copy link
Member

尝试了一下,build的文件没问题了。搜索也好了。但是点击 details 后,tab 还是会有问题,但是换了个症状。

现在往下滚动一定距离再滚动会页面顶部之后,这个tab好像会无法恢复原状

image

@ZnPdCo
Copy link
Author

ZnPdCo commented Sep 8, 2024

尝试了一下,build的文件没问题了。搜索也好了。但是点击 details 后,tab 还是会有问题,但是换了个症状。

现在往下滚动一定距离再滚动会页面顶部之后,这个tab好像会无法恢复原状

image

能不能录个像

@ZnPdCo
Copy link
Author

ZnPdCo commented Sep 8, 2024

我这边复现不了

@Enter-tainer
Copy link
Member

我玩了一会,似乎是如果我开着feedback sys就有概率搞出来,不开就没事。我猜可能是因为feedback sys请求失败的时候会破坏一些东西。应该没太大问题

@Enter-tainer Enter-tainer merged commit 777f5cf into OI-wiki:master Sep 8, 2024
2 of 4 checks passed
@Enter-tainer
Copy link
Member

@ZnPdCo 您在主站 repo 里面开个 pr 来 update 一下 submodule?我来帮您点 approve

@ZnPdCo
Copy link
Author

ZnPdCo commented Sep 8, 2024

@Enter-tainer 我不太懂这个,您来吧

@Enter-tainer
Copy link
Member

Enter-tainer commented Sep 8, 2024

我可以是可以 但是我没法自己给自己点approve😂,得再抓个管理来点

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

Successfully merging this pull request may close these issues.

2 participants