Pelican book theme

I am trying to convert a CMS page to Pelican. My page is devoted to a technical topic in the form of a book (for example, for example, a textbook / book about HTML). It seems that all static site generators are focused on blogs. Therefore, most of the topics I found just make a kind of blog layout.

Can someone point me to a topic more suitable for a book with sections and sections? Ideally, I like to see the structure of the content in some tree in the sidebar. Also, I'm wondering how to link specific pages so that the reader can jump from section to section.

+5
source share
1 answer

I would recommend the "Elegant" theme , it has the flexibility you are looking for (there is a good example on their homepage that you mention).

As you structure your Pelican site, you probably want to completely ignore the functionality of the Pelican blog and create your book content as a bunch of static pages. If all of your pages contain markup information, you can do something similar in your pelican sites directory:

pelicanconf.py content/ i_am_a_blog_post.md pages/ book_index.md chapter1.md chapter2.md chapter3.md 

Then (this is the key to the ability to transfer links to various materials in the book), you specify the output location of the files book_index.md , chapter1.md , etc., using the chapter1.md meta tag. So, for example, book_index.md will contain:

 Title: Book Index save_as: book_index/index.html Here is the index for my book: * [Chapter 1]({{ SITEURL }}/chapter1/) * [Chapter 2]({{ SITEURL }}/chapter2/) * [Chapter 3]({{ SITEURL }}/chapter3/) 

and chapter1.md will contain save_as: chapter1/index.html , etc. etc. Now, when you visit your Pelican website, you can add "book_index /" to the end of the URL and it will automatically take you to your book index page - which is convenient for you can still be written to Markdown.

0
source

Source: https://habr.com/ru/post/1203158/


All Articles