[fastpages] GitHub Pages Blog Using Nbdev

This got to be my most tiny PR (spend almost 3 hours though), the problem is the CRLF(WINDOW) token and LF token(UNIX). Git would not even let me commit at all since Git does not pick up these changes. So I have to add/remove some line to let it commit.

Solve it by myself! I have no idea how I run into this Window/Linux error…But I feel great to fix this tiny bug. Learn about docker-compose up and docker-compose build at least,
which I have almost 0 idea what it is. (The build take so long that I was so nervous if the fix will work)

Please check and accept the PR if it looks fine (which literally does not change anything… on the surface)

2 Likes

Great work @nok on fixing that via your PR! Much appreciated.

Thx! I always amazed by the tools coming from fastai and I am happy to contribute by any means.

1 Like

Looking at the config knowing that it use Rouge for syntax highlighting, but I cannot find config field to change the theme directly. So I end up tweaking the .highlight part in scss and it works fine.

But for some reason, even I copy the main.scss from fastpages/master.There are some weird color on the code block edge which does not exist in fastpages.fast.ai.

1 Like

Yes you have to use CSS to customize it, unfortunately.

1 Like

Yup I added that in CSS to make it look more like a notebook.

1 Like

I see, as it seems work only on notebook generated post now but not with markdown code block so I thought it is some bug on my side.

I know aesthetics can be very personal, and I am not a web dev or UI designer. I found the current setting (1px) is a bit uncomfortable too thin (almost invisible), I find 4-6px is more comfortable (Jupyter notebook use 5px if I checked correctly).
It’s your call. :slight_smile:


image

I also know very little about web design! Therefore, my inclination is to keep things as they are, as long as they aren’t super ugly and let people tweak things to suit their personal tastes. I get lots of messages about font sizes, colors, spacing, margins, background, etc all day :cry: and I am not sure there is much agreement.

P.S. I think I will provide a file called custom_styles.css where you can more easily override / tweak css without fear of your changes being lost when you upgrade. I’ll update this message if/when I make this change.

2 Likes

Sounds great, sorry if that bothered you. I will try to share my custom config after I am done instead.

Not at all! Really happy that you are sharing feedback! (especially in the forums)

Me neither - but your pics are really helpful, and if you find tweaks that make things look more like Jupyter, and work across the major modern browsers and in most contexts, I’m happy to take a PR to nbdev / fastpages. By “contexts” I mean that it should look OK when there is both input and output cell, only input, or only output, and whether it has a header before or after it or prose before or after it, or another code block next to it.

1 Like

Hi Henrik, I managed to solved it by removing the {%- if jekyll.environment == 'production' and site.google_analytics -%} statement in the _includes/head.html. I might be facing problems with the jekyll.environment == 'production' condition.

can you post a screenshot of the html what it will look like if Google analytic is configure correctly? I seems to struggle with same issue, I can’t find it on my github page.

{%- if jekyll.environment == ‘production’ and
site.google_analytics -%}

By doing so it seems to work, so somehow jekyll envioronment is not production even on github page? I am not sure how to debug this, may need some help on this. :slight_smile:

@nok I think that I may have to fix this https://jekyllrb.com/docs/configuration/environments/

Please send me a link to your repo so I can make a PR and we can test it out for you. Leave the if statement in. Once we figure it out I can turn it on for everyone

I rollbacked the If statement changes.

note: I may not be able to give you feedback until tomorrow morning. I live in Asia so… time for bed.

1 Like

@nok @kennethwang this change will set the environment to production when your site is deployed https://github.com/fastai/fastpages/pull/177

You should not have to change the if statement. Let me know if this change works for you .

Nevermind. Looks like I have debugging to do, will report back on this thread in a bit

@nok @kennethwang Turns out I had to upgrade fastpages to get everything to work. Now production mode is turned on, so you shouldn’t have to change your if statement.

You should upgrade to the latest version of fastpages, however, as I made some significant improvements. Announcement is here Major Upgrade To Fastpages: Faster build times & customizations

2 Likes

Yikes it looks like git diff displays a lot of javascript stuff whn using bokeh?