can I post a new article by programming
-
July 29, 2021 at 1:45 am #6067[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 ?
July 31, 2021 at 12:35 pm #6086[anonymous]Hi,
At this moment unfortunately there is no external API to use with Publii.
August 1, 2021 at 7:28 pm #6098[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.
August 2, 2021 at 8:21 am #6102[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 😉
August 2, 2021 at 8:32 am #6103[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.
August 2, 2021 at 8:48 am #6104[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.
August 4, 2021 at 4:54 pm #6119[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
August 4, 2021 at 5:06 pm #6120[anonymous]This is the case when the client cannot be opened. Refer to the picture
August 4, 2021 at 6:24 pm #6122[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.