Skip to content

Commit 83b79d0

Browse files
authored
Merge pull request #126 from justwriteclick/build
Make new layout for Learn pages
2 parents 7e0c9e4 + 47ebdf6 commit 83b79d0

11 files changed

Lines changed: 62 additions & 30 deletions

_layouts/learn.html

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
<!DOCTYPE html>
2+
<!--
3+
So Simple Jekyll Theme 3.0.1
4+
Copyright 2013-2018 Michael Rose - mademistakes.com | @mmistakes
5+
Free for personal and commercial use under the MIT license
6+
https://github.com/mmistakes/so-simple-theme/blob/master/LICENSE
7+
-->
8+
<html lang="{{ page.lang | default: site.lang | default: 'en-US' }}" class="no-js">
9+
{% include head.html %}
10+
11+
<body class="layout--default">
12+
<main id="main" class="main-content" aria-label="Content">
13+
<article>
14+
<div class="page-wrapper">
15+
<div class="page-content">
16+
{% include skip-links.html %}
17+
{% include navigation.html %}
18+
<h1>{{ page.title }}</h1>
19+
<div>
20+
<img src="{{ page.image.thumbnail }}" alt="{{ page.image.caption }}">
21+
</div>
22+
{{ content }}
23+
</div>
24+
</div>
25+
{% include footer.html %}
26+
{% include scripts.html %}
27+
</article>
28+
</main>
29+
</body>
30+
31+
</html>

_learn/01-sphinx-python-rtd.md

Lines changed: 19 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
---
22
title: "Set Up Sphinx with Python"
3-
layout: page
3+
layout: learn
44
image:
5-
path: /images/learn/sphinx-docs-page.png
65
thumbnail: /images/learn/python-logo400x200.png
7-
caption: "Screenshot from Read the Docs theme"
6+
caption: "Python and Sphinx"
87
---
98

109
Sphinx works with either major versions of Python active today, Python 2 and Python 3. Python 3 is the current and recommended version. Sphinx is a documentation tool that creates HTML, CSS, and JavaScript files from [ReStructured](http://docutils.sourceforge.net/rst.html) text files.
@@ -51,7 +50,7 @@ You also want the latest version of Python 3 available.
5150
Python 3.7.0
5251
```
5352
54-
1. Check the version set as the default version, the version of Python that is executed when you simply enter `python`. The default version of Python remains a Python 2.7 version.
53+
1. Check the version set as the default version, the version of Python that is executed when you simply enter `python`. The default version of Python remains a Python 2.7 version.
5554
5655
```
5756
python -V
@@ -60,6 +59,7 @@ You also want the latest version of Python 3 available.
6059
```
6160
Python 2.7.15
6261
```
62+
6363
## Set Up Virtual Environment
6464
6565
Let's ensure that you know how to create Python Virtual Environments for each version of Python. These [Python Virtual Environments](https://docs.python.org/3/tutorial/venv.html) provide a method of creating isolated "environments" where you can work with specific versions of Python along with independent sets of libraries and dependencies.
@@ -103,7 +103,7 @@ Most people use Virtual Environments because it's a recommended practice when wo
103103
(py3-sphinx) $ pip install sphinx
104104
```
105105
106-
1. To verify that sphinx is installed, run the `sphinx-build` command with the `--help` parameter.
106+
1. To verify that Sphinx is installed, run the `sphinx-build` command with the `--help` parameter.
107107
108108
```
109109
(py3-sphinx) $ sphinx-build --help
@@ -123,36 +123,38 @@ You can also get familiar with [ReStructured text](http://docutils.sourceforge.n
123123
```
124124
1. Answer all the questions from the prompts.
125125
You can choose enter to pick all the defaults and get a working project in the current directory (`.`).
126+
>Some notes for the context of this tutorial:
127+
* You can either use a directory named `_build` within the root path, or have separate `source` and `build` directories, which is the default. To see an example directory structure with a `source` directory, refer to this [justwriteclick/rockthedocs-demo](https://github.com/justwriteclick/rockthedocs-demo) repo on GitHub.
128+
* When answering the questions, note that you can choose "githubpages set to yes" to create a `.nojekyll` file to publish the document on GitHub pages. In our case, though, our example builds to Read the Docs, so you can use the defaults throughout.
126129
127-
Some notes for the context of this tutorial:
128-
* You can either use a directory named `_build` within the root path, or have separate `source` and `build` directories, which is the default.
129-
* Note that you can choose "githubpages set to yes" to create a `.nojekyll` file to publish the document on GitHub pages. In our case, though, our example builds to Read the Docs, so you can use the defaults throughout.
130130
1. Once you have the basics answered, the script creates the necessary files and you can edit those to your liking.
131131
1. Create a couple of `.rst` files and add skeleton information for starters.
132132
```
133133
$ touch source/prerequisites.rst
134134
$ touch source/about.rst
135135
```
136136
1. Edit those new `.rst` files in your favorite text editor.
137-
1. Now, you can build the docs to see the changes locally:
137+
1. Now, you can build the docs to see the changes locally. Run this command in the directory with the `conf.py` file:
138138
```
139139
$ make html
140140
```
141141
1. In your browser, open the `build/html/index.html` file to take a look at your Sphinx site locally. You can also look at `build/html/prerequisites.html` and `build/html/about.html` though they won't be linked to the main page until you add them as a link or in a table of contents entry.
142-
1. Edit the `source/index.rst` file to include links to the additional pages. Here is an example:
143-
```
144-
.. toctree::
145-
:maxdepth: 2
146-
:caption: Contents:
142+
1. Edit the `source/index.rst` file to include links to the additional pages.
143+
Here is an example:
144+
```
145+
.. toctree::
146+
:maxdepth: 2
147+
:caption: Contents:
147148

148-
about.rst
149-
prerequisites.rst
150-
```
149+
about.rst
150+
prerequisites.rst
151+
```
151152
1. Build again to see these changes locally:
152153
```
153154
$ make html
154155
```
155156
1. In your browser, refresh the `build/html/index.html` page to see the new Contents with two entries linked.
157+
![Rock the docs example site](/images/learn/sphinx-docs-page.png)
156158
1. Make sure you commit your changes to the Git repository by following the steps in [Working with content in GitHub repositories](https://docslikecode.com/learn/04-add-content-workflow/).
157159
158160
## What's next

_learn/02-jekyll-ruby-gh-pages.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: "Set Up Jekyll with Ruby"
3-
layout: page
3+
layout: learn
44
image:
55
path: /images/learn/jekyll-docs-page.png
66
thumbnail: /images/learn/ruby-logo400x200.png
@@ -172,7 +172,7 @@ Once you've prepared your environment, you can build locally and review the site
172172
```
173173

174174
1. Use the **Server address** URL `http://127.0.0.1:4000/latest/` in a browser to preview the content.
175-
175+
![Example Jekyll site]( /images/learn/jekyll-docs-page.png)
176176
1. Press `Ctrl+C` in the serve terminal to stop the server.
177177
> ***TIP***
178178
> Leave the serve terminal open and running. Every time you save changes to a file, it automatically regenerates the site so you can test the output as you write. That said, if you change the `_config.yml` file, you must stop (ctrl-c) and then re-run the serve command to see changes.

_learn/03-hugo-go-netlify.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: "Set Up Hugo with Go"
3-
layout: page
3+
layout: learn
44
image:
55
path: /images/learn/hugo-docs-page.png
66
thumbnail: /images/learn/go-logo400x200.png
@@ -105,11 +105,10 @@ For Hugo, it's important to know that draft pages are only served when using the
105105
Web Server is available at http://localhost:1313/ (bind address 127.0.0.1)
106106
Press Ctrl+C to stop
107107
```
108-
109108
1. Open the **Web Server** URL, `http://localhost:1313/` in your local browser to view the site.
110-
111-
1. Press `Ctrl+C` in the server terminal to stop the Hugo server.
112-
1. You can add your files to a Git commit. Refer to [Working with content in GitHub repositories](https://docslikecode.com/learn/04-add-content-workflow/) for a documentation workflow with your Hugo site.
109+
![Example Hugo site](/images/learn/hugo-docs-page.png)
110+
3. Press `Ctrl+C` in the server terminal to stop the Hugo server.
111+
4. You can add your files to a Git commit. Refer to [Working with content in GitHub repositories](https://docslikecode.com/learn/04-add-content-workflow/) for a documentation workflow with your Hugo site.
113112

114113
## Modify the Hugo theme
115114

_learn/04-add-content-workflow.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: "Working with content in GitHub repositories"
3-
layout: page
3+
layout: learn
44
image:
55
path: /images/learn/octocat.png
66
thumbnail: /images/learn/octocat-github-logo400x200.png

_learn/05-cd-for-docs.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: "Continuous Deployment (CD) for Documentation Sites"
3-
layout: page
3+
layout: learn
44
image:
55
path: /images/learn/netlify-logo400x200.png
66
thumbnail: /images/learn/netlify-logo400x200.png

_learn/06-test-docs-as-code.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: "Set Up Automated Tests for Docs"
3-
layout: page
3+
layout: learn
44
image:
55
path: /images/learn/travis-ci-logo400x200.png
66
thumbnail: /images/learn/travis-ci-logo400x200.png

_learn/07-evaluating-ssg-themes.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: "Evaluating Static Site Generator themes"
3-
layout: page
3+
layout: learn
44
image:
55
path: /images/learn/ssg-themes.png
66
thumbnail: /images/learn/ssg-themes400x225.png

_learn/08-evaluating-table-layouts.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: "Evaluating table layouts and formatting"
3-
layout: page
3+
layout: learn
44
image:
55
path: /images/learn/table-layout.png
66
thumbnail: /images/learn/table-layout400x225.png

_learn/09-ssg-search-implementations.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: "Evaluating Static Site Generator search options"
3-
layout: page
3+
layout: learn
44
image:
55
path: /images/learn/ssg-search-options.png
66
thumbnail: /images/learn/ssg-search-options400x225.png

0 commit comments

Comments
 (0)