Fix some spelling errors (#5)

This commit is contained in:
Robert Linde
2017-10-04 10:12:53 +02:00
committed by Benedikt Rötsch
parent e773c8b32d
commit 01fd3cc9b3
8 changed files with 14 additions and 14 deletions

2
app.js
View File

@@ -29,7 +29,7 @@ app.use(bodyParser.urlencoded({ extended: false }))
app.use(cookieParser()) app.use(cookieParser())
app.use(express.static(path.join(__dirname, 'public'))) 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) { app.use(function (req, res, next) {
res.locals.helpers = helpers res.locals.helpers = helpers
const qs = url.parse(req.url).query const qs = url.parse(req.url).query

View File

@@ -1,7 +1,7 @@
const express = require('express') const express = require('express')
const router = express.Router() const router = express.Router()
/* GET home page. */ /* GET about page. */
router.get('/', function (req, res, next) { router.get('/', function (req, res, next) {
res.render('about', { title: 'About' }) res.render('about', { title: 'About' })
}) })

View File

@@ -1,7 +1,7 @@
const express = require('express') const express = require('express')
const router = express.Router() const router = express.Router()
/* GET courses listing. */ /* GET categories listing. */
router.get('/', function (req, res, next) { router.get('/', function (req, res, next) {
res.render('categories', { title: 'Categories' }) res.render('categories', { title: 'Categories' })
}) })

View File

@@ -17,9 +17,9 @@ router.get('/', async function (req, res, next) {
res.render('courses', { title: `All Courses (${courses.length})`, categories, courses }) 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) { 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 courses = []
let categories = [] let categories = []
let activeCategory = '' let activeCategory = ''

View File

@@ -1,7 +1,7 @@
const express = require('express') const express = require('express')
const router = express.Router() const router = express.Router()
/* GET seeting page. */ /* GET sitemap page. */
router.get('/', function (req, res, next) { router.get('/', function (req, res, next) {
res.render('sitemap', { title: 'Sitemap' }) res.render('sitemap', { title: 'Sitemap' })
}) })

View File

@@ -21,15 +21,15 @@ exports.initClient = (options) => {
} }
exports.getCourses = (locale = 'en-US', api = `cda`) => { exports.getCourses = (locale = 'en-US', api = `cda`) => {
// to get all the courses we simply request from Contentful all the entries // to get all the courses we request all the entries
// with the content_type `course` // with the content_type `course` from Contentful
const client = api === 'cda' ? cdaClient : cpaClient const client = api === 'cda' ? cdaClient : cpaClient
return client.getEntries({content_type: 'course', locale, include: 10}) return client.getEntries({content_type: 'course', locale, include: 10})
.then((response) => response.items) .then((response) => response.items)
} }
exports.getLandingPage = (locale = 'en-US', api = `cda`) => { 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 const client = api === 'cda' ? cdaClient : cpaClient
// TODO slug should be renamed to `contentful-the-example-app` or something .... // 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}) 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`) => { 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) // 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 // make sure to specify the content_type whenever you want to perform a query
const client = api === 'cda' ? cdaClient : cpaClient const client = api === 'cda' ? cdaClient : cpaClient

View File

@@ -28,7 +28,7 @@ block content
if course.fields.duration if course.fields.duration
.course__overview-item .course__overview-item
img.course__overview-icon(src='/images/icon-duration.svg') 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 if course.fields.skillLevel
.course__overview-item .course__overview-item
img.course__overview-icon(src='/images/icon-skill-level.svg') img.course__overview-icon(src='/images/icon-skill-level.svg')

View File

@@ -3,7 +3,7 @@ extends layout
block content block content
.layout-centered .layout-centered
h1= title 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(action=`/settings` method="POST" class="form")
.form-item .form-item
@@ -12,12 +12,12 @@ block content
.help-text Some help text we still need to define .help-text Some help text we still need to define
.form-item .form-item
label(for="cda") Delivery API Key label(for="cda") Delivery API key
input(type="text" name="cda" value=settings.cda) input(type="text" name="cda" value=settings.cda)
.help-text Some help text we still need to define .help-text Some help text we still need to define
.form-item .form-item
label(for="cpa") Preview API Key label(for="cpa") Preview API key
input(type="text" name="cpa" value=settings.cpa) input(type="text" name="cpa" value=settings.cpa)
.help-text Some help text we still need to define .help-text Some help text we still need to define