lumeland / base-blog

A template repository to build a blog with Lume static site generator
https://lumeland.github.io/base-blog/
97 stars 13 forks source link

New Install #4

Closed jppope closed 2 years ago

jppope commented 2 years ago

Hi there!

I just did a fresh install of the base-blog and received this error:


Error: Error rendering this page
page: /index.njk

  Template render error: (/Users/Pope/Code/StormCloud/index.njk)
  Template render error: (/Users/Pope/Code/StormCloud/_includes/templates/postslist.njk) [Line 16, Column 29]
  Error: Unable to call `search["page"]`, which is undefined or falsey
  Template render error: (/Users/Pope/Code/StormCloud/_includes/templates/postslist.njk) [Line 16, Column 29]
  Error: Unable to call `search["page"]`, which is undefined or falsey
  at Module._prettifyError (https://deno.land/x/nunjucks@3.2.3/src/lib.js:32:11)
  at https://deno.land/x/nunjucks@3.2.3/src/environment.js:493:19
  at eval (eval at _compile (https://deno.land/x/nunjucks@3.2.3/src/environment.js:570:20), <anonymous>:40:11)
  at https://deno.land/x/nunjucks@3.2.3/src/environment.js:501:11
  at Template.root [as rootRenderFunc] (eval at _compile (https://deno.land/x/nunjucks@3.2.3/src/environment.js:570:20), <anonymous>:100:3)
  at Template.render (https://deno.land/x/nunjucks@3.2.3/src/environment.js:482:10)
  at eval (eval at _compile (https://deno.land/x/nunjucks@3.2.3/src/environment.js:570:20), <anonymous>:39:10)
  at fn (https://deno.land/x/nunjucks@3.2.3/src/waterfall.js:51:22)
  at https://deno.land/x/nunjucks@3.2.3/src/waterfall.js:34:22```

not really sure why its happening. I'm going to work around it and just remove the search function but I thought y'all would want to know

Heres the info about my environment: 
- 2015 Macbook Pro 13 inch, 2.7 GHz Intel Core i5, 8 GB 1867 MHz DDR3
- MacOS: 10.14.6 (18G9323)
- Deno 1.20.5
- Lume v1.1.0
jppope commented 2 years ago

Looks like there is a simpler fix:

change this line to something like this

{% set postslist = search.pages("posts", "date=desc", 10) %}

then change it back

{% set postslist = search.pages("type=posts", "date=desc", 10) %}

might just be me...

oscarotero commented 2 years ago

This is because your lume version is very old (v1.1.0). Try updating to the latests version. Or additionally, you can simply run deno task serve to execute Lume as a deno task and use the same version defined in the import_map.json file (https://github.com/lumeland/base-blog/blob/master/import_map.json)

jppope commented 2 years ago

sure thing. I have to build another new site in a week or two I'll try your suggestions 👍