diff --git a/app.js b/app.js index ea64400..d7bda29 100644 --- a/app.js +++ b/app.js @@ -29,7 +29,7 @@ app.use(bodyParser.urlencoded({ extended: false })) app.use(cookieParser()) app.use(express.static(path.join(__dirname, 'public'))) -// Pass custo helpers to all our templates +// Pass custom helpers to all our templates app.use(function (req, res, next) { res.locals.helpers = helpers const qs = url.parse(req.url).query diff --git a/routes/about.js b/routes/about.js index d99d036..ba53760 100644 --- a/routes/about.js +++ b/routes/about.js @@ -1,7 +1,7 @@ const express = require('express') const router = express.Router() -/* GET home page. */ +/* GET about page. */ router.get('/', function (req, res, next) { res.render('about', { title: 'About' }) }) diff --git a/routes/categories.js b/routes/categories.js index c2d9599..703f6a4 100644 --- a/routes/categories.js +++ b/routes/categories.js @@ -1,7 +1,7 @@ const express = require('express') const router = express.Router() -/* GET courses listing. */ +/* GET categories listing. */ router.get('/', function (req, res, next) { res.render('categories', { title: 'Categories' }) }) diff --git a/routes/courses.js b/routes/courses.js index 3e92480..150d021 100644 --- a/routes/courses.js +++ b/routes/courses.js @@ -17,9 +17,9 @@ router.get('/', async function (req, res, next) { res.render('courses', { title: `All Courses (${courses.length})`, categories, courses }) }) -/* GET courses listing. */ +/* GET courses listing by category. */ router.get('/categories/:category', async function (req, res, next) { - // we get all the entries with the content type `course` + // we get all the entries with the content type `course` filtered by a category let courses = [] let categories = [] let activeCategory = '' diff --git a/routes/sitemap.js b/routes/sitemap.js index 8d91554..573ba01 100644 --- a/routes/sitemap.js +++ b/routes/sitemap.js @@ -1,7 +1,7 @@ const express = require('express') const router = express.Router() -/* GET seeting page. */ +/* GET sitemap page. */ router.get('/', function (req, res, next) { res.render('sitemap', { title: 'Sitemap' }) }) diff --git a/services/contentful.js b/services/contentful.js index 8a77d88..54038f8 100644 --- a/services/contentful.js +++ b/services/contentful.js @@ -21,15 +21,15 @@ exports.initClient = (options) => { } exports.getCourses = (locale = 'en-US', api = `cda`) => { - // to get all the courses we simply request from Contentful all the entries - // with the content_type `course` + // to get all the courses we request all the entries + // with the content_type `course` from Contentful const client = api === 'cda' ? cdaClient : cpaClient return client.getEntries({content_type: 'course', locale, include: 10}) .then((response) => response.items) } exports.getLandingPage = (locale = 'en-US', api = `cda`) => { - // our Home page is fully configureable via contentful + // our Home page is fully configureable via Contentful const client = api === 'cda' ? cdaClient : cpaClient // TODO slug should be renamed to `contentful-the-example-app` or something .... return client.getEntries({content_type: 'landingPage', locale, 'fields.slug': 'contentful-university', include: 10}) @@ -37,7 +37,7 @@ exports.getLandingPage = (locale = 'en-US', api = `cda`) => { } exports.getCourse = (slug, locale = 'en-US', api = `cda`) => { - // the SDK support link resolution only when you request the collection endpoint + // the SDK supports link resolution only when you call the collection endpoints // That's why we are using getEntries with a query instead of getEntry(entryId) // make sure to specify the content_type whenever you want to perform a query const client = api === 'cda' ? cdaClient : cpaClient diff --git a/views/course.pug b/views/course.pug index 517c2ad..7472de2 100644 --- a/views/course.pug +++ b/views/course.pug @@ -28,7 +28,7 @@ block content if course.fields.duration .course__overview-item img.course__overview-icon(src='/images/icon-duration.svg') - .course__overview-value Duration: #{course.fields.duration}min + .course__overview-value Duration: #{course.fields.duration} min if course.fields.skillLevel .course__overview-item img.course__overview-icon(src='/images/icon-skill-level.svg') diff --git a/views/settings.pug b/views/settings.pug index 3cfd35e..18ace49 100644 --- a/views/settings.pug +++ b/views/settings.pug @@ -3,7 +3,7 @@ extends layout block content .layout-centered h1= title - p To query and get content using the APIs, client apllications need to authenticate iwth both the Space ID and an access token. + p To query and get content using the APIs, client applications need to authenticate with both the Space ID and an access token. form(action=`/settings` method="POST" class="form") .form-item @@ -12,12 +12,12 @@ block content .help-text Some help text we still need to define .form-item - label(for="cda") Delivery API Key + label(for="cda") Delivery API key input(type="text" name="cda" value=settings.cda) .help-text Some help text we still need to define .form-item - label(for="cpa") Preview API Key + label(for="cpa") Preview API key input(type="text" name="cpa" value=settings.cpa) .help-text Some help text we still need to define