Clean-blog theme not working as expected

PICOcms is a fantastic addition to NC. I currently use the default theme for the intranet in my small organisation. I found a very nice theme https://github.com/BesrourMS/clean-blog

I have installed it according to the instructions given in the app.
I have uploaded the clean-blog files to /var/nc_data/appdata_ocv8usaqvspv/cms_pico/themes/
I have uploaded the content to /var/nc_data/appdata_ocv8usaqvspv/cms_pico/templates/ I had to add an assts folder in the content to get it accepted.
I have uploaded the pagination plugin to /var/nc_data/appdata_ocv8usaqvspv/cms_pico/plugins/

I have activated the theme, template and plugin in the Administration/PicoCMS page. Everything is accepted OK.

I have created a new config.yml file at /var/nc_data/appdata_ocv8usaqvspv/cms_pico/config/config.yml
In that file I have edited the lines as described here [Beta] [Needs Testing] Pico CMS for Nextcloud v1.0.0

pages_order_by: date
pages_order: desc
PicoExcerpt.enabled: true
excerpt_length: 12

I have created the site (named Blog)
I have added the index.md and post.md to the content map in the “Files/Blog/” folder.

When I access the site I get the headline of the post. No text. I cannot get the index.md showing.

I wonder if Ithere is something missing like a twig-file or yml-file or _meta.md?

I appreciate any suggestions

clean-blog is known to be not the easiest theme to get working. It requires a pagination plugin, otherwise it shows no pages, and you must add Template: post to all your blog articles. However, you can still simply rewrite the theme to fit your needs.

I have installed and activated the pagination plugin.

And the blog articles have Template: post in the metaheader. The index has Template: index. Funny thing is that after adding a date to the index.md header I can access the text in the post.md when clickin on the first heading displayed. And the index heading is now visible placed below the post heading.

Any other proposed solution?

I have installed the defaault Pico CMS and it works well. I am trying to install the clean-blog theme. I have NC 17.0.1, Ubuntu 18.04 and nginx.

According to the instructions I have uploaded the new theme files to /var/nc_data/appdata_ocv8usaqvspv/cms_pico/themes/ , the new content files to /var/nc_data/appdata_ocv8usaqvspv/cms_pico/templates/ and the new plug in to /var/nc_data/appdata_ocv8usaqvspv/cms_pico/plugins/

I have made a config.yml from the template at ./var/nc_data/appdata_ocv8usaqvspv/cms_pico/config/config.yml.template

I then add these new variables from the Pico CMS setup in NC. I construct the new site with no issues. I find a folder for the new site and its content and assets folder among the files. I put the example content for the new theme in them.
When I access the new site it is not working as it should - see previous post.

For the troubleshooting I look at the folder structure. I find the folders for the active plugins and my themes (default and new) in folders under ./var/www/nextcloud/apps/cms_pico/appdata_public/

But the revised config.yml is still in the original place at /var/nc_data/appdata_ocv8usaqvspv/cms_pico/config/config.yml.

I find two other config.yml.templates in
./var/www/nextcloud/apps/cms_pico/vendor/picocms/pico/config/config.yml.template
./var/www/nextcloud/apps/cms_pico/appdata/config/config.yml.template

I also find that the default theme has a Pico-default.yml file.
My question is about the new config.yml file. Is it correct it should stay under the nc_data folders? Or should I create a clean-blog.yml somewhere? Or do I need to make changes to the nginx

Yeah, clean-blog is a bit… unhandy. I highly recommend editing the theme to fit your needs, like removing the use of paged_pages (i.e. the pagination plugin) if you don’t need pagination, replacing the use of auto-generated excerpts by meta.description, etc.

The “right” config.yml to edit is /var/nc_data/appdata_ocv8usaqvspv/cms_pico/config/config.yml. All other files can be ignored, you don’t need those.

Thanks

I tried the default-blog instead of the clean-blog.

Followed the instructions and activated the theme and the template. Created the site - When I access the site I get

nternal Server Error

The file and directory structure of this website appears to be broken and thus could not be accessed.

I do not get these error for the default or clean-blog theme. I see no evident error.

Please provide the full stack trace of the exception (check NC’s log).

I was too fast.

The first phase works OK, ie there is a Blog alternative in the menu. Click on that - the healdines of the two new blogposts are shown. Click on the forst blogpost headline and I get the error

In the logs I get

|Error|cms_pico|OCA\CMSPico\Exceptions\PicoRuntimeException: Unable to find template “post.twig” (looked into: /var/www/nextcloud/apps/cms_pico/appdata_public/themes/pEfU1v8QMF/default).

  1. /var/www/nextcloud/apps/cms_pico/lib/Service/WebsitesService.php - line 282:OCA\CMSPico\Service\PicoService->getPage(OCA\CMSPico\Model\Website {})
  2. /var/www/nextcloud/apps/cms_pico/lib/Controller/PicoController.php - line 108:OCA\CMSPico\Service\WebsitesService->getPage(“gemenskap”, “blog/firstpost”, “NCadmin”, false)
  3. /var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php - line 170:OCA\CMSPico\Controller\PicoController->getPage(“gemenskap”, “blog/firstpost”, false)
  4. /var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php - line 99:OC\AppFramework\Http\Dispatcher->executeController(OCA\CMSPico\ … {}, “getPage”)
  5. /var/www/nextcloud/lib/private/AppFramework/App.php - line 126:OC\AppFramework\Http\Dispatcher->dispatch(OCA\CMSPico\ … {}, “getPage”)
  6. /var/www/nextcloud/lib/private/AppFramework/Routing/RouteActionHandler.php - line 47:OC\AppFramework\App::main(“OCA\CMSPic … r”, “getPage”, OC\AppFramew … {}, { page: "blo … "})
  7. <>OC\AppFramework\Routing\RouteActionHandler->__invoke({ page: "blo … "})
  8. /var/www/nextcloud/lib/private/Route/Router.php - line 297:call_user_func(OC\AppFramew … {}, { page: "blo … "})
  9. /var/www/nextcloud/lib/base.php - line 1000:OC\Route\Router->match("/apps/cms_p … t")
  10. /var/www/nextcloud/index.php - line 42:OC::handleRequest()|
    | — | — |

I see it is looking for post.twig. I had a post.twig in the pico-blog-theme-master but I have removed that theme. Maybe there are some traces left somewhere?
There is no mention of post.twig in the “Welcome” description of the Blogging alternative

I added the post.twig found in the pico-blog-theme-master, and now ther is no error but the page is not well shown. The post.twig file needs some editing.

I solved it. Copied blog-index.twig to post.twig

Nope - did not. It worked, but when I tried to fix the navigation issue as above I once again get I get the Internal server error. Now this log:

[cms_pico] Error: OCA\CMSPico\Exceptions\PicoRuntimeException: Unexpected end of template. at <>

  1. /var/www/nextcloud/apps/cms_pico/lib/Service/WebsitesService.php line 282
    OCA\CMSPico\Service\PicoService->getPage(OCA\CMSPico\Model\Website {})
  2. /var/www/nextcloud/apps/cms_pico/lib/Controller/PicoController.php line 108
    OCA\CMSPico\Service\WebsitesService->getPage(“gemenskap”, “blog”, “NCadmin”, false)
  3. /var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php line 170
    OCA\CMSPico\Controller\PicoController->getPage(“gemenskap”, “blog”, false)
  4. /var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php line 99
    OC\AppFramework\Http\Dispatcher->executeController(OCA\CMSPico\Controller\PicoController {}, “getPage”)
  5. /var/www/nextcloud/lib/private/AppFramework/App.php line 126
    OC\AppFramework\Http\Dispatcher->dispatch(OCA\CMSPico\Controller\PicoController {}, “getPage”)
  6. /var/www/nextcloud/lib/private/AppFramework/Routing/RouteActionHandler.php line 47
    OC\AppFramework\App::main(“OCA\CMSPico\C … r”, “getPage”, OC\AppFramework\ … {}, {page: “blog”,si … "})
  7. <>
    OC\AppFramework\Routing\RouteActionHandler->__invoke({page: “blog”,si … "})
  8. /var/www/nextcloud/lib/private/Route/Router.php line 297
    undefinedundefinedcall_user_func(OC\AppFramework\ … {}, {page: “blog”,si … "})
  9. /var/www/nextcloud/lib/base.php line 1000
    OC\Route\Router->match("/apps/cms_pico/pico/gemenskap/blog")
  10. /var/www/nextcloud/index.php line 42
    OC::handleRequest()

GET /apps/cms_pico/pico/gemenskap/blog
from 192.168.1.1 by NCadmin at 2019-12-07T14:44:39+01:00

I’m new to PicoCMS but looks like Clean-blog is working for me (NextclouPi 17 -Apache)
But i can’t figure how to link the “Post” header image to a .JPG in the Assets folder.

(post.md for exemple)

---
Title: Man must explore, and this is exploration at its greatest
Description: Problems look mighty small from 150 miles up
Date: 11 June 2016
Author: Mohamed Safouan Besrour
Profile: http://besrourms.github.io
Img: https://unsplash.it/1200/628?image=1075
Template: post
---

As we can’t use external https image links in Nextcloud for security, using:
img: /apps/cms_pico/appdata_public/themes/ksEPFJC9We/clean-blog/img/post-bg.jpg
is working but it would be more convenient if i could link an image from the user Assets folder.

i’ve tried:
img: ![Image Title](%assets_url%/image.png)
but it’s not working in the “YAML header” (i’m probably wrong formating)

The theme looks great but not very easy to customize “socials” or “Menu” (for a noob like me).
i still need to learn more about customizing “twig” etc…

You have an syntax error in your Twig template. Check that you’ve closed all {% if %}, {% for %}, etc.

AFAIK clean-blog doesn’t use Pico’s new url Twig filter, thus %assets_url% isn’t interpreted in the theme’s meta header. You can either add the url Twig filter to the theme yourself (btw: it’s Img: %assets_url%/image.png then) or you must use full URLs like Img: /index.php/apps/cms_pico/pico/example_site/assets/image.png

1 Like

Correct. Had lost the last {% endfor %} of the insert as described in the Welcome.
Now it works.
I am also thinking about if it is possible to add a picture to the meta-header for the blog-post.
In the clean-blog post.twig I see

and in the meta-head of the blogpost there is
Img: https://unsplash.it/1200/628?image=1075
Can I do something similar with the default blog?

Ahoj rollanders and PhrozenByte,

sorry to warm this up again, but could you tell me what was the outcome of your efforts in the end? Did you stick with “default-blog”?
I wanted to install a theme for a blog (pagination is very useful) and tried “clean-blog”, without success so far.
Is it feasible at all, @PhrozenByte, or simply not functional with the current versions?

The idea of integrating a light-weight cms with nc is really great, first steps a charm, but then the themes-ecosystem of pico is a little bit unclear and not easy to handle.

thanks a lot for this thread!

Support for 3rd-party themes (and plugins - i.e. the whole “Pico ecosystem”, not just the official plugins and themes) is out of what I can manage, sorry :cry: Time is very limited and I’m developing both Pico and Pico CMS for Nextcloud basically all by myself in my free time. I try to help whenever possible, but in the end clean-blog was made by a 3rd-party developer.

clean-blog has various known issues, none of them is Pico’s fault. In Pico there are always several ways to realize something - and clean-blog chose some clumsy solutions. In general the clean-blog theme should work with Pico CMS for Nextcloud. However, you’ll have to strictly follow the instructions and also change a few bits since Pico CMS for Nextcloud is stricter than Pico due to security reasons (like not allowing users to embed active content from different servers).

It seems like the developer of clean-blog abandoned the project. But it’s open-source after all, so forking and fixing it is very welcome - I’m very happy to add the theme’s new home to Pico’s website.

1 Like

Thanks for your quick response, and in no way I wanted you to burden with supporting themes. I just wanted your educated opinion if I am more or less at a dead end with the current clean-blog when I am not able to deep-dive into the technology, which I am more or less convinced now. :slight_smile:

I just chose clean-blog because it’s ranked 1st place as a blog theme for pico, and it seems to be the only one with pagination (i consider this a must for a blog, no?).

You’re absolutely right that improving it would be the most favorable way to go, but I am not sure if it’s good for a beginner to start with a source that has design flaws; not sure if I am able to detect those and learn wrong things instead.
Anyway, I think I’ll give it a try! :wink:

1 Like

Can anybody explain how to put images from Nextcloud into the posts of clean-blog theme? I mean not in the top of the page, but inside the text.

When I put something like IMG_6577 I can see only text string IMG_6577