Skip to content
This repository has been archived by the owner on Mar 1, 2022. It is now read-only.

Failed to generate blog.html #1

Closed
glasslion opened this issue Mar 6, 2014 · 13 comments
Closed

Failed to generate blog.html #1

glasslion opened this issue Mar 6, 2014 · 13 comments

Comments

@glasslion
Copy link

Your theme is awesome, thanks for sharing it.

However I failed to generate the blog.html. It doesn't exist in the output directory. index2.html index3.html ... exist and I think they should not.

Maybe I need to setup something in my pelicanconf.py but I am not sure which variables I need to set.

I tried to add 'blog' to DIRECT_TEMPLATES, then I got "CRITICAL: slice indices must be integers or None or have an index method".

@glasslion
Copy link
Author

I figured it out. After I add the following settings to my pelicanconf.py, it works, cool!

DIRECT_TEMPLATES = ('index', 'tags', 'categories', 'archives', 'blog')
PAGINATED_DIRECT_TEMPLATES = ('blog-index',)
POST_LIMIT=10

@KenMercusLai
Copy link
Owner

看了你的个人信息,但是考虑到可能有非中文技能的人看,所以我还是用英语吧

I'm seriously considering writing a readme file for the theme. =_=

There are two things have to be set in the pelicanconf.py for correctly generate the output file.

  • add the below line in the file if you don't have set TEMPLATE_PAGES, or just add blog.html into it
TEMPLATE_PAGES = {'blog.html': 'blog.html'}
  • I think this is a little tricky because the official document haven't mentioned about this. I figured it out after reading the source code. Add these two line into your config file, or just put the content into the config line.
PAGINATED_DIRECT_TEMPLATES = ('blog-index',)
DIRECT_TEMPLATES = ('categories', 'index', 'blog-index', 'blog')

Also, I have to mention that the blog-index is for the index file for your blog, and will be loaded by ajax to reduce the init load time in plan.

Since I'm suck at using git, I cannot find out a proper work flow for creating the pull request, I won't pull the theme into upstream until I figure it out.

多谢关注!!我也考虑要写个README了。

@KenMercusLai
Copy link
Owner

=_=

@aschilling
Copy link

Hi,

I would like to congratulate you also for this awesome theme. Unfortunately, I have similar issues getting the blog.html page working. In particular, I get two issues when I follow your recommendations:

  1. when calling the pelican commad I get the error message:
    "CRITICAL: slice indices must be integers or None or have an index method"

  2. Despite this error message pelican compiles the sites, but the layout seems somehow broken, after some looking around in the source code I found that in the header of the pages are still these two links:

<link type="text/css" rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.1.0/css/bootstrap.min.css"></link>
<link rel="stylesheet" href="//netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.css"></link>

How can I reconfigure the paths of these two links?

I would really appreciate appreciate your help with these issues.

Cheers

Andy

@KenMercusLai
Copy link
Owner

Hi, Andy,

I cannot recreate the first problem

and if you are not able to connect to bootstrapcdn. you can google these two files and find other hosts, or you can download them and upload somewhere. them point the link to them.

@rawrgulmuffins
Copy link
Contributor

Ran into this problem as well. Using python 3.4, pelican 3.5.

my pelicanconf.py needed

DIRECT_TEMPLATES = ('index', 'tags', 'categories', 'archives', 'blog')
TEMPLATE_PAGES = {'blog.html': 'blog.html'}
POST_LIMIT=10

@KenMercusLai
Copy link
Owner

dude, you forgot this:

PAGINATED_DIRECT_TEMPLATES = ('blog-index',)

@rawrgulmuffins
Copy link
Contributor

If i add PAGINATED_DIRECT_TEMPLATES = ('blog-index',) I receive the error CRITICAL: 'articles_page' is undefined.

@KenMercusLai
Copy link
Owner

DIRECT_TEMPLATES = ('categories', 'index', 'blog-index', 'blog')

missed blog-index in it?

@rawrgulmuffins
Copy link
Contributor

On a fresh clone of the template if I use this configuration

# These need to be here in order to use the BT3-Flat theme
DIRECT_TEMPLATES = ('index', 'tags', 'categories', 'blog-index', 'archives', 'blog')
TEMPLATE_PAGES = {'blog.html': 'blog.html'}
POST_LIMIT=10

gets me

$ pelican content/
CRITICAL: 'articles_page' is undefined

I made a fresh clone from the repository to make sure, here's a tree of my clone just in case.

BT3-Flat/
├── README.md
├── static
│   ├── css
│   │   ├── blog.css
│   │   ├── font-awesome.css
│   │   ├── framework.css
│   │   ├── jquery.mglass.css
│   │   ├── layout.css
│   │   ├── linecons.css
│   │   ├── magnific-popup.css
│   │   ├── owl.carousel.css
│   │   ├── pygment-solarized-dark.css
│   │   ├── pygment-solarized-light.css
│   │   ├── reset.css
│   │   ├── superslides.css
│   │   └── typography.css
│   ├── img
│   │   ├── 1x1.png
│   │   ├── down_alternate.png
│   │   ├── loading.gif
│   │   └── magnifier.png
│   └── js
│       ├── application.js
│       ├── holder.js
│       ├── ImageAutoResize.js
│       ├── jquery.appear.js
│       ├── jquery.carouFredSel-6.2.1-packed.js
│       ├── jquery.countTo.js
│       ├── jquery.fitvids.min.js
│       ├── jquery.isotope.js
│       ├── jquery.magnific-popup.min.js
│       ├── jquery.mglass.js
│       ├── jquery.superslides.min.js
│       ├── masonry.js
│       ├── modernizr.min.js
│       ├── owl.carousel.min.js
│       └── scripts.js
└── templates
    ├── article.html
    ├── blog_base.html
    ├── blog.html
    ├── blog-index.html
    ├── category.html
    ├── _includes
    │   ├── footer.html
    │   ├── header.html
    │   ├── nav.html
    │   └── share_post.html
    ├── index.html
    ├── macros.html
    ├── page.html
    ├── pagination.html
    └── tag.html

@KenMercusLai
Copy link
Owner

This is kind of weird, I've checked the config from a fresh clone of the template and everything looked good.

How about using my config example in README & see what's the result? @rawrgulmuffins

@KenMercusLai KenMercusLai reopened this Jan 3, 2015
@rawrgulmuffins
Copy link
Contributor

I'm a bad person but I fixed this somehow and didn't report it. =(

I'll try to spend some time re-tracing my tracks.

@KenMercusLai
Copy link
Owner

we all sometimes forgot something ^_^

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants