@ssgjs/source-devto
TypeScript icon, indicating that this package has built-in type declarations

0.0.9 • Public • Published

@ssgjs/source-devto

pull from dev.to given an api key

// ssg.config.js
require('dotenv-safe').config()
const devToPlugin = require('@ssgjs/source-devto')({ 
  apiKey: process.env.DEV_TO_API_KEY
})

exports.plugins = {
  devToPlugin,
}

// mandatory. called once, should be cheap
exports.createIndex = async (mainIndex = {}) => {
  console.log('getting intial data')
  // can add more data to index here
  console.log('Number of articles:', Object.keys(mainIndex.devToPlugin).length)
  return mainIndex
}

Readme

Keywords

Package Sidebar

Install

npm i @ssgjs/source-devto

Weekly Downloads

10

Version

0.0.9

License

MIT

Unpacked Size

30.3 kB

Total Files

7

Last publish

Collaborators

  • sw-yx