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

添加作者文章列表 #995

Closed
wants to merge 3 commits into from
Closed

添加作者文章列表 #995

wants to merge 3 commits into from

Conversation

CyrusYip
Copy link
Contributor

效果图:

image

@yufree
Copy link
Collaborator

yufree commented Nov 26, 2021

谢谢!从效果上看似乎只有联合署名文章会被列上去,另外我估计同样会存在 #950 的重名问题,可能要加些条件判断。

@CyrusYip
Copy link
Contributor Author

从效果上看似乎只有联合署名文章会被列上去

已修复。重名问题暂时没头绪。

@CyrusYip
Copy link
Contributor Author

CyrusYip commented Nov 26, 2021

先记一下思路:

if (存在 id) 且 (id 不是空字符串)
    根据 id 筛选
else
    根据名字筛选

如果有人愿意背这口锅,可以冒个泡。

@CyrusYip
Copy link
Contributor Author

CyrusYip commented Nov 28, 2021

我这样按照 id 筛选文章:

{{ $pages := (where $.Site.RegularPages ".Params.author_id" "intersect" (slice .id)) }}
{{ $pages := $pages | union (where $.Site.RegularPages ".Params.author_id" .id) }}

两位赵鹏的列表是对的,但其他人就有一长串文章了,不知道怎么解决。

image

image

@tcgriffith 能不能帮忙改改这个 pull request,解决下重名问题?

@tcgriffith
Copy link
Contributor

有空我看看!

Copy link
Member

@yihui yihui left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

谢谢!

layouts/shortcodes/members.html Outdated Show resolved Hide resolved
Co-authored-by: Yihui Xie <[email protected]>
@yufree
Copy link
Collaborator

yufree commented Jun 5, 2022

@tcgriffith TC兄有进展否?最近清理历史遗留问题 #663,感觉这个PR如果可以应该可以顺道解决

@tcgriffith
Copy link
Contributor

@yufree 预计一周后(8.6以后)我可以!先记入我的todo

tcgriffith pushed a commit to tcgriffith/cosx.org-1 that referenced this pull request Apr 10, 2023
@tcgriffith
Copy link
Contributor

一年半以后终于撸起袖子解决这个pr了… 年代久远 rebase又不大熟悉干脆重新按最新分支另写起草了一个PR,请移步查看预览效果和讨论 #1097

yufree pushed a commit that referenced this pull request Apr 10, 2023
感谢 @tcgriffith! 同时感谢 @CyrusYip 的原型 #995 
* Follow-up on #995, authors with duplicated names will generate the article list by author_id

* tweak the logic for edge cases: when author_id doesn't exist, use name instead

---------

Co-authored-by: tc <[email protected]>
@yufree
Copy link
Collaborator

yufree commented Apr 10, 2023

感谢 @CyrusYip !最终解决方案在 #1097,感谢 @tcgriffith

@yufree yufree closed this Apr 10, 2023
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.

4 participants