Equivalent of `publish` command from Cobalt?

Hi there,

I’m in the process of migrating my blog from Cobalt to Zola and in my automated flow, I use cobalt publish to do:

  • set the draft state to false
  • set the publish date in frontmatter
  • change the filename to YYYY-MM-DD-slug.md
  • move the file from drafts to posts folder.

What is the Zola way to do at least the draft status change and the date operations (front + rename the .md file)?

Regards,

There isn’t a command for that, it needs to be done manually.
For my own workflow, I don’t use draft but do a PR on my site and just merge it when it’s ready after updating the date and netlify builds it automatically.

Ok thank you :slight_smile:

Would you accept the addition of such a feature in Zola? (If so, I volonteer to write it and do a PR for that)
Same for a permalink templating system to define where the files are going to in public.

To do something like, in a section _index.md:

page_path = "{{ year }}/{{ month }}"

will create for a post with a date 2019-10-24 public/2019/19/my_post/

For the command no. This is pretty niche and adding a new command (like zola check recently) needs to offer a strong value to every users and a publish command using drafts is not that.

For the url templating, there is Custom URL templates. · Issue #635 · getzola/zola · GitHub (google is much better at finding things than me :sweat_smile:). I personally don’t like it for the reasons mentioned in Custom URL templates. · Issue #635 · getzola/zola · GitHub to which I would add that it makes updating an article impossible (the url will still be the old one). I’m not 100% opposed to the idea of URL templates as some of them can be useful (eg {{date}}-report) but it would take some convincing.

Ok for the command, I’ll write some kind of wrapper in Rust (I have to write one anyway to replace my current messy mix of shell-script/awk that automate the scheduling of my posts).

For the URL, I’ll continue the discussion over there :slight_smile: