Skip to content

Commit

Permalink
get Gavin's changes
Browse files Browse the repository at this point in the history
Merge branch 'gh-pages' of https://github.com/DUNE/lesson-template into gh-pages
  • Loading branch information
hschellman committed Nov 13, 2024
2 parents 0834adb + b9bb807 commit b309d91
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 26 deletions.
7 changes: 3 additions & 4 deletions _episodes/00-Local-Setup-For-Local-Build.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ keypoints:
## Instructions for local setup to build your lessons - very useful


> #### Note:
> ## Carpentries instructions
> The Carpentries provide excellent instructions and examples at: [https://carpentries.github.io/lesson-example/setup.html](https://carpentries.github.io/lesson-example/setup.html).
> Carpentries has moved on to an 'R' based system which we are not using. We are still using this older format.
{: .callout}
Expand All @@ -24,7 +24,6 @@ keypoints:

Follow the instructions [https://carpentries.github.io/lesson-example/setup.html#setup-for-local-rendering-of-the-lessons-optional](https://carpentries.github.io/lesson-example/setup.html#setup-for-local-rendering-of-the-lessons-optional) for setup on your local machine - in principle this is optional but in practice it is really helpful. You are going to need ruby and pyYAML. I used conda on a mac but they have instructions for Windows, Mac and UNIX.

> #### Alert!!!
> ## Alert
> At this point you should stop following their instructions and start using our github template to avoid overwriting DUNE specific items.
{: .callout}

{: .caution}
54 changes: 34 additions & 20 deletions _episodes/01-How-to-make-a-lesson.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,45 +7,50 @@ questions:
objectives:
- Learn how to set up locally to build a lesson and to deploy it.
keypoints:
- If you can do basic markdown, you can do this.
- If you can do basic markdown, you can do this.
- Import the template to your own GitHub account when developing new lessons
---


## Here I describe how I built this lesson. You can follow along.



> #### Note:
> Check out the [previous episode]({{ site.baseurl }}/00-Local-Setup-For-Local-Build.html)to set up a local server and to do local builds.
> ## Note
> Check out the [previous episode]({{ site.baseurl }}/00-Local-Setup-For-Local-Build.html) to set up a local server and to do local builds.
{: .callout}

## First you need to decide on a name for your new lesson.

> #### Note:
> ## Note
> Because github insists on using gh_pages for deployment, it is good to use your own github account for initial (and ongoing) development and pull over to /DUNE/ for the official version rather than using branches in the /DUNE/ github area.
{: .callout}

## Do local setup for local rendering (optional)

Then follow the instructions [https://carpentries.github.io/lesson-example/setup.html#setup-for-local-rendering-of-the-lessons-optional](https://carpentries.github.io/lesson-example/setup.html#setup-for-local-rendering-of-the-lessons-optional) for setup on your local machine - in principle this is optional but in practice it is really helpful. You are going to need ruby and pyYAML. I used conda on a mac but they have instructions for Windows, Mac and UNIX.

> #### Alert!!!
> ## Alert
> At this point you should stop following their instructions and start using our template to avoid overwriting DUNE specific items.
{: .callout}
{: .caution}

## Then import this template.

- Use the [GitHub’s importer](https://github.com/new/import) to make a copy of this repo in your own GitHub account. (Note: This is like a GitHub Fork, but not connected to the upstream changes)
- Use [GitHub’s importer](https://github.com/new/import) to make a copy of this repo in your own GitHub account.

- Put the URL of this repository, that is https://github.com/DUNE/lesson-template.git in the “Your old repository’s clone URL” box.
> ## GitHub Import
> This is like a GitHub Fork, but is not connected to the upstream changes.
{: .callout}

- Put the URL of this repository, that is `https://github.com/DUNE/lesson-template.git` in the `The URL for your source repository*` URL box.

- Select the owner for your new repository (you).

- Set the name you chose for your lesson repository.

- Make sure the repository is public.

> #### Note:
> ## Import to your GitHub account
> Please import to your own account and new lesson, work there and then move it over to `/DUNE/` once you have a decent draft in place.
{: .callout}

Expand All @@ -61,7 +66,7 @@ git clone -b gh-pages <your new repository>

You need to look at the following pages.

- `_config.yml ` to set the title and other parameters for the lesson
- `_config.yml` to set the title and other parameters for the lesson
- `AUTHORS` to tell people who is doing this
- `CITATION` how to cite the page - often just the URL
- `LICENSE` you can keep it as is
Expand Down Expand Up @@ -136,15 +141,24 @@ will launch a web server and a site at: `http://127.0.0.1:4000`

You may need to reload the web site to see your changes.

> ### Note:
> ## Note
> These will hang around until you kill them so if you try to launch twice you can't. Look for processes with:
{: .callout}


~~~
ps -ef | grep jekyll
ps -ef | grep 'jekyll serve'
~~~
{: .language-bash}
You can identify the process number from the second column that is printed and kill that process.
Alternatively this can be achieved with a one line command:
~~~
ps -ef | grep '[j]ekyll serve' | awk '{print $2}'
~~~
{: .language-bash}
The `awk` command grabs the second column, the PID. The `[j]` is a trick to stop it from also passing the `grep` process to kill also.



### Publishing your draft site to `<yourname>.github.io/<yoursite>`

Expand All @@ -163,7 +177,7 @@ git push
~~~
{: .language-bash}

Wait a couple of minutes and you shouild see your page appear at:
Wait a couple of minutes and you should see your page appear at:

`https://<yourname>.github.io/<yoursite>`

Expand All @@ -176,21 +190,21 @@ Ok, once you have your site in decent shape you can import it back to

Once you have it checked out you can use the import function to make an official dune site.

- Use the [GitHub’s importer](https://github.com/new/import) to make a copy of this repo in your own GitHub account. (Note: This is like a GitHub Fork, but not connected to the upstream changes)
- Use [GitHub’s importer](https://github.com/new/import) to make a copy of this repo in your own GitHub account. (Note: This is like a GitHub Fork, but not connected to the upstream changes)

- Put the URL of this repository, that is `https://github.com/<yourname/<yoursite>.git` in the “Your old repository’s clone URL box.
- Put the URL of this repository, that is `https://github.com/<yourname/<yoursite>.git` in the `The URL for your source repository*` URL box.

- Select the owner for your new repository `DUNE`
- Select the owner for your new repository: `DUNE`

- Set the name you chose for your lesson repository `<yoursite>`
- Set the name you chose for your lesson repository: `<yoursite>`

- Make sure the repository is public.

### Maintaining your site

- try to make changes on your local copy - others can also do things in their local copies
- Try to make changes on your local copy - others can also do things in their local copies

- use pull requests to merge changes into the official DUNE site where possible
- Use pull requests to merge changes into the official DUNE site where possible

- you can make minor patches directly on the main site but generally, it's better to work locally.
- You can make minor patches directly on the main site but generally, it's better to work locally.

4 changes: 2 additions & 2 deletions _includes/navbar.html
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@
<img class="navbar-logo" src="{{ relative_root_path }}{% link /assets/img/cp-logo-blue.svg %}" alt="The Carpentries logo" />
</a>
{% elsif site.carpentry == "dune" %}
<a href="{{ site.carpentries_site }}" class="pull-left">
<img class="navbar-logo" src="{{ relative_root_path }}{% link /assets/img/DUNElogo_color.jpeg %}" alt="The Carpentries logo" />
<a href="{{ site.dune_site }}" class="pull-left">
<img class="navbar-logo" src="{{ relative_root_path }}{% link /assets/img/DUNElogo_color.jpeg %}" alt="The DUNE logo" />
</a>
{% elsif site.carpentry == "lab" %}
<a href="{{ relative_root_path }}{% link index.md %}" class="pull-left">
Expand Down

0 comments on commit b309d91

Please sign in to comment.