|
| 1 | +--- |
| 2 | +title: "Basics of GitHub websites" |
| 3 | +order: 6 |
| 4 | +description: | |
| 5 | + A guide on making and editing websites in the `steno-aarhus` GitHub organisation. |
| 6 | +--- |
| 7 | + |
| 8 | +## Getting started |
| 9 | + |
| 10 | +If you would like to get a GitHub website set up for your project under |
| 11 | +`steno-aarhus` on GitHub, you first need to do the following: |
| 12 | + |
| 13 | +1. Create a [GitHub account](github.com), if you don't have one |
| 14 | + already. |
| 15 | +2. Decide on a name for your project. This should be a short, |
| 16 | + descriptive name without spaces. For example `prodiap` or |
| 17 | + `on-limit`. |
| 18 | +3. Send your GitHub username and the name of your project to one of the |
| 19 | + `steno-aarhus` administrators, e.g., Luke Johnston |
| 20 | + ([lwjohnst\@clin.au.dk](mailto:lwjohnst@clin.au.dk){.email}) or |
| 21 | + Signe Kirk Brødbæk |
| 22 | + ([signekb\@clin.au.dk](mailto:signekb@clin.au.dk){.email}). Then, |
| 23 | + we'll set up the website for you on GitHub in a |
| 24 | + [repository](https://docs.github.com/en/repositories/creating-and-managing-repositories/about-repositories) |
| 25 | + in the [`steno-aarhus` |
| 26 | + organisation](https://github.com/steno-aarhus). |
| 27 | + |
| 28 | +Since we'll set up the website for you, you don't need to worry about |
| 29 | +the technical details of how to set up a GitHub website. The only things |
| 30 | +you need to do are [Navigating GitHub](#navigating-github) and [Adding |
| 31 | +content](#adding-content-to-website). |
| 32 | + |
| 33 | +If you would like a more complex website with multiple pages, you might |
| 34 | +want to add them in the navigation bar at the top of the website (see |
| 35 | +section below on [Multi-page websites](#multi-page). |
| 36 | + |
| 37 | +## :compass: Navigating GitHub {#navigating-github} |
| 38 | + |
| 39 | +To add content to a GitHub website, you first need to be able to |
| 40 | +navigate GitHub and know some of the basics of how GitHub works. For a |
| 41 | +quick introduction to GitHub, check out the [navigating a GitHub |
| 42 | +repository](/contributing/navigating-github.md) guide. |
| 43 | + |
| 44 | +::: callout-tip |
| 45 | +## Want to learn more about GitHub? |
| 46 | + |
| 47 | +If you want to learn more about GitHub, we recommend this [Introduction |
| 48 | +to GitHub](https://github-intro.rostools.org/) workshop. All the |
| 49 | +material is on the website and you can work through it at your own pace. |
| 50 | +It's designed to be a gentle 3-hour introduction to GitHub, and it |
| 51 | +covers the basics of how to add, edit, and delete files and folders on |
| 52 | +GitHub. |
| 53 | +::: |
| 54 | + |
| 55 | +## :pencil2: Adding content to a GitHub website {#adding-content-to-website} |
| 56 | + |
| 57 | +The `steno-aarhus` websites are built using |
| 58 | +[Quarto](https://quarto.org/) and the content is written in a format |
| 59 | +called [Markdown](https://en.wikipedia.org/wiki/Markdown). |
| 60 | + |
| 61 | +**Markdown** is a lightweight markup language that allows you to format |
| 62 | +text using plain text syntax. It is widely used for writing |
| 63 | +documentation, and other types of content. Markdown is easy to read and |
| 64 | +write, and it can be converted to HTML (for websites) and other formats |
| 65 | +(like PDFs). |
| 66 | + |
| 67 | +Since we're using Quarto, the files you write your website content in |
| 68 | +will be in either the `.qmd` (the `q` in `qmd` stands for *Quarto* |
| 69 | +Markdown) or `.md` format (which stands for "Markdown"). These file |
| 70 | +formats mean you can write your content using Markdown. To learn how to |
| 71 | +write in Markdown, check out our [guide](writing-markdown.md) or the |
| 72 | +[Quarto |
| 73 | +documentation](https://quarto.org/docs/authoring/markdown-basics.html). |
| 74 | + |
| 75 | +## :books: Learn from others |
| 76 | + |
| 77 | +You can go to [steno-aarhus](https://github.com/steno-aarhus) on GitHub |
| 78 | +and take a look at other GitHub websites. This is an easy way to see how |
| 79 | +the files are structured and how the content is written. And because the |
| 80 | +websites are on GitHub, you can copy and paste all you want. |
| 81 | + |
| 82 | +Let's look at how to do this. |
| 83 | + |
| 84 | +### Find the link of another `steno-aarhus` GitHub website |
| 85 | + |
| 86 | +When you have found another website on the `steno-aarhus` page linked |
| 87 | +above, click it to see its repository. On the right side of the page, |
| 88 | +there should be a link to the website. |
| 89 | + |
| 90 | +### Copy content from another `steno-aarhus` website |
| 91 | + |
| 92 | +If you have found something on a `steno-aarhus` website that you would |
| 93 | +like to copy, for example someone has added a video to their website and |
| 94 | +you want to do the same, follow these steps: |
| 95 | + |
| 96 | +1. Go to the page on the website where content you want to copy is |
| 97 | + shown. |
| 98 | +2. On the right side of the page, click "View source". This takes you |
| 99 | + to the page's source code (i.e., the plain text behind the website |
| 100 | + that you want to copy). This will show you the Markdown content and |
| 101 | + any code chunks that were used to generate the output |
| 102 | +3. Locate the relevant parts and copy and paste it into your own `.md` |
| 103 | + file. |
| 104 | +4. Edit the content to fit your own needs. |
| 105 | +5. Save the file and commit the changes to your GitHub repository. |
| 106 | +6. Done! :raised_hands: |
| 107 | + |
| 108 | +## Multi-page websites {#multi-page} |
| 109 | + |
| 110 | +If you want multiple pages on your GitHub website, you can add them in |
| 111 | +the navigation bar at the top of the website. This will allow you to |
| 112 | +easily navigate between different pages on your website. |
| 113 | + |
| 114 | +To add a page to the navigation bar, you first need to create a new |
| 115 | +`.md` file in your website's GitHub repository. See [Navigating |
| 116 | +GitHub](#navigating-github) for how to do this. |
| 117 | + |
| 118 | +Then, you can add the new page to the navigation bar. For To add it, you |
| 119 | +need to edit the `_quarto.yml` file in your website's GitHub repository. |
| 120 | +This file contains the configuration settings for your Quarto project, |
| 121 | +including the navigation settings. |
| 122 | + |
| 123 | +In your `_quarto.yml` file, you will see a section called `navbar`. This |
| 124 | +is where you can add your new page. You can do this by adding a new |
| 125 | +section under the `navbar` configuration. For example, if you want to |
| 126 | +add a page called "Om projektet" in a file named `about.md`, you need to |
| 127 | +add the following three lines to the `navbar` section of your |
| 128 | +`_quarto.yml` file: |
| 129 | + |
| 130 | +``` {.yaml filename="_quarto.yml"} |
| 131 | +navbar: |
| 132 | + pinned: true |
| 133 | + left: # add links to the left side of the navigation bar |
| 134 | + - text: "Om projektet" |
| 135 | + href: about.md |
| 136 | +``` |
| 137 | + |
| 138 | +`left` is the section of the navigation bar where you want to add your |
| 139 | +new page. `text` is the text that will be displayed in the navigation |
| 140 | +bar, and `href` is the link to your new page, which should include the |
| 141 | +name of the file. |
| 142 | + |
| 143 | +You can also add other pages to the navigation bar in the same way. If |
| 144 | +you for example wanted to add a page called "Om os" in a file called |
| 145 | +`about-us.md`, you would add the following lines just below the previous |
| 146 | +lines: |
| 147 | + |
| 148 | +``` {.yaml filename="_quarto.yml"} |
| 149 | + - text: "Om os" |
| 150 | + href: about-us.md |
| 151 | +``` |
| 152 | + |
| 153 | +Where "Om os" is the text that will be displayed in the navigation bar, |
| 154 | +and `about-us.md` is name of the file with the page content. |
| 155 | + |
| 156 | +::: callout-note |
| 157 | +If your file is in a subfolder, you need to include the path to the file |
| 158 | +in the `href` section. For example, if your file is in a folder called |
| 159 | +`pages`, you would write `href: "pages/about.md"`. |
| 160 | +::: |
| 161 | + |
| 162 | +Adding these two pages results in the following `left` section under |
| 163 | +`navbar` in your `_quarto.yml` file: |
| 164 | + |
| 165 | +``` {.yaml filename="_quarto.yml"} |
| 166 | +navbar: |
| 167 | + pinned: true |
| 168 | + left: |
| 169 | + - text: "Om projektet" |
| 170 | + href: about.md |
| 171 | + - text: "Om os" |
| 172 | + href: about-us.md |
| 173 | +``` |
| 174 | + |
| 175 | +And this will add two new pages with the text "Om projektet" and "Om os" |
| 176 | +to the navigation bar at the top of your website. |
| 177 | + |
| 178 | +See the [Quarto |
| 179 | +documentation](https://quarto.org/docs/websites/website-navigation.html#top-navigation) |
| 180 | +for more information on how to set up navigation in your Quarto project. |
| 181 | + |
| 182 | +## :raising_hand_woman: Asking for help |
| 183 | + |
| 184 | +If you have any questions or need help with anything more specific in |
| 185 | +regards to your GitHub website, please reach out to either Luke Johnston |
| 186 | +or Signe Kirk Brødbæk by writing an |
| 187 | +[Issue](https://docs.github.com/en/issues/tracking-your-work-with-issues/configuring-issues/quickstart#opening-a-blank-issue) |
| 188 | +in your website repository on GitHub. Please tag us using `@` in the |
| 189 | +issue, `@lwjohnst86` or `@signekb`. Then, we'll get a notification and |
| 190 | +get back to you when we can. |
0 commit comments