MkDocs site not getting deployed correctly to github pages - mkdocs

I am using Deploy MkDocs action to deploy my site to github pages. After pushing my changes to my master branch the action successfully runs.
However, when I visit my project page link then my site seems to be broken. Any pointers would be of great help.
My repo structure is the following-->
The document contents are inside the "docs" directory.
When I tried to visit the site using my pages link, I can see something like this(I have checked my site locally and it renders properly on my local machine) -->

Add an index.md to the src folder e.g. When build this will produce needed index.html page. Also try to build with: mkdocs build --clean.

Related

Git live preview HTML file does not working

I am working on the odin project and make my first html project, the first recipe project.
I have now finished it and upload it to my repo on github. If I want to see it with live preview the index.html page is working well. But if I click on a link at the index page it does not working.
Can u check my html file?
Or is it maybe that I have make failure with github workflow. I have changed/finished my coding on MS VisualStudio and then add the following statements in the terminal:
git add .
git commit -m "something"
git push origin main
My Repo:
https://github.com/ztrk-dev/odin-recipes/tree/main/recipes
You are hosting what Github Pages refers to as a Project site, which means the page is being hosted at "username.github.io/repository".
The reason the pages with images aren't loading as expected(if I'm misunderstanding the question let me know) is because they are linked as /images/spaghetti-napoli.jpeg, which is a relative file path for the file spaghetti-napoli.jpeg that is located in a folder "images" located in the root directory. The problem is that the root directory / isn't the base directory of your project site. /{repo-name}/ is (so that you could have many different projects with their own websites if you wanted to).
If you want the repository to be the root of your site, you'd need a User site, which would require a repository named ztrk-dev.github.io to host the projects files. If you'd rather use a project site, you would need to link the images as /{repo-name}/{path-to-file} instead of /{path-to-file}.
That is to say, /images/spaghetti-napoli.jpeg would become
/odin-recipes/images/spaghetti-napoli.jpeg or ../images/spaghetti-napoli.jpeg

"Page Not Found" upon deploying site to Netlify via Github repo

I'm a complete beginner to web development and am trying to deploy my first site via Netlify. Despite my site working fine when being displayed from my local machine, I'm given the following error when navigating to my site's URL:
Page Not FoundLooks like you've followed a broken link or entered a URL that doesn't exist on this site.Back to our site
Since my page is functional on my local machine, I believe the error lies within my Github repo and/or my deploy settings. Here's my repo:
https://github.com/Cotton0419/TestSite
And my deploy settings:
Repository: github.com/Cotton0419/TestSite
Base directory: acme
Build command: Not set
Publish directory: acme/disp
Deploy log visibility: Logs are public
Any help would be greatly appreciated, I can supplement more information if need be.
The Base directory on Netlify is only used by the build environment for a reference to your code base (defaults to root of the repository if not given).
The Publish directory would be relative to the base directory. So in your case disp or acme/disp if using the default.
You are referencing assets in a location that does not exist in your published paths, so they would not exist in your deploy to the CDN.
<link rel="stylesheet" href="../css/style.css">
You should move your assets into your deploy disp folder and edit the correct paths into your code files.
Similar problem I encountered today. I decided to upload an old portfolio I had made a while back. Then for some reason after running the URL on Netlify, nothing happened. The only thing that showed up was a prompt similar to yours -
Page Not Found
Looks like you've followed a broken link or entered a URL that doesn't exist on this site.
Back to our site
After revisiting the HTML and CSS files, I realized that I had set the title for my HTML file to porfolio.html instead of index.html which solved my problem!
For this kind of error please kindly check the HTML filename change it into index.html it worked for me!

deploy a Jekyll site with the use of a

This is the first time that I am going to use Jekyll to build a static site. I would like to use a dozen plugins that are not white listed for deploying on Github. My question is : is it possible to deploy a such site with a dozen plugins (not white listed) on github ?
Browsing on internet, I found the following assertions :
1) We can't run user plugins on GitHub Pages due to security restrictions. That' what the documentation says
2) You are free to generate your site locally and push the resulting HTML to a Git repo, however : what does that means ? First when you generate the site locally, it ends with a group of HTML files and that group of html files, are they enough to run the site autonomously (for example must you include the css files in html pages ) ? Furthermore when you push the resulting HTML to a Git repo, is it enough to deploy it on a production environment (on GITHUB for example) ? and how you do that ?
3) on this link (https://help.github.com/articles/using-jekyll-plugins-with-github-pages/) I found the following explaination : Adding Jekyll plugins to a GitHub Pages site
You can further customize your GitHub Pages site by adding Jekyll plugins. (do they talk about all plugins ?)
GitHub Pages officially supports the Jekyll plugins found in the GitHub Pages gem. For the exact versions of the Jekyll plugins that GitHub Pages supports, see this list of GitHub Pages dependencies. Other plugins are not supported, so the only way to incorporate them in your site is to generate your site locally and then push your site's static files to your GitHub Pages site.
So as they say, it is possible , generating your site locally and then pushing your site's static files to your GitHub Pages site. Is there a detailled procedure example somewhere ?
Thanks in advance for your answers
To be able to use Jekyll with any plugins and host in Github pages you have two options
first alternative
Build your site locally and then push the resulting site at _site to Github.
Then push the built site's static files to your pages publishing branch (gh-pages or master depending on your site type).
GitHub Pages supports any HTML or static files you push to it so you
can use any static site generator to build your site. You can even
just push raw HTML files to GitHub Pages and it will build your site.
You can also customize your own build process locally or on another
server.
second alternative
Use a CI service like Travis, so when you push your Jekyll files to Github, it automatically builds your site and deploy it to your publishing branch.

How to force Github Pages to look at /build?

I'm using create-react-app which is serving its files from the /build folder. Typically Github Pages looks at index.html at the root level, but I'd like to direct it to look at /build for deployment.
I've tried to add "homepage": "/build" inside my package.json configuration, and Github Settings says it's deployed via <username>.github.io. However, the site just shows my README.md file.
Any help is appreciated :)
The problem here is that this is a Web Browser issue, and not a Host issue. When you visit a webpage your browser always looks for the index.html file at the URL so localhost:8080 becomes localhost:8080/index.html.
This means that there are a couple ways to fix this. You could create an index.html file in your root directory and then have that serve up the scripts in the build folder like <script src="build/main.js"></script>
You could also go through the pain and suffering of manually adding /build to the end of the URL. But you don't want users to have to do that, so you could write a script to redirect you there.
Good luck!

github page doesn't exist (the simple jekyll configuration)

I have the simplest (default jekyll) page on github
https://github.com/pejot/pejot.github.io
When I run locally
bundle exec jekyll serve
it works fine.
but on the github domain
pejot.github.io
it says: "There isn't a GitHub Page here."
what can be a problem that it works locally but not on github? Please take into account that page is basically empty. Is the default one generated by jekyll.
I get it!
github takes gh-pages branch for project page and master for the user one.