Download
We're evolving to serve you better! This current forum has transitioned to read-only mode. For new discussions, support, and engagement, we've moved to GitHub Discussions.

can I post a new article by programming

  • #6067
    Avatar photo[anonymous]

    I know Publii is a client for users,it’s very easy to use. but are there some advanced method for coder.

    I want to post a article by my program or script,are there has some api support it ?

    #6086
    Avatar photo[anonymous]

    Hi,

    At this moment unfortunately there is no external API to use with Publii.

    #6098
    Avatar photo[anonymous]

    All posts are stored in db.sqlite. You can create posts by entering them directly into the database (not officially supported, but it works for me 😉 )

    Unfortunately, an automatic (eg. from command-line) deploy is not an option. This would be very nice no have but I think it’s not a priority for our kind developers.

    #6102
    Avatar photo[anonymous]
    Tomasz Dziuda wrote:

    Hi,

    At this moment unfortunately there is no external API to use with Publii.

    Thanks for your answer,and Thanks for providing us the Publii software 😉

    #6103
    Avatar photo[anonymous]
    [anonymous] wrote:

    All posts are stored in db.sqlite. You can create posts by entering them directly into the database (not officially supported, but it works for me 😉 )

    Unfortunately, an automatic (eg. from command-line) deploy is not an option. This would be very nice no have but I think it’s not a priority for our kind developers.

    Thanks,I has found the db.sqlite,and I also see the db table in  db.sqlite.  Yet, I wasn’t sure whether inserting directly into the db.sqlite would succeed.

    if you already success,I think I maybe can success too. I will try it.

    #6104
    Avatar photo[anonymous]

    I do it because on some of my websites I publish huge amounts of information that are provided to me in the form of a database.

    The data model of Publii is very simple. Make a few posts, look at the database and replicate what Publii does using SQL.

    The only issue I ever had, was with empty fields. Not sure anymore what it was, but it had to do with filling them either with NULL or ” (empty string). If you get it wrong, the website will not generate.

    #6119
    Avatar photo[anonymous]
    [anonymous] wrote:

    I do it because on some of my websites I publish huge amounts of information that are provided to me in the form of a database.

    The data model of Publii is very simple. Make a few posts, look at the database and replicate what Publii does using SQL.

    The only issue I ever had, was with empty fields. Not sure anymore what it was, but it had to do with filling them either with NULL or ” (empty string). If you get it wrong, the website will not generate.

    After coding, I can insert articles into SQLite. When there are few articles, everything is normal. But when there are too many articles (I have inserted more than 15000 articles with the program), the client can’t open. I’m sure there’s no NULL in the database.

    I tried to reduce the number of articles to more than 3000, and deleted all tag associations. The client can barely open, but the page performance is very poor.

    I see that the article list in the client is not paged. Is it blocked because all the data is queried

    #6120
    Avatar photo[anonymous]

    This is the case when the client cannot be opened. Refer to the picture

    #6122
    Avatar photo[anonymous]

    Hi there,

    Been there, done that 🙂 Exactly the same happened to me. Creating too many posts will slow down the opening of the website to the point you think Publii is no longer responding. Deploying will take even longer.

    The developers helped me out and even rewrote parts of the code to improve the speed. I now have a website with 2141 posts which opens and deploys a bit slowly, but not too much.

    The first thing you should do, is edit your config.json file, and make these changes:

    • “createContentStructure”: false,
    • “renderSimilarPosts”: false,

    These are very costly processes that slow down your website incredibly. Try this and give it a shot. I imagine 15.000 posts will never be possible, but 3000 should be manageable.