Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file removed src/assets/img/landing/new/endpoint1.png
Binary file not shown.
Binary file removed src/assets/img/landing/new/[email protected]
Binary file not shown.
Binary file removed src/assets/img/landing/new/endpoint2.png
Binary file not shown.
Binary file removed src/assets/img/landing/new/[email protected]
Binary file not shown.
Binary file removed src/assets/img/landing/new/endpoint3.png
Binary file not shown.
Binary file removed src/assets/img/landing/new/[email protected]
Binary file not shown.
Binary file removed src/assets/img/landing/new/[email protected]
Binary file not shown.
5 changes: 0 additions & 5 deletions src/assets/img/landing/new/endpoint5.svg

This file was deleted.

30 changes: 0 additions & 30 deletions src/assets/img/landing/new/endpoint6.svg

This file was deleted.

6 changes: 6 additions & 0 deletions src/assets/img/proxy/atlas.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
79 changes: 79 additions & 0 deletions src/assets/json/oss-cdn-projects.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
{
"cocoa": {
"title": "CocoaPods",
"apiCdnName": "cocoa",
"descr": "CocoaPods is a dependency manager for Swift and Objective-C Cocoa projects. It has over 87 thousand libraries and is used in over 3 million apps. CocoaPods can help you scale your projects elegantly.",
"link": "https://www.cocoapods.org",
"docsLink": "https://github.com/CocoaPods/cdn.cocoapods.org",
"jsDelivrLink": "/oss-cdn/cocoa",
"imgSrc": "/img/proxy/cocoa.svg",
"imgWidth": "202",
"imgHeight": "46"
},
"ghost": {
"title": "Ghost",
"apiCdnName": "ghost",
"descr": "Ghost is a powerful app for new-media creators to publish, share, and grow a business around their content. It comes with modern tools to build a website, publish content, send newsletters & offer paid subscriptions to members.",
"link": "https://ghost.org",
"docsLink": "https://ghost.org/docs/install",
"jsDelivrLink": "/oss-cdn/ghost",
"imgSrc": "/img/proxy/ghost.png",
"imgWidth": "152",
"imgHeight": "56"
},
"pyodide": {
"title": "Pyodide",
"apiCdnName": "pyodide",
"descr": "Pyodide brings the Python 3.9 runtime to the browser via WebAssembly, thanks to Emscripten. It builds the Python scientific stack including NumPy, Pandas, Matplotlib, SciPy, and scikit-learn. Over 75 packages are currently available. In addition, it’s possible to install pure Python wheels from PyPI.",
"link": "https://pyodide.org",
"docsLink": "https://pyodide.org/en/stable/usage/index.html",
"jsDelivrLink": "/oss-cdn/pyodide",
"imgSrc": "/img/proxy/pyodide.svg",
"imgWidth": "170",
"imgHeight": "56"
},
"atlas": {
"title": "AtlasOS",
"apiCdnName": "atlas",
"descr": "AtlasOS is creating a \"kinder\" Windows experience. Reducing bloatware and optimizing performance for enthusiasts, gamers, and privacy-conscious individuals.",
"link": "https://atlasos.net",
"docsLink": "https://docs.atlasos.net",
"jsDelivrLink": "/oss-cdn/atlas",
"imgSrc": "/img/proxy/atlas.svg",
"imgWidth": "158",
"imgHeight": "58"
},
"musescore": {
"title": "MuseScore",
"apiCdnName": "musescore",
"descr": "Create, play and print beautiful sheet music. The world’s most popular notation software.",
"link": "https://musescore.org",
"docsLink": "https://musescore.org",
"jsDelivrLink": "/oss-cdn/musescore",
"imgSrc": "/img/proxy/musescore.svg",
"imgWidth": "213",
"imgHeight": "48"
},
"fontsource": {
"title": "Fontsource",
"apiCdnName": "fontsource",
"descr": "Fontsource is a collection of open-source fonts.",
"link": "https://fontsource.org",
"docsLink": "https://fontsource.org/docs/getting-started/cdn",
"jsDelivrLink": "/oss-cdn/fontsource",
"imgSrc": "/img/proxy/fontsource.svg",
"imgWidth": "239",
"imgHeight": "46"
},
"yocto": {
"title": "Yocto",
"apiCdnName": "yocto-sstate",
"descr": "The Yocto Project is an open-source collaboration project that helps developers create custom Linux-based systems regardless of the hardware architecture. The project provides a flexible set of tools and a space where embedded developers worldwide can share technologies, software stacks, configurations, and best practices that can be used to create tailored Linux images for embedded and IOT devices.",
"link": "https://www.yoctoproject.org",
"docsLink": "https://docs.yoctoproject.org",
"jsDelivrLink": "/oss-cdn/yocto",
"imgSrc": "/img/proxy/yocto.svg",
"imgWidth": "145",
"imgHeight": "56"
}
}
26 changes: 16 additions & 10 deletions src/assets/less/pages/proxy.less
Original file line number Diff line number Diff line change
Expand Up @@ -17,26 +17,32 @@
row-gap: 80px;
}

.content-wrapper {
.proxy-wrapper {
width: 100%;
max-width: 1272px;
padding: 0 24px;
}

.bg-wrapper {
display: flex;
justify-content: center;
width: 100%;
padding: 40px 0;
background: #f9fafb;

@media (min-width: @screen-sm-min) {
padding: 80px 0;
&:nth-child(2n) {
width: 100%;
padding: 40px 24px;
background: #f9fafb;

@media (min-width: @screen-sm-min) {
padding: 80px 24px;
}
}
}

.proxy-info {
width: 100%;
max-width: 1272px;
padding: 0 24px;
}

.proxy-item {
width: 100%;
max-width: 1224px;

.c-proxy-head {
margin-bottom: 40px;
Expand Down
12 changes: 4 additions & 8 deletions src/middleware/sitemap/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,17 @@ let siteMap0Template = Handlebars.compile(fs.readFileSync(viewsPath + '/sitemap-
let siteMapIndexTemplate = Handlebars.compile(fs.readFileSync(viewsPath + '/sitemap-index.xml', 'utf8'));
let packagesPromise = updatePackages();

const ossCdnProjects = require('../../assets/json/oss-cdn-projects.json');
const OSS_CDN_LINKS = Object.values(ossCdnProjects).map(project => project.jsDelivrLink.slice(1));

module.exports = async (ctx) => {
ctx.params.page = ctx.params.page.replace(/\.xml$/, '');
let pages = (await readDirRecursive(viewsPath + '/pages', [ '_*' ])).map(p => path.relative(viewsPath + '/pages', p).replace(/\\/g, '/').slice(0, -5));
let packages = await packagesPromise;
let maxPage = Math.ceil(packages.length / 50000);
let page = Number(ctx.params.page);

pages.push(
'oss-cdn/cocoa',
'oss-cdn/ghost',
'oss-cdn/musescore',
'oss-cdn/pyodide',
'oss-cdn/fontsource',
'oss-cdn/yocto',
);
pages.push(...OSS_CDN_LINKS);

if (ctx.params.page === 'index') {
ctx.body = siteMapIndexTemplate({ serverHost, maps: _.range(1, maxPage + 1) });
Expand Down
13 changes: 12 additions & 1 deletion src/routes/jsdelivr.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ const readme = require('../middleware/readme');
const algoliaNode = require('../lib/algolia-node');
const legacyMapping = require('../../data/legacy-mapping.json');

const ossCdnProjects = require('../assets/json/oss-cdn-projects.json');
const OSS_CDN_PROJECT_NAMES = Object.keys(ossCdnProjects);

const router = new KoaRouter();

/**
Expand Down Expand Up @@ -146,8 +149,16 @@ koaElasticUtils.addRoutes(router, [
koaElasticUtils.addRoutes(router, [
[ '/oss-cdn/:name', '/oss-cdn/:name' ],
], async (ctx) => {
let name = ctx.params.name;

if (!OSS_CDN_PROJECT_NAMES.includes(name)) {
ctx.status = 404;
ctx.body = await ctx.render(`pages/_404.html`);
return;
}

let data = {
name: ctx.params.name,
name,
};

try {
Expand Down
Loading