zola icon indicating copy to clipboard operation
zola copied to clipboard

zola init shoud prefill basic example template

Open Rinkana opened this issue 4 years ago • 9 comments

During my startup with Zola i found it hard to get a good gripe with how this (or any) static site generator works. The docs are fairly complete but lack a "hand holding session" which guides you trough your first template setup.

There have been some earlier issues made (#534 , #466) but they focus on the docs side of things and what i found when i ran zola init was a bunch of empty directories. And the current docs are imo a better reference for when you have a basic setup.

So what i'd like to propose is to prepopulate the directories with a super basic template setup:

  • /sass
    • main.scss with a simple head styling setup
  • /static
    • Zola logo image
  • /content
    • index.md with some markdown examples and links to the docs
  • /templates
    • index.html with:
      • Logo from /static
      • css include from /sass
      • content block render
  • /themes
    • .keep so git won't remove this directory

During my setup i found this very useful: https://github.com/getzola/zola/issues/534#issuecomment-551065726 so we might simplify and edit this setup.

This would be a very basic example but we can incorporate some best practices too like presetting some meta tags.

I think this would help newcomers a fair bit. And maybe ask if this should be done during the init.

P.s. additionally asking if git should be initialized might also be an good idea

Rinkana avatar Mar 03 '20 08:03 Rinkana

Note that the docs now have a quickstart section: https://www.getzola.org/documentation/getting-started/overview/ Overview might be a bad name for it though. The issue I have with putting some files in zola init is that right now if you do zola serve you get some indications on what to do to proceed. We could have the same in a template/markdown but I am not really sure how to organise that.

Keats avatar Mar 03 '20 09:03 Keats

The getting-started page is indeed very helpful to start. But currently when you do zola init you'll get just a bunch of empty folders. And even some basic setup files (like what you get when you run zola serve) would be helpful. Even if just to browse trough and not to have the getting-started page side-by-side

Rinkana avatar Mar 03 '20 13:03 Rinkana

can we get hugo like experience for creating new posts by using cli. like zola new --post hello.md

vvsubash avatar Mar 05 '20 12:03 vvsubash

zola new --post hello.md is not going to happen

Keats avatar Mar 05 '20 14:03 Keats

sorry, What can we do to make it happen.

vvsubash avatar Mar 13 '20 15:03 vvsubash

You can probably write a Makefile for that but let's not derail the issue. This isn't about zola new

Keats avatar Mar 14 '20 08:03 Keats

Thanks for reply

vvsubash avatar Mar 14 '20 15:03 vvsubash

I think an example website to walkthrough might be helpful to solve this problem — even though it was in the documentation, it took me a while to figure out how to generate a list of all of my posts — I feel like an example site that I could poke around in would have been helpful

Sent with GitHawk

jasikpark avatar Mar 15 '20 16:03 jasikpark

How about this one: https://github.com/emdete/zolaschool - i just wrote down what i did to get an understanding of zola :)

emdete avatar Feb 22 '22 15:02 emdete

I want to echo the original request to pre-fill the basic example when running zola init.

I would be perfectly happy with the most basic *.html and _index.md files that are described in this awesome document. https://www.getzola.org/documentation/getting-started/overview/#initialize-site

I think it will help adoption because it will enable newcomers like me to start adding my content and seeing on my localhost'ed version (thanks for the awesome zola serve)

petr-tik avatar Jul 15 '23 13:07 petr-tik

Ideally the default template should have show the template needed for rendering each page

Keats avatar Jul 15 '23 20:07 Keats