Using GitHub Pages' Flashcards

1
Q

Q: What is GitHub Pages?

A

A: A static site hosting service provided by GitHub to host personal, project, or organisation pages directly from a repository.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Q: How do you enable GitHub Pages for a repository?

A

A: Go to Settings > Pages, select a branch and folder as the source, and save.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Q: What types of repositories can use GitHub Pages?

A

A: Public and private repositories can use GitHub Pages, but free plans limit it to public repositories.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Q: What is the default URL structure for GitHub Pages?

A

A: For personal repositories: https://<username>.github.io/<repository-name>.</repository-name></username>

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Q: What are the three main types of GitHub Pages sites?

A

A: User/organisation sites, project sites, and private sites (for paid plans).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Q: How do you create a personal GitHub Pages site?

A

A: Create a repository named <username>.github.io, push your website files, and enable Pages.</username>

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Q: What file is required for GitHub Pages to work?

A

A: An index.html file in the root directory or the chosen source folder.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Q: Can GitHub Pages host Jekyll-powered static sites?

A

A: Yes, Jekyll is natively supported by GitHub Pages.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Q: How do you disable Jekyll processing for a GitHub Pages site?

A

A: Add a .nojekyll file to the root of the repository.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Q: How do you select a custom theme for GitHub Pages?

A

A: Use the Theme Chooser under Settings > Pages, or include a Jekyll theme in _config.yml.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Q: How do you add a custom domain to a GitHub Pages site?

A

A: Go to Settings > Pages, enter your domain under Custom Domain, and configure DNS records.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Q: What DNS records are needed for a custom domain on GitHub Pages?

A

A: A records pointing to GitHub’s IP addresses and CNAME records for subdomains.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Q: How do you configure HTTPS for a custom domain?

A

A: Enable Enforce HTTPS in Settings > Pages after setting up the custom domain.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Q: What branch is typically used for GitHub Pages?

A

A: The gh-pages branch, but you can also use the main or any other branch.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Q: How do you publish a GitHub Pages site from a specific folder?

A

A: Select the folder (e.g., /docs) as the source under Settings > Pages.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Q: How do you preview changes to a GitHub Pages site locally?

A

A: Use Jekyll to build and serve the site locally with bundle exec jekyll serve.

17
Q

Q: How do you troubleshoot a GitHub Pages build error?

A

A: Check the Actions or Pages > Build and Deployment logs for error details.

18
Q

Q: How do you update a GitHub Pages site?

A

A: Push changes to the repository branch configured as the Pages source.

19
Q

Q: How do you unpublish a GitHub Pages site?

A

A: Go to Settings > Pages and change the source to None.

20
Q

Q: Can you use GitHub Pages to host dynamic websites?

A

A: No, GitHub Pages is for static websites only, but you can use JavaScript for client-side interactivity.

21
Q

Q: How do you set up a custom 404 page for GitHub Pages?

A

A: Add a 404.html file to the root directory or the configured source folder.

22
Q

Q: What is the maximum file size for GitHub Pages?

A

A: Files cannot exceed 100 MB, and the repository size is limited to 1 GB.

23
Q

Q: Can you deploy GitHub Pages for a private repository?

A

A: Yes, but only on paid GitHub plans.

24
Q

Q: How do you automate GitHub Pages deployment using GitHub Actions?

A

A: Use a workflow file with the actions/checkout and actions/deploy-pages actions.

25
Q

Q: How do you redirect a GitHub Pages site to another URL?

A

A: Add a CNAME file with the target URL or use a <meta></meta> redirect in your index.html file.