mirror of
https://github.com/kremalicious/blog.git
synced 2025-02-14 21:10:25 +01:00
new photos
This commit is contained in:
parent
58a6e7b470
commit
ab571c1a82
BIN
content/photos/2017-04-29-palace-scaffolding.jpg
Normal file
BIN
content/photos/2017-04-29-palace-scaffolding.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 3.3 MiB |
9
content/photos/2017-04-29-palace-scaffolding.md
Normal file
9
content/photos/2017-04-29-palace-scaffolding.md
Normal 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 |
@ -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
|
BIN
content/photos/2018-06-01-roger-waters-us-them.jpg
Normal file
BIN
content/photos/2018-06-01-roger-waters-us-them.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 515 KiB |
9
content/photos/2018-06-01-roger-waters-us-them.md
Normal file
9
content/photos/2018-06-01-roger-waters-us-them.md
Normal 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
|
@ -22,18 +22,18 @@ spinner.text = `Adding '${title}'.`
|
|||||||
const titleSlug = slugify(title, { lower: true })
|
const titleSlug = slugify(title, { lower: true })
|
||||||
const postsPath = path.join('.', 'content', 'posts')
|
const postsPath = path.join('.', 'content', 'posts')
|
||||||
const photosPath = path.join('.', 'content', 'photos')
|
const photosPath = path.join('.', 'content', 'photos')
|
||||||
const date = new Date().toISOString()
|
|
||||||
const dateShort = date.slice(0, 10)
|
|
||||||
|
|
||||||
const newContents = template
|
let date = new Date().toISOString()
|
||||||
.split('TITLE')
|
|
||||||
.join(title)
|
|
||||||
.split('SLUG')
|
|
||||||
.join(titleSlug)
|
|
||||||
.split('DATE')
|
|
||||||
.join(date)
|
|
||||||
|
|
||||||
const newContentsPhoto = templatePhoto
|
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')
|
.split('TITLE')
|
||||||
.join(title)
|
.join(title)
|
||||||
.split('SLUG')
|
.split('SLUG')
|
||||||
@ -43,15 +43,26 @@ const newContentsPhoto = templatePhoto
|
|||||||
.split('DATE_SHORT')
|
.split('DATE_SHORT')
|
||||||
.join(dateShort)
|
.join(dateShort)
|
||||||
|
|
||||||
const file = `${postsPath}/${dateShort}-${titleSlug}/index.md`
|
|
||||||
const filePhoto = `${photosPath}/${dateShort}-${titleSlug}.md`
|
|
||||||
|
|
||||||
if (isPhoto) {
|
|
||||||
fs.appendFile(filePhoto, newContentsPhoto, err => {
|
fs.appendFile(filePhoto, newContentsPhoto, err => {
|
||||||
if (err) spinner.fail(`Error creating photo post: ${err}`)
|
if (err) spinner.fail(`Error creating photo post: ${err}`)
|
||||||
spinner.succeed(`New post '${title}' created.`)
|
spinner.succeed(`New post '${title}' created.`)
|
||||||
})
|
})
|
||||||
} else {
|
} 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)
|
fs.outputFile(file, newContents)
|
||||||
.then(() => fs.readFile(file, 'utf8'))
|
.then(() => fs.readFile(file, 'utf8'))
|
||||||
.then(() => spinner.succeed(`New post '${title}' created.`))
|
.then(() => spinner.succeed(`New post '${title}' created.`))
|
||||||
|
@ -30,7 +30,7 @@ const providers = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class ExifMap extends PureComponent {
|
class ExifMap extends PureComponent {
|
||||||
state = { zoom: 6 }
|
state = { zoom: 8 }
|
||||||
|
|
||||||
static propTypes = {
|
static propTypes = {
|
||||||
gps: PropTypes.object
|
gps: PropTypes.object
|
||||||
@ -38,7 +38,7 @@ class ExifMap extends PureComponent {
|
|||||||
|
|
||||||
zoomIn = () => {
|
zoomIn = () => {
|
||||||
this.setState({
|
this.setState({
|
||||||
zoom: Math.min(this.state.zoom + 3, 18)
|
zoom: Math.min(this.state.zoom + 4, 16)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user