Why is languages section not displayed my github repository? - github

Why is languages section not displayed on my github repository?
My Repository is https://github.com/alumuko/vanilla-datetimerange-picker
I found a question GitHub not showing languages used in repository
So I have added ".gitattributes" in my repository like this.
dist/* linguist-documentation=false
But not displayed yet.

All files under dist/ are considered vendor files by Linguist by default. Vendor files are not counted in language statistics. You can see the list of default vendor files in lib/linguist/vendor.yml.
To consider files under dist/ for language statistics, you can add the following to .gitattributes:
dist/* linguist-vendored=false
linguist-documentation=false shouldn't be needed.

Thanks to pchaigno and Robson.
I added
dist/* linguist-vendored=false
into ".gitattributes",
then the problem has been resolved.

You need this line in the .gitattributes:
dist/* linguist-vendored=false
I've forked it here, made that change and now the language share is displayed:
https://github.com/Robson/vanilla-datetimerange-picker

Related

GitHub not showing languages used in repository

I uploaded my android studio project in java on GitHub but it is not showing languages section.
How do I add languages section. And why GitHub failed to detect languages used in repository?
Repository link - https://github.com/QAZIMAAZARSHAD/Bank-Android-App
https://i.stack.imgur.com/6C3il.jpg
These files are considered documentation by Linguist because they're in the app/ folder. You can use the following.
make a file name called .gitattributes this file will override that behavior and paste the following in that file.
app/* linguist-documentation=false
app/* linguist-vendored

Is there an overview of what can go into a .github "dot github" directory?

I keep finding piecemeal examples of things that can go into a .github directory on a GitHub repository.
I can see that it is used for GitHub actions and workflow and for Pull request and issue templates, but I can't see a page outlining what you can put in there with ideally some documentation. I also think I've seen a funding example too.
Basically every time I see something you can do there, I think "that's neat I should do that", but other than examples I can't see a way to discover new things other than by example.
Due to the fact that the directory is called .github it seems to defy Google and SO search as well.
On Github, folder .github is just a convention folder used to place Github related stuff inside it. Github handles some of these files even when you place it in root of your project (such as CONTRIBUTING.md, CODE_OF_CONDUCT.md etc). Because Github is constantly bringing in new features, these features are documented on their own, so there is no "all possible files in .github" page. Feel free to place anything that is related to Github specifically inside it.
Some of the most used files in .github folder:
CODE_OF_CONDUCT.md -> How to engage in community and how to behave yourself.
CONTRIBUTING.md -> How to contribute to repo (making pull request, setting development environment...)
LICENSE.md - A software license tells others what they can and can't do with your source code (You should place this at the root of your project since GitHub ignores it in .github folder. You can find this file while browsing other Git hosting services such as GitLab, Bitbucket etc.)
FUNDING.yml -> Supporting a project
ISSUE_TEMPLATE -> Folder that contains a templates of possible issues user can use to open issue (such as if issue is related to documentation, if it's a bug, if user wants new feature etc) P.S. Take a look at tensorflow ISSUE_TEMPLATE
PULL_REQUEST_TEMPLATE.md -> How to make a pull request to project
stale.yml -> Probot configuration to close stale issues. There are many other apps on Github Marketplace that place their configurations inside .github folder because they are related to GitHub specifically.
SECURITY.md -> How to responsibly report a security vulnerability in project
workflows -> Configuration folder containing yaml files for GitHub Actions
CODEOWNERS -> Pull request reviewer rules. More info here.
dependabot.yml -> Configuration options for dependency updates. More info here.
You don't have to create all these files immediately. If there are lot of bugs reported in your project, create ISSUE_TEMPLATE. If several people wants to support you, create FUNDING.yml . You will create more and more files when the need comes.
Github lists all of the files you can use in the documentation page titled Creating a default community health file and the workflows you can add to the .github directory are detailed in the Introduction to GitHub Actions documentation.

Jekyll static site generation on a subsite?

Is it possible to have Jekyll on a single subsection of my website hosted on GitHub? i.e. is it possible to have "example.github.io" be a regular site and "example.github.io/blog" be statically generated by Jekyll?
I believe it's possible to do this by creating another GitHub repo called "blog" and having that repo managed by Jekyll. I'm wondering if it can all be done in one main "example.github.io" repo.
Thanks!
Yes, it's possible. You just have to use the Exclude setting in your _config.yml to tell Jekyll which files and/or folders it should ignore. Similarly, you can also use the Include setting to specifically include files and/or folders.
Configuration Settings / Global Configuration
https://jekyllrb.com/docs/configuration/#global-configuration

Using Github pages with Jekyll in a subdirectory

I recently wanted to publish my Jekyll site on Github pages, but it seems that putting everything in a subdirectory is giving some issues, even after I change the source to the correct directory.
My structure looks like this:
- site
- src (contains all Jekyll stuff)
- README.md
- GruntFile.js
- ...
Locally my site builds perfectly and when I go to http://localhost:4040 I can see it just nicely, but when I commit this to my Github and visit username.github.io I get a 404, if I go to username.github.io/src I can see part of my site, however all {% include %} are ignored.
In my _config.yml I updated the source: source: ./src, but that doesn't seem to help.
Is there a way to make Github Pages handle subdirectories properly? Basically I want to tell it that my Jekyll site is inside /src, and I want the url to just be username.github.io instead of username.github.io/src
I know i can use the pages branch and commit to there, but I would prefer if it could happen automaticly.
If it helps anyone, I attempted to run Jekyll on GH Pages from a subdir (and modified source) and was banging my head against the wall over these errors:
A file was included in subdir/index.html that is a symlink or does not exist in your _includes directory. For more information, see https://help.github.com/articles/page-build-failed-file-is-a-symlink.
After much searching on this, the definitive answer was right there in the docs:
Configuration Overrides
We override the following _config.yml values, which you are unable to
configure:
safe: true
lsi: false
source: your top-level directory
Keep in mind that if you change the source setting, your pages may not
build correctly. GitHub Pages only considers source files in the
top-level directory of a repository.
I contact Github support and they gave me 2 solutions.
Move all my Jekyll source files to my top-lever directory.
Use a different branch and update it manually each time.

Which files/directories to ignore in a Laravel 4 project when using version control?

I have a Laravel 4 project, and I would like to know which files should be ignored when using a version control software such as Git, Mercury or SVN?
The structure of my project looks like the following screen capture.
I'm pretty new to Composer so I'm not very clear about what goes to a repo what not. If someone can post their .gitignore file or their SVN ignore property, it could be handy.
For reference, that .gitignore file can be found here:
/bootstrap/compiled.php
/vendor
composer.phar
composer.lock # Remove this one after you create a project
.env.*.php
.env.php
.DS_Store
Thumbs.db
As noted in the below comment, you probably want to commit composer.lock in your project. Laravel ignores it by default so the authors of the laravel/laravel package don't accidently impose packages on you.
Your project should include the composer.lock file so you can install packages of stable versions (via composer install instead of composer update) properly in your production environments.
Note that the config file:
app/config/app.php
Has a cryptographic key in it that wouldn't be great to commit to a repository. Or, at least, the file needs to be overwritten in production.
You might also want to see the Laravel docs here and here. This discusses how to setup different Laravel configurations for different environments and protect sensitive information. All your .env.local.php type files should not be included in version control. Note that the .env.*.php and .env.php is added in the default Laravel .gitignore file. You can see it here
Laravel has posted their .gitignore on GitHub, which can be found here.
As of today, it looks like this:
/bootstrap/compiled.php
/vendor
composer.phar
composer.lock
.env.*.php
.env.php
.DS_Store
Thumbs.db
GitHub has a repository of suggested .gitignore files for almost all kinds of projects at: http://github.com/github/gitignore
Alternatively, you can search it for your project using this handy and extremely useful online tool: http://www.gitignore.io