Create content rich websites with ease - built on next.js, contentlayer and tailwindcss

Overview

Pliny

Note: Pliny is currently in alpha. Expect breaking changes.

Pliny makes creating, editing and publishing markdown content easy and simple. It is based on Next.js, Tailwind CSS and Contentlayer.

Installation

npm i -g @pliny/cli

Usage

Here are some examples of common commands:

Create a new starter blog project called "my-blog"

pliny new --template=starter-blog my-blog

Add a recipe

Currently, there are 2 main types of recipes - scaffolding a content type e.g. the pages associated with a blog or adding templates to the layouts folder. As a convention, recipes to scaffold are in the form of add-[content type] while layouts are in the form of [content type]-[theme].

Adding a blog page to an existing Next.js application (assumes you have contentlayer setup, as it will automatically add defineDocumentType)

pliny install add-blog ContentDir=data ContentName=Blog

Add the blog-classic templates to the layouts folder:

pliny install blog-classic

Features

Content Modeling with Contentlayer

  • Live reload on content changes
  • Fast and incremental builds
  • Simple but powerful schema DSL to design your content model (validates your content and generates types)
  • Auto-generated TypeScript types based on your content model (e.g. frontmatter or CMS schema)

Templates

  • Based on Next.js and Tailwindcss
  • Highly configurable config, easily extendable nextjs website
  • Mobile friendly
  • Supports light and dark theme
  • Layouts to customize templates
  • Blog theme is completed, docs is in the works

Full suite of markdown plugins

Modular React components for services

  • Newsletter (Buttondown, Convertkit, Email Octopus, Klaviyo, Mailchimp, Revue)
  • Analytics (Google Analytics, Plausible Analytics, Simple Analytics, Umami Analytics)
  • Comments (Disqus, Giscus, Utterances)
Comments
  • Search

    Search

    https://github.com/timlrx/pliny/issues/26

    Search Component

    • Supports Algolia and Kbar (local)
    • Search component is implemented using react context and is meant to wrap the entire application at the root level
    • Modal based search which can be open with control k
    • Users can also toggle open or close the component by using the query.toggle() method from useContext
    • Algolia search is modified from the docusaurus integration and lazy loads the modal
    • Kbar is modified from contentlayer docs implementation but instead of using the default table display which has compatibility issues with Preact (https://github.com/timc1/kbar/issues/208), we use a simple list to display the results.
    • Instead of using loading all the content to search together with the component, we create the search index at build time using a post build script and load the content to be search after the main page loads to avoid delaying FCP.
    • Sample config for kbar
        provider: 'kbar',
        kbarConfig: {
           searchDocumentsPath: 'search.json', // path to load documents to search
        },
    
    • Config for algolia
    provider: 'algolia',
    algoliaConfig: {
          // The application ID provided by Algolia
          appId: 'R2IYF7ETH7',
          // Public API key: it is safe to commit it
          apiKey: '599cec31baffa4868cae4e79f180729b',
          indexName: 'docsearch',
        },
    
    opened by timlrx 2
  • Change newsletter subscription button label

    Change newsletter subscription button label

    Since this is a newsletter subscription and not a website registration form, the label has been modified from "Sign up" to "Subscribe"

    opened by n-i-m-a 1
  • pliny install on mac with any command segfaults

    pliny install on mac with any command segfaults

    When running pliny install on mac results in segfault e.g.

    zsh: segmentation fault  pliny install add-classic
    

    There is no additional output

    To Reproduce Steps to reproduce the behavior:

    1. Install pliny as per instructions: npm i -g @pliny/cli(pliny --version outputs '0.0.5')
    2. Try to use pliny install e.g. pliny install add-blog ContentDir=content ContentName=Blog
    3. See error: zsh: segmentation fault pliny install add-blog ContentDir=content ContentName=Blog

    Note that pliny install works and puts up a prompt. if you select any option from list it seg faults.

    Expected behavior

    Command to work and add the template.

    Screenshots If applicable, add screenshots to help explain your problem.

    System Info (if dev / build issue):

    Output of version command

    @pliny/cli/0.0.5 darwin-x64 node-v16.5.0

    bug 
    opened by rufuspollock 1
  • Update/next 12.3

    Update/next 12.3

    • use esm export for main pliny package, prefer named exports and re-organize structure
    • lazy import kbar search only when ctrl-k is pressed
    • update dependencies (except vitest since we use process.chdir() and in the new version --no-thread does not work. see https://github.com/vitest-dev/vitest/issues/1436)
    • fixed preact setup for starter blog

    Note: test fails because react in node_modules is getting replaced by preact, as specified in the starter-blog package.json. Would need to find a way to separate both.

    opened by timlrx 1
  • Compiled MJS files can't import `next/script`, `next/dynamic`, etc.

    Compiled MJS files can't import `next/script`, `next/dynamic`, etc.

    Describe the bug Some of the compiled MJS files in the pliny package fail to import because they use try to use node-style module resolution while node requires explicit module resolution for ESM.

    The error looks like:

    Error [ERR_MODULE_NOT_FOUND]: Cannot find module '<path-to-project>\node_modules\next\script' imported from <path-to-project>\node_modules\pliny\dist\chunk-J2TU2LAM.mjs
    Did you mean to import next/script.js?
        at new NodeError (node:internal/errors:371:5)
        at finalizeResolution (node:internal/modules/esm/resolve:391:11)
        at moduleResolve (node:internal/modules/esm/resolve:893:10)
        at Loader.defaultResolve [as _resolve] (node:internal/modules/esm/resolve:1004:11)
        at Loader.resolve (node:internal/modules/esm/loader:89:40)
        at Loader.getModuleJob (node:internal/modules/esm/loader:242:28)
        at ModuleWrap.<anonymous> (node:internal/modules/esm/module_job:76:40)
        at link (node:internal/modules/esm/module_job:75:36) {
      code: 'ERR_MODULE_NOT_FOUND',
      page: '/'
    }
    

    To Reproduce Steps to reproduce the behavior:

    1. Create a new blog (e.g. pliny new --template=starter-blog my-blog)
    2. Run npm run dev
    3. Navigate to localhost:3000

    Expected behavior Loads the page

    System Info (if dev / build issue):

    • OS: Windows 10
    • Node version: 16.9.0
    • Npm version: 8.1.4
    bug 
    opened by TheUnlocked 1
  • Contentlayer codemod

    Contentlayer codemod

    Enhancement for #30

    • Add contentlayer config to paths
    • Add utility function to detect contentlayer parts in installer
    • Add contentlayer document type transform helper codemod
    • Pass cli args to transformers
    • Add contentlayer transform codemod to add-blog recipe
    • Sync starter blog with v1.5.6 in secondary repo
    opened by timlrx 1
  • When deploying to Vercel, I get this error of no declared member

    When deploying to Vercel, I get this error of no declared member

    Declared function

    In this screenshot I declared the function and when I try to deploy it to Vercel I get this error message.

    Vercel Error Message

    Any help would be greatly appreciated, fairly new to programming so not sure what or how to fix this issue.

    bug 
    opened by OhYello 0
  • fix: sitemap regex

    fix: sitemap regex

    The current regex removes any mention of .js|.tsx|.mdx|.md in the file name and changes the slug when generating a sitemap.

    Example: /blog/my-new-nextjs-reactjs-portfolio.mdx becomes /blog/my-new-nex-reac-portfolio

    opened by Music47ell 1
  • Giscus not loading due to Content Security Policy

    Giscus not loading due to Content Security Policy

    Hi,

    I'm trying to get Giscus working in my blog https://flow-wizard.xyz but I'm struggling with the giscus implementation. It is said in the readme that the content security policy needs to be changed. But it doesn't say how it should be changed. I've added the giscus env variables in .env but when I render the page and click on Load Comments, it outputs this in the console:

    Refused to frame 'https://giscus.app/' because an ancestor violates the following Content Security Policy directive: "frame-ancestors 'self'".
    Failed to load resource: the server responded with a status of 404 ()
    

    I've tried adding frame-src 'self' giscus.app https://giscus.app; inside next.config.js but the same error stays

    When I render the giscus script that was given to me by giscus.app (<Script ... />) inside the layout file it actually loads, but only on a refresh.

    bug 
    opened by flov 1
  • Migrate to next 13 app directory with react server components

    Migrate to next 13 app directory with react server components

    opened by timlrx 0
  • dependency resolution error with next v13 and contentlayer

    dependency resolution error with next v13 and contentlayer

    To Reproduce Bootstrapping a new package with npm or running npm install in the repo will throw the following error:

    npm ERR! code ERESOLVE
    npm ERR! ERESOLVE could not resolve
    npm ERR! 
    npm ERR! While resolving: [email protected]
    npm ERR! Found: [email protected]
    npm ERR! node_modules/next
    npm ERR!   next@"13.0.2" from the root project
    npm ERR!   peer next@"*" from [email protected]
    npm ERR!   node_modules/next-themes
    npm ERR!     next-themes@"^0.2.0" from the root project
    npm ERR!     next-themes@"^0.2.0" from [email protected]
    npm ERR!     node_modules/pliny
    npm ERR!       pliny@"0.0.9" from the root project
    npm ERR!   1 more (pliny)
    npm ERR! 
    npm ERR! Could not resolve dependency:
    npm ERR! peer next@"^12" from [email protected]
    npm ERR! node_modules/next-contentlayer
    npm ERR!   next-contentlayer@"0.2.8" from the root project
    npm ERR!   next-contentlayer@"0.2.8" from [email protected]
    npm ERR!   node_modules/pliny
    npm ERR!     pliny@"0.0.9" from the root project
    npm ERR! 
    npm ERR! Conflicting peer dependency: [email protected]
    npm ERR! node_modules/next
    npm ERR!   peer next@"^12" from [email protected]
    npm ERR!   node_modules/next-contentlayer
    npm ERR!     next-contentlayer@"0.2.8" from the root project
    npm ERR!     next-contentlayer@"0.2.8" from [email protected]
    npm ERR!     node_modules/pliny
    npm ERR!       pliny@"0.0.9" from the root project
    

    Workaround Manually install with npm install --legacy-peer-deps or use yarn in the meantime until next-contentlayer updates its dependency

    bug 
    opened by timlrx 2
Owner
Timothy
Timothy
A web component that allows you to run high level programming languages on your websites (static websites included!)

Code-Runner-Web-Component A web component that allows you to run high level programming languages on your website via the public Piston API Show your

Marketing Pipeline 28 Dec 16, 2022
A meditating website to clear your mind. Built with Next.JS and TailwindCSS ♥

Meditate A modern meditation web app for you to meditate on your own terms. Track your progress and share your thoughts with others. Table of Contents

Andy 5 Jul 27, 2022
An alternative YouTube frontend built with Next.js, TailwindCSS, and TypeScript.

Invideo Invideo is an alternative YouTube frontend. Tools & Tech It's built with Next.js, TypeScript, and TailwindCSS. Where does Invideo get the data

Ayaan Zaveri 9 Sep 22, 2022
Kittos is NFT Marketplace built with Next Js, Hardhat, Solidity, Arweave + Bundlr Client and All The CSS Magic with TailwindCSS. 😺

Kittos NFT Marketplace ?? Built with Next Js, Hardhat, Solidity, Arweave, Bundlr and Tailwind CSS. Functionalities New Listed Assets Mint NFT Buy NFT

Aakrut 7 Dec 24, 2022
Stablo is a minimal blog website template built with Next.js, TailwindCSS & Sanity CMS

Stablo Blog Template - Next.js & Sanity CMS Stablo is a JAMStack Starter template built with Next.js, Tailwind CSS & Sanity CMS by Web3Templates. Clic

Web3Templates 159 Dec 30, 2022
simple-remix-blog is a blog template built using Remix and TailwindCSS. Create your own blog in just a few minutes!

simple-remix-blog is a blog template built using remix.run and TailwindCSS. It supports markdown and MDX for the blog posts. You can clone it and star

José Miguel Álvarez Vañó 8 Dec 8, 2022
🎬 Movie, TV Series and Actor website made with TMDb, Next.js and TailwindCSS.

Movie App Demo Getting Started ?? Development Server npm install --s --f && npm run dev # or yarn install && yarn dev ?? Production Server npm install

uh! 10 Dec 27, 2022
Medium-Clone with Next.JS, Typescript, Tailwindcss, and Sanity!!

Medium Clone ?? Overview /pages ✔️ pages/index.tsx = Homepage and list all Blogs ✔️ pages/post/[slug].tsx = Details Blog /pages/api ✔️ pages/api/creat

argikurnia 23 Nov 16, 2022
Next.js starter with TypeScript, Supabase and TailwindCSS

This project is a Next.js starter with: TypeScript Supabase TailwindCSS It is basically what is presented in the Supabase + Next.js quickstart, just w

Sébastien Castiel 32 Dec 24, 2022
A Tauri + Next.js (SSG) template, with TailwindCSS, opinionated linting, and GitHub Actions preconfigured

Tauri + Next.js Template This is a Tauri project template using Next.js, bootstrapped by combining create-next-app and create tauri-app. This template

Kevin Xiao 58 Dec 30, 2022
Twitter-Clone (For Learning Purpose) made with Next.js,Firebase,TailwindCss

Project Name : Twitter-Clone This is a clone of Twitter . This build is for learning purpose only. Technology Used To Build This How it look's Some im

Ankit Singh 8 Oct 4, 2022
Medium.com (Redesign with Next.js & Tailwindcss)

Medium.com (Redesign with Next.js & Tailwindcss) It is a redesign of the popular blogging website Medium.com. It is designed with React and Tailwindcs

Kazem Mirzaei 4 Jun 11, 2022
Decentralized twitter using Solidity, Ethereum, hardhat, ethers, IPFS, Next.JS, TypeScript, TailwindCSS.

DWITTER: Decentralized Twitter Check out the deployed version of this app at https://dwtr.wajeshubham.in Transactions on Ethereum are slow. Therefore,

Shubham Waje 12 Sep 2, 2022
Frontend of thisisbac blog. Technical stack: Next.js, ReduxToolkit, TailwindCss,...

Introduction ThisisBac frontend services are responsible for all interface actions related to ThisisBac Blog with technical stack Next.js, Redux Toolk

Dinh-Bac Nguyen 3 May 15, 2022
Frontend of ecert. Technical stack: Next.js, ReduxToolkit, TailwindCss,...

Introduction ThisisBac frontend services are responsible for all interface actions related to ThisisBac Blog with technical stack Next.js, Redux Toolk

Dinh-Bac Nguyen 3 May 15, 2022
This is a clone of Instagram built with NextJS, TailwindCSS, NextAuthJS and Firebase

Instagram This is a clone of instagram built with: This application is completely functional and responsive. Users can Sign in straightaway with Googl

Nutifafa Afi Attor 13 Sep 2, 2022
🔥 Bon5R — Create static, blog-aware websites with pure MDX.

Bon5R Create static, blog-aware websites with pure MDX. Explore the docs » View Demo · Report Bug · Request Feature Table of Contents About The Projec

Manu Anish 3 Jul 5, 2022
To Do List Application Organize your tasks with simple add and delete functionality. Organize your items with ease.

TODO-LIST To Do List Application Organize your tasks with simple add and delete functionality. Organize your items with ease. Additional description a

Steve 12 Jul 22, 2022