1
0
mirror of https://github.com/kremalicious/blog.git synced 2024-12-22 17:23:50 +01:00

new photos

This commit is contained in:
Matthias Kretschmann 2018-11-06 00:28:52 +01:00
parent 58a6e7b470
commit ab571c1a82
Signed by: m
GPG Key ID: 606EEEF3C479A91F
8 changed files with 62 additions and 24 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 MiB

View File

@ -0,0 +1,9 @@
---
type: photo
date: 2017-04-29T00:00:00.000Z
title: Palace scaffolding
image: 2017-04-29-palace-scaffolding.jpg
---
Reconstructed [Berlin Palace](https://en.wikipedia.org/wiki/Berlin_Palace) taking shape.

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 MiB

View File

@ -0,0 +1,9 @@
---
type: photo
date: 2017-12-15T22:28:49.832Z
title: "El Born Centre de Cultura i Memòria"
image: 2017-12-15-el-born-centre-de-cultura-i-memoria.jpg
---
[El Born Centre de Cultura i Memòria](http://elbornculturaimemoria.barcelona.cat), Barcelona, Spain

Binary file not shown.

After

Width:  |  Height:  |  Size: 515 KiB

View File

@ -0,0 +1,9 @@
---
type: photo
date: 2018-06-01T00:00:00.000Z
title: "Roger Waters, Us + Them"
image: 2018-06-01-roger-waters-us-them.jpg
---
@Mercedes-Benz Arena, Berlin, Germany

View File

@ -22,36 +22,47 @@ spinner.text = `Adding '${title}'.`
const titleSlug = slugify(title, { lower: true })
const postsPath = path.join('.', 'content', 'posts')
const photosPath = path.join('.', 'content', 'photos')
const date = new Date().toISOString()
const dateShort = date.slice(0, 10)
const newContents = template
.split('TITLE')
.join(title)
.split('SLUG')
.join(titleSlug)
.split('DATE')
.join(date)
const newContentsPhoto = templatePhoto
.split('TITLE')
.join(title)
.split('SLUG')
.join(titleSlug)
.split('DATE_LONG')
.join(date)
.split('DATE_SHORT')
.join(dateShort)
const file = `${postsPath}/${dateShort}-${titleSlug}/index.md`
const filePhoto = `${photosPath}/${dateShort}-${titleSlug}.md`
let date = new Date().toISOString()
if (isPhoto) {
if (process.argv[4]) {
date = new Date(process.argv[4]).toISOString()
}
const dateShort = date.slice(0, 10)
const filePhoto = `${photosPath}/${dateShort}-${titleSlug}.md`
const newContentsPhoto = templatePhoto
.split('TITLE')
.join(title)
.split('SLUG')
.join(titleSlug)
.split('DATE_LONG')
.join(date)
.split('DATE_SHORT')
.join(dateShort)
fs.appendFile(filePhoto, newContentsPhoto, err => {
if (err) spinner.fail(`Error creating photo post: ${err}`)
spinner.succeed(`New post '${title}' created.`)
})
} else {
if (process.argv[3]) {
date = new Date(process.argv[3]).toISOString()
}
const dateShort = date.slice(0, 10)
const file = `${postsPath}/${dateShort}-${titleSlug}/index.md`
const newContents = template
.split('TITLE')
.join(title)
.split('SLUG')
.join(titleSlug)
.split('DATE')
.join(date)
fs.outputFile(file, newContents)
.then(() => fs.readFile(file, 'utf8'))
.then(() => spinner.succeed(`New post '${title}' created.`))

View File

@ -30,7 +30,7 @@ const providers = {
}
class ExifMap extends PureComponent {
state = { zoom: 6 }
state = { zoom: 8 }
static propTypes = {
gps: PropTypes.object
@ -38,7 +38,7 @@ class ExifMap extends PureComponent {
zoomIn = () => {
this.setState({
zoom: Math.min(this.state.zoom + 3, 18)
zoom: Math.min(this.state.zoom + 4, 16)
})
}