Giter VIP home page Giter VIP logo

celqaz / blog-template Goto Github PK

View Code? Open in Web Editor NEW

This project forked from danielcgilibert/blog-template

0.0 0.0 0.0 34.45 MB

๐Ÿ“š Openblog is an elegant, simple, and user-friendly blog. Focused on accessibility, SEO and performance.

Home Page: https://blog-template-gray.vercel.app

License: GNU General Public License v3.0

Shell 0.11% JavaScript 2.45% TypeScript 7.11% CSS 1.10% Astro 52.90% MDX 36.33%

blog-template's Introduction

Screenshot

โญ Leave a star if you like this project! โญ๏ธ

Deploy with Vercel Deploy to Netlify

๐Ÿ“Œ Table Of Contents

  1. Demo
  2. CMS
  3. Features
  4. Roadmap
  5. Stack
  6. Running locally
  7. Configure
  8. Categories
  9. Posts
  10. Draft
  11. FrontMatter
  12. CLI
  13. Contributors

๐Ÿ’ป Demo

Check out the Demo, hosted on Vercel

demo.mp4

๐Ÿฆ™ Tina CMS

By default, this template comes pre-configured with Tina CMS.

Now you can create your posts directly from the CMS without the need to do it manually.

If you decide to use Tina, it's not necessary to add any properties to the Markdown files, Tina does it automatically.

Example:

tina.mp4

The documentation for Tina CMS can be found here

Tina is completely optional, and you can remove it, and it will still function in the same way.

๐Ÿ’ช Features:

openblog Lighthouse Score

  • โœ… Minimal styling
  • โœ… Mobile responsive
  • โœ… 100/100 Lighthouse performance
  • โœ… SEO-friendly with canonical URLs and OpenGraph data
  • โœ… Sitemap support
  • โœ… RSS Feed support
  • โœ… Markdown & MDX support
  • โœ… Syntax highlighting
  • โœ… Image optimization
  • โœ… Table of contents
  • โœ… Dark mode
  • โœ… Reading Time
  • โœ… Pagefind static search library integration
  • โœ… Related posts
  • โœ… Share posts (Linkedin, twitter)
  • โœ… Draft mode
  • โœ… Copy code block
  • โœ… CMS in the repository (Tina CMS)
  • โœ… Pagination
  • โœ… ViewTransition (new)

๐Ÿ›ฃ๏ธ Roadmap

  • โŒ Add post author
  • โŒ Add customization with colors
  • โŒ Add filters for reading time, date...
  • โŒ More sharing options
  • โŒ Internationalization (i18n)

โš™๏ธ Stack

๐Ÿ‘จ๐Ÿปโ€๐Ÿ’ป Running Locally

Recommended extensions for VSCode:

  1. Clone or fork the repository:
[email protected]:danielcgilibert/blog-template.git
  1. Install dependencies:
pnpm install
  1. Run the development server:
pnpm dev

๐Ÿ“ Configure

  • Edit the configuration file src/data/site.config.ts for the basic blog metadata.
  • Update the astro.config.mjs file at the root of the project with your own domain.
  • Modify the files in the /public folder:
    • favicon
    • robots.txt -> update the Sitemap url to your own domain
    • open-graph -> the open-graph is the image that will be displayed when sharing the blog link. For posts, the preview image is the post cover.
  • Edit the social networks in the Header component - src/components/Header.astro, change the URL to your social network.

๐Ÿ—‚๏ธ Adding a category

To add a new category to your blog, simply go to the src/data/categories.ts file and add it to the array.

Example:

export  const  CATEGORIES  =  [
'JavaScript',
'React',
'new category here'  <---
]  as  const

๐Ÿšจ Zod checks whether the category is not correctly written or does not exist in the properties of the markdown document. It will throw an error when building the application. ๐Ÿšจ

๐Ÿ“„ Adding a post

Adding a post is as simple as adding a .md or .mdx file to the blog folder at the path src/content/blog. The filename will be used to create the slug/URL of the page.

For example, if you have a file named jsx-and-react.md, it will be transformed into: http://yourdomain.com/post/jsx-and-react/

๐Ÿ“ Activating draft mode

To activate draft mode, add the property draft: true to the file, and it will no longer be displayed on the blog.

Example :

title: MacBook Pro 2022
description: 'The new MacBook Pro 2022 is here. With the Apple M2 chip, a new design, and more, the new MacBook Pro is the best laptop Apple has ever made.'
pubDate: 'Jul 02 2022'
heroImage: '../../assets/bg.jpg'
category: 'Category 1'
tags: ['JavaScript', 'css', 'HTML5', 'GitHub']
draft: true <---

โšก๏ธ Frontmatter

Required properties:

  • Title
  • Description
  • pubDate
  • heroImage (post cover)
  • category (Choose a category from src/data/categories.ts)

Optional properties:

  • draft (no need to include it, by default it's false)
  • tags

The schema for posts is located at src/content/config.ts. You can modify any parameter, for example, by adding a maximum of 80 characters for titles: title: z.string().max(80). For more information, refer to the zod documentation.

๐Ÿงž Commands

All commands are run from the root of the project, from a terminal:

Command Action
pnpm install Installs dependencies
pnpm run dev Starts local dev server at localhost:3000
pnpm run build Build your production site to ./dist/
pnpm run preview Preview your build locally, before deploying
pnpm run format:check Check code format with Prettier
pnpm run format Format codes with Prettier
pnpm run sync Generates TypeScript types for all Astro modules. Learn more.
pnpm run lint Lint with ESLint

๐Ÿ‘‹ Contributors

blog-template's People

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.