mirror of
https://github.com/kremalicious/blog.git
synced 2024-12-23 01:30:01 +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 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)
|
||||
let date = new Date().toISOString()
|
||||
|
||||
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')
|
||||
.join(title)
|
||||
.split('SLUG')
|
||||
@ -43,15 +43,26 @@ const newContentsPhoto = templatePhoto
|
||||
.split('DATE_SHORT')
|
||||
.join(dateShort)
|
||||
|
||||
const file = `${postsPath}/${dateShort}-${titleSlug}/index.md`
|
||||
const filePhoto = `${photosPath}/${dateShort}-${titleSlug}.md`
|
||||
|
||||
if (isPhoto) {
|
||||
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.`))
|
||||
|
@ -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)
|
||||
})
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user