Skip to content

Commit cba8f23

Browse files
alphapapastefanvjarrodmillmanpre-commit-ci[bot]
authored
Docs: (getstarted.md) Update instructions (#401)
* Docs: (getstarted.md) Update instructions See <#397>. * Change: Address feedback Co-authored-by: Stefan van der Walt <stefanv@berkeley.edu> Co-authored-by: Jarrod Millman <jarrod.millman@gmail.com> * Add: Dart Sass installation instructions Hugo's guide seems comprehensive and well-written, so we link to it. * Minor change Co-authored-by: Stefan van der Walt <stefanv@berkeley.edu> * '[pre-commit.ci 🤖] Apply code format tools to PR' --------- Co-authored-by: Stefan van der Walt <stefanv@berkeley.edu> Co-authored-by: Jarrod Millman <jarrod.millman@gmail.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent abeb16c commit cba8f23

File tree

1 file changed

+54
-32
lines changed

1 file changed

+54
-32
lines changed

doc/content/getstarted.md

Lines changed: 54 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -2,62 +2,84 @@
22
title: Get Started
33
---
44

5-
## The Scientific Python theme for Hugo
5+
The **Scientific Python Hugo Theme** is a theme for the [Hugo](https://gohugo.io) static site generator, inspired by the [PyData Sphinx Theme](https://pydata-sphinx-theme.readthedocs.io/en/latest/).
66

7-
The **Scientific Python Hugo Theme** is a theme for the
8-
[Hugo](https://gohugo.io) static site generator based on the
9-
[Fresh](https://github.com/StefMa/hugo-fresh) theme.
7+
To use this theme on your site, follow these instructions.
108

11-
To use the theme, you will need to
12-
[download hugo](https://github.com/gohugoio/hugo/releases)
13-
and place it on your path.
9+
## Install Hugo
1410

15-
## Download and install
11+
To use this theme, you will need Hugo. Hugo is a static site generator, i.e. it takes Markdown source files and transforms them into a website.
1612

17-
1. Download [the theme ZIP file](https://github.com/scientific-python/scientific-python-hugo-theme/archive/refs/heads/main.zip) and extract it.
13+
1. Install Hugo according to [its installation instructions](https://gohugo.io/installation/). The standard edition of Hugo is sufficient; you may install the extended edition, but it is not required by this theme.
1814

19-
2. Copy the `doc` folder as a template of your new website:
15+
2. Verify that the `hugo` binary is present in your `PATH` environment variable by running the command `hugo version`, which should output a message like:
16+
17+
```
18+
hugo v0.120.3-a4892a07b41b7b3f1f143140ee4ec0a9a5cf3970 linux/amd64 BuildDate=2023-11-01T17:57:00Z VendorInfo=gohugoio
19+
```
20+
21+
### Install Dart Sass
22+
23+
This theme also uses the [Dart Sass](https://sass-lang.com/dart-sass) CSS transpiler. To install it, follow [Hugo's Dart Sass installation guide](https://gohugo.io/hugo-pipes/transpile-sass-to-css/#dart-sass).
24+
25+
## Install theme
26+
27+
This theme is designed to be used as a Git submodule inside the repository that contains the Web site's source files, which Hugo builds from.
28+
29+
1. Create a Git repository for your new site:
2030

2131
```sh
22-
cp -r scientific-python-hugo-theme-main/doc ./my-website
23-
cd my-website
32+
mkdir NEW-SITE && cd NEW-SITE && git init
2433
```
2534

26-
3. Initialize git and add `scientific-python-hugo-theme` as a submodule:
35+
2. Add the theme repository as a submodule:
2736

2837
```sh
29-
git init
3038
git submodule add https://github.com/scientific-python/scientific-python-hugo-theme themes/scientific-python-hugo-theme
3139
```
3240

33-
4. Build your site:
41+
3. Copy the theme's documentation site as a template for your site:
3442

3543
```sh
36-
make serve
44+
cp -a themes/scientific-python-hugo-theme/doc/* .
3745
```
3846

39-
Browse to `http://localhost:1313`, and hopefully you will see your new site!
47+
4. Test the site by running `make serve`. The command's output should include a line like:
4048

41-
## Build HTML
49+
```
50+
Web Server is available at http://localhost:1313/ (bind address 127.0.0.1)
51+
```
4252

43-
Run `make html`. Output appears in `./public`.
53+
Load that URL in your browser, and you should see the theme's documentation page, which indicates that the site compiled successfully, and you can now customize it with your own content.
4454

45-
## Customizing the site
55+
## Develop your site
4656

47-
Edit `config.yaml` to your liking.
57+
Now you may proceed to develop your site by adding content and custom resources like CSS or JavaScript.
4858

49-
To customize styling, add one or more `*.css` files to the `assets/css` directory.
50-
These files may make use of Hugo templating,
51-
e.g. to access configuration variables as `{{ .Site.Params.somevar }}`.
59+
As you work, a live preview of your site is available via `make serve`.
5260

53-
Add custom JavaScript to `static/js/*.js`.
61+
### Customization
5462

55-
## Next steps
63+
#### `config.yaml`
5664

57-
See [features]({{< relref "features" >}}) and [shortcodes]({{< relref "shortcodes" >}}).
65+
The main configuration file is `config.yaml`, in the repository's root directory. It is used to set the name of the site, configure navigation bars, etc.
66+
67+
For examples of what's possible by editing this file, see these repositories which also use this theme: [scientific-python.org](https://github.com/scientific-python/scientific-python.org/blob/main/config.yaml), [numpy.org](https://github.com/numpy/numpy.org/blob/main/config.yaml.in), and [scipy.org](https://github.com/scientific-python/scientific-python.org/blob/main/config.yaml).
68+
69+
#### CSS
70+
71+
To customize styles, add CSS files to the `assets/css/` directory. It's recommended to put your customizations in a `custom.css` file, but you may add additional ones as well.
72+
73+
These files may use Hugo templates. For example, configuration variables from the `config.yaml` file may be accessed like `{{ .Site.Params.VARIABLE }}`.
74+
75+
#### JavaScript
76+
77+
Add custom JavaScript files to the `static/js/` directory with a `.js` extension. They will automatically be included in the built pages.
78+
79+
## Build your site
80+
81+
To build your site for deployment, run `make html`. The generated files will be placed in the `public/` directory.
82+
83+
## Next steps
5884

59-
See the
60-
[scientific-python.org](https://github.com/scientific-python/scientific-python.org),
61-
[numpy.org](https://github.com/numpy/numpy.org), and
62-
[scipy.org](https://github.com/scipy/scipy.org) repositories for
63-
examples of what is possible by changing `config.yaml`.
85+
To learn about the features provided by this theme, see [features]({{< relref "features" >}}) and [shortcodes]({{< relref "shortcodes" >}}).

0 commit comments

Comments
 (0)