Sign in

Clarification on adding a post style

  • This topic has 12 replies, 4 voices, and was last updated 2 years, 6 months ago by .
Viewing 13 posts - 1 through 13 (of 13 total)
  • Author
    Posts
  • #2945
    Avatar photoJOduMonT

    I started to being conformable to override theme

    and injecting custom CSS/JS/HTML codes directly in ./input/config/

    but I didn’t succeed to add a new post style as described here https://getpublii.com/dev/how-to-create-custom-templates/#js-header

    I add this in config.json file of my simple-override folder

    },
    "postTemplates": {
    "services": "Human readable template name"
    }

    and simply copy post.hbs from the simple folder to simple-override/post-services.hbs

    so now when I write a new post I see the Other options and Post Template
    but the dropdown menu is gray and say Not available in your theme.
    #3007
    Avatar photoTomasz Dziuda

    Hi,

    It seems that config.json override is not supported :/ I will add it in v.0.37 release which will be focused on the theme development improvements.

    --
    Do you appreciate the support you've received today? If so, consider donating to the Publii team by clicking here; we'll be sure to use your donation to make Publii even better!

    #4557
    Avatar photoSzymon Koscielniak

    I generally tried to just add a new post template without overrides, following same tutorial
    https://getpublii.com/dev/how-to-create-custom-templates/#js-header

    But also just see a grayed out dropdown.

    I added a post-services.hbs file (it just just a copy of post.hbs with changed name)

    Publii/app/default-files/default-themes/simple/post-services.hbs

    And then I have edited

    Publii/app/default-files/default-themes/simple/config.json

    and added

    "postTemplates": {
         "services": "Human readable template name"
    },

    but with not success.. another try was to add this code also to

    Publii/app/default-files/theme-files/config.json

    but no success either.

    Am I missing something?

    #4558
    Avatar photoBob

    Publii/app/default-files/default-themes/simple/post-services.hbs – it’s wrong file location.

    You should work in this area: Documents ▸ ⁨Publii⁩ ▸ ⁨sites⁩ ▸ ⁨YOUR_SITE ▸ ⁨input⁩ ▸ ⁨themes⁩ ▸ ⁨YOUR_THEME

    --
    Do you appreciate the support you've received today? If so, consider donating to the Publii team by clicking here; we'll be sure to use your donation to make Publii even better!

    #4560
    Avatar photoSzymon Koscielniak

    Hmm.. I tried it and still no success… or at least partially..
    I found out one thing – when I run Publi over npm run dev and then npm run build the options are there. But if I used a precompiled application the options are not visible… Might it be it has something to do with caching?

    #4561
    Avatar photoBob

    By default, both versions use the same site files. Are you sure you have made changes to both files in this location: Documents ▸ ⁨Publii⁩ ▸ ⁨sites⁩ ▸ ⁨YOUR_SITE ▸ ⁨input⁩ ▸ ⁨themes⁩ ▸ ⁨YOUR_THEME ?

    If yes, please attach your website backup here (Private Reply).

    --
    Do you appreciate the support you've received today? If so, consider donating to the Publii team by clicking here; we'll be sure to use your donation to make Publii even better!

    #4562
    Avatar photoSzymon Koscielniak
    This reply has been marked as private.
    #4564
    Avatar photoBob
    This reply has been marked as private.
    #4574
    Avatar photoSzymon Koscielniak

    Answer is not visible 🙁

    #4575
    Avatar photoBob

    Something is wrong with your site, many files are missing, after importing to Publi it doesn’t work. It will take some time to figure out why and what is happening, so I really don’t have time for that. Send me the mentioned by you in the previous message input folder instead of a corrupted backup.

    --
    Do you appreciate the support you've received today? If so, consider donating to the Publii team by clicking here; we'll be sure to use your donation to make Publii even better!

    #4576
    Avatar photoSzymon Koscielniak

    I just checked and have set setting in App Settings ▸  Files Location ▸  Sites Location back to default.
    With this done, everything works as expected.

    It looks like there is something wrong when having the sites in different location. I will investigate a bit more in the code today and keep You updated Bob.

    #4584
    Avatar photoSzymon Koscielniak

    Found out the reason, I edited the
    Documents ▸ Publii configapp-config.json manually (reason for that was a broken app (path I wanted to change to was somehow wrong initially and Publii was crashing).

    The fact that it was a manual change is causing Publii to not run a lot of important file operations.
    I have re-saved the path from Publii directly and my settings as well as as filesystem is fixed now.

    And adding template files works as well now!

    #4585
    Avatar photoBob

    Good news.

    --
    Do you appreciate the support you've received today? If so, consider donating to the Publii team by clicking here; we'll be sure to use your donation to make Publii even better!

Viewing 13 posts - 1 through 13 (of 13 total)
  • The topic ‘Clarification on adding a post style’ is closed to new replies.