I can't edit Jekyll index.html - jekyll

I'm trying to change /_site/about in index.html. When I edit the index.html and start jekyll, index.html back to it's original content.
Sorry for my english.Thank you very much for your help.

You don't edit files inside the /_site directory. When jekyll builds the site, it overwrites any and all files in that directory.
Edit the index.html file in the /about/ directory outside of the /_site/ folder.
Run the command jekyll build to apply these changes to the generated site.
Or use jekyll serve to automatically host the content locally and update the content when a change is made.

There's no need to edit Index.html file as it is generated from the markdown file your provided which as we all know is called index.md, whenever you change that file and run jekyll build it re-generates the index.html file hence if you edit once you would have to do the same again when you change index.md file.
So directly write html / markdown in index.md file in your jekyll directory.
Best,
Daksh

Related

hosting a github pages server with multiple html files

Im trying to host a github live server for a project that right now has a "index.html" main folder with 4 files inside that main folder named "forgot-pass.html" "home.html" "sign-in.html" "sign-up.html"
I know to host on github your html needs to be a index.html but my question is can you have a folder named index.html with html files inside that folder and it still work? or how can i host on github if i have multiple html files named various things.
Yes you can have more html files in the same folder or subfolders, but it's mandatory to have the "index.html" file. Also I think you can make that folder but will not work (I don't know if it works or not, but give it a shot).
Its required to have a "index.html" file located in the root directory. As far as having a main FOLDER named index.html with files inside of that as-well, did not work for me. but i did not try to have a index.html file in the root directory on its own ALONG with a separate folder containing the rest of the html files. So i don't know if that works or not. i just put all the html files in the root directory and made sure to have one named "index.html"

Jekyllrb /assets/images directory?

How exactly do I add this? If I add a images directory to the assets folder it gets deleted....but most examples talk about referring to /assets/images/whatever.jpg to be able to access an image.
How exactly do I get a folder added?
Im using the minimal-mistakes theme (but I doubt that matters)
You should add your directory to the "source root" instead of within the _site folder.
The contents of _site gets recycled every time you run jekyll build or jekyll serve..
Simply add assets/images/whatever.jpg to the root of your site's source and it will be "copied" as is into _site by Jekyll...

Jekyll add file to _site without extension

In Netlify to redirect a default Netlify subdomain to a primary domain I need to add a _redirects file to the root of my _site folder.
In the root of my Jekyll project I've added a file named _redirects (no extension), but when my _site is generated it ignored the file and nothing is created, no file, no folder and page. How do I move a file with no extension into my _site directory?
I've added numerous static files with extensions without an issue, but I'm not sure how to accomplish this one.
From Netlify redirects documentation :
... (For Jekyll, this requires adding an include parameter to _config.yml.)
include:
- ...
- _redirects

Jekyll Wiping My Directory

I followed the instructions for Jekyll Quickstart. Whenever I make changes in my site's directory, the changes get wiped somehow. For example, I modified some of the code in index.html, only to have it return to Jekyll's default. I also created a subdirectory in _site called 'otherservices' with an index.html. That gets wiped as well. Any idea why this may be happening? I can't really use Jekyll if it keeps wiping.
Jekyll is a static website generator, each time it generates a website it place files in the _site folder.
Any changes you make inside the above folder are lost because it is recreated when executing jekyll build or jekyll serve .
Changes should be made to the rest of the files or folders so they will be processed and locate the resulting files inside _site.
You should not write manually into _site directory, that is Jekyll's output.
If you need an otherservices directory in the output, place it one level above, like this:
_site/
otherservices/
index.html
index.md
Jekyll will copy every file and directory into _site, which is not excluded in the configuration and doesn't start with _ prefix. Files that have front-matter will be processed in addition to copying. So in result Jekyll will generate this structure:
_site/
otherservices/ (copies it)
index.html
index.html (generates it from index.md)
otherservices/
index.html
index.md
It is worth reading the documentation on how to create custom pages.

How to bypass Jekyll Build by GitHub and Deploy _site folder directly?

How can I bypass jekyll compilation at GitHub and push _site folder (after local compilation) and host there.
If you don't want github page to process you site with Jekyll, you can add an empty .nojekyll file at the root of your generated code. See mojombo post.
There is nothing special to do; just use your _site folder as the content for you github pages.
You can't bypass the compilation step, but it will not modify your content.
Just try and run jekyll serve locally in your _site folder to make sure.
EDIT: #David Jacquel's answer is more accurate