My index.html (https://srgg6701.github.io/Music-Is-My-Life/) can't see 3 existing .js files, although I can load them directly in raw mode. They are here: https://github.com/srgg6701/Music-Is-My-Life/tree/gh-pages/js/_libs
What may be cause of this?
By default, Jekyll (which GitHub Pages uses to generate your pages) ignores anything that starts with an underscore.
You can change this setting by modifying your settings, as discussed here:
If your GitHub Pages site isn't publishing certain files then you
might need to reformat their titles. If you are using Jekyll you can
create a .nojekyll file or edit the _config.yml file to publish
these files.
By default, Jekyll does not build any files or directories that
are hidden or used for backup (indicated by names that start with . or #, or that end with ~);
contain site content (indicated by names that start with _); or
are excluded in the site configuration.
To work around this behavior, you can
include a .nojekyll file in the root path to turn off Jekyll;
use [the include directive][global-config] in your _config.yml to specify files that should not be ignored; or
do not use file or directory names that start with an underscore (_), period (.), or hash symbol (#), or that end with a tilde
(~).
Related
I have a built react app in the docs directory of my project. The project is set to have it's github page source to that directory. All that works fine.
https://pgooch.github.io/find-your-ross/#/
As you can see, it all works, notably the image assets, which are located here.
https://github.com/pgooch/find-your-ross/tree/master/docs/static/media
While all of that works absolutely great, the markdown file in that directory 404's.
https://pgooch.github.io/find-your-ross/static/media/_linked_readme.d73385c3.md
The file appears in the repo as you'd expect (it's at the very bottom of the list). I have; waited more than 8 hours, tried different browsers on different devices, and checked that the permissions were good, confirmed that the file names were cased the same. No difference. This file 404s when viewed directly or fetched (as can be seen by clicking about).
The reason why the _linked_readme.d73385c3.md file is not coming up on GitHub pages is due to Jekyll ignoring the file which has a name starting with an underscore.
If you are not using Jekyll, just add an empty .nojekyll file within the docs folder. You can just create the file and commit it on GitHub UI or create the file on your local machine, commit it and push it to the GitHub repo. Once the file is added within the docs folder, the _linked_readme.d73385c3.md file will come up on your GitHub pages site.
Or if you have the option of renaming your file, just drop the underscore at the beginning of the file and rename it from _linked_readme.d73385c3.md to linked_readme.d73385c3.md.
Reference: GitHub
How do I setup the .gitignore file to ignore files with invalid characters like the examples below
WEB FILES
foo. js
foo.js <----space after the s
CSS:CSS.css
foo???.html
I just want any file with a special character/space to be ignored. Likewise if I can also apply that to folders.
FOLDERS
images <----space after the s
I teach a Web Development class for 9-12th graders and use github and it amazes me everyday how kids can find ways to blow up my repository. These are all examples of files and folders that cause github desktop to not be able to pull origin.
Git 2.0 mentions
Trailing whitespaces in .gitignore files, unless they are quoted for fnmatch(3), e.g. "path\", are warned and ignored
So in your case, you can:
add "*.js\ " to your .gitignore
delete the file or rename it
check that any new file with a trailing space is indeed ignored.
I have a requirement in my project where I need to ignore the .html file to track via git in the project however need to track any .html file in a given folder along with its sub folder.
I tried using below code to exclude to track all files from ignore_directory but it didn't worked.
*.html
!ignore_directory/*
What you have is the correct way to exclude a directory.
# See http://help.github.com/ignore-files/ for more about ignoring files.
#
# If you find yourself ignoring temporary files generated by your text editor or
# operating system, you probably want to add a global ignore instead:
# git config --global core.excludesfile ~/.gitignore_global
*.html
!ignore_directory/*
Either the path you have is incorrect or is not relative to the directory you want to exclude. It's also possible that the directory you want to exclude contains a gitignore file overriding your exclusion.
Read GitHub help on Ignoring files for a simple introduction to ignoring files and also tead the Git - gitignore documentation.
I have a project for which I'm building the doxygen documentation in a CI job and publishing using github-pages.
However, I'm running into an issue where the documentation for files (i.e. generated with doxygen's #file command ) does not get uploaded - the links exist and the files exist in the gh-pages branch but clicking on any link leads to a 404 error. For example this should lead to this file but the link is dead.
As far as I can tell, this is because Jekyll is ignoring any file whose name begins with an underscore, and this is the output pattern that doxygen uses with (as far as I can tell) no way to change that. It looks like to fix this you need to tell Jekyll to include these files but this has not worked for me so far.
I have tried
Adding a _config.yml file to the master branch to include _*.html files
Modifying that file to include _
Swapping that file for a .nojekyll file
Creating a .nojekyll file as part of the build
Creating a _config.yml file in the gh-pages branch (this one has no link because travis completely overrides it :P )
Any of these files I create on the master branch seems to be ignored in the gh-pages branch and anything I create on the gh-pages branch is (predictably) overwritten by travis.
How can I get these files published to the webpage?
Doxygen decides, as default, how to create output filenames based on the OS used. This results a.o. in a way that on case insensitive systems there are always unique names (e.g by replacing an upper case character with an underscore followed by the corresponding lowercase character (underscores are replaced by double underscores).
To steer this the configuration parameter CASE_SENSE_NAMES can be used.
From the the documentation (1.8.15):
CASE_SENSE_NAMES If the CASE_SENSE_NAMES tag is set to NO then doxygen
will only generate file names in lower-case letters. If set to YES,
upper-case letters are also allowed. This is useful if you have
classes or files whose names only differ in case and if your file
system supports case sensitive file names.
Windows and Mac users are advised to set this option to NO.
The default value is: system dependent.
I am hosting a static application on GitHub pages. My application structure is like this - I have some front-end facing files, and some Python files that are run periodically to get the data for the front-end, but should not be user-facing:
index.html
/js
index.js
vendor/
/css
/data
get_data.py
How can I stop everything in data/ being publicly available on the website?
You have two main options:
Option 1: Rename your data directory to _data.
Jekyll ignores files and directories that start with an underscore. You could also create a top-level _backend directory and then move your data directory into that.
Option 2: Configure your Jekyll to exclude the data directory.
You can add an exclude setting to _config.yml to tell Jekyll to ignore your data directory.
From the configuration documentation:
Exclude
Exclude directories and/or files from the conversion. These exclusions
are relative to the site's source directory and cannot be outside the
source directory.
exclude: [DIR, FILE, ...]
Googling "jekyll underscore directory" returns a ton of results, including this one which explains all of the above: https://help.github.com/articles/files-that-start-with-an-underscore-are-missing/