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

feat: support creating collections #185

Open
Rotten-LKZ opened this issue Feb 18, 2023 · 12 comments
Open

feat: support creating collections #185

Rotten-LKZ opened this issue Feb 18, 2023 · 12 comments
Labels
enhancement New feature or request

Comments

@Rotten-LKZ
Copy link
Collaborator

Rotten-LKZ commented Feb 18, 2023

I always want to write a series of posts like serial novels, serial tutorials and so on. So maybe Valaxy can add a collection feature to put these posts together. The struction of collection is just like a novel, which has chapters (even has volumes). Here are some detailed functions I want:

  1. Put these posts in a folder and create a file like collection.yaml to config this collection.
  2. A collection belongs to the same category, which means all posts needn't require to set category, tags.

Next, I will talk about the functions above.

For the first function, the struction of posts folder is like this:
image
And when I create collection.yaml in a subdirectory of posts, I hope Valaxy can identify this folder as a collection and collection.yaml is like this:

name: 陷入爱情了
cover: https://cdn.yunyoujun.cn/img/bg/stars-timing-0-blur-30px.jpg
catagory:
  - 小说
  - 恋爱
tags:
  - 幻想时刻
  - 小说

Similarly, creating collection.md and put these settings in the frontmatter is okay.

For the second function, (the house icon means a collection)
image
image
image


Of course I can put serial posts in the same catagory, but every post is shown like this:
image
image
And the second thing is that a series of posts belongs to the same category and tags, so it is troublesome to set or modify category and tags for every post.


Well, in summary, collection feature is like this:
image

@YunYouJun
Copy link
Owner

YunYouJun commented Feb 18, 2023

通过文件夹结构(是否在一个文件夹下)或 collection.yaml 判断文件是否属于一个合集吗?而不书写 categories 是吗?

@YunYouJun
Copy link
Owner

对于用户来说,chapter-1 chapter-2 是在一个页面上会同时显示吗?

@YunYouJun YunYouJun added the enhancement New feature or request label Feb 18, 2023
@Rotten-LKZ
Copy link
Collaborator Author

通过文件夹结构(是否在一个文件夹下)或 collection.yaml 判断文件是否属于一个合集吗?而不书写 categories 是吗?

是的,就是通过类似于这样子的形式来判断是否属于一个合集,categories 书写进整个合集的配置当中,将整个合集分进同一个 categories。

@Rotten-LKZ
Copy link
Collaborator Author

对于用户来说,chapter-1 chapter-2 是在一个页面上会同时显示吗?

如果没有合集的话,chapter-1 chapter-2 会作为两个帖子在各个显示文章列表的页面上同时显示出来,我认为如果是那种系列文章没有必要全部显示出来,只需要作为一个合集显示就可以了。

@Rotten-LKZ
Copy link
Collaborator Author

Rotten-LKZ commented Feb 19, 2023

同时比如说对于合集的话可以在原先的 TOC 位置进行切换,选择现实本帖子目录或者合集帖子列表。其次就是单独写个页面展示合集内文章的界面。比如在 archive、categories、tags 这样子的页面可以只显示合集名称,点进去之后是合集里的帖子列表;在主页可以将最新帖子的标题、时间、相关概述进行显示,并且标注这是在合集中的帖子,然后点进这个帖子的时候直接跳转到此文章。

至于合集文章的排序我觉得可以按照最新更新时间或者用户在每个合集里的帖子的 frontmatter 自己定义 order。

@YunYouJun
Copy link
Owner

这仍然属于 posts 的一种形式吗?它在页面上的展示效果仍然与 posts 相同吗?是否应该以 /collections 作为一种新的页面形式?

@hairyf
Copy link
Contributor

hairyf commented Feb 20, 2023

wow,看起来不错,文章大多数都是有合集顺序的情况下,这意味着我不用在对一个合集中的每一个文章重复定义 categories 和 tags 了

image

@Rotten-LKZ
Copy link
Collaborator Author

wow,看起来不错,文章大多数都是有合集顺序的情况下,这意味着我不用在对一个合集中的每一个文章重复定义 categories 和 tags 了

image

对的,我想的就是类似这种感觉,这类文章是特别能形成一个系列的非常适合放到一个集合里。

@Rotten-LKZ
Copy link
Collaborator Author

这仍然属于 posts 的一种形式吗?它在页面上的展示效果仍然与 posts 相同吗?是否应该以 /collections 作为一种新的页面形式?

我认为除了在 aside 添加合集目录,其余的页面展示上没有什么区别。可以使用 /posts/<collection name>/<chaper name> 作为文章的链接。当然,/collections/<collection name>/<chaper name> 我认为也是可行的。

@YunYouJun
Copy link
Owner

我认为 /posts/collections 都是可行的,但单纯就开发实现上来说,我认为 /collections 更为便捷,因为它可以与 /posts 下的文件相区分,而避免处理一些边界情况,同时在开发阶段也能自由地移除或添加 feature,同时不影响正常用户。

@YunYouJun
Copy link
Owner

YunYouJun commented Feb 26, 2023

如果不存在必须放置于 /posts 下的理由,我认为我们可以先开始着手尝试 /collections 的实现。

当然,在此之前,我觉得需要询问是否存在一些反驳(放在 /collections)的理由。

@Rotten-LKZ
Copy link
Collaborator Author

我认为可以直接放在 /collections,若以后有需要再更改即可。

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

No branches or pull requests

3 participants