{"size": 1310, "ext": "js", "max_stars_repo_path": "src/pages/libros.js", "max_stars_repo_name": "eduardodargent-laplebe/eduardodargent.pe", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "src/pages/libros.js", "max_issues_repo_name": "eduardodargent-laplebe/eduardodargent.pe", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "src/pages/libros.js", "max_forks_repo_name": "eduardodargent-laplebe/eduardodargent.pe", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 23.8181818182, "max_line_length": 72, "alphanum_fraction": 0.4633587786}
import React from 'react'
import Page from '../components/Page'
import Card from '../components/Card'
import { Link, graphql } from 'gatsby'
import './publicaciones.css'

export default ({ data }) => {
  return (
    <Page class="publicaciones">
      <div className="publicaciones-items">
        {data.allContentfulLibros.edges.map((edge, i) => (
          <Card key={i}>
            <Link to={`/libros/${edge.node.slug}`}>
              <div
                className="card-image"
                style={{
                  backgroundImage: `url(${edge.node.portada.file.url})`,
                }}
              />
              <h2 className="card-title">{edge.node.titulo}</h2>
              <div className="card-date">{edge.node.anho}</div>
              <div className="card-date">{edge.node.lugar}</div>
            </Link>
          </Card>
        ))}
      </div>
    </Page>
  )
}

export const ideasQuery = graphql`
  query {
    allContentfulLibros(sort: { fields: anho, order: DESC }) {
      edges {
        node {
          slug
          titulo
          anho
          lugar
          portada {
            file {
              url
            }
          }
          descripcion {
            childMarkdownRemark {
              html
            }
          }
        }
      }
    }
  }
`
