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

File-based categories #19

Open
freetonik opened this issue Nov 4, 2019 · 7 comments
Open

File-based categories #19

freetonik opened this issue Nov 4, 2019 · 7 comments
Labels
idea Idea or a discussion

Comments

@freetonik
Copy link
Owner

I received the following comment:

f “no front matter” is a hard design goal, it may be tricky to apply that idea to underblog. But, maybe there are other “natural” metadata sources one can use instead? Random idea: put a page in a subdirectory to set its category, and symlink it to other subdirectories to add secondary categories.

This is very interesting and I think it does fit the philosophy of underblog. Categories are optional and by default you won't even know they exist. But if you need them, they exist transparently in the file system (just like dates and slugs do).

What do you think? @egregors @longdog

@freetonik freetonik added the idea Idea or a discussion label Nov 4, 2019
@dmbaturin
Copy link

There are some portability consideration to address of course. On POSIX-compatible systems it's not a concern, but does git support NTFS symlinks for example? I suppose it should, but it's worth a check.

@bryfry
Copy link

bryfry commented Nov 4, 2019

One potential implementation could simply be to make the markdown folder recursive. Any folders inside there and any markdown files get rendered at the corresponding path. This allows symlinks, directory structures, and any other related idea to be implemented via the filesystem.

Index generation would need updated to incorporate pointing to both posts and paths. Each folder would have an index listing it's containing posts and paths. I think that would be recursively scalable and more importantly predictable. This would also work without any prescription of paths for where markdown files should live if you want to group them, or what reason you want to group them.

@longdog
Copy link
Contributor

longdog commented Nov 5, 2019

If you need the categories, it's probably best way - the OS directories are categories as they are
But I think, a title, publication date (blog is a diary, right?) and directly post text is enough to describe post. And any synthetic taxonomies, like tags and categories are primarily for SEO.

@dmbaturin
Copy link

@longdog I completely disagree. "Synthetic" taxonomies can very useful for readers. Suppose Dr. John Doe posts about category theory and baking. Suppose you are interested in baking but not in category theory. With a synthetic taxonomy, you can go to https://example.edu/~jdoe/blog/baking and read it all. Else you'd have to fish those posts out of a feed that mostly consists of posts you are not interested in.

The issue is even more apparent with people who maintain multiple projects that are not big enough to warrant their own blogs, and you are only interested in some of them.

@longdog
Copy link
Contributor

longdog commented Nov 5, 2019

@dmbaturin maybe you're right, categories as a primitive recommendation and search system

@longdog
Copy link
Contributor

longdog commented Nov 6, 2019

@freetonik check my simple implementation https://github.com/longdog/underblog/tree/categories

@tyeeman
Copy link

tyeeman commented Mar 20, 2022

@longdog I downloaded your mod, how do I use categories?

Update - OK, found your examples and used them. Ran build and got this error -

2022/03/19 21:19:18 can't execute template: template: post.html:14:24: executing "post.html" at <.Ca
ts>: can't evaluate field Cats in type *cmd.Post

Anything come to mind. I'm on Windows.

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

No branches or pull requests

5 participants