Henrieta's Website Quest

a hen of few words. most of them threats.in place of a dark hen, a QUEEN. beautiful and terrible as the morning. all shall love her and despair.

HENRIETA: Alessandra. You built me a house above the peach tree. I have decided to let you live. In return, I will teach you to build a website. Do as I say and no one gets pecked.

hihi Alessandra!! this page walks you through making your own portfolio site from scratch: one page that scrolls through your projects, each with a title, a few words and big pictures. you'll type the HTML by hand (the words and pictures), put it online with git and GitLab Pages (free!), then make it pretty with CSS.

it'll live at https://alessandranomoly.gitlab.io (if that's your GitLab username, swap in yours if not). go in order. each step has a checkbox so you can see how far you got (it remembers, even if you close the tab). you already pushed to SQSHt, so you've done the scariest part!!

you need: a computer, a browser, a text editor (VS Code is free and nice), git, and your GitLab account. stuck, or want to peek? here are the finished files from the end of part one and the end of part three. try typing it yourself first.

๐Ÿฅš starter-html.zip๐Ÿ” finished.zip
0%
0 of 0 steps done
๐Ÿฅš ๐Ÿฅš ๐Ÿฅš
๐Ÿฅš

part one: HTML

type the page by hand

make your nest

step 1

HENRIETA: You built me a house above the peach tree. Now I am building YOU a house. On the internet. Where I cannot peck you. Yet.

make a folder called portfolio. inside it, make a folder called public. inside public, make a folder called images.

your folders
portfolio/
  public/
    images/
remember this: everything inside public is what goes on the web. it matters later.

lay the skeleton

step 2

HENRIETA: Every website has bones. I respect bones. Type these. With your FINGERS. Copying is for roosters.

open your text editor (VS Code is free and nice). make a new file and save it as index.html inside public. type this:

public/index.html
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <title>Alessandra's portfolio</title>
  </head>
  <body>

  </body>
</html>

double-click index.html to open it in your browser.

you should see: a blank white page, and the browser tab says Alessandra's portfolio. that's the <title>. the <head> is stuff about the page. the <body> is what people see.

what's a tag? HTML wraps your stuff in tags that say what it is. most come in pairs: an opening <h1> and a closing </h1>, with your words in between.

announce yourself

step 3

HENRIETA: State your name. LOUDLY. Like I do at 5 AM.

inside <body>, type:

public/index.html, inside <body>
<h1>Alessandra</h1>
<p>Artist. I make things. Here are some of them.</p>

save, then reload the browser tab.

you should see: your name big and bold, with a sentence under it. h1 is the biggest heading, p is a paragraph. write your own sentence, this is your page.

your first project

step 4

HENRIETA: Show them what you have made. I have made many eggs. Judy ATE them. I have not forgotten.

under that, add:

public/index.html
<h2>Project one</h2>
<p>A sentence or two about this project.</p>

save, reload.

you should see: a smaller heading and a paragraph. h2 is a second-level heading. put in a real project name and a casual line about it.

a picture, with alt text

step 5

HENRIETA: Some visitors cannot see pictures. You will DESCRIBE the picture to them. Nobody gets left out of my coop.

put a photo in your images folder. give it a short name with no spaces, all lowercase, like project-1.jpg. then, under your project's paragraph, type:

public/index.html
<img src="images/project-1.jpg" alt="Describe what the picture shows">
good alt text says what's in the picture, the way you'd describe it to a friend on the phone. skip "image of" or "photo of", that's already known.

<img> is one of the few tags with no closing tag. save, reload.

you should see: your picture, probably HUGE. that's fine, we fix it with CSS later.

try breaking it: change the src to images/oops.jpg and reload. you'll see a little broken-picture icon with your alt text next to it. that's what alt text is for. change it back.

more projects

step 6

HENRIETA: One project is a snack. Three is a feast.

copy your project (the h2, the p and the img) and paste it twice under itself. change the words and pictures for each. one long scroll of projects is the whole design.

how to reach you

step 7

HENRIETA: Let people find you. Unlike the raccoon. The raccoon will not be found. Ever again.

at the bottom of the body:

public/index.html
<p>Say hi: <a href="mailto:you@example.com">you@example.com</a></p>

<a> is a link. href is where it goes. use a web address like https://instagram.com/yourname to link to a site instead.

tagwhat it is
<h1>, <h2>headings, big and less big
<p>a paragraph
<img src="..." alt="...">a picture and its description
<a href="...">a link
<title>the words in the browser tab

these are the tags you know now. not bad for a featherless biped.

๐Ÿฃ

part two: git + GitLab Pages

put it on the internet

make the GitLab project

step 8

HENRIETA: Now we release it into the wild. GitLab is the wild.

on gitlab.com, choose New project, then Create blank project.

click Create project.

you should see: an empty project page with instructions. leave it open.

the hatching recipe

step 9

HENRIETA: GitLab needs instructions. Like me. I need instructions on where the mealworms are.

in the portfolio folder (next to public, not inside it), make a file called .gitlab-ci.yml. the dot at the start matters.

portfolio/.gitlab-ci.yml
# Publish everything in the "public" folder to GitLab Pages
# every time you push.
pages:
  stage: deploy
  script:
    - echo "Publishing the public folder"
  artifacts:
    paths:
      - public
careful!! spaces matter in this file. line them up exactly like this.
your folders now
portfolio/
  .gitlab-ci.yml
  public/
    index.html
    images/

your computer may hide files starting with a dot. on a Mac, Cmd+Shift+. in Finder shows them.

push it

step 10

HENRIETA: git remembers every version of everything. Like I remember every wrong done to me.

open a terminal (Terminal on a Mac, Git Bash on Windows) and go to your folder:

terminal
cd portfolio

turn it into a git repository:

terminal
git init -b main

you should see: Initialized empty Git repository.

stage everything and save a snapshot:

terminal
git add .
git commit -m "First version of my portfolio"

you should see: a list of the files that went into the commit.

connect it to GitLab. on your project page, click the blue Code button and copy the address under Clone with HTTPS (or SSH, if that's how you pushed to SQSHt). then:

terminal
git remote add origin PASTE-THE-ADDRESS-HERE
git push -u origin main

you should see: some lines ending in main -> main. reload the project page on GitLab and your files are there.

watch it hatch

step 11

HENRIETA: Do not rush the hatching. I sat on things for twenty-one days. You can wait two minutes.

  1. in your GitLab project, go to Build โ†’ Pipelines. there's a pipeline running. wait for the green check.
  2. go to Deploy โ†’ Pages. if Use unique domain is ticked, untick it and click Save changes. that keeps your address short instead of a random one.
  3. visit https://alessandranomoly.gitlab.io (or yourusername.gitlab.io).

the very first time can take a few minutes.

you should see: your page, on the real internet. send it to someone. send it to Judy. she owes you.

๐Ÿ”

part three: CSS

make it look good

connect a stylesheet

step 12

HENRIETA: Your site is naked. Like a plucked bird. Put some FEATHERS on it.

HTML says what things are. CSS says how they look. in public, make a file called style.css. type:

public/style.css
body {
  background: #fdf8f2;
}

now tell your page to use it. in index.html, inside <head>, add these two lines:

public/index.html, inside <head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="style.css">

the first line makes phones show your page at a readable size. the second loads your CSS. save both, reload.

you should see: a warm cream background. still white? check the spelling of style.css in both places.

fonts and colors

step 13

HENRIETA: I am black with a green shine when the sun hits me. Choose your colors with the same care.

add to the body rule:

public/style.css
body {
  background: #fdf8f2;
  color: #2b2233;
  font-family: Georgia, serif;
  line-height: 1.6;
  margin: 0;
}

you should see: softer dark text in a serif font, with more space between lines.

colors starting with # are hex codes. any color picker gives you one. steal colors from your own art.

group your page into parts

step 14

HENRIETA: A coop has a roost, a nest box and a run. Your page needs parts too.

back in index.html, wrap your page in three containers so CSS can grab them. your body becomes:

public/index.html, the whole <body>
<header>
  <h1>Alessandra</h1>
  <p class="tagline">Artist. I make things. Here are some of them.</p>
</header>

<main>
  <section class="project">
    <h2>Project one</h2>
    <p>A sentence or two about this project.</p>
    <img src="images/project-1.jpg" alt="Describe what the picture shows">
  </section>

  <!-- one <section class="project"> for each project -->
</main>

<footer>
  <p>Say hi: <a href="mailto:you@example.com">you@example.com</a></p>
</footer>

these tags don't change how it looks on their own. class="project" is a name tag so CSS can style all projects at once. <!-- --> is a comment, a note the browser ignores.

center everything

step 15

HENRIETA: Stand in the MIDDLE of the yard. Where everyone can see you. Where you are a threat.

in style.css, add:

public/style.css
header, main, footer {
  max-width: 700px;
  margin: 0 auto;
  padding: 0 16px;
}

you should see: a neat column down the middle. make your browser narrow and wide and watch it stay centered.

tame the pictures

step 16

HENRIETA: Your pictures are spilling off the page like feed from a tipped bucket. Contain them.

public/style.css
header {
  text-align: center;
  padding-top: 48px;
}

h1 {
  font-size: 3rem;
  margin-bottom: 0;
}

.tagline {
  color: #7a6a80;
  margin-top: 4px;
}

img {
  width: 100%;
  height: auto;
  border-radius: 12px;
}

a dot in front, .tagline, means "things with that class".

you should see: your name centered at the top, and pictures that fit the column exactly with soft rounded corners. they shrink to fit on a phone too.

breathing room, then ship it

step 17

HENRIETA: Give each project space. I do not like to be crowded. Ask the other hens. Actually, don't.

public/style.css
.project {
  margin: 64px 0;
}

a {
  color: #c2185b;
}

footer {
  text-align: center;
  padding-bottom: 48px;
}

you should see: space between projects so each one gets its moment, a pink link, and a centered footer.

now send it to the internet:

terminal
git add .
git commit -m "Add CSS"
git push

green check, reload your site, done!!

๐Ÿ‘ ๐Ÿ‘ ๐Ÿ‘

your everyday routine

HENRIETA: Every morning I wake up and scream. Every time you change your site, you do THIS.

terminal
git add .
git commit -m "Say what you changed"
git push

wait for the green check, reload your site. that's the whole job.

side quests

HENRIETA: You finished. I am... not angry. Do not tell anyone.

break things. reload. that's how everyone learns this.

help, something broke!!

HENRIETA: Nothing is broken forever. git remembers everything. Breathe. Then peck at it again.

what you seetry this
a picture won't showthe name must match exactly, capitals too. Photo.JPG and photo.jpg are different files on the web. check it's inside public/images.
my change isn't on the sitecheck Build โ†’ Pipelines for a green check, then reload. Shift+reload skips the browser's saved copy.
404 on the live sitecheck the project is named exactly yourusername.gitlab.io, the pipeline passed, and give it a few minutes the first time.
pipeline is red โœ—it's usually the spaces in .gitlab-ci.yml. compare it line by line with step 9. click the failed job to read the log.
git push asks for a passwordGitLab wants a personal access token or an SSH key, not your normal password. use whatever you used for SQSHt.
git push says "rejected" or "fetch first"GitLab has a change you don't have yet (maybe you edited on the website). run git pull, then git push again.
CSS isn't doing anythingcheck the <link> line is inside <head> and the file is called style.css in both places.