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

Prepare docu and repo for release v0.2.0 #958

Merged
merged 8 commits into from
Apr 7, 2022
5 changes: 5 additions & 0 deletions dependencies/go.mod
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
module github.com/google/docsy/dependencies

go 1.12

require (
github.com/FortAwesome/Font-Awesome v0.0.0-20210804190922-7d3d774145ac // indirect
github.com/twbs/bootstrap v4.6.1+incompatible // indirect
)
deining marked this conversation as resolved.
Show resolved Hide resolved
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ go 1.12

require (
github.com/FortAwesome/Font-Awesome v0.0.0-20210804190922-7d3d774145ac // indirect
github.com/google/docsy/dependencies v0.2.0-pre // indirect
github.com/google/docsy/dependencies v0.2.0 // indirect
github.com/twbs/bootstrap v4.6.1+incompatible // indirect
)
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ If you prefer to create a site from scratch, follow the instructions in Start a
At your Unix shell or Windows command line, run the following command:

```
git clone -b sandbox https://github.com/google/docsy-example.git my-new-site
git clone https://github.com/google/docsy-example.git my-new-site
cd my-new-site
hugo server
```
Expand All @@ -39,14 +39,14 @@ There are two different routes to get a local clone of the example site:
If you want to use a remote repository other than GitHub (such as [GitLab](https://gitlab.com), [BitBucket](https://bitbucket.org/), [AWS CodeCommit](https://aws.amazon.com/codecommit/), [Gitea](https://gitea.io/)) or if you don't want a remote repo at all, simply make a local working copy of the example site directly using `git clone`. As last parameter, give your chosen local repo name (here: `my-new-site`):

```
git clone -b sandbox https://github.com/google/docsy-example.git my-new-site
git clone https://github.com/google/docsy-example.git my-new-site
```

#### Option 2: Using the GitHub UI (local copy + associated GitHub repo)

As the Docsy example site repo is a [template repository](https://github.blog/2019-06-06-generate-new-repositories-with-repository-templates/), creating your own remote GitHub clone of this Docsy example site repo is quite easy:

1. Go to the [Docsy example site repo](https://github.com/google/docsy-example/tree/sandbox) and click **Use this template**.
1. Go to the [Docsy example site repo](https://github.com/google/docsy-example) and click **Use this template**.

1. Chose a name for your new repository (e.g. `my-new-site`) and type it in the **Repository name** field. You can also add an optional **Description**.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@ At your command prompt, run the following:
hugo new site my-new-site
cd my-new-site
hugo mod init github.com/me/my-new-site
hugo mod get github.com/google/docsy@0.2.0-pre
hugo mod get github.com/google/docsy/dependencies@0.2.0-pre
hugo mod get github.com/google/docsy@v0.2.0
cat >> config.toml <<EOL
[module]
[[module.imports]]
Expand All @@ -35,8 +34,7 @@ hugo server
hugo new site my-new-site
cd my-new-site
hugo mod init github.com/me/my-new-site
hugo mod get github.com/google/docsy@0.2.0-pre
hugo mod get github.com/google/docsy/dependencies@0.2.0-pre
hugo mod get github.com/google/docsy@v0.2.0
(echo [module]^

[[module.imports]]^
Expand Down Expand Up @@ -78,14 +76,13 @@ hugo mod init github.com/me/my-new-site

This creates two new files, `go.mod` for the module definitions and `go.sum` which holds the checksums for module verification.

Next declare the Docsy theme module as a dependency for your site. You must also declare the submodule `dependencies` as a second dependency. This submodule pulls in both a workaround for a bug in Go's module management and the dependencies `bootstrap` and `Font-Awesome`.
Next declare the Docsy theme module as a dependency for your site.

```
hugo mod get github.com/google/docsy@0.2.0-pre
hugo mod get github.com/google/docsy/dependencies@0.2.0-pre
hugo mod get github.com/google/docsy@v0.2.0
```

These commands add both the `docsy` theme module and the `dependencies` submodule to your definition file `go.mod`.
This command adds the `docsy` theme module to your definition file `go.mod`.

### Add theme module configuration settings

Expand Down
47 changes: 23 additions & 24 deletions userguide/content/en/docs/Updating/Convert-site-to-module.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@ Run the following from the command line:
{{< tab header="Unix shell" >}}
cd /path/to/my-existing-site
hugo mod init github.com/me-at-github/my-existing-site
hugo mod get github.com/google/docsy@0.2.0-pre
hugo mod get github.com/google/docsy/dependencies@0.2.0-pre
hugo mod get github.com/google/docsy@v0.2.0
sed -i '/theme = \["docsy"\]/d' config.toml
cat >> config.toml <<EOL
[module]
Expand All @@ -29,8 +28,7 @@ hugo server
{{< tab header="Windows command line" >}}
cd my-existing-site
hugo mod init github.com/me-at-github/my-existing-site
hugo mod get github.com/google/docsy@0.2.0-pre
hugo mod get github.com/google/docsy/dependencies@0.2.0-pre
hugo mod get github.com/google/docsy@v0.2.0
findstr /v /c:"theme = [\"docsy\"]" config.toml > config.toml.temp
move /Y config.toml.temp config.toml
(echo [module]^
Expand Down Expand Up @@ -65,14 +63,13 @@ hugo mod init github.com/me/my-existing-site

This creates two new files, `go.mod` for the module definitions and `go.sum` which holds the checksums for module verification.

Next declare the Docsy theme module as a dependency for your site. You must also declare the submodule `dependencies` as a second dependency. This submodule pulls in both a workaround for a bug in Go’s module management and the dependencies `bootstrap` and `Font-Awesome`.
Next declare the Docsy theme module as a dependency for your site.

```
hugo mod get github.com/google/docsy@0.2.0-pre
hugo mod get github.com/google/docsy/dependencies@0.2.0-pre
hugo mod get github.com/google/docsy@v0.2.0
```

These commands add both the `docsy` theme module and the `dependencies` submodule to your definition file `go.mod`.
This command adds the `docsy` theme module to your definition file `go.mod`.

### Update your config file

Expand Down Expand Up @@ -150,10 +147,10 @@ To make sure that your configuration settings are correct, run the command `hugo
```
hugo mod graph
hugo: collected modules in 1092 ms
github.com/me/my-existing-site github.com/google/docsy@0.2.0-pre
github.com/me/my-existing-site github.com/google/docsy/dependencies@0.2.0-pre
github.com/google/docsy/dependencies@0.2.0-pre github.com/twbs/bootstrap@v4.6.1+incompatible
github.com/google/docsy/dependencies@0.2.0-pre github.com/FortAwesome/Font-Awesome@v0.0.0-20210804190922-7d3d774145ac
github.com/me/my-existing-site github.com/google/docsy@v0.2.0
github.com/me/my-existing-site github.com/google/docsy/dependencies@v0.2.0
github.com/google/docsy/dependencies@v0.2.0 github.com/twbs/bootstrap@v4.6.1+incompatible
github.com/google/docsy/dependencies@v0.2.0 github.com/FortAwesome/Font-Awesome@v0.0.0-20210804190922-7d3d774145ac
```

Make sure that three lines with dependencies `docsy`, `bootstrap` and `Font-Awesome` are listed. If not, please double check your config settings.
Expand All @@ -171,35 +168,37 @@ hugo: cleaned module cache for "github.com/twbs/bootstrap"
```
{{% /alert %}}

### Clean up your repository
## Clean up your repository

Since your site now uses Hugo Modules, your previously used `themes` directory can be removed:
Since your site now uses Hugo Modules, you can remove `docsy` from the `themes` directory, as instructed below.
First, change to the root directory of your site:

```
rm -rf /path/to/your/theme
cd /path/to/my-existing-site
```

If your Docsy theme was installed as submodule, you can remove the theme submodule:
### Previous use of Docsy theme as git clone

Simply remove the subdirectory `docsy` inside your `themes` directory:

```
git rm --cached /path/to/your/submodule/theme
git add .
rm -rf themes/docsy
```

With your submodule deleted, now delete the relevant line from the hidden submodule definition file `.gitmodules`, too. If this is the only line, you can delete the file altogether.
### Previous use of Docsy theme as git submodule

If your Docsy theme was installed as submodule, use git's `rm` subcommand to remove the subdirectory `docsy` inside your `themes` directory:

```
rm .gitmodules
git rm -rf themes/docsy
```

Finally, delete the now untracked submodule files and also clean up the internal directory that git used to store your git submodules:
You are now ready to commit your changes to your repository:

```
rm -rf /path/to/your/submodule/theme
rm -rf .git/modules
git commit -m "Removed docsy git submodule"
```


{{% alert title="Attention" color="warning" %}}
Be careful when using the `rm -rf` command, make sure that you don't inadvertently delete any productive data files!
{{% /alert %}}
4 changes: 2 additions & 2 deletions userguide/content/en/docs/Updating/Updating-hugo-module.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ Hugo automatically pulls in the latest theme version. That's it, your update is


{{% alert title="Tip" %}}
If you want to set your module to a certain version inside the docsy theme repo, simply specific the name of the tag representing this version (here: _0.2.0_) when updating your theme:
If you want to set your module to a certain version inside the docsy theme repo, simply specific the name of the tag representing this version (here: _v0.2.0_) when updating your theme:

```
hugo mod get -u github.com/google/docsy@0.2.0
hugo mod get -u github.com/google/docsy@v0.2.0
```

Instead of a version tag, you can also specify a commit hash inside the repo (here: _c7b9901e_) when updating your theme:
Expand Down