Skip to content

Commit

Permalink
Merge branch 'main' into update-pages
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinzunigacuellar authored Jul 3, 2022
2 parents 615851a + 54687b0 commit 1fc85d2
Show file tree
Hide file tree
Showing 50 changed files with 1,618 additions and 1,054 deletions.
13 changes: 7 additions & 6 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
<!-- Thank you for opening a PR! We really appreciate you taking the time to help out 🙌 -->

#### What kind of changes does this PR include?
<!-- Place an X in the [ ] for any of these that apply -->
<!-- Delete any that don’t apply -->

- [ ] Minor content fixes (broken links, typos, etc.)
- [ ] New or updated content
- [ ] Translated content
- [ ] Changes to the docs site code
- [ ] Something else!
- Minor content fixes (broken links, typos, etc.)
- New or updated content
- Translated content
- Changes to the docs site code
- Something else!

#### Description

- Closes # <!-- Add an issue number if this PR will close it. -->
- What does this PR change? Give us a brief description.
- Did you change something visual? A before/after screenshot can be helpful.

Expand Down
149 changes: 71 additions & 78 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,58 +1,86 @@
# Contributor Manual

We welcome contributions of any size and skill level. As an open source project, we believe in giving back to our contributors and are happy to help with guidance on PRs, technical writing, and turning any feature idea into a reality.
We welcome contributions of any size and contributors of any skill level. As an open source project, we believe in giving back to our contributors. We are happy to help with guidance on PRs, technical writing, and turning any feature idea into a reality.

> **Tip for new contributors:**
> Take a look at <https://github.com/firstcontributions/first-contributions> for helpful information on contributing
> Take a look at [GitHub's Docs](https://docs.github.com/en/get-started/quickstart/hello-world) for helpful information on working with GitHub
**Coming-soon**: guides for contributing to the docs as a(n):

- Astro Maintainer with merge permissions in this repository

- Support Squad member who is helping to ensure a two-way flow of information between support threads and docs


This document is an active work in progress! But, we hope you'll find some useful information here to get started.

## Contributions to this Repository
## Types of Contributions

We encourage you to:

We welcome contributions!
- **File an Issue** to let us know of outdated, confusing, or incorrect documentation. You can also let us know of any problems you encounter on the site itself.

While this site is currently in active, planned restructuring and development by our Docs Team, there are some kinds of contributions we are more prepared to handle than others.
- **Start a Discussion** if you're not sure that your "issue" rises to the level of incorrect documentation requiring a "fix," but you still want to share ideas and opinions.

In general:
- **Make a PR directly** for very obvious documentation fixes like typos or broken links.

**File an Issue** to let us know of outdated, confusing, or incorrect documentation.
We provide new content and rework existing content _in response to GitHub Issues and Discussions_.

**Start a Discussion** if you're not sure that your "issue" rises to the level of incorrect documentation requiring a "fix," but you still want to share ideas and opinions.
Submitting an Issue is usually the first step to making a change. After an Issue has been considered by the community, we often reach out to community members to encourage them to submit PRs based on existing Issues.

**Make a PR directly** for very obvious documentation fixes like typos or broken links.
Larger contributions to the docs are encouraged after participating in Issues and Discussions, as unsolicited material may not fit into our existing plans.

Our Docs Team, core maintainers and Technical Steering Committee provide new content, restructure and rewrite existing content _in response to GitHub Issues and Discussions_. We often reach out to community members who have proposed material and participated in these discussions and encourage them to submit PRs after an issue has been considered by the community.
> Tip: Existing PRs and Issues need reviewing, triaging, and feedback, too! You can make valuable contributions by commenting, suggesting, testing, researching, brainstorming and generally helping in all areas on GitHub!
Larger contributions to the docs are encouraged after consultation, as unsolicited material may not fit into our existing plans.

### Examples of Helpful PR Contributions
<!-- ### Examples of Helpful PR Contributions
- typo fixes (to any language)
- correcting broken links (in any language)
- rewriting broken code samples (typos, or incorrect/incomplete code)
- additions or corrections to a short section on a page
- adding a new or undocumented item in a list with a short description
- noting or removing a deprecated feature
- noting or removing a deprecated feature -->

### Examples of Helpful GitHub New Issues
- a particular explanation is confusing
- a suggested rewording of a section
- a code example is wrong (with no fix proposed)
- a11y issues discovered
- missing content or topic not yet covered in the docs
- a (request for a) walk-through of implementing a specific feature (eg. responsive nav bar)

### Examples of Helpful GitHub New Discussions
- should a page be moved into a different section?
- are theme colours too bold/not bold enough?

- a particular explanation is confusing (with explanation)
- a code example is wrong (with or without a proposed fix)
- accessibility (a11y) issues discovered
- missing content
- a request for an example of how to implement a specific feature (e.g. responsive nav bar)

### Examples of Helpful GitHub PRs
- PRs addressing an existing Issue
- unsolicited PRs to address typos, broken links, and other minor problems
<!--TODO: Link to past successful PRs, and explain why they were successful (maybe best for a later section) -->

### Examples of Helpful GitHub Discussions
- is this page in the right section of the docs?
- is anything missing from our docs landing page?
- is this theme color too bold?
- is site navigation clear and helpful?
- is our Astro vs X page providing helpful comparisons between Astro and other website builders?
- is our "Astro vs X" page providing helpful comparisons between Astro and other website builders?

<!-- ## Who Are We? -->

## Making a New Issue

If you're unsure which type of contribution best represents your concern, please [make a new issue](https://github.com/withastro/docs/issues/new)!

### Writing an Issue

Helpful issues usually include:
- Clear descriptive titles
- Links to relevant pages/files
- Explanations as to why (or _for whom_) this is a problem
- Optional: proposed solutions

## Making PRs (pull requests)

Contributions to the documentation site are made by editing the docs repo code. You can do this directly on GitHub.com or by creating a copy of the repository locally, and making your changes there.
Contributions to the documentation site are made by editing the docs repository. You can do this directly on GitHub.com or by creating a copy of the repository locally, making your changes there, and contributing back to our repository.


**Important Note re: Internationalization (i18n)**
**Internationalization (i18n)**

Please only add new text content to the docs **in English**, by modifying only **`.md` files located within `src/pages/en/`**.

Expand All @@ -66,9 +94,22 @@ You can click that button to edit the source code for that page in **GitHub**.
After you make your changes, click **Commit changes**.
This will automatically create a [fork](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/about-forks) of the docs in your GitHub account with the changes.

Once your edits are ready in GitHub, follow the prompts to **create a pull request** and submit your changes for review.
Once you have committed your edits to your fork, follow the prompts to **create a pull request** and submit your changes for review.

Every pull request needs to be reviewed by our contributors and approved by a maintainer.

You can also read an annotated blog post with screenshots [demonstrating the process of editing the docs this way](https://www.rainsberger.ca/posts/contribute-open-source-docs-edit-page-on-github/).

### Contribute PRs using an online code editor (e.g. StackBlitz, CodeSandbox, Gitpod)

Editing a local fork on GitHub.com is convenient for small text changes, but does not allow you to see a live preview of the site.

You can instead open your fork in an online IDE (integrated development environment) for a code editor and live preview without needing to set up any local development environment. Each online IDE has its own shortcut URL for opening an existing repository, and will allow you to create pull requests after you have made changes.

See specific instructions for opening an existing repository in [CodeSandbox](https://codesandbox.io/docs/importing#import-from-github), [StackBlitz](https://developer.stackblitz.com/docs/platform/importing-projects/#import-from-github) and [Gitpod](https://www.gitpod.io/docs/getting-started#start-your-first-workspace) on their respective websites.

Note that CodeSandbox and StackBlitz provide Astro syntax highlighting in their custom code editors, while Gitpod supports the full [Astro VSCode extension](https://docs.astro.build/en/editor-setup/#vs-code).

### Contribute PRs by Developing Locally

To begin developing locally, checkout this project from your machine.
Expand Down Expand Up @@ -99,7 +140,9 @@ git checkout -b add/partial-hydration-typo-fix
```
### Opening a PR

One you have made your changes, you’re ready to create a “Pull Request”! This will let the Astro docs team know you have some changes to propose. At this point we can give you feedback and might request changes. For translations, we like to have at least one other person who knows the language you are translating into review the PR.
One you have made your changes using any of the above methods, you’re ready to create a “Pull Request!”

This will let the Astro docs team know you have some changes to propose. At this point we can give you feedback and might request changes. For translations, we like to have at least one other person who knows the language you are translating into review the PR.

[Read more about making a pull request in GitHub’s docs](https://docs.github.com/en/get-started/quickstart/contributing-to-projects#making-a-pull-request)

Expand Down Expand Up @@ -141,56 +184,6 @@ In the terminal on your computer:
2. Click <kbd>Install</kbd>
3. Follow the instructions to select your fork


-----

## Style Guide

We are developing a full Style Guide to help our contributors provide new content with a consistent style and voice!

### Tone

As a general guide for writing tone, you can follow the [Google Developers Guide](https://developers.google.com/style/tone):

>In your documents, aim for a voice and tone that's conversational, friendly, and respectful without being overly colloquial or frivolous; a voice that's casual and natural and approachable, not pedantic or pushy. Try to sound like a knowledgeable friend who understands what the developer wants to do.
>
>Don't try to write exactly the way you speak; you probably speak more colloquially and verbosely than you should write, at least for developer documentation. But aim for a conversational tone rather than a formal one.
>
>Don't try to be super-entertaining, but also don't aim for super-dry. Be human, let your personality show, and be memorable. But remember that the primary purpose of the document is to provide information to someone who's looking for it and may be in a hurry.
>
>Remember that many readers aren't fluent English speakers, many of them come from cultures different from yours, and your document might be translated into other languages. For more information, see Writing for a global audience.
Also see tips on how to [write inclusive documentation](https://developers.google.com/style/inclusive-documentation).
## Specific Astro Writing Notes

For now, here are some specific items you should know about when writing new docs content.

### Writing Asides (aka how not to abuse `blockquote`)

Sometimes in documentation you want to provide information that is complementary but not strictly part of the current text or call out something that is particularly important. For example, maybe you want to include a tip that isn’t essential but could be helpful or warn a reader about a potential pitfall.

For these use cases you can use our aside component. This is an accessible component, based on the [recommended markup from the BBC’s GEL design system](https://bbc.github.io/gel/components/breakout-boxes/#recommended-markup).

The component has **note**, **tip**, **caution** and **danger** variants with colour, iconography, and default labelling distinct for each.

You can use a simple custom syntax to use the component in Markdown and also avoid needing to import it in the frontmatter all the time.

```
:::tip
It’s best to avoid using `<blockquote>` for things that aren’t quotes.
:::
```

The syntax also supports custom titles for the asides:

```
:::caution[Deprecated]
Using `<blockquote>` for notes is deprecated.
:::
```

You can see all three currently-used styles (we don't have any "danger" yet!) in action on the [Astro Components Page](https://docs.astro.build/en/core-concepts/astro-components/).

## Next Steps

- [Read the docs](https://docs.astro.build/)
Expand Down
145 changes: 145 additions & 0 deletions WRITING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,145 @@
# Writing Guide

This writing guide is in progress! If you have any questions or suggestions, please [make a new issue](https://github.com/withastro/docs/issues/new) and let us know.

Please use the following as a general guideline, and thank you in advance for understanding that contributions may be edited to match existing style, tone, conventions and structure.

## Readability

All readers can benefit from clear, straightforward writing, but this can be particularly important for people who:

- are reading documentation in a non-native language.
- are frustrated, tired, or in a hurry.
- have cognitive, learning or attention difficulties.
- come from a non-traditional development background.

We aim for **clear** and **helpful** documentation that serves the reader above all else!

Usually this means choosing:

- shorter sentences and paragraphs
- simpler vocabulary and phrases
- less jargon
- fewer assumptions about what the reader already knows
- writing out abbreviations and acronyms in full
- bullet points and section headings to break up chunks of text

You can check your writing by pasting it into [Hemingway App](https://hemingwayapp.com/). It will show you if a sentence is too long and will encourage you to use active voice, which is generally shorter and easier to read.

### Tone

As a general guide for writing tone, you can follow the [Google Developers Guide](https://developers.google.com/style/tone):

>In your documents, aim for a voice and tone that's conversational, friendly, and respectful without being overly colloquial or frivolous; a voice that's casual and natural and approachable, not pedantic or pushy. Try to sound like a knowledgeable friend who understands what the developer wants to do.
>
>Don't try to write exactly the way you speak; you probably speak more colloquially and verbosely than you should write, at least for developer documentation. But aim for a conversational tone rather than a formal one.
>
>Don't try to be super-entertaining, but also don't aim for super-dry. Be human, let your personality show, and be memorable. But remember that the primary purpose of the document is to provide information to someone who's looking for it and may be in a hurry.
>
>Remember that many readers aren't fluent English speakers, many of them come from cultures different from yours, and your document might be translated into other languages. For more information, see Writing for a global audience.
Also see tips on how to [write inclusive documentation](https://developers.google.com/style/inclusive-documentation) and [write accessible documentation](https://developers.google.com/style/accessibility)

<!--
-->

## Custom Aside Component

Sometimes in documentation you want to provide information that is complementary but not strictly part of the current text or call out something that is particularly important. For example, maybe you want to include a tip that isn’t essential but could be helpful or warn a reader about a potential pitfall.

For these use cases you can use our aside component. This is an accessible component, based on the [recommended markup from the BBC’s GEL design system](https://bbc.github.io/gel/components/breakout-boxes/#recommended-markup).

The component has **note**, **tip**, **caution** and **danger** variants with colour, iconography, and default labelling distinct for each.

You can use a simple custom syntax to use the component in Markdown and also avoid needing to import it in the frontmatter all the time.

```
:::tip
It’s best to avoid using `<blockquote>` for things that aren’t quotes.
:::
```

The syntax also supports custom titles for the asides:

```
:::caution[Deprecated]
Using `<blockquote>` for notes is deprecated.
:::
```

You can see all three currently-used styles (we don't have any "danger" yet!) in action on the [Astro Components Page](https://docs.astro.build/en/core-concepts/astro-components/).


## Lists vs. Headings

Both lists and headings are used in our docs for readability. We will often start by using `<ul>` to list related items.

But, when individual line items become large, span multiple paragraphs, or contain too many `<code>` terms affecting readability, then we will change to section headings.

Use unordered (bulleted) lists when the order of the items is not important.

Use ordered (numbered) lists when giving steps or instructions to be followed in sequence.

## Headings

New sections should be at the `<h2>` level. The page title is an `<h1>` element.

Please keep headings short. `<h2>` and `<h3>` headings will appear in the right sidebar / "On this page" menu, so please check previews and consider shortening headings if the sidebar entry looks too long.

Headings should not end in punctuation (e.g. ":") but should format `<code>` when appropriate.

Do use headings to break up text into organized sections! Many readers prefer to skim, and your headings will show up in the sidebar / table of contents menu to help your readers navigate, and let them know they are on the correct page.

## Examples (e.g. examples)

Current practice is to use the words "for example" in full within the text of a sentence, but (e.g. Netlify, Vercel) inside a parenthetical so as to not take the reader out of the flow the sentence.

> For example, when passing props . . .
> If you store your Astro project in an online Git provider (e.g. GitHub, GitLab), you can . . .
## Code Samples

Here are a few specific situations we have encountered when writing code samples, and the decisions we have taken:

#### Include File Names

Code should include a sample file name so that we give the reader not only copy-pastable code, but also provide the file into which that code should be pasted.

#### Astro Code Samples
When including the file name in an `.astro` code sample, the file name should come AFTER the opening code fence:

```astro
---
// src/pages/index.astro
const title = "My Page Title"
---
<!-- component template -->
```

### Don't destructure props

The following prop syntax is relevant to all component frameworks we support:

```jsx
// src/components/MySidebar.jsx
export default function MySidebar(props) {
return (
<aside>
<header>{props.title}</header>
<main>{props.children}</main>
<footer>{props.socialLinks}</footer>
</aside>
)
}

```

## Next Steps

- [Read the docs](https://docs.astro.build/)
- [Fork the docs](https://github.com/withastro/docs/fork)
- [Raise an issue](https://github.com/withastro/docs/issues/new)
- [Discuss the docs](https://discord.gg/cZDZU3hJHc)
Loading

0 comments on commit 1fc85d2

Please sign in to comment.