You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: pages/basic_structure/index.qmd
+23-11Lines changed: 23 additions & 11 deletions
Original file line number
Diff line number
Diff line change
@@ -104,24 +104,36 @@ This is my homepage.
104
104
105
105
## Rendering your website
106
106
107
-
**Rendering** means converting your Quarto source files into the final website - a colelction of `.html` pages that live inside a folder called `_site`. There are two ways to do this.
107
+
**Rendering** means converting your Quarto source files into the final website - a collection of `.html` pages that live inside a folder called `_site`. To render your site:
108
108
109
-
**Option 1: Preview button.** Open `index.qmd` in the editor, and click the **Preview** button in the top right hand corner
109
+
1. Open `index.qmd` in the editor, and click the **Preview** button in the top right hand corner
110
110
111
-
{fig-alt="Screenshot of VSCode with Preview button circled."}
111
+
{fig-alt="Screenshot of VSCode with Preview button circled."}
112
112
113
-
**Option 2: Terminal.** In the bottom panel, ensure you are on the **Terminal** tab. The Terminal is a place where you type commands instead of clicking buttons. We just need to type `quarto preview` then press <kbd>Enter</kbd> on your keyboard.
113
+
2. In the bottom panel in the Terminal, you should see it says **Preparing to preview** and runs through files. It is creating `_sites/` folder containing your rendered site. Then when it is done, green text saying `Browse at ...`.
114
114
115
-
{fig-alt="Screenshot of VSCode with 'quarto preview' command in Terminal circled."}
115
+
{fig-alt="Screenshot of the 'Preparing to preview' message in the Terminal."}
116
116
117
-
After either of these, you should see it says **Preparing to preview** and runs through files. It is creating `_sites/` folder containing your rendered site. Then when it is done, green text saying `Browse at ...`.
117
+
3. You are now viewing a **live preview** of your site in the browser. Nothing is public yet; this preview only runs on your own computer. In other words, you are the only person who can see this site right now, and it will not appear on the internet until you deliberately publish or upload the rendered files somewhere.
118
+
119
+
By default, VSCode will open the preview in-line. This will be quite a small preview - to open it in a new tab, either copy the URL from the Terminal (`http://localhost:...`) or click the "Open in Browser" button in the top right.
120
+
121
+
{fig-alt="Screenshot of preview opened in-line, with cursor hovering over the 'Open in Browser' button."}
122
+
123
+
<br>
118
124
119
-
{fig-alt="Screenshot of the 'Preparing to preview' message in the Terminal."}
120
125
121
-
Open that link, by doing <kbd>Ctrl</kbd> and click, or by simply copying and pasting the link into your web browser.
122
126
123
-
This will open a **live preview** of your site in the browser. Keep the browser open while you edit; every time you save a Quarto file, the preview will auto-refresh so you can immediately see your changes without re-running any commands.
127
+
::: {.callout-note title="Optional extra: rendering via the terminal" collapse="true"}
124
128
125
-
Nothing is public yet; this preview only runs on your own computer. In other words, you are the only person who can see this site right now, and it will not appear on the internet until you deliberately publish or upload the rendered files somewhere.
129
+
Alternatively, you can render and preview your site directly via commands in the terminal.
126
130
127
-
{fig-alt="Screenshot of the rendered site."}
131
+
In the bottom panel, ensure you are on the **Terminal** tab. The Terminal is a place where you type commands instead of clicking buttons. We just need to type `quarto preview` then press <kbd>Enter</kbd> on your keyboard.
132
+
133
+
{fig-alt="Screenshot of VSCode with 'quarto preview' command in Terminal circled."}
134
+
135
+
You can then use the `http://localhost:...` link printed in the Terminal to open your site in the browser.
136
+
137
+
With this method, the site updates automatically whenever files are saved. In Codespaces, files are auto‑saved very frequently, so the preview will re-render often; for that reason, the **Preview** button described above is usually a calmer option during this workshop.
0 commit comments