UCSB-MEDS / UCSB-MEDS.github.io

https://ucsb-meds.github.io/
2 stars 1 forks source link

Creating personal website with Quarto - minor suggestion for `quarto preview` #31

Closed jimgar closed 1 year ago

jimgar commented 1 year ago

Hi @samanthacsik

Thank you so much for the incredibly well put together materials on Quarto websites and blogs. Having them on your site and accessible for all is a great example to set. I'm psyched to be moving from rmd to qmd. Such an amazing publishing tool!

The minor suggestion: In the materials for command line/terminal, I've found previewing the site is a bit more flexible than you have written. In an Important box, you say

In order to preview your website, you must be in the directory one level higher than your website. For example, if my Quarto website directory is at User/samanthacsik/git/mysite, I must be in User/samanthacsik/git when I run the quarto preview mysite command in the terminal.

With Quarto 1.2.280 on MacOS Ventura 13.0.1 I can run quarto preview with or without the filepath argument depending on the context. For example if I am in ~/git/mysite I can run quarto preview. If I am anywhere outside of the directory, I can supply the relative or absolute path, e.g. quarto preview ~/git/mysite.

I've written some text you might use - if you find this behaviour reproducible! Bear in mind that you have already directed the user to cd into their website's directory at this point in the materials.

  1. You can preview your very basic, but functional website straight from the terminal by typing: quarto preview

Your site preview should open up in your browser. Quit your preview by pressing control + C

Important You need to supply the path to your website directory when previewing from a different location. For example, if my Quarto website directory is at User/samanthacsik/git/mysite, but I am one directory above in User/samanthacsik/git, I can run quarto preview mysite. Alternatively I could provide the full path quarto preview User/samanthacsik/git/mysite or relative path quarto preview ~/git/mysite, no matter which directory I am currently in.

Thanks again! Jim

samanthacsik commented 1 year ago

Hi @jimgar! Thank you so much for the kind words and thorough feedback :) I gave it a go and you're absolutely right about the command line tool being much more flexible than I had realized. I appreciate you taking the time to draft up new language for that Important box -- it made edits incredibly easy on my part!

I also updated the language regarding recommended repo names -- we teach students how to deploy via GitHub pages, but I realized that that may not have been clear at the point where folks are supposed to create/name a new GitHub repo. It now reads:

Recommended: Because we’ll be using GitHub pages to publish/host our websites, it’s recommended that you name your project yourusername.github.io (you’re allowed one user website with the github.io suffix) – for example, my personal website that is hosted via GitHub pages is named samanthacsik.github.io. Otherwise, name it something reasonable (this will become the slug for your site if publishing with GitHub pages, so choose carefully). I’m calling my project mysite just for tutorial purposes only – you should definitely give yours a more practical/creative name.

Thanks again for taking the time to share your thoughts with me -- I'm looking forward to seeing your site!