diff --git a/.devcontainer/test-custom-devcontainer/devcontainer.json b/.devcontainer/test-custom-devcontainer/devcontainer.json index 1faad1483dc1..587805e006bc 100644 --- a/.devcontainer/test-custom-devcontainer/devcontainer.json +++ b/.devcontainer/test-custom-devcontainer/devcontainer.json @@ -1,5 +1,5 @@ { - "name": "test", + "name": "Test postCreateCommand", "image": "mcr.microsoft.com/devcontainers/universal:linux", "settings": { @@ -22,6 +22,6 @@ "forwardPorts": [5000], // Use 'postCreateCommand' to run commands after the container is created. - "postCreateCommand": "echo test > aaa-TEST.txt" + "postCreateCommand": "echo Added: `date` > aaa-TEST.txt" } diff --git a/content/get-started/using-git/about-git.md b/content/get-started/using-git/about-git.md index 55b44cb031dc..1893ccfe5ed3 100644 --- a/content/get-started/using-git/about-git.md +++ b/content/get-started/using-git/about-git.md @@ -162,10 +162,3 @@ There are two primary ways people collaborate on {% data variables.product.produ With a shared repository, individuals and teams are explicitly designated as contributors with read, write, or administrator access. This simple permission structure, combined with features like protected branches, helps teams progress quickly when they adopt {% data variables.product.product_name %}. For an open source project, or for projects to which anyone can contribute, managing individual permissions can be challenging, but a fork and pull model allows anyone who can view the project to contribute. A fork is a copy of a project under a developer's personal account. Every developer has full control of their fork and is free to implement a fix or a new feature. Work completed in forks is either kept separate, or is surfaced back to the original project via a pull request. There, maintainers can review the suggested changes before they're merged. For more information, see "[AUTOTITLE](/get-started/quickstart/contributing-to-projects)." - -## Further reading - -The {% data variables.product.product_name %} team has created a library of educational videos and guides to help users continue to develop their skills and build better software. - -- [Beginner projects to explore](https://github.com/showcases/great-for-new-contributors) -- [{% data variables.product.product_name %} video guides](https://youtube.com/githubguides) \ No newline at end of file diff --git a/content/pages/setting-up-a-github-pages-site-with-jekyll/about-jekyll-build-errors-for-github-pages-sites.md b/content/pages/setting-up-a-github-pages-site-with-jekyll/about-jekyll-build-errors-for-github-pages-sites.md index 27e304a15ced..5b61d5481365 100644 --- a/content/pages/setting-up-a-github-pages-site-with-jekyll/about-jekyll-build-errors-for-github-pages-sites.md +++ b/content/pages/setting-up-a-github-pages-site-with-jekyll/about-jekyll-build-errors-for-github-pages-sites.md @@ -70,7 +70,7 @@ We recommend testing your site locally, which allows you to see build error mess ## Viewing Jekyll build error messages in your pull request with a third-party CI service -You can configure a third-party service, such as [Travis CI](https://travis-ci.org/), to display error messages after each commit. +You can configure a third-party service, such as [Travis CI](https://travis-ci.com/), to display error messages after each commit. 1. If you haven't already, add a file called _Gemfile_ in the root of your publishing source, with the following content: ```ruby @@ -78,7 +78,7 @@ You can configure a third-party service, such as [Travis CI](https://travis-ci.o gem `github-pages` ``` -2. Configure your site's repository for the testing service of your choice. For example, to use [Travis CI](https://travis-ci.org/), add a file named _.travis.yml_ in the root of your publishing source, with the following content: +2. Configure your site's repository for the testing service of your choice. For example, to use [Travis CI](https://travis-ci.com/), add a file named _.travis.yml_ in the root of your publishing source, with the following content: ```yaml language: ruby rvm: diff --git a/content/rest/guides/building-a-ci-server.md b/content/rest/guides/building-a-ci-server.md index 0487e646ad1a..de1f2f864ca6 100644 --- a/content/rest/guides/building-a-ci-server.md +++ b/content/rest/guides/building-a-ci-server.md @@ -182,7 +182,7 @@ You can always rely on [GitHub integrations][integrations]. [webhook]: /webhooks/ [octokit.rb]: https://github.com/octokit/octokit.rb [access token]: /articles/creating-an-access-token-for-command-line-use -[travis api]: https://api.travis-ci.org/docs/ +[travis api]: https://api.travis-ci.com/docs/ [janky]: https://github.com/github/janky [heaven]: https://github.com/atmos/heaven [hubot]: https://github.com/github/hubot diff --git a/content/rest/guides/delivering-deployments.md b/content/rest/guides/delivering-deployments.md index e6b6dc988d6f..7dfa9f2232fa 100644 --- a/content/rest/guides/delivering-deployments.md +++ b/content/rest/guides/delivering-deployments.md @@ -198,7 +198,7 @@ You can always rely on [GitHub integrations][integrations]. [webhook]: /webhooks/ [octokit.rb]: https://github.com/octokit/octokit.rb [access token]: /articles/creating-an-access-token-for-command-line-use -[travis api]: https://api.travis-ci.org/docs/ +[travis api]: https://api.travis-ci.com/docs/ [janky]: https://github.com/github/janky [heaven]: https://github.com/atmos/heaven [hubot]: https://github.com/github/hubot diff --git a/contributing/content-style-guide.md b/contributing/content-style-guide.md index 1dfe2da5caf3..9db2a35a8b6f 100644 --- a/contributing/content-style-guide.md +++ b/contributing/content-style-guide.md @@ -157,6 +157,10 @@ For more information, see the [content model](/contributing/content-model.md#tit ## Images +We use static images including screenshots, diagrams, and graphs throughout the docs to complement textual information. + +Do not use animated GIFs in the docs. + ### Alt text Every image must include alt text providing a textual equivalent of the visual information. @@ -371,6 +375,7 @@ Some best practices for using links: - Links should be meaningful and provide high value to the user’s journey—link out carefully. - Move links that are helpful but not necessary to an article’s further reading section. - Do not repeat the same link more than once in the same article or under the same H2 header. +- Do not include the `apiVersion` query parameter in REST links unless you need to link to a specific calendar version of the REST docs. (This should be a rare occurance.) For accessibility and readability, avoid inline or midsentence links. - **Use:** OAuth2 tokens can be acquired programmatically for applications that are not websites. For more information, see "[Setting up and registering OAuth Apps](https://developer.github.com/apps/building-integrations/setting-up-and-registering-oauth-apps/)" and "[Create a new authorization](https://docs.github.com/en/enterprise-server@2.22/rest/reference/oauth-authorizations/#create-a-new-authorization)." diff --git a/tests/fixtures/content/get-started/images/index.md b/tests/fixtures/content/get-started/images/index.md index 3a784e489156..0aba6db4d407 100644 --- a/tests/fixtures/content/get-started/images/index.md +++ b/tests/fixtures/content/get-started/images/index.md @@ -9,4 +9,5 @@ versions: children: - /single-image - /images-in-lists + - /link-to-image --- diff --git a/tests/fixtures/content/get-started/images/link-to-image.md b/tests/fixtures/content/get-started/images/link-to-image.md new file mode 100644 index 000000000000..8c7ce1fb8abc --- /dev/null +++ b/tests/fixtures/content/get-started/images/link-to-image.md @@ -0,0 +1,14 @@ +--- +title: Link to image +intro: You can link directly to an asset +versions: + fpt: '*' + ghes: '*' + ghae: '*' + ghec: '*' +type: how_to +--- + +## Expand your mind + +[View image](/assets/images/_fixtures/screenshot.png) diff --git a/tests/rendering-fixtures/images.js b/tests/rendering-fixtures/images.js index 9c34d08b6eb3..f6e4c9b94cc9 100644 --- a/tests/rendering-fixtures/images.js +++ b/tests/rendering-fixtures/images.js @@ -1,6 +1,6 @@ import sharp from 'sharp' -import { get, getDOM } from '../helpers/e2etest.js' +import { get, head, getDOM } from '../helpers/e2etest.js' describe('render Markdown image tags', () => { test('page with a single image', async () => { @@ -46,4 +46,15 @@ describe('render Markdown image tags', () => { const imageSpan = $('#article-contents > div > ol > li > span.procedural-image-wrapper') expect(imageSpan.length).toBe(1) }) + + test("links directly to images aren't rewritten", async () => { + const $ = await getDOM('/get-started/images/link-to-image') + // There is only 1 link inside that page + const links = $('#article-contents a[href^="/"]') // exclude header link + expect(links.length).toBe(1) + // This proves that the link didn't get rewritten to `/en/...` + expect(links.attr('href'), '/assets/images/_fixtures/screenshot.png') + const res = await head(links.attr('href')) + expect(res.statusCode).toBe(200) + }) }) diff --git a/tests/rendering/server.js b/tests/rendering/server.js index ab61547e7b80..0a185919547d 100644 --- a/tests/rendering/server.js +++ b/tests/rendering/server.js @@ -284,107 +284,6 @@ describe('server', () => { expect($('a[href="/en/authentication/keeping-your-account-and-data-secure"]')).toHaveLength(1) }) - describe('image asset paths', () => { - const localImageCacheBustBasePathRegex = /^\/assets\/cb-\d+\/images\// - const localImageBasePath = '/assets/images' - const legacyImageBasePath = '/assets/enterprise' - const latestEnterprisePath = `/en/enterprise/${enterpriseServerReleases.latest}` - const oldestEnterprisePath = `/en/enterprise/${enterpriseServerReleases.oldestSupported}` - - test('github articles on dotcom have images that point to local assets dir', async () => { - const $ = await getDOM( - '/en/github/authenticating-to-github/configuring-two-factor-authentication' - ) - const imageSrc = $('img').first().attr('src') - expect( - localImageCacheBustBasePathRegex.test(imageSrc) || imageSrc.startsWith(localImageBasePath) - ).toBe(true) - }) - - test('github articles on GHE have images that point to local assets dir', async () => { - const $ = await getDOM( - `${latestEnterprisePath}/user/github/authenticating-to-github/configuring-two-factor-authentication` - ) - const imageSrc = $('img').first().attr('src') - expect( - localImageCacheBustBasePathRegex.test(imageSrc) || - imageSrc.startsWith(localImageBasePath) || - imageSrc.startsWith(legacyImageBasePath) - ).toBe(true) - }) - - test('admin articles on latest version of GHE have images that point to local assets dir', async () => { - const $ = await getDOM( - `${latestEnterprisePath}/admin/configuration/configuring-github-connect/enabling-unified-search-for-your-enterprise` - ) - const imageSrc = $('img').first().attr('src') - expect( - localImageCacheBustBasePathRegex.test(imageSrc) || - imageSrc.startsWith(localImageBasePath) || - imageSrc.startsWith(legacyImageBasePath) - ).toBe(true) - }) - - test('admin articles on older GHE versions have images that point to local assets dir', async () => { - const $ = await getDOM( - `${oldestEnterprisePath}/admin/configuration/configuring-github-connect/enabling-unified-search-for-your-enterprise` - ) - const imageSrc = $('img').first().attr('src') - expect( - localImageCacheBustBasePathRegex.test(imageSrc) || - imageSrc.startsWith(localImageBasePath) || - imageSrc.startsWith(legacyImageBasePath) - ).toBe(true) - }) - - test('links that point to /assets are not rewritten with a language code', async () => { - const $ = await getDOM('/en/site-policy/privacy-policies/github-privacy-statement') - expect($('#french').next().children('a').attr('href').startsWith(localImageBasePath)).toBe( - true - ) - }) - - test('github articles on GHEC have images that point to local assets dir', async () => { - const $ = await getDOM( - '/en/enterprise-cloud@latest/billing/managing-billing-for-your-github-account/viewing-the-subscription-and-usage-for-your-enterprise-account' - ) - const imageSrc = $('img').first().attr('src') - expect( - localImageCacheBustBasePathRegex.test(imageSrc) || imageSrc.startsWith(localImageBasePath) - ).toBe(true) - }) - - test('admin articles on GHEC have images that point to local assets dir', async () => { - const $ = await getDOM( - '/en/enterprise-cloud@latest/admin/configuration/configuring-your-enterprise/verifying-or-approving-a-domain-for-your-enterprise' - ) - const imageSrc = $('img').first().attr('src') - expect( - localImageCacheBustBasePathRegex.test(imageSrc) || imageSrc.startsWith(localImageBasePath) - ).toBe(true) - }) - - test('github articles on GHAE have images that point to local assets dir', async () => { - const $ = await getDOM( - '/en/github-ae@latest/github/administering-a-repository/changing-the-default-branch' - ) - const imageSrc = $('img').first().attr('src') - expect( - localImageCacheBustBasePathRegex.test(imageSrc) || - imageSrc.startsWith(localImageBasePath) || - imageSrc.startsWith(legacyImageBasePath) - ).toBe(true) - }) - - test('admin articles on GHAE have images that point to local assets dir', async () => { - const $ = await getDOM('/en/github-ae@latest/admin/user-management/managing-dormant-users') - const imageSrc = $('img').first().attr('src') - expect( - localImageCacheBustBasePathRegex.test(imageSrc) || imageSrc.startsWith(localImageBasePath) - ).toBe(true) - }) - }) - describe('English local links', () => { const latestEnterprisePath = `/en/enterprise-server@${enterpriseServerReleases.latest}`