Skip to content

Commit

Permalink
Merge branch 'main' into glossary
Browse files Browse the repository at this point in the history
  • Loading branch information
nimonian authored Apr 22, 2024
2 parents 9756da2 + 125837b commit 3d4b8a0
Show file tree
Hide file tree
Showing 43 changed files with 1,000 additions and 1,670 deletions.
1 change: 1 addition & 0 deletions .spag-report.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Spelling check passed :)
51 changes: 6 additions & 45 deletions .vitepress/sidebars/express.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,24 +17,6 @@ export const express = [
}
]
},
{
text: 'Creating an API',
text: 'Data layer',
items: [
{
text: 'Managing the database',
link: '/express/managing-the-database'
},
{
text: 'Connecting to a database',
link: '/express/connecting-to-a-database'
},
{
text: 'Adding a model layer',
link: '/express/adding-a-model-layer'
}
]
},
{
text: 'Creating an API',
items: [
Expand All @@ -49,16 +31,6 @@ export const express = [
{ text: 'Body and headers', link: '/express/body-and-headers' }
]
},
{
text: 'Request and response',
link: '/express/request-response',
collapsed: true,
items: [
{ text: 'Query params', link: '/express/query-params' },
{ text: 'URL params', link: '/express/url-params' },
{ text: 'Body and headers', link: '/express/body-and-headers' }
]
},
{ text: 'Routing', link: '/express/routing' },
{ text: 'Sending errors', link: '/express/sending-errors' },
{ text: 'Schema validation', link: '/express/schema-validation' }
Expand All @@ -67,23 +39,12 @@ export const express = [
{
text: 'Server side rendering',
items: [
{ text: 'Static files' },
{ text: 'Views and templates' },
{ text: 'Partial templates' },
{ text: 'Styling with CSS' },
{ text: 'Rendering lists' },
{ text: 'User input' }
]
},
{
text: 'Server side rendering',
items: [
{ text: 'Static files' },
{ text: 'Views and templates' },
{ text: 'Partial templates' },
{ text: 'Styling with CSS' },
{ text: 'Rendering lists' },
{ text: 'User input' }
{ text: 'Static files', link: '/express/static-files' },
{ text: 'Views and templates', link: '/express/views-and-templates' },
{ text: 'Using loops', link: '/express/using-loops' },
{ text: 'Template partials', link: '/express/template-partials' },
{ text: 'CSS and assets', link: '/express/css-and-assets' },
{ text: 'User input', link: 'express/user-input' }
]
}
]
10 changes: 0 additions & 10 deletions .vitepress/sidebars/javascript.js
Original file line number Diff line number Diff line change
Expand Up @@ -139,15 +139,5 @@ export const javascript = [
link: '/js/fetching-data.md'
}
]
},
{
text: 'Working with databases',
collapsed: true,
items: [
{
text: 'Connecting to a database',
link: '/js/connecting-to-a-database'
}
]
}
]
39 changes: 7 additions & 32 deletions .vitepress/sidebars/sql.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,48 +38,23 @@ export const sql = [
{
text: 'Grouped aggregates',
link: '/sql/grouped-aggregates'
}
]
},
{
text: 'Writing data',
items: [
{
text: 'Inserting rows',
link: '/sql/inserting-rows'
},
{
text: 'Updating rows',
link: '/sql/updating-rows'
},
{
text: 'Deleting rows',
link: '/sql/deleting-rows'
text: 'Many-to-many relationships',
link: '/sql/many-to-many'
}
]
},
{
text: 'Managing the database',
text: 'Modifying the database',
items: [
{
text: 'Creating tables',
link: '/sql/creating-tables'
},
{
text: 'Altering tables',
link: '/sql/altering-tables'
text: 'Writing data',
link: '/sql/writing-data'
},
{
text: 'Deleting tables',
link: '/sql/deleting-tables'
},
{
text: 'One-to-many relationships',
link: '/sql/one-to-many'
},
{
text: 'Many-to-many relationships',
link: '/sql/many-to-many'
text: 'Creating tables',
link: '/sql/creating-tables'
}
]
}
Expand Down
2 changes: 2 additions & 0 deletions .vscode/ltex.dictionary.en-GB.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
bleet
bleets
1 change: 1 addition & 0 deletions .vscode/ltex.disabledRules.en-GB.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
OXFORD_SPELLING_Z_NOT_S
1 change: 1 addition & 0 deletions .vscode/ltex.hiddenFalsePositives.en-GB.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"rule":"UPPERCASE_SENTENCE_START","sentence":"^\\Qwill help you to think about how the rows should be grouped in order to get the total likes column we desire.\\E$"}
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"ltex.language": "en-GB"
}
30 changes: 30 additions & 0 deletions .wordlist.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ anyNameYouWant
Anyshire
ANZR
appendFile
AppError
areBooksEqual
argv
ArianaVenti
Expand All @@ -35,6 +36,7 @@ biomedicine
bleet
Bleeter
bleetId
bleetRouter
bleet's
bleets
bookCondition
Expand Down Expand Up @@ -107,13 +109,16 @@ dotenv
driay
EdShearing
Eich
ejs
EJS
elit
else's
Elusk
EluskM
encodedBodySize
endTime
env
errorHandler
esm
etag
EternalKnowledge
Expand All @@ -133,11 +138,13 @@ findMinimumYear
firstAuthor
firstName
Flexbox
FoodieTunes
formatString
formattedPi
formattedPrice
FrameRate
fs
GalacticGourmet
García
gardenCam
genresArray
Expand All @@ -151,6 +158,7 @@ Getters
gitignore
gmail
gonner
GordonRambo
Grande
GsVpLyJPBxDD
gws
Expand All @@ -159,6 +167,7 @@ hasOverdueBooks
headersList
HeadersList
hotmail
hoven
https
ic
impactful
Expand All @@ -167,6 +176,7 @@ initialValue
InnoDB
inputId
inputID
instanceof
internalCompileFunction
ipAddress
ipsum
Expand All @@ -175,10 +185,12 @@ isBookAvailable
ISC
isConnected
isMembershipActive
isNaN
isOn
JDQ
JeffWho
Jin
Joi
js
json
JSON
Expand Down Expand Up @@ -211,14 +223,17 @@ MarkZeeberg
Márquez
MarsRoyalty
MartianOprah
MDN
mealController
MeghanTrainer
middleware
Middleware
minimumAge
minimumYear
MinnieMouse
MinnieMouse
minYear
MissingIngredients
mkdir
mkv
mochajs
Expand All @@ -230,6 +245,7 @@ mv
MzZ
nel
networkPrefix
newBrightness
newColor
newName
NextSingle
Expand Down Expand Up @@ -261,6 +277,7 @@ parseFloat
parseInt
piString
png
poolCam
Postgres
postRedirectStartTime
powershell
Expand All @@ -287,6 +304,7 @@ RJlX
roomId
runMain
runtime
safeParse
Satrapi
sclient
SelenaGofar
Expand All @@ -302,6 +320,7 @@ SmartCamera
SmartDevice
SmartLight
SmartThermostat
snyk
SocialNetwork
Sometown
sortedByYearAscending
Expand Down Expand Up @@ -330,6 +349,7 @@ SyntaxError
TaL
targetTemperature
TaylorSquid
templating
textarea
Textarea
thunderclient
Expand Down Expand Up @@ -358,24 +378,30 @@ TypeError
typeof
unavailableBooks
unshift
untrusted
upperCaseQuote
uri
urlencoded
urlList
usain
useNullAsDefault
userAge
userEarliestBookYear
userId
userRouter
UserSchema
usr
utf
utils
uyL
VARCHAR
ve
vh
vitepress
vlog
vm
Vue
walkthroughs
webpage
wellbeing
whitespace
Expand All @@ -385,7 +411,11 @@ wsl
WSL
xox
XoyXChze
xss
XSS
xz
yaz
zod
Zod
Zoja
zz
Binary file modified dictionary.dic
Binary file not shown.
35 changes: 35 additions & 0 deletions src/express/css-and-assets.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# CSS and assets

<Vimeo id="936624461" />

## Including assets

With static file serving set up, you are able to access assets in the
`public folder` from within your views. Suppose you have an image stored at
`public/images/logo.png`. You can display it in your views like this:

```html{6} [index.ejs]
<%- include('partials/header') %>
<h1>Welcome to Bleeter</h1>
<h2>Follow the herd</h2>
<img src="/images/logo.png" alt="Bleeter logo" width="150">
<%- include('partials/footer') %>
```

## Applying CSS

To apply CSS to your files, create a `.css` file in your public folder. For
example, `public/css/index.css`. To apply it, simply include in your HTML
`<head>` as normal:

```html{4} [header.ejs]
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="/css/index.css">
<title>Bleeter | <%= title %></title>
</head>
```
2 changes: 1 addition & 1 deletion src/express/sending-errors.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class AppError extends Error {
In our models, we can throw errors that arise from handling data, which is where
most errors occur.

```js {2-4,9-11}
```js{2-4,9-11}
async findById(id) {
if (isNaN(id)) {
throw new AppError('ID must be a number.', 400)
Expand Down
Loading

0 comments on commit 3d4b8a0

Please sign in to comment.