[fastpages] GitHub Pages Blog Using Nbdev

Hello I just can’t seem to get by index.html page right:
I wrote the simple code

<style>img {border-radius: 50%;}</style>
<p style="text-align:center;">
<img src="images/git.jpeg" height=210, width=195, alt="Avatar">
</p>
<div align="center">Ayushman Buragohain</div>
<p style="text-align:center;">
<a href="https://github.com/benihime91"><img src="https://raw.githubusercontent.com/benihime91/blog/master/images/github.svg" height=30, width=30></a>
<a href="https://www.linkedin.com/in/ayushman-buragohain-2145a718"><img src="https://raw.githubusercontent.com/benihime91/blog/master/images/linkedin.svg" height=30, width=30></a>
</p>

And this is the result I would expect:

And this works fine whenever I put this code in a normal .md file.
But for some reason it won’t work on the blog page generated:


my index.html file:

---
layout: home
search_exclude: true
image: images/logo.png
---

<style>img {border-radius: 50%;}</style>
<p style="text-align:center;">
<img src="images/git.jpeg" height=210, width=195, alt="Avatar">
</p>
<div align="center">Ayushman Buragohain</div>
<p style="text-align:center;">
<a href="https://github.com/benihime91"><img src="https://raw.githubusercontent.com/benihime91/blog/master/images/github.svg" height=30, width=30></a>
<a href="https://www.linkedin.com/in/ayushman-buragohain-2145a718"><img src="https://raw.githubusercontent.com/benihime91/blog/master/images/linkedin.svg" height=30, width=30></a>
</p>

# Posts

How to fix this ?

You cannot put HTML in that file, confusingly you can only put markdown in that file. I know its counter intuitive. I think if you rename it to .md you can embed HTML in there.

There is also a Jekyll template you for the home page you can put your HTML there too. https://github.com/fastai/fastpages/blob/master/_layouts/home.html

1 Like

With codespace now is it possible to run fastpage with local docker for hot reloading and able to view the page?

It would save my effort to syncing my repository in multiple machine and just use codespace as my repository for taking notes and write mini blog on it.

I am trying to figure out how to use images and docker with the local files (I am a bit of a noob). According to https://fastpages.fast.ai/jupyter/2020/02/20/test.html to add an image I need to use ![](my_icons/fastai_logo.png), but this doesn’t seem to work for me. Also, the baseurl doesn’t seem to work like it should. [2020-11-07 06:04:42] ERROR `/' not found.. Baseurl is correct, but whenever I try to access the link through Docker it shows image
so I have to manually add /Blogging/ to localhost:4000. After I manually add /Blogging/ it works.
So my questions are:

  1. How do I fix ERROR `/' not found
  2. how can I add photos to my project since adding them to _notebooks/my_icons doesn’t seem to work. [2020-11-07 05:40:50] ERROR `/Blogging/jupyter/explanation/2020/11/04/my_icons/loss2.PNG' not found.

If you don’t share your repo its going to be impossible to help you. Most likely something wrong in your settings

sorry about that, here’s the repo: https://github.com/ClaudiuFilip110/Blogging

Try putting your markdown image embedding on a seperate line.

instead of

foo bar ![](/someimage)
foo bar

![](/someimage)

1 Like

I don’t see this error.

No, you manually removed it AFTER it was automatically added for you. This was automatically added for you when you cloned the repo:

However, you took it out manually, thus breaking your site here: https://github.com/ClaudiuFilip110/Blogging/commit/c5a15ebc4ab9345645b367e780e7680ee3a2f0ab

Please see the Troubleshooting section of the README for more tips

What I meant by manually adding /Blogging/ is that I add /Blogging/ in the url after I start docker. It connects to localhost:4000 and I have to manually add /Blogging/. I removed it, but I put it back in a later commit.
When I start the local server with docker in the cmd it says image
but when I open in browser image this is what starts image and I get this error image
Sorry for not being explicit from the beginning.

Yeah I guess that is an annoyance. We will be working on a different version of fastpages soon based on Hugo so not sure this is worth fixing.

Hello there! I’m having trouble getting the utterance comments to appear at the bottom of my markdown and notebook posts. Here is what I’ve tried:

  • installed the Utterances app and confirmed through my blog repo settings that the Utterances app is installed, that it has read access to metadata and read/write access to issues, and that it has permission to access my blog repo.

  • confirmed that issues are enabled for my blog repo

  • confirmed that the blog repo is public

  • added comments: true in the front matter of this markdown post and this notebook post.

  • confirmed that there are no build errors when I preview the blog locally

When I navigate to those linked posts, I don’t see any comment section at the bottom of the page. Am I missing something?

what does your browser console say what kind of errors does it give you?

The Chrome console shows:

Uncaught Error: Invalid repo: "/blog"
    at pa (utterances.8ca43796.js:1)
    at utterances.8ca43796.js:1
    at utterances.8ca43796.js:1
    at utterances.8ca43796.js:1

Ok, so eventually I figured out that I wasn’t setting the github_username variable in _config.yml, so the repo reference was invalid. Correctly setting github_username seems to fix the issue.

Hi y’all,

At my company i’m building a flask compatible version of FastPages.
It builds on the simplest/best practices inspired flask app design.
It is heavily inspired by BentoML’s design and incorporates Pandas and Plotly (and some machine learning libs like SKtime, LightGBM, SHAP, Optuna, etc.).

The project allows one to point to a folder which contains .ipynb notebooks.
It will update them automatically if new source data is present or a code change has occurred in the notebook)
It inserts some useful inits (suppressing warnings, setting plotly renderers, etc).
executes all cells of the notebook (for automatic updating of content).
Stores the resulting html in a sql database(along with metadata).
And allows one to retrieve the posts and serve them through flask (and uses the search functionality). These pages can be inserted in an iframe for example.
It also allows the notebook to be rendered as a Reveal.JS presentation instead of a page.

The system has some more integrations (like automatic triggers for scrapers, which in turn trigger tables to be updated, which triggers plots to be updated which in turn triggers the notebook to be updated).
There is also a flask-login integration, allowing one to set access.

I did not fork the fastpages repo, instead I monkey patched some NBdev code (heavily inspired by fastpages (from the _actionfiles folder).

I have seen a kubernetes implementation which seems like an interesting take.
The main difference is that my solution uses a simple CRUD app with some task queues and cron jobs combined with a ci/cd pipeline which checks for code differences (it stores a hash of the source code of each plot/table/notebook/dashboard).

Would there be any interest in me sharing this project?

Hey, I just create a blog with fastpages (awesome project btw) and I was doing some changes but when I go to Actions it always appears two workflow file as you can see in the image. One succeded commit and the other one failed. Although the changes I made always appear, I would like to know if this is normal since I only commit once. Thanks in advance…

Just share it. Forums are for sharing :slight_smile:

Whenever you see an error, it is a good idea to read the error message! This is what I can see from your repo. You need to fix this problem

Hi all,
Thanks a lot for developing fastpages – I just started using it to setup my blog and it looks really good, easy-to-use and user-friendly :star_struck:

I just wanted to know whether Bokeh interactive plots were supported now? I see that it wasn’t originally, as stated in an earlier post of yours @hamelsmu, as well as in this blog post.
But maybe is it the case now (although I couldn’t find any announcement on Google)? I use Bokeh a lot, so it’s definitely a feature I’d love and use :heart_eyes:

Looking forward to hearing from you, thanks again for all your work, and stay safe in these difficult times!
Alex

1 Like