picocms / Pico

Pico is a stupidly simple, blazing fast, flat file CMS.
http://picocms.org/
MIT License
3.82k stars 616 forks source link

Step-by-step Blogging Guide #471

Closed loseth closed 5 years ago

loseth commented 5 years ago

This issue has been raised before (https://github.com/picocms/Pico/issues/204), but I don't feel that it has been resolved.

I've tried to follow the description in the documentation, but as someone with close to zero knowledge about PHP and Twig, it really isn't as simple as it is claimed.

I would suggest that one provides a fully implemented but bare bones blogging example in the documentation. It is much easier to tinker with something that actually works.

PhrozenByte commented 5 years ago

Our current blogging example is the most bare bone example I can think of. In fact, step 4 is no longer necessary since Pico 2.0. So, the only remaining step which requires Twig is step 3 - and this step already includes a fully working Twig snippet that just needs to be copied.

Thus I unfortunately can't really understand where any difficulties araise. Since there was some trouble using the "Clean Blog" theme before about this particular step, the only simplification I can think of is to no longer recommend creating a distinct Twig template for blog posts (blog-post.twig; step 2). Anyway, I'm not sure whether this is really an improvement; if a user missed this step it would have worked anyways, and users will likely need a distinct Twig template for blog posts later. I've updated the blogging example accordingly (removed steps 2 and 4, splitted step 3 in two steps), see cbed65c.

Anyway, if you want to create your own theme, you must learn Twig (no need to learn PHP though). There's no way around this, if you want to create something own, you'll have to learn how to do it. If you don't want to learn Twig you can use a third-party theme. There are quite a lot themes with blogging support out there (see http://picocms.org/themes/ and https://github.com/picocms/Pico/wiki/Pico-Themes). They often follow pretty different strategies to deal with blogging, there are many ways to do it.

loseth commented 5 years ago

Thank you for your reply, that did the trick. I'm trying out the clutter theme by the way, and perhaps my stumbling blocks will show where it might be better explained for a newbie.

First it was step 4 where the left side menu got mangled up, skipping that step fixed that. Then in step 3 what should be in the blog.twig file to begin with, this turned out to be just the same as in index.twig and blog-post.twig. And then where to insert the suggested code in blog.twig, and this should go right after this:

<main class="main-content">
    <article class="article">
        ...
        {{ content }}
    </article>

Thank you again, and for the updated documentation. And yes I will definitely find some time to learn Twig!

stale[bot] commented 5 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in two days if no further activity occurs. Thank you for your contributions! :+1: