npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

netlify-plugin-ghost-markdown

v3.1.0

Published

Generates posts, pages, tag pages and author pages from a Ghost publication as markdown files, using the Ghost Content API.

Downloads

56

Readme

Netlify Ghost Markdown Build Plugin

npm version badge

This plugin generates posts, pages, tag pages and author pages from a Ghost publication as markdown files, using the Ghost Content API. In addition it will copy images from the Ghost publication into a local assets directory. Pages, posts, tag pages, author pages and images will be generated on the onPreBuild event in the Netlify deployment cycle, this is to ensure the files are present before an actual build occurs.

Prerequisites

Before you can use this package you'll need a Netlify project that can consume markdown files and images. This package was built with Jekyll in mind, however in theory it should work with any static site generator :sparkles:. Additionally you'll need the Netlify CLI tool installed and Build Plugins Beta enabled.

Installation

To install, add the following lines to your netlify.toml file:

[[plugins]]
package = "netlify-plugin-ghost-markdown"

   [plugins.inputs]
   ghostURL = "https://YOURGHOST.URL"
   ghostKey = "YOURGHOSTKEY"

Note: The [[plugins]] line is required for each plugin, even if you have other plugins in your netlify.toml file already.

You'll need to get a Ghost Content API URL and key to authenticate with your Ghost publication. Please see the Ghost documentation for more info.

Psst, test credentials can be "borrowed" from here: https://ghost.org/docs/api/v3/javascript/content/#working-example

Configuration

[[plugins]]
package = "netlify-plugin-ghost-markdown"

  [plugins.inputs]
  # Required: Your Ghost domain, must not end in a trailing slash
  ghostURL = "https://YOURGHOST.URL"

  # Required: Content API key from the Integrations screen in Ghost Admin
  ghostKey = "YOURGHOSTKEY"

  # Optional: Directory containing image assets (assets/images by default)
  assetsDir = "./assets/images/"

  # Optional: Directory containing pages (site root by default)
  pagesDir = "./"

  # Optional: Directory containing posts (_posts/ directory by default)
  postsDir = "./_posts/"

  # Optional: Output tag pages (false by default)
  tagPages = false

  # Optional: Output author pages (false by default)
  authorPages = false

  # Optional: Directory containing tags (tag/ directory by default)
  tagsDir = "tag/"

  # Optional: Directory containing authors (author/ directory by default)
  authorsDir = "author/"

  # Optional: Layout value for pages (page by default)
  pageLayout = "page"

  # Optional: Layout value for posts (post by default)
  postsLayout = "post"

  # Optional: Layout value for pages (page by default)
  tagsLayout = "tag"

  # Optional: Layout value for posts (post by default)
  authorsLayout = "author"

  # Optional: Date prefix on post file names (true by default)
  postDatePrefix = true

  # Optional: File path and name for a timestamp caching file (_data/ghostMarkdownCache.json by default)
  cacheFile = "./_data/ghostMarkdownCache.json"

Currently posts follow the Jekyll markdown file name format. Set the postDatePrefix to false to use the post slug as the file name

Development

Testing inside the project is proving difficult at the minute. Currently requesting support on a practical method here

Currently you need clone this project and copy the plugin into an example site, copy the package.json into the root of the project, and then run it like a custom build plugin. You can download the demo site here if you need it as a quick starting point. Don't forget to install the dependencies and run it using Netlify CLI!

License

Released under the MIT license.