Search code examples
fullpage.jsmetalsmith

Metalsmith Blog using FullPage.js


I am trying to set up a simple blog using Metalsmith and the fullPage.js library.

At the moment I have a problem where the height of the section divs upon intial loading are roughly 2 times the correct size.

Ie. when it initially loads the height in the console reads 1563px.

The odd thing is that once I resize my browser window in any way ie. make it larger or smaller, the div(class='section') height will then resize to its correct height in the console and in the browser, and everything is laid out correctly again (with regular sized divs as opposed to the super tall ones that were there previously.

This initial height inconsistency is causing many issues with alignment in my layout, such as the prev/next arrows as well as the div content.

here is a link to my public git repo for this project.

If you want to run this locally you can pull it down, run npm install, then run nf start. You will then be able to access it at localhost/3000.

If anyone has any suggestions that would be much appreciated.

Thanks.


Solution

  • It is not ideal to just public your source. A link reproducing the error would be much better.

    In any case, I believe yours is a case of missing the compulsory DOCTYPE declaration at the very start of the page.

    Take a look at any examples of fullpage.js. They all have it.

    Add this in the first line of your resulting HTML files:

    <!DOCTYPE html>