Notes

This is notes about concepts.

Commands

php artisan bookshelves:generate -eft
ln -s /home/jails/sftp/pictures-authors public/storage/data/pictures-authors
ln -s /home/jails/sftp/pictures-series public/storage/data/pictures-series

ln -s /home/jails/sftp/books-libres public/storage/data/books
ln -s /mnt/e/WorkInProgress/ebooks/environment/books-libres public/storage/data/books
ln -s /mnt/e/WorkInProgress/ebooks/environment/books-pirates public/storage/data/books

ln -s /mnt/e/WorkInProgress/ebooks/environment/pictures-authors public/storage/data/pictures-authors
ln -s /mnt/e/WorkInProgress/ebooks/environment/pictures-series public/storage/data/pictures-series

cmd /c mklink /J "C:\workspace\projets\bookshelves-back\public\storage\data\books\books-pirates" "C:\Users\ewila\OneDrive\Documents\WorkInProgress\ebooks\environment\books-pirates"

New-Item -ItemType Junction -Path "C:\workspace\projets\bookshelves-back\public\storage\data\books\books-pirates" -Target "C:\Users\ewila\OneDrive\Documents\WorkInProgress\ebooks\environment\books-pirates"

New-Item -ItemType Junction -Path "C:\workspace\projets\bookshelves-back\public\storage\data\pictures-authors\pictures-authors" -Target "C:\Users\ewila\OneDrive\Documents\WorkInProgress\ebooks\environment\pictures-authors"

New-Item -ItemType Junction -Path "C:\workspace\projets\bookshelves-back\public\storage\data\pictures-series\pictures-series" -Target "C:\Users\ewila\OneDrive\Documents\WorkInProgress\ebooks\environment\pictures-series"

JsonLD

// JSON LD ARTICLE

<script type="application/ld+json">
{
  "@context": "http://schema.org/",
  "@type": "Article",
  "mainEntityOfPage": {
    "@type": "WebPage",
    "@id": "url"
  },
  "author": {
    "@type": "Person",
    "name": "name"
  },
  "publisher": {
    "@type": "Organization",
    "name": "publisher name",
    "logo": {
      "@type": "ImageObject",
      "url": "logo"
    }
  },
  "headline": "headline",
  "image": "image url",
  "datePublished": "2021-04-03",
  "dateModified": "2021-04-03"
}
</script>

// JSON LD WEBSITE

<script type="application/ld+json">
{
  "@context": "http://schema.org/",
  "@type": "WebSite",
  "url": "url",
  "potentialAction": {
    "@type": "SearchAction",
    "target": "search url{search_term_string}",
    "query-input": "required name=search_term_string"
  }
}
</script>

// JSON LD PERSON

<script type="application/ld+json">
{
  "@context": "http://schema.org/",
  "@type": "Person",
  "name": "name",
  "image": "photo",
  "url": "website",
  "jobTitle": "job",
  "worksFor": {
    "@type": "Organization",
    "name": "company"
  }
  "sameAs": []
}
</script>

// JSON LD PRODUCT

<script type="application/ld+json">
{
  "@context": "http://schema.org/",
  "@type": "Product",
  "name": "name",
  "image": "image url",
  "description": "text",
  "isbn": "9782075038362",
  "brand": {
    "@type": "Brand",
    "name": "brand"
  },
  "aggregateRating": {
    "@type": "AggregateRating",
    "ratingValue" : "4",
    "ratingCount" : "2",
    "reviewCount" : "2",
    "worstRating" : "3",
    "bestRating" : "5"
  },
  "review": [
    {
      "@type": "Review",
      "name" : "Amazing!",
      "author": {
        "@type": "Person",
        "name": "Ewilan"
      },
      "datePublished": "2021-04-03",
      "reviewBody" : "Amazing book!",
      "reviewRating": {
        "@type": "Rating",
        "ratingValue" : "5",
        "worstRating" : "0",
        "bestRating" : "5"
      }
    }
  ]
}

// CURRENT BOOK SLUG

jsonld() {
  const breadcrumbs = [
    {
      url: `${this.$config.baseURL}/`,
      text: 'Home',
    },
    {
      url: `${this.$config.baseURL}/books`,
      text: 'Books',
    },
    {
      url: `${this.$config.baseURL}/books/${this.$route.params.author}/${this.$route.params.slug}`,
      text: this.book.title,
    },
  ]
  const authors = this.book.authors.map((author, index) => ({
    '@type': 'Person',
    familyName: author.lastname,
    givenName: author.firstname,
    name: author.name,
    url: `${this.$config.baseURL}/authors/${author.meta.slug}`,
  }))

  const items = breadcrumbs.map((item, index) => ({
    '@type': 'BreadcrumbList',
    item: {
      '@type': 'ListItem',
      position: index + 1,
      '@id': item.url,
      name: item.text,
    },
  }))
  return {
    '@context': 'https://schema.org',
    '@type': 'WebPage',
    itemListElement: items,
    mainEntity: {
      '@type': 'Book',
      author: authors,
      bookFormat: 'http://schema.org/Book',
      datePublished: this.book.publishDate,
      image: this.book.cover.thumbnail,
      inLanguage: formatLanguage(this.book.language),
      isbn: this.book.identifier
        ? this.book.identifier.isbn || this.book.identifier.isbn13
        : null,
      name: this.book.title,
      numberOfPages: this.book.pageCount,
      publisher: this.book.publisher ? this.book.publisher.name : '',
    },
  }
},
</script>
Edit this page on GitHub Updated at Tue, Apr 12, 2022