-
Notifications
You must be signed in to change notification settings - Fork 243
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
主站搜索结果链接错误 #874
Comments
怪哉…… @fyears @Lchiffon @XiangyunHuang @tcgriffith 求关注 |
大概知道啥问题 |
提交的algolia index里的url字段就是这个 搜索页F12的返回结果:
与其他帖子的源文件对比了一下,源文件yaml头里的日期没有用引号括起来,估计是用hugo源文件生成algolia索引这一步有问题,依稀记得之前我的站也碰到过 不过主站生成algolia index的模块可能跟我用的不一样,下面我就没法试了,同志们交给你们了哈哈哈哈 |
好的,如果问题是引号引起的话,至少有 4 篇文章加 members 页面需要修复,我来发个 PR 好了: fn <- list.files("content/", recursive = TRUE, full.names = TRUE)
k <- length(fn)
content <- vector("list", k)
for (i in 1:k) content[[i]] <- readLines(fn[i])
dates <- rep(NA, k)
for (i in 1:k) {
x <- which(grepl("date:", content[[i]]))[1]
dates[i] <- if (length(x)) content[[i]][x] else NA
}
fn[which(!grepl("\\\"|'", dates))]
# [1] "content//archives.md"
# [2] "content//members.md"
# [3] "content//post/2017-09-30-psychology-in-crisis.md"
# [4] "content//post/2018-04-01-RoTK-Analysis.md"
# [5] "content//post/2018-10-12-Python-and-R-implementation-of-gcForest.md"
# [6] "content//post/2019-10-24-bayesian-multilevel-lijin.md"
# [7] "content//search.md" |
按理说引号是可以省略的,不过试试看吧。 |
我扒拉了半天才想起来我们的网站是通过什么手段提交给 Algolia 索引的了……大为设置了个 Travis 定期运行脚本向 Algolia 提交数据,不过好像是每周跑一次:https://travis-ci.org/Lchiffon/cosx-algolia/builds |
石锤了,确实是引号问题, @nanxstats 找的另一个帖子 用R分析光荣《三国志》系列人物数据 返回链接也有问题 |
重现方法:
在主站搜索关键词:心理学
第一个结果的链接为
正确的链接应为
The text was updated successfully, but these errors were encountered: