Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

repo sync #20070

Merged
merged 6 commits into from
Aug 23, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file removed assets/images/help/pages/cancel-edit.png
Binary file not shown.
Binary file removed assets/images/help/pages/choose-a-theme.png
Binary file not shown.
Binary file removed assets/images/help/pages/select-theme.png
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -672,7 +672,7 @@ You can add the optional `--prune` argument to remove unreachable Git objects th

{% warning %}

**Warning**: Before using the `--prune` argument to remove unreachable Git objects, put {% data variables.product.product_location %} into maintenance mode, or ensure the repository is offline. For more information, see "[Enabling and scheduling maintenance mode](/admin/configuration/configuring-your-enterprise/enabling-and-scheduling-maintenance-mode)."
**Warning**: Before using the `--prune` argument to remove unreachable Git objects, put {% data variables.product.product_location %} into maintenance mode, or ensure all repositories within the same repository network are locked. For more information, see "[Enabling and scheduling maintenance mode](/admin/configuration/configuring-your-enterprise/enabling-and-scheduling-maintenance-mode)."

{% endwarning %}

Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,9 @@ shortTitle: Create a GitHub Pages site

You can add more pages to your site by creating more new files. Each file will be available on your site in the same directory structure as your publishing source. For example, if the publishing source for your project site is the `gh-pages` branch, and you create a new file called `/about/contact-us.md` on the `gh-pages` branch, the file will be available at {% ifversion fpt or ghec %}`https://<user>.github.io/<repository>/{% else %}`http(s)://<hostname>/pages/<username>/<repository>/{% endif %}about/contact-us.html`.

You can also add a theme to customize your site’s look and feel. For more information, see {% ifversion fpt or ghec %}"[Adding a theme to your {% data variables.product.prodname_pages %} site with the theme chooser](/articles/adding-a-theme-to-your-github-pages-site-with-the-theme-chooser){% else %}"[Adding a theme to your {% data variables.product.prodname_pages %} site using Jekyll](/articles/adding-a-theme-to-your-github-pages-site-using-jekyll){% endif %}."
You can also add a theme to customize your site’s look and feel. For more information, see "[Adding a theme to your {% data variables.product.prodname_pages %} site using Jekyll](/articles/adding-a-theme-to-your-github-pages-site-using-jekyll)".

To customize your site even more, you can use Jekyll, a static site generator with built-in support for {% data variables.product.prodname_pages %}. For more information, see "[About {% data variables.product.prodname_pages %} and Jekyll](/articles/about-github-pages-and-jekyll)."
To customize your site even more, you can use Jekyll, a static site generator with built-in support for {% data variables.product.prodname_pages %}. For more information, see "[About {% data variables.product.prodname_pages %} and Jekyll](/articles/about-github-pages-and-jekyll)".

## Further reading

Expand Down
2 changes: 0 additions & 2 deletions content/pages/getting-started-with-github-pages/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ topics:
children:
- /about-github-pages
- /creating-a-github-pages-site
- /adding-a-theme-to-your-github-pages-site-with-the-theme-chooser
- /configuring-a-publishing-source-for-your-github-pages-site
- /changing-the-visibility-of-your-github-pages-site
- /creating-a-custom-404-page-for-your-github-pages-site
Expand All @@ -26,4 +25,3 @@ children:
- /unpublishing-a-github-pages-site
shortTitle: Get started
---

2 changes: 0 additions & 2 deletions content/pages/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ featuredLinks:
- '{% ifversion fpt or ghec %}/pages/configuring-a-custom-domain-for-your-github-pages-site/managing-a-custom-domain-for-your-github-pages-site{% endif %}'
- '{% ifversion ghes or ghae %}/pages/setting-up-a-github-pages-site-with-jekyll/creating-a-github-pages-site-with-jekyll{% endif %}'
- '{% ifversion ghec %}/pages/getting-started-with-github-pages/changing-the-visibility-of-your-github-pages-site{% endif %}'
- '{% ifversion fpt %}/pages/getting-started-with-github-pages/adding-a-theme-to-your-github-pages-site-with-the-theme-chooser{% endif %}'
- '{% ifversion ghes or ghae %}/pages/setting-up-a-github-pages-site-with-jekyll/adding-content-to-your-github-pages-site-using-jekyll{% endif %}'
popular:
- '{% ifversion fpt or ghec %}/pages/configuring-a-custom-domain-for-your-github-pages-site/about-custom-domains-and-github-pages{% endif %}'
Expand Down Expand Up @@ -51,4 +50,3 @@ children:
- /setting-up-a-github-pages-site-with-jekyll
- /configuring-a-custom-domain-for-your-github-pages-site
---

13 changes: 6 additions & 7 deletions content/pages/quickstart.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,12 @@ This guide will lead you through creating a user site at `username.github.io`.
![Repository name field](/assets/images/help/pages/create-repository-name-pages.png)
{% data reusables.repositories.sidebar-settings %}
{% data reusables.pages.sidebar-pages %}
1. Click **Choose a theme**.
![Choose a theme button](/assets/images/help/pages/choose-theme.png)
2. The Theme Chooser will open. Browse the available themes, then click **Select theme** to select a theme. It's easy to change your theme later, so if you're not sure, just choose one for now.
![Theme options and Select theme button](/assets/images/help/pages/select-theme.png)
3. After you select a theme, your repository's `README.md` file will open in the file editor. The `README.md` file is where you will write the content for your site. You can edit the file or keep the default content for now.
4. When you are done editing the file, click **Commit changes**.
5. Visit `username.github.io` to view your new website. **Note:** It can take up to 20 minutes for changes to your site to publish after you push the changes to {% data variables.product.product_name %}.
1. Under "Build and deployment", under "Source", select **Deploy from a branch**.
1. Under "Build and deployment", under "Branch", use the **None** or **Branch** drop-down menu and select a publishing source.

![Drop-down menu to select a publishing source](/assets/images/help/pages/publishing-source-drop-down.png)
1. Optionally, open the `README.md` file of your repository. The `README.md` file is where you will write the content for your site. You can edit the file or keep the default content for now.
1. Visit `username.github.io` to view your new website. **Note:** It can take up to 10 minutes for changes to your site to publish after you push the changes to {% data variables.product.product_name %}.

## Changing the title and description

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,9 @@ You can add `site.github` to a post or page to add any repository references met
{% data reusables.pages.add-jekyll-theme %} For more information, see "[Themes](https://jekyllrb.com/docs/themes/)" in the Jekyll documentation.

{% ifversion fpt or ghec %}
You can add a supported theme to your site on {% data variables.product.prodname_dotcom %}. For more information, see "[Supported themes](https://pages.github.com/themes/)" on the {% data variables.product.prodname_pages %} site and "[Adding a theme to your {% data variables.product.prodname_pages %} site with the theme chooser](/articles/adding-a-theme-to-your-github-pages-site-with-the-theme-chooser)."
You can add a supported theme to your site on {% data variables.product.prodname_dotcom %}. For more information, see "[Supported themes](https://pages.github.com/themes/)" on the {% data variables.product.prodname_pages %} site and [Adding a theme to your {% data variables.product.prodname_pages %} site using Jekyll"](/articles/adding-a-theme-to-your-github-pages-site-using-jekyll).

To use any other open source Jekyll theme hosted on {% data variables.product.prodname_dotcom %}, you can add the theme manually.{% else %} You can add a theme to your site manually.{% endif %} For more information, see{% ifversion fpt or ghec %} [themes hosted on {% data variables.product.prodname_dotcom %}](https://github.com/topics/jekyll-theme) and{% else %} "[Supported themes](https://pages.github.com/themes/)" on the {% data variables.product.prodname_pages %} site and{% endif %} "[Adding a theme to your {% data variables.product.prodname_pages %} site using Jekyll](/articles/adding-a-theme-to-your-github-pages-site-using-jekyll)."
To use any other open source Jekyll theme hosted on {% data variables.product.prodname_dotcom %}, you can add the theme manually.{% else %} You can add a theme to your site manually.{% endif %} For more information, see{% ifversion fpt or ghec %} [themes hosted on {% data variables.product.prodname_dotcom %}](https://github.com/topics/jekyll-theme) and{% else %} "[Supported themes](https://pages.github.com/themes/)" on the {% data variables.product.prodname_pages %} site and{% endif %} "[Adding a theme to your {% data variables.product.prodname_pages %} site using Jekyll](/articles/adding-a-theme-to-your-github-pages-site-using-jekyll)".

You can override any of your theme's defaults by editing the theme's files. For more information, see your theme's documentation and "[Overriding your theme's defaults](https://jekyllrb.com/docs/themes/#overriding-theme-defaults)" in the Jekyll documentation.

Expand All @@ -96,7 +96,7 @@ You can download or create Jekyll plugins to extend the functionality of Jekyll
- [`jekyll-titles-from-headings`](https://github.com/benbalter/jekyll-titles-from-headings)
- [`jekyll-relative-links`](https://github.com/benbalter/jekyll-relative-links)

You can enable additional plugins by adding the plugin's gem to the `plugins` setting in your *_config.yml* file. For more information, see "[Configuration](https://jekyllrb.com/docs/configuration/)" in the Jekyll documentation.
You can enable additional plugins by adding the plugin's gem to the `plugins` setting in your *_config.yml* file. For more information, see "[Configuration](https://jekyllrb.com/docs/configuration/)" in the Jekyll documentation.

For a list of supported plugins, see "[Dependency versions](https://pages.github.com/versions/)" on the {% data variables.product.prodname_pages %} site. For usage information for a specific plugin, see the plugin's documentation.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ shortTitle: Jekyll build errors for Pages

{% note %}

**Note:** It can take up to 20 minutes for changes to your site to publish after you push the changes to {% data variables.product.product_name %}.
**Note:** It can take up to 10 minutes for changes to your site to publish after you push the changes to {% data variables.product.product_name %}.

{% endnote %}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ redirect_from:
- /articles/adding-a-jekyll-theme-to-your-github-pages-site
- /articles/adding-a-theme-to-your-github-pages-site-using-jekyll
- /github/working-with-github-pages/adding-a-theme-to-your-github-pages-site-using-jekyll
- /pages/getting-started-with-github-pages/adding-a-theme-to-your-github-pages-site-with-the-theme-chooser
product: '{% data reusables.gated-features.pages %}'
versions:
fpt: '*'
Expand Down
9 changes: 7 additions & 2 deletions middleware/archived-enterprise-versions-assets.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@ import got from 'got'

import patterns from '../lib/patterns.js'
import isArchivedVersion from '../lib/is-archived-version.js'
import { setFastlySurrogateKey, SURROGATE_ENUMS } from './set-fastly-surrogate-key.js'
import { cacheControlFactory } from './cache-control.js'

const cacheControl = cacheControlFactory(60 * 60 * 24)
const cacheControl = cacheControlFactory(60 * 60 * 24 * 365)

// This module handles requests for the CSS and JS assets for
// deprecated GitHub Enterprise versions by routing them to static content in
Expand Down Expand Up @@ -58,8 +59,12 @@ export default async function archivedEnterpriseVersionsAssets(req, res, next) {
res.set('content-length', r.headers['content-length'])
res.set('x-is-archived', 'true')
res.set('x-robots-tag', 'noindex')
// Allow the browser and Fastly to cache these

// This cache configuration should match what we do for archived
// enterprise version URLs that are not assets.
cacheControl(res)
setFastlySurrogateKey(res, SURROGATE_ENUMS.MANUAL)

return res.send(r.body)
} catch (err) {
// Primarly for the developers working on tests that mock
Expand Down
5 changes: 4 additions & 1 deletion tests/routing/deprecated-enterprise-versions.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ describe('recently deprecated redirects', () => {
// 301 redirects are safe to cache aggressively
expect(res.headers['set-cookie']).toBeUndefined()
expect(res.headers['cache-control']).toContain('public')
expect(res.headers['cache-control']).toMatch(/max-age=\d+/)
expect(res.headers['cache-control']).toMatch(/max-age=[1-9]/)
})
test('redirects enterprise-server 3.0 with actual redirect without language', async () => {
const res = await get(
Expand Down Expand Up @@ -214,6 +214,9 @@ describe('JS and CSS assets', () => {
expect(result.statusCode).toBe(200)
expect(result.headers['x-is-archived']).toBe('true')
expect(result.headers['content-type']).toBe('text/css; charset=utf-8')
expect(result.headers['cache-control']).toContain('public')
expect(result.headers['cache-control']).toMatch(/max-age=[1-9]/)
expect(result.headers['surrogate-key']).toBe(SURROGATE_ENUMS.MANUAL)
})

it('returns the expected CSS file', async () => {
Expand Down
10 changes: 5 additions & 5 deletions tests/unit/static-assets.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,10 +112,10 @@ describe('archived enterprise static assets', () => {
setDefaultFastlySurrogateKey(req, res, () => {})
await archivedEnterpriseVersionsAssets(req, res, next)
expect(res.statusCode).toBe(200)
checkCachingHeaders(res, true, 60)
checkCachingHeaders(res, false, 60)
})

it('should proxy if the Referrer header indicates so', async () => {
it('should proxy if the Referrer header indicates so on home page', async () => {
const req = mockRequest('/_next/static/only-on-proxy.css', {
headers: {
Referrer: '/enterprise/2.21',
Expand All @@ -128,10 +128,10 @@ describe('archived enterprise static assets', () => {
setDefaultFastlySurrogateKey(req, res, () => {})
await archivedEnterpriseVersionsAssets(req, res, next)
expect(res.statusCode).toBe(200)
checkCachingHeaders(res, true, 60)
checkCachingHeaders(res, false, 60)
})

it('should proxy if the Referrer header indicates so', async () => {
it('should proxy if the Referrer header indicates so on sub-page', async () => {
const req = mockRequest('/_next/static/only-on-2.3.css', {
headers: {
Referrer: '/en/enterprise-server@2.3/some/page',
Expand All @@ -144,7 +144,7 @@ describe('archived enterprise static assets', () => {
setDefaultFastlySurrogateKey(req, res, () => {})
await archivedEnterpriseVersionsAssets(req, res, next)
expect(res.statusCode).toBe(200)
checkCachingHeaders(res, true, 60)
checkCachingHeaders(res, false, 60)
})

it('might still 404 even with the right referrer', async () => {
Expand Down