Giter VIP home page Giter VIP logo

Comments (11)

pietia avatar pietia commented on July 27, 2024

+1

from middleman-blog.

pietia avatar pietia commented on July 27, 2024

in other words: middleman-blog should use separate layouts for articles and blog ("index") itself

from middleman-blog.

polarblau avatar polarblau commented on July 27, 2024

As a work–around we've found that you can wrap the whole nested layout in a conditional using if is_blog_article?.

from middleman-blog.

bhollis avatar bhollis commented on July 27, 2024

I'll take a look at it tonight.

from middleman-blog.

bhollis avatar bhollis commented on July 27, 2024

(this is particularly weird because I do this exact same thing on my own blog and it works fine)

from middleman-blog.

bhollis avatar bhollis commented on July 27, 2024

Oh! I think I realize what you're doing wrong. Layouts other than the default go in source/layouts. Move your layout there and see if it works. Since you have the layout just hanging out in source, the builder is trying to actually build it as its own file.

from middleman-blog.

polarblau avatar polarblau commented on July 27, 2024

Got it, thanks a lot!

from middleman-blog.

acandael avatar acandael commented on July 27, 2024

I have exactly the same problem

When I try to build my Middleman project I get this error:

error  tmp/blogpost.html    
undefined method `title' for nil:NilClass

My repository is at: https://github.com/acandael/personal-site

any help is appreciated, thanks,

Anthony

from middleman-blog.

lolmaus avatar lolmaus commented on July 27, 2024

Hey @acandael, your problem is that you're keeping your layouts outside the layouts/ folder. Create the folder under source/ and move layout files into it. Layout files are the ones that have a single extension .erb (unlike page files which have a double extension .html.erb).

Middleman was treating your layouts as pages and was trying to build them, but they included references to variables unavailable due to the fact that layouts were treated as pages.

Also, consider naming your repository to acandael.github.io. Then you could use it to publish your website to http://acandael.github.io/ rather than http://acandael.github.io/personal-site/ . It would also save you some trouble with relative URLs.

from middleman-blog.

acandael avatar acandael commented on July 27, 2024

hi lolmaus, thanks a lot, all is fixed now. Also thanks for the tip about my Github repository

greetings,

Anthony

from middleman-blog.

jshou avatar jshou commented on July 27, 2024

thanks @bhollis this works!

from middleman-blog.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.