Skip to content
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
2 changes: 2 additions & 0 deletions .vscode/cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
"isset",
"lastmod",
"markdownify",
"mentees",
"navbars",
"nvmrc",
"Occitan",
Expand All @@ -35,6 +36,7 @@
"subfolders",
"tabpane",
"unmarshal",
"unselectable",
"upvote",
"viewports",
"warnf",
Expand Down
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Changelog

The changelog is published online, see
[Changelog](https://main--docsydocs.netlify.app/project/about/changelog/) or the
[Changelog](https://www.docsy.dev/project/about/changelog/) or the
[page source](docsy.dev/content/en/project/about/changelog.md).
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Contributing

The contributing page is published online, see
[Contributing](https://main--docsydocs.netlify.app/project/about/contributing/)
or the [page source](docsy.dev/content/en/project/about/contributing.md).
[Contributing](https://www.docsy.dev/project/about/contributing/) or the
[page source](docsy.dev/content/en/project/about/contributing.md).
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ This project is licensed under the Apache License 2.0, see
<!-- FIXME: once 0.14.0 is released, update the link to the changelog page -->

[official-support]:
https://www.docsy.dev/blog/2024/0.10.0/#hugo-breaking-changes-and-deprecation-notices
https://www.docsy.dev/project/about/changelog/#official-support
[releases]: https://github.com/google/docsy/releases

<!-- cSpell:ignore docsy -->
1 change: 1 addition & 0 deletions docsy.dev/.prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
!/content/en/docs/_index.md
!/content/en/docs/best-practices/**/*.*
!/content/en/docs/content/**/*.*
!/content/en/docs/contribution-guidelines/**/*.*
!/content/en/docs/get-started/**/*.*
!/content/en/docs/language.md
!/content/en/examples/**/*.*
Expand Down
129 changes: 79 additions & 50 deletions docsy.dev/content/en/docs/contribution-guidelines/_index.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,25 @@
---
title: Contribution Guidelines
weight: 9
title: Contribution guidelines
description: How to contribute to Docsy
weight: 9
cSpell:ignore: docsy
---

Docsy is an open source project and we love getting patches and contributions to make Docsy and its docs even better.
Docsy is an open source project and we love getting patches and contributions to
make Docsy and its docs even better.

## Contributing to Docsy
> [!CAUTION] A note for **students** and **prospective mentees**
>
> We welcome your contributions but note that:
>
> - We cannot guarantee when pull requests will be reviewed.
> - Review does not guarantee acceptance or merging.
> - We may reject pull requests with content (e.g., AI-generated) that does not
> meet our quality standards.

The Docsy theme itself lives in <https://github.com/google/docsy>.
> [!NB] Maintainers, see [Maintainer notes](/project/about/contributing/).

## Contributing to Docsy

### Contributor License Agreement

Expand All @@ -31,7 +42,12 @@ information on using pull requests.

### Previewing your changes

As Docsy is a theme rather than a site, you can't serve the theme directly to check your changes work. Instead use your updated local theme in a local copy of the Docsy example site (copy or make your changes in the `themes/docsy` directory) and [preview](/docs/deployment/) from there. Alternatively, clone the [Docsy theme repo](https://github.com/google/docsy) and test your changes in a local copy of this site, as described [below](#previewing-your-changes-locally).
As Docsy is a theme rather than a site, you can't serve the theme directly to
check your changes work. Instead use your updated local theme in a local copy of
the Docsy example site (copy or make your changes in the `themes/docsy`
directory) and [preview](/docs/deployment/) from there. Alternatively, clone the
[Docsy theme repo](https://github.com/google/docsy) and test your changes in a
local copy of this site, as described [below](#previewing-your-changes-locally).

### Community guidelines

Expand All @@ -40,72 +56,87 @@ This project follows

### Creating issues

Alternatively, if there's something you'd like to see in Docsy (or if you've found something that isn't working the way you'd expect), but you're not sure how to fix it yourself, please create an [issue](https://github.com/google/docsy/issues).
Alternatively, if there's something you'd like to see in Docsy (or if you've
found something that isn't working the way you'd expect), but you're not sure
how to fix it yourself, please create an
[issue](https://github.com/google/docsy/issues).

## Contributing to these docs

This user guide is, like our example site, a Docsy site that uses the Hugo static site generator. We welcome updates to the docs!
This user guide is, like our example site, a Docsy site that uses the Hugo
static site generator. We welcome updates to the docs!

We use [Netlify](https://www.netlify.com/) to manage the deployment of the site and provide previews of doc updates. The instructions here assume you're familiar with basic GitHub workflows.
We use [Netlify](https://www.netlify.com/) to manage the deployment of the site
and provide previews of doc updates. The instructions here assume you're
familiar with basic GitHub workflows.

### Quick start with Netlify

1. Fork the [Docsy repo](https://github.com/google/docsy) on GitHub: this site's files live in the `docsy.dev` subdirectory.
1. Fork the [Docsy repo](https://github.com/google/docsy) on GitHub: this site's
files live in the `docsy.dev` subdirectory.
1. Make your changes and send a pull request (PR).
1. If you're not yet ready for a review, add "WIP" to the PR name to indicate
it's a work in progress. (**Don't** add the Hugo property
"draft = true" to the page front matter, because that prevents the
auto-deployment of the content preview described in the next point.)
1. Wait for the automated PR workflow to do some checks. When it's ready,
you should see a comment like this: **deploy/netlify — Deploy preview ready!**
1. Click **Details** to the right of "Deploy preview ready" to see a preview
of your updates.
it's a work in progress. (**Don't** add the Hugo property "draft = true" to
the page front matter, because that prevents the auto-deployment of the
content preview described in the next point.)
1. Wait for the automated PR workflow to do some checks. When it's ready, you
should see a comment like this: **deploy/netlify — Deploy preview ready!**
1. Click **Details** to the right of "Deploy preview ready" to see a preview of
your updates.
1. Continue updating your doc and pushing your changes until you're happy with
the content.
1. When you're ready for a review, add a comment to the PR, and remove any
"WIP" markers.
the content.
1. When you're ready for a review, add a comment to the PR, and remove any "WIP"
markers.

### Updating a single page

If you've just spotted something you'd like to change while using the docs, Docsy has a shortcut for you:
If you've just spotted something you'd like to change while using the docs,
Docsy has a shortcut for you:

1. Click **Edit this page** in the top right hand corner of the page.
1. If you don't already have an up to date fork of the project repo, you are prompted to get one - click **Fork this repository and propose changes** or **Update your Fork** to get an up to date version of the project to edit. The appropriate page in your fork is displayed in edit mode.
1. Follow the rest of the [Quick start with Netlify](#quick-start-with-netlify) process above to make and preview your changes.
1. If you don't already have an up to date fork of the project repo, you are
prompted to get one - click **Fork this repository and propose changes** or
**Update your Fork** to get an up to date version of the project to edit. The
appropriate page in your fork is displayed in edit mode.
1. Follow the rest of the [Quick start with Netlify](#quick-start-with-netlify)
process above to make and preview your changes.

### Previewing your changes locally

If you want to run your own local Hugo server to preview your changes as you work:
If you want to run your own local Hugo server to preview your changes as you
work:

1. Follow the instructions in [Getting started](/docs/getting-started) to install Hugo and any other tools you need.
1. Fork the [Docsy](https://github.com/google/docsy) repo into your own project, then create a local copy using `git clone`:
1. Follow the instructions in [Getting started](/docs/getting-started) to
install Hugo and any other tools you need.
1. Fork the [Docsy](https://github.com/google/docsy) repo into your own project,
then create a local copy using `git clone`:

```sh
git clone https://github.com/google/docsy.git
```
```sh
git clone https://github.com/google/docsy.git
```

1. Change to the `docsy.dev` directory and run the following Hugo command to build the site and start the Hugo server.
Note that you need the `themesDir` flag because the site files are inside the theme repo.
1. Change to the `docsy.dev` directory and run the following Hugo command to
build the site and start the Hugo server. Note that you need the `themesDir`
flag because the site files are inside the theme repo.

```sh
cd docsy.dev
hugo server --themesDir ../..
```
```sh
cd docsy.dev
hugo server --themesDir ../..
```

By default your site will be available at <http://localhost:1313/>. Now that
you're serving your site locally, Hugo will watch for changes to the content
and automatically refresh your site.
By default your site will be available at <http://localhost:1313/>. Now that
you're serving your site locally, Hugo will watch for changes to the content
and automatically refresh your site.

1. Continue with the usual GitHub workflow to edit files, commit them, push the
changes up to your fork, and create a pull request.
changes up to your fork, and create a pull request.

#### Preview your changes using a Docker container

Docsy comes with `Dockerfile` and `docker-compose` files to run the server
locally with Docker, without installing any additional dependencies.

- Using [Docker]:

1. Build the Docker container:

```bash
Expand All @@ -121,7 +152,6 @@ locally with Docker, without installing any additional dependencies.
```

- Using [Docker Compose][docker-compose]:

1. Build the container:

```bash
Expand All @@ -147,18 +177,17 @@ Press **Ctrl + C** to stop the container.
### User guide formatting

We use [Prettier](https://prettier.io) to format the markdown source of the User
Guide. To check the formatting of your documentation changes, use the
following command:
Guide. To check the formatting of your documentation changes, use the following
command:

```bash
npm run check:format
```

To automatically fix formatting issues, run `npm run fix:format`.

Prettier doesn't currently understand Hugo template language directives,
so you might need to bracket such directives using the following ignore
directives:
Prettier doesn't currently understand Hugo template language directives, so you
might need to bracket such directives using the following ignore directives:

```go-html-template
<!-- prettier-ignore-start -->
Expand All @@ -176,7 +205,7 @@ omit the end directive and replace the start directive with
### Creating an issue

If there's something you'd like to see in the docs, but you're not sure how to
fix it yourself, please create an issue in [this
repository](https://github.com/google/docsy). You can also create an issue about
a specific page by clicking the **Create Issue** button in the top right hand
corner of the page.
fix it yourself, please create an issue in
[this repository](https://github.com/google/docsy). You can also create an issue
about a specific page by clicking the **Create Issue** button in the top right
hand corner of the page.
Original file line number Diff line number Diff line change
Expand Up @@ -72,18 +72,13 @@ Install Hugo using

### As an `npm` module

You can install Hugo as an `npm` module using
[`hugo-bin`](https://www.npmjs.com/package/hugo-bin). This adds `hugo-bin` to
your `node_modules` folder and adds the dependency to your `package.json` file.
To install the extended version of Hugo:
You can conveniently install any Hugo version using [hugo-extended][] (replace
`latest` with the version you want to install):

```bash
npm install hugo-extended --save-dev
npm install hugo-extended@latest --save-dev
```

See the [`hugo-bin` documentation](https://www.npmjs.com/package/hugo-bin) for
usage details.

## Install Go language

Hugo's commands for module management require that the Go programming language
Expand Down Expand Up @@ -175,3 +170,5 @@ site

- [Start with a prepopulated site (for beginners)](/docs/get-started/docsy-as-module/example-site-as-template/)
- [Start site from scratch (for experts)](/docs/get-started/docsy-as-module/start-from-scratch/)

[hugo-extended]: https://www.npmjs.com/package/hugo-extended
Loading
Loading