getpelican / pelican

Static site generator that supports Markdown and reST syntax. Powered by Python.
https://getpelican.com
GNU Affero General Public License v3.0
12.58k stars 1.81k forks source link

Add use case of pelican as general static site generator #1065

Open diimpp opened 11 years ago

diimpp commented 11 years ago

It can be done by moving pages to / and articels to /blog

Here is a example configuration.

ARTICLE_DIR = 'blog'
ARTICLE_URL = 'blog/{slug}.html'
ARTICLE_SAVE_AS = 'blog/{slug}.html'
PAGE_DIR = 'pages'
PAGE_URL = '{slug}.html'
PAGE_SAVE_AS = '{slug}.html'
AUTHOR_SAVE_AS = False
CATEGORY_SAVE_AS = 'blog/category/{slug}.html'
CATEGORY_URL = 'blog/category/{slug}.html'
TAG_SAVE_AS = 'blog/tag/{slug}.html'
TAG_URL = 'blog/tag/{slug}.html'
DIRECT_TEMPLATES = (('index', 'blog/tags', 'blog/categories', 'blog/archives', 'blog/index'))
PAGINATED_DIRECT_TEMPLATES = (('index', 'blog/index', ))

Details can be found in first comment to this post http://stackful-dev.com/static-site-jinja-pelican-shared-templates.html

talha131 commented 11 years ago

I think, merged patch bfa8c74 addresses this issue partly.

justinmayer commented 10 years ago

See also: https://github.com/cocodelabs/cocode.org/issues/6

foresto commented 9 years ago

Pelican really is shaping up into a decent general-purpose site generator. I suspect more people would choose it if features useful for creating/migrating non-blog sites were more obvious to newcomers. For example:

Most of this stuff can be discovered if someone is willing to invest a bunch of time carefully reading the docs and experimenting, but someone who just wants a convenient website generator is more likely to see Pelican as a blogger's tool and move on to something else. That's a pity, because Pelican is definitely capable of more if configured with the right combination of settings.

Perhaps a sensible start toward addressing the issue would be to give the Tutorials page some sample configurations specifically tailored to non-blog sites, and highlight them in the documentation. Once the most common/popular use cases are identified and refined, one or two of them could be added to pelican-quickstart. I think this would go a long way toward turning such sites into first-class citizens. (Or from another perspective, turning Pelican into a first-class tool for such sites.)

iKevinY commented 9 years ago

Great points, @foresto. Adding onto your point about expanding the documentation, perhaps the Quickstart should describe the process for quickstarting a simple static site as well as quickstarting a blog? Also, it might be beneficial for the Pelican homepage to explicitly state the fact that it is usable as a general-purpose static site generator as well as a blogging tool, in order to clear up the potential misconception that Pelican is only good for blogging sooner rather than later.

asmaier commented 9 years ago

I completely agree with @foresto . In addition to documentation I would suggest to add another pelican-quickstart script creating a base project using the defaults as shown by @diimpp . This would help a lot of people for which a blog is just of secondary interest for their website. It would also prevent people from being forced to create their own website generators for this purpose (see e.g. http://www.jandecaluwe.com/blog/i-dont-like-blogs.html) and simply use pelican instead.

naturallymitchell commented 8 years ago

static site generation infographic

leotrs commented 8 years ago

What's the state of this? I was recommended pelican by friends and they outright told me it not only works for blogs. It's worked brilliantly up to now, but I agree a bit more documentation could be in order. I think adding diimpp's defaults to the faq would be enough.

leotrs commented 8 years ago

@justinmayer Maybe we can add this to the next milestone. It's no longer an issue, we just need docs.

justinmayer commented 8 years ago

@leotrs: I'm open to including this in the next release, but I'd prefer to add it once someone has submitted a pull request that implements it. (^_^)

leotrs commented 8 years ago

I was under the impression this can already be achieved and we are only in need of documentation. I use pelican for non-blog static site with perfect results.

pjz commented 7 years ago

FYI http://stackful-dev.com/static-site-jinja-pelican-shared-templates.html is a dead site - is there another/better/different HOWTO ?

cjer commented 6 years ago

Is there any documented progress here or some examples? I have a running blog using pelican, but would like to use pelican for another non-blog static site.

cjer commented 6 years ago

and @pjz you can always turn to the Internet Archive for rescue: https://web.archive.org/web/20160126144309/http://stackful-dev.com/static-site-jinja-pelican-shared-templates.html

mosra commented 6 years ago

@cjer I'm using pelican to generate primarily static sites, with a blog being just an optional part. Frankly I didn't have any problems or wasn't missing documentation on how to achieve that, it's just about adapting the SAVE_AS / URL settings and overriding index.html with a dedicated page. If that helps you in any way, this is one such site and this is the corresponding configuration and setup.

wumpus commented 3 years ago

I'm here because I looked through all of the pelican-templates and 100% of them were blogs. So I suppose I'm here to vote for making non-blog usage prominent in the existing docs. For example the FAQ has one question about it, with an answer much less interesting than the discussion here.