Conversation
Also: the blog / list apps do not have a base_url, only the whole application
Produce working URLs whether the blog app route ends with `/` or not, through joining on `/` and doing `=~s{//}{/}r`
Discussion in preaction#585
Configurable in statocles.conf: - arguments to a yancy#list call: filter, order_by, limit, etc. - categories (and whether to make tags) - route Show two typical uses - a "blog" and a "list" in the default config The app produces a list of posts, and corresponds to a "list" template There's also a "page" template for a single page XXX t/theme.t starts failing
|
@preaction we were talking about this problem where a piece of content doesn't know which app it was linked from. I think the solution is to decide that an "app" is a list of posts built on a Yancy query, and tied to a route. It becomes quite configurable - choices like This PR breaks something with the themes: I can choose default or bootstrap, but seems necessary to fix the other tests. I can spend more time on finding out what it is, if you approve of the general direction. It's potentially questionable because it blocks a certain route for development. Statocles::App can make default categories from tags, and it can probably also handle a few other optional extras. However, it can't also be something completely different, like a Pod renderer. If a "blog" is just a Statocles::App with a suggested setup, the current Yancy schema for posts - saying that each |
|
|
||
| if ( my $theme = $app->config->{theme} ) { | ||
| do { | ||
| my $theme = $app->config->{theme} //= '+Statocles/theme/default'; |
There was a problem hiding this comment.
This helped with the unit tests, if it's a clue to why the tests are broken
There was a problem hiding this comment.
Hmm... Might be that the config_override in Test::Mojo doesn't work the way I assumed it did (which, I don't know why I assumed it would merge with the defaults, because the docs explicitly say it does not)...
There was a problem hiding this comment.
It merges with the default when making a statocles.conf, which could be added to each each share directory. Providing a hash to Test::Mojo makes a new config.
|
There are two application ideas that don't quite fit the model of a simple list.
Maybe the idea of having applications manage multiple different lists of data is the problem here: If an app only had one I would definitely be okay if Statocles::App was the generic content list app (so, Statocles::App::List is renamed to Statocles::App). A lot can be done with a simple list and a template, and it would provide some uniformity to the apps: Every app should define a I'll have to think about this, and maybe try out a couple options to see the pros/cons. If the configuration file gets too complicated, it'll be more difficult to manage / understand. But also maybe we don't need to optimize for sites with 40 different overlapping topics of content (https://mojolicious.io/blog/ has >50 tags by my count). (aside: "topic" is a shorter word than "category", and might better define what it's doing: collecting articles with similar subject matter) |
|
@preaction Search and calendar are very nice use cases: they can be generically added to anyone's blog. I think we can arrive at a design that handles them by leaning on the "categories/topics" that an app has. Each app has a filter: that's a bit like SQL's "where" clause. With more generic topics we would aim at something like a "group by" clause.
Here are some examples. The current categories correspond to something like below, where the bucket is made from a 'value', and '?' is replaced with it in the bound route for a bucket, like in a stored procedure or something: A similar one, for retrieving all posts from the same author: A calendar is a template would be using {text, href} assuming that the text field is a date, and be tasked with making a cool widget. The search index corresponds to a "topic" that puts everything in one bucket: To make the search functional, the template would call a helper and go through the A topic frequently corresponds to a widget in the sidebar: "Categories" and a list of tags, "Posted by" with all the authors, "Search" that searches, "Calendar" that lets you click on days and get posts from that day. However, I expect the functionality will show up throughout the layout: clicking on an author name and seeing their posts, or clicking a label #gardening to see all gardening posts. I don't know how I would translate "stored procedures" (SQL::Abstract queries with a "?" appearing) to actual code, and keeping |
|
This branch has a "posted on" and "tags" added to individual blog pages which is probably a patch more than a feature - added through "item-caption" etc. I should have probably done it separately, just now I've tried to make a post on my blog from a master branch, these were gone from posts, and I wondered why. |
No description provided.