diff --git a/assets/scss/components/tutorial/_tutorial_author.scss b/assets/scss/components/tutorial/_tutorial_author.scss
deleted file mode 100644
index c207a3c46f..0000000000
--- a/assets/scss/components/tutorial/_tutorial_author.scss
+++ /dev/null
@@ -1,47 +0,0 @@
-.tutorial-author {
- background: $primary;
- width: 100%;
-
- img {
- border-radius: $radius;
- margin: 0 $whitespace 0 0;
- }
-
- .details {
- p {
- @include font-light;
-
- color: $banner;
- font-size: 16px;
- margin: 0 0 $whitespace;
-
- a {
- color: darken($banner, 7%);
- text-decoration: underline;
- transition: color $transition-duration $transition-timing-function;
-
- &:hover,
- &:focus {
- color: $darker;
- }
- }
-
- &.name {
- @include font-medium;
-
- font-size: 22px;
- margin: ($whitespace * .25) 0 $whitespace;
- }
-
- &.social {
- font-size: 20px;
-
- a {
- display: inline-block;
- margin: 0 ($whitespace * .5) 0 0;
- text-decoration: none;
- }
- }
- }
- }
-}
diff --git a/assets/scss/components/tutorial/_tutorial_hero.scss b/assets/scss/components/tutorial/_tutorial_hero.scss
deleted file mode 100644
index bbdc9b48ec..0000000000
--- a/assets/scss/components/tutorial/_tutorial_hero.scss
+++ /dev/null
@@ -1,44 +0,0 @@
-.tutorial-hero {
- h1 {
- @include font-medium;
-
- color: $light;
- font-size: 45px;
- margin: ($whitespace * .5) 0 0;
- }
-
- h2 {
- @include font-medium;
-
- color: $light;
- font-size: 25px;
- margin: ($whitespace * .125) 0 ($whitespace * 1.5);
-
- a {
- @include primary-link;
- }
- }
-
- p {
- @include font-regular;
-
- color: $light;
- font-size: 18px;
- }
-
- .description {
- margin: ($whitespace * 1) 0 ($whitespace * .5);
- }
-
- .author {
- margin: 0;
-
- p {
- margin: ($whitespace * .25) $whitespace ($whitespace * .5) 0;
-
- a {
- @include primary-link;
- }
- }
- }
-}
diff --git a/assets/scss/components/tutorial/_tutorial_list.scss b/assets/scss/components/tutorial/_tutorial_list.scss
deleted file mode 100644
index b3fd8cbe7b..0000000000
--- a/assets/scss/components/tutorial/_tutorial_list.scss
+++ /dev/null
@@ -1,46 +0,0 @@
-.tutorial-list {
- h3 {
- @include font-medium;
-
- color: $light;
- font-size: 30px;
- margin: ($whitespace * 2) 0 ($whitespace);
- }
-
- p {
- @include font-regular;
-
- color: $light;
- font-size: 20px;
- margin: ($whitespace * .5) 0 ($whitespace);
-
- a {
- @include primary-link;
- }
- }
-
- ul {
- border-top: 3px solid $white;
- list-style: none;
- margin: ($whitespace * 2) 0 0;
- padding: ($whitespace * 2) 0;
-
- li {
- margin: 0 0 ($whitespace);
-
- p {
- font-size: 20px;
- margin: 0;
-
- &:not(:first-child) {
- font-size: 16px;
- }
-
- a {
- display: inline-block;
- line-height: 1.5;
- }
- }
- }
- }
-}
diff --git a/assets/scss/style.scss b/assets/scss/style.scss
index 1137f16106..6ae8f51f9a 100644
--- a/assets/scss/style.scss
+++ b/assets/scss/style.scss
@@ -18,9 +18,6 @@
@import "components/library/library_card";
@import "components/library/library_hero";
@import "components/library/library_asset_buttons";
-@import "components/tutorial/tutorial_hero";
-@import "components/tutorial/tutorial_author";
-@import "components/tutorial/tutorial_list";
@import "components/search/search";
@import "components/banner";
@import "components/footer";
@@ -32,7 +29,5 @@
@import "views/libraries";
@import "views/libraries-library";
@import "views/libraries-library-version";
-@import "views/libraries-library-tutorials";
-@import "views/libraries-library-tutorials-tutorial";
@import "views/about";
@import "views/api";
diff --git a/assets/scss/views/_api.scss b/assets/scss/views/_api.scss
index 6837e50602..4bc4145ed9 100644
--- a/assets/scss/views/_api.scss
+++ b/assets/scss/views/_api.scss
@@ -122,6 +122,40 @@ main {
}
}
}
+
+ .callout {
+ align-items: center;
+ background: rgba($primary, .9);
+ border-radius: .5em;
+ display: flex;
+ flex-flow: row nowrap;
+ margin: 2em 0;
+ padding: 1em;
+
+ > * {
+ margin: 0 .5em;
+ }
+
+ .icon {
+ color: $white;
+ font-size: 2.25em;
+ }
+
+ p {
+ @include font-medium;
+
+ color: $banner;
+
+ a {
+ color: $white;
+
+ &:hover,
+ &:focus {
+ color: $banner;
+ }
+ }
+ }
+ }
}
}
}
diff --git a/assets/scss/views/_libraries-library-tutorials-tutorial.scss b/assets/scss/views/_libraries-library-tutorials-tutorial.scss
deleted file mode 100644
index 676bbfb987..0000000000
--- a/assets/scss/views/_libraries-library-tutorials-tutorial.scss
+++ /dev/null
@@ -1,61 +0,0 @@
-main {
- &.libraries-library-tutorials-tutorial {
- .tutorial {
- max-width: 100%;
-
- h1,
- h2 {
- @include font-bold;
- }
-
- h3,
- h4,
- h5 {
- @include font-medium;
- }
-
- h1 {
- font-size: 2.4rem;
- }
-
- h2 {
- font-size: 2rem;
- }
-
- h3 {
- font-size: 1.6rem;
- }
-
- h4 {
- font-size: 1.2rem;
- }
-
- h5 {
- font-size: .8rem;
- }
-
- p {
- line-height: 1.5;
- margin: 0 0 ($whitespace * .5);
- }
-
- a {
- @include primary-link;
-
- text-decoration: underline;
- }
- }
-
- .callout {
- align-items: center;
-
- h4 {
- margin: $whitespace 0;
- }
-
- .button {
- margin: $whitespace;
- }
- }
- }
-}
diff --git a/assets/scss/views/_libraries-library-tutorials.scss b/assets/scss/views/_libraries-library-tutorials.scss
deleted file mode 100644
index 565117a9be..0000000000
--- a/assets/scss/views/_libraries-library-tutorials.scss
+++ /dev/null
@@ -1,17 +0,0 @@
-main {
- &.libraries-library-tutorials {
- .tutorials-hero {
- h1 {
- @include font-medium;
-
- color: $light;
- font-size: 45px;
- margin: ($whitespace * .5) 0 0;
-
- a {
- @include primary-link;
- }
- }
- }
- }
-}
diff --git a/components/api/library.vue b/components/api/library.vue
index 2428f02724..3c69f7b5b1 100644
--- a/components/api/library.vue
+++ b/components/api/library.vue
@@ -4,6 +4,22 @@
Getting a specific library on cdnjs
+
+
+
+
+ The tutorials
property of libraries is deprecated.
+ It will always be an empty array, and will be removed in the future.
+
+
+ See
+
+ cdnjs/cdnjs issue #14130
+ for more information.
+
+
+
+
The /libraries/:library
endpoint allows for data on a specific library to be
requested and will return a JSON object with all library data properties by default.
@@ -68,11 +84,11 @@
{"name":"vue","author":"Evan You <yyx990803@gmail.com>","description":"Simple, Fast & Composable MVVM for building interactive interfaces","filename":"vue.min.js","sri":"sha256-ngFW3UnAN0Tnm76mDuu7uUtYEcG3G5H1+zioJw3t+68=","version":"2.6.11","repository":{"type":"git","url":"https://github.com/vuejs/vue.git"},"autoupdate":{"source":"npm","target":"vue"}}
-
{"name":"react","description":"React is a JavaScript library for building user interfaces.","tutorials":[{"id":"universal-react-apps","modified":"2017-09-05T17:31:26.000Z","author":{"name":"Ahmed Bouchefra","email":"techiediaries9@gmail.com","description":"Web developer, technical writer and entrepreneur","homepage":"https://www.techiediaries.com","twitter":"techiediaries"},"description":"This tutorial will cover how to use React and Next.js to build a simple universal web app.","homepage":"https://www.techiediaries.com","keywords":["react","nextjs","universal"],"library-tags":["react","nextjs"],"name":"Building Universal Server Rendered Apps with React and Next.js 3.0","repository":"https://github.com/techiediaries","content":"\n## Introduction\n\nNext.js is a framework for quickly building universal (also called Isomorphic) server-rendered web apps with\nReact. In this tutorial you will learn essential concepts of server-rendered React apps by creating a demo app with Next.js.\n\nBuilding apps with Next.js is simple. You just create a <em>pages</em> directory and place React components in it.\nNext.js will take care of everything else.\n\nThis tutorial was originally published in [techiediaries](https://www.techiediaries.com/universal-react-apps-nextjs/)\n\nNow let's get started\n\nFirst we need to install the required tools:\n\n## Installing Next.js 2.0\n\nYou can install Next.js 2.0 via npm with:\n\n npm install --save next react react-dom\n\n## Installing Next.js 3.0\n\nNext.js 3.0 is still in beta, you can also install it via npm with:\n\n npm install next@beta react react-dom --save\n\n## Adding NPM Scripts to package.json\n\nBuilding apps with Next.js is a matter of using three commands:\n\n next\n next build\n next start\n\nSo lets add NPM scripts to trigger these commands:\n\n \"scripts\": {\n \"dev\": \"next\",\n \"build\": \"next build\",\n \"start\": \"next start\"\n },\n\n## Adding Pages\n\nTo create pages you first need to create a pages directory:\n\n mkdir pages\n\n### Adding the Home Page\n\nCreate an index.js file inside pages folder and put this content in it:\n\n import Link from 'next/link'\n export default () => (\n <div>\n <Link href='/'><a>Home</a></Link> -\n <Link href='/about'><a>About Me</a></Link> -\n <Link href='/contact'><a>Contact</a></Link>\n <br></br>\n <p>This is the home page</p>\n\n </div>\n )\n\n### Adding the About Page\n\nNext create an about.js file inside pages folder then put the following content:\n\n import Link from 'next/link'\n export default () => (\n <div>\n <Link href='/'><a>Home</a></Link> -\n <Link href='/about'><a>About Me</a></Link> -\n <Link href='/contact'><a>Contact</a></Link>\n <br></br>\n <p>This is about page</p>\n </div>\n )\n\n### Adding the Contact Page\n\nAdd contact.js file inside pages folder then put the following:\n\n import Link from 'next/link'\n export default () => (\n <div>\n <Link href='/'><a>Home</a></Link> -\n <Link href='/about'><a>About Me</a></Link> -\n <Link href='/contact'><a>Contact</a></Link>\n <br></br>\n <p>This is the contact page</p>\n\n </div>\n )\n\nNow you can launch next with:\n\n npm run dev\n\nYour app will be available from [http://localhost:3000](http://localhost:3000).\n\nAs you can see the names of files inside pages directory become the routes except for / which points to index.js\n\n## Conclusion\n\nUniversal apps become very popular in these days and thanks to React and Next.js you can build them in a matter\nof a few commands.\n\nThanks for reading!\n"}]}
+
{"name":"react","description":"React is a JavaScript library for building user interfaces."}
diff --git a/components/json-ld/tutorial.vue b/components/json-ld/tutorial.vue
deleted file mode 100644
index 97cf22df0b..0000000000
--- a/components/json-ld/tutorial.vue
+++ /dev/null
@@ -1,35 +0,0 @@
-
diff --git a/components/json-ld/tutorials.vue b/components/json-ld/tutorials.vue
deleted file mode 100644
index ae48d7c930..0000000000
--- a/components/json-ld/tutorials.vue
+++ /dev/null
@@ -1,38 +0,0 @@
-
diff --git a/components/tutorial/tutorial_author.vue b/components/tutorial/tutorial_author.vue
deleted file mode 100644
index 3c66d82389..0000000000
--- a/components/tutorial/tutorial_author.vue
+++ /dev/null
@@ -1,59 +0,0 @@
-
-
-
-
-
diff --git a/components/tutorial/tutorial_hero.vue b/components/tutorial/tutorial_hero.vue
deleted file mode 100644
index 35898e0efc..0000000000
--- a/components/tutorial/tutorial_hero.vue
+++ /dev/null
@@ -1,66 +0,0 @@
-
-
-
{{ tutorial.name }}
-
- For
-
- {{ library }}
-
-
-
-
- {{ tutorial.description }}
-
-
-
-
-
-
-
diff --git a/components/tutorial/tutorial_list.vue b/components/tutorial/tutorial_list.vue
deleted file mode 100644
index 78b479a660..0000000000
--- a/components/tutorial/tutorial_list.vue
+++ /dev/null
@@ -1,75 +0,0 @@
-
-
-
-
-
diff --git a/data/json-ld/library.js b/data/json-ld/library.js
index 91c94fe7f6..519fe11fb0 100644
--- a/data/json-ld/library.js
+++ b/data/json-ld/library.js
@@ -27,9 +27,5 @@ export default (base, library, libraryName) => {
softwareVersion: library.version,
applicationCategory: 'library',
operatingSystem: 'any',
- hasPart: {
- '@type': 'CreativeWorkSeries',
- url: `${base}libraries/${libraryName}/tutorials`,
- },
};
};
diff --git a/data/json-ld/tutorial.js b/data/json-ld/tutorial.js
deleted file mode 100644
index e034d085e2..0000000000
--- a/data/json-ld/tutorial.js
+++ /dev/null
@@ -1,38 +0,0 @@
-export default (base, tutorial, tutorialName, library) => ({
- '@context': 'http://schema.org',
- '@type': 'TechArticle',
- name: tutorial.name,
- headline: tutorial.name,
- description: tutorial.description,
- keywords: tutorial.keywords && tutorial.keywords.join(','),
- url: `${base}libraries/${library}/tutorials/${tutorialName}`,
- inLanguage: 'en',
- accessMode: 'textual',
- accessModeSufficient: 'textual',
- isAccessibleForFree: true,
- image: `${base}banner.png`,
- isPartOf: {
- '@type': 'CreativeWorkSeries',
- url: `${base}libraries/${library}/tutorials`,
- },
- author: {
- '@type': 'Person',
- name: tutorial.author.name,
- },
- publisher: {
- '@type': 'Organization',
- name: 'cdnjs',
- url: base,
- logo: {
- type: 'ImageObject',
- url: `${base}favicon.png`,
- },
- },
- sourceOrganization: {
- '@type': 'Organization',
- name: 'cdnjs',
- url: base,
- },
- dateModified: tutorial.modified,
- datePublished: tutorial.created,
-});
diff --git a/data/json-ld/tutorials.js b/data/json-ld/tutorials.js
deleted file mode 100644
index 7050f45b2b..0000000000
--- a/data/json-ld/tutorials.js
+++ /dev/null
@@ -1,27 +0,0 @@
-import Tutorial from './tutorial';
-
-export default (base, library, tutorials, keywords) => ({
- '@context': 'http://schema.org',
- '@type': 'CreativeWorkSeries',
- name: `${library} Tutorials`,
- headline: `${library} Tutorials`,
- description: `Tutorials for ${library} on cdnjs`,
- keywords,
- url: `${base}libraries/${library}/tutorials`,
- inLanguage: 'en',
- accessMode: 'textual',
- accessModeSufficient: 'textual',
- isAccessibleForFree: true,
- isPartOf: `${base}libraries/${library}`,
- hasPart: tutorials.map(d => Tutorial(base, d, d.id, library)),
- publisher: {
- '@type': 'Organization',
- name: 'cdnjs',
- url: base,
- },
- sourceOrganization: {
- '@type': 'Organization',
- name: 'cdnjs',
- url: base,
- },
-});
diff --git a/pages/libraries/_library/index.vue b/pages/libraries/_library/index.vue
index 38c9fc3a8b..c8f6d652d3 100644
--- a/pages/libraries/_library/index.vue
+++ b/pages/libraries/_library/index.vue
@@ -54,8 +54,6 @@
-
-
@@ -76,7 +74,6 @@
import Breadcrumbs from '../../../components/breadcrumbs';
import LibraryHero from '../../../components/library/library_hero';
import LibraryAssetButtons from '../../../components/library/library_asset_buttons';
- import TutorialList from '../../../components/tutorial/tutorial_list';
import JSONLDLibrary from '../../../components/json-ld/library';
const meta = {
@@ -128,7 +125,6 @@
Breadcrumbs,
LibraryHero,
LibraryAssetButtons,
- TutorialList,
JSONLDLibrary,
VueSelect,
},
diff --git a/pages/libraries/_library/tutorials/_tutorial.vue b/pages/libraries/_library/tutorials/_tutorial.vue
deleted file mode 100644
index c7de743747..0000000000
--- a/pages/libraries/_library/tutorials/_tutorial.vue
+++ /dev/null
@@ -1,150 +0,0 @@
-
-
-
-
-
-
-
Looking for more {{ libraryName }} tutorials?
-
- View all tutorials for {{ libraryName }}
-
-
-
-
-
-
-
diff --git a/pages/libraries/_library/tutorials/index.vue b/pages/libraries/_library/tutorials/index.vue
deleted file mode 100644
index e4086bba19..0000000000
--- a/pages/libraries/_library/tutorials/index.vue
+++ /dev/null
@@ -1,77 +0,0 @@
-
-
-
-
-
diff --git a/util/build/routes.js b/util/build/routes.js
index fe63e98ad2..88fbb14fdc 100644
--- a/util/build/routes.js
+++ b/util/build/routes.js
@@ -8,20 +8,9 @@ export default async () => {
const libsJson = await libsRaw.json();
const libsAsync = libsJson.results.map((lib) => {
return [lib.name, async () => {
- const libRaw = await fetch(`${baseApi}/libraries/${encodeURIComponent(lib.name)}?fields=tutorials,versions`);
+ const libRaw = await fetch(`${baseApi}/libraries/${encodeURIComponent(lib.name)}?fields=versions`);
const libJson = await libRaw.json();
- if (!libJson.tutorials) {
- console.warn(`No tutorials array for ${lib.name}`, libJson);
- }
-
- const tutorials = (libJson.tutorials || []).map((tut) => {
- return {
- url: `/libraries/${encodeURIComponent(lib.name)}/tutorials/${encodeURIComponent(tut.id)}`,
- priority: 0.5,
- };
- });
-
if (!libJson.versions) {
console.warn(`No versions array for ${lib.name}`, libJson);
}
@@ -38,12 +27,7 @@ export default async () => {
url: `/libraries/${encodeURIComponent(lib.name)}`,
priority: 0.6,
},
- ...tutorials,
...versions,
- {
- url: `/libraries/${encodeURIComponent(lib.name)}/tutorials`,
- priority: 0.4,
- },
];
}];
});
diff --git a/util/build/sitemap.js b/util/build/sitemap.js
index 0a2813e977..81bfd6c7a2 100644
--- a/util/build/sitemap.js
+++ b/util/build/sitemap.js
@@ -24,7 +24,7 @@ const getUrls = async () => {
},
];
- // Add in all the libraries, their versions & tutorials
+ // Add in all the libraries and their versions
return urls.concat(await routes());
};
diff --git a/util/get_library.js b/util/get_library.js
index 39fd9806f8..feef22fabe 100644
--- a/util/get_library.js
+++ b/util/get_library.js
@@ -7,7 +7,7 @@ const spdxLicenseIds = require('spdx-license-ids/index.json');
const index = searchClient.initIndex('libraries');
const apiFields = () => new Set([
- 'name', 'autoupdate', 'licenses', 'license', 'homepage', 'description', 'keywords', 'version', 'filename', 'versions', 'tutorials',
+ 'name', 'autoupdate', 'licenses', 'license', 'homepage', 'description', 'keywords', 'version', 'filename', 'versions',
]);
const apiFieldsQuery = fields => `?fields=${Array.from(fields).map(f => encodeURIComponent(f)).join(',')}`;
diff --git a/util/get_tutorial.js b/util/get_tutorial.js
deleted file mode 100644
index 99c19a3c60..0000000000
--- a/util/get_tutorial.js
+++ /dev/null
@@ -1,25 +0,0 @@
-import fetch from 'node-fetch';
-import { baseApi } from '../data/config';
-
-export const getTutorials = async (lib) => {
- // Get data from cdnjs API
- const res = await fetch(`${baseApi}/libraries/${encodeURIComponent(lib)}/tutorials`);
- const apiData = await res.json();
-
- // Done
- return apiData;
-};
-
-export const getTutorial = async (lib, tut) => {
- // Get data from cdnjs API
- const res = await fetch(`${baseApi}/libraries/${encodeURIComponent(lib)}/tutorials/${encodeURIComponent(tut)}`);
- const apiData = await res.json();
-
- // Not found
- if (Object.entries(apiData).length === 0 && apiData.constructor.name === Object.name) {
- throw new Error('Tutorial not found');
- }
-
- // Done
- return apiData;
-};