Skip to content

Commit 28d0a9b

Browse files
author
Philipp Eisen
committed
Change page titles to Nostalgia HN
1 parent 0333fd6 commit 28d0a9b

File tree

3 files changed

+37
-37
lines changed

3 files changed

+37
-37
lines changed

manifest.json

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,37 @@
11
{
2-
"name": "Vue Hackernews 2.0",
3-
"short_name": "Vue HN",
2+
"name": "Nostalgia HN",
3+
"short_name": "N7a HN",
44
"icons": [{
5-
"src": "/public/logo-120.png",
6-
"sizes": "120x120",
7-
"type": "image/png"
8-
}, {
9-
"src": "/public/logo-144.png",
10-
"sizes": "144x144",
11-
"type": "image/png"
12-
}, {
13-
"src": "/public/logo-152.png",
14-
"sizes": "152x152",
15-
"type": "image/png"
16-
}, {
17-
"src": "/public/logo-192.png",
18-
"sizes": "192x192",
19-
"type": "image/png"
20-
}, {
21-
"src": "/public/logo-256.png",
22-
"sizes": "256x256",
23-
"type": "image/png"
24-
}, {
25-
"src": "/public/logo-384.png",
26-
"sizes": "384x384",
27-
"type": "image/png"
28-
}, {
5+
"src": "/public/logo-120.png",
6+
"sizes": "120x120",
7+
"type": "image/png"
8+
}, {
9+
"src": "/public/logo-144.png",
10+
"sizes": "144x144",
11+
"type": "image/png"
12+
}, {
13+
"src": "/public/logo-152.png",
14+
"sizes": "152x152",
15+
"type": "image/png"
16+
}, {
17+
"src": "/public/logo-192.png",
18+
"sizes": "192x192",
19+
"type": "image/png"
20+
}, {
21+
"src": "/public/logo-256.png",
22+
"sizes": "256x256",
23+
"type": "image/png"
24+
}, {
25+
"src": "/public/logo-384.png",
26+
"sizes": "384x384",
27+
"type": "image/png"
28+
}, {
2929
"src": "/public/logo-512.png",
3030
"sizes": "512x512",
3131
"type": "image/png"
32-
}],
32+
}],
3333
"start_url": "/",
3434
"background_color": "#f2f3f5",
3535
"display": "standalone",
3636
"theme_color": "#f60"
37-
}
37+
}

server.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ const serverInfo =
1616

1717
const app = express()
1818

19-
function createRenderer (bundle, options) {
19+
function createRenderer(bundle, options) {
2020
// https://github.com/vuejs/vue/blob/dev/packages/vue-server-renderer/README.md#why-use-bundlerenderer
2121
return createBundleRenderer(bundle, Object.assign(options, {
2222
// for component caching
@@ -78,7 +78,7 @@ app.use('/service-worker.js', serve('./dist/service-worker.js'))
7878
// https://www.nginx.com/blog/benefits-of-microcaching-nginx/
7979
app.use(microcache.cacheSeconds(1, req => useMicroCache && req.originalUrl))
8080

81-
function render (req, res) {
81+
function render(req, res) {
8282
const s = Date.now()
8383

8484
res.setHeader("Content-Type", "text/html")
@@ -87,7 +87,7 @@ function render (req, res) {
8787
const handleError = err => {
8888
if (err.url) {
8989
res.redirect(err.url)
90-
} else if(err.code === 404) {
90+
} else if (err.code === 404) {
9191
res.status(404).send('404 | Page Not Found')
9292
} else {
9393
// Render Error Page or Redirect
@@ -98,7 +98,7 @@ function render (req, res) {
9898
}
9999

100100
const context = {
101-
title: 'Vue HN 2.0', // default title
101+
title: 'Nostalgia HN', // default title
102102
url: req.url
103103
}
104104
renderer.renderToString(context, (err, html) => {

src/util/title.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
function getTitle (vm) {
1+
function getTitle(vm) {
22
const { title } = vm.$options
33
if (title) {
44
return typeof title === 'function'
@@ -8,19 +8,19 @@ function getTitle (vm) {
88
}
99

1010
const serverTitleMixin = {
11-
created () {
11+
created() {
1212
const title = getTitle(this)
1313
if (title) {
14-
this.$ssrContext.title = `Vue HN 2.0 | ${title}`
14+
this.$ssrContext.title = `Nostalgia HN | ${title}`
1515
}
1616
}
1717
}
1818

1919
const clientTitleMixin = {
20-
mounted () {
20+
mounted() {
2121
const title = getTitle(this)
2222
if (title) {
23-
document.title = `Vue HN 2.0 | ${title}`
23+
document.title = `Nostalgia HN | ${title}`
2424
}
2525
}
2626
}

0 commit comments

Comments
 (0)