1

Context: working on a simple todo list app as part of the Odin Project. I'm on an assignment where we must assemble this project using webpack, but no other frameworks (just vanilla js).

What I expect to happen: my live preview shows up successfully when I push to main. I am trying to finish up the todo list app via webpack.

What happens instead: Instead of previewing my app, my github live preview only shows the readme file instead.

What I have tried: When I google the issue, most people who have had this problem say that it is because of either not having an index.html file at all (which I do) or suggest moving it to your root. But webpack puts the packaged file into /dist, and that worked just fine with my restaurant project, so I'm not sure what is wrong here. I have also tried to update the readme to link to the index.html as this user did in a similar question, only with permalink: ./dist/index.html, but doing this for my code just made the live preview 404 entirely.

Link to Repo: https://github.com/manski117/todo-list-app-project

Link to what is supposed to be the live preview: https://manski117.github.io/todo-list-app-project/

manski
  • 131
  • 1
  • 10

1 Answers1

0

I see your build uses Jekyll.

It is better to use the official actions/starter-workflows pages/jekyll.yml action.

See Jekyll GitHub Action, and add it in .github/workflows, with the source of your site directly at the root folder. Including a _config.yml to set at least the title.

But if your webapp should not use Jekyll, then chose one of the others starter workflows, or adapt one to your own application.


See also "Configuring a publishing source for your GitHub Pages site"

You can directly publish a built content:

The source branch can be any branch in your repository, and the source folder can either be the root of the repository (/) on the source branch or a /docs folder on the source branch.

So no "dist".

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • If you build everything locally, you can also just disable Jekyll by creating an empty `.nojekyll` file in the publishing source directory, without using actions to deploy. It looks like the publishing source is set to the root directory instead of `dist`, though. – Benjamin W. Dec 21 '22 at 19:56
  • Is there a way to change it? So that the publishing source is set to dist instead of root? – manski Dec 21 '22 at 20:01
  • @manski It depends what framework you are using to build your site. Jekyll? Something else? – VonC Dec 21 '22 at 20:02
  • 1
    @manski I have edited my answer to reference a publication source for your GitHub Pages site: `/` or `/docs/` folder only, no `/dist/`. – VonC Dec 21 '22 at 20:04
  • No framework to my knowledge. I'm not really supposed to be using a framework yet. I'm literally just following the steps directly from the guides on webpack's website as I am extremely new to using it and trying to keep it as simple as possible. I've never even heard of Jekyll until just now. – manski Dec 21 '22 at 20:05
  • @manski OK. That is why I have edited my answer. – VonC Dec 21 '22 at 20:05
  • @BenjaminW. you say the empty .nojekyll file goes in the publishing directory. Would that be the root directory or would it be /dist? – manski Dec 21 '22 at 20:10
  • @manski As I mentioned: no dist. / or docs only. – VonC Dec 21 '22 at 20:13
  • Let us [continue this discussion in chat](https://chat.stackoverflow.com/rooms/250594/discussion-between-manski-and-vonc). – manski Dec 21 '22 at 20:14
  • Update: tried adding a blank .nojekyll file to my source branch. Also separately tried just deleting the readme file. Both give 404 error. – manski Dec 21 '22 at 20:56