timlrx / tailwind-nextjs-starter-blog

This is a Next.js, Tailwind CSS blogging starter template. Comes out of the box configured with the latest technologies to make technical writing a breeze. Easily configurable and customizable. Perfect as a replacement to existing Jekyll and Hugo individual blogs.
https://tailwind-nextjs-starter-blog.vercel.app/
MIT License
8.45k stars 1.96k forks source link

generator #960

Open abernier opened 1 month ago

abernier commented 1 month ago

depends on: #958

This PR adds a "reusable workflow" that any new {repo} can re-"use" as a generator(think Jekyll), eg:

on:
  push:
    branches: main

jobs:
  build:
    uses: timlrx/tailwind-nextjs-starter-blog/.github/workflows/action.yml@v2

...

The repo can override any file from timlrx/tailwind-nextjs-starter-blog, especially data/blog/ folder.

-> A working example: abernier/myblog

vercel[bot] commented 1 month ago

@abernier is attempting to deploy a commit to the timlrx's projects Team on Vercel.

A member of the Team first needs to authorize it.

timlrx commented 1 month ago

This is too smart 😄

Now I really feel like creating a documentation template that expands on this concept. I think we should automatically disable the newsletter box since it is the only feature in the static site that cannot actually be used.

Another consideration is maintenance - I don't want to break everyone's blog with an update. Having the deployable github pages is a start, but I can't guarantee that the settings and data are always backwards compatible, not to mention certain dependencies with breaking changes. Perhaps we should pin this to a version and let the user manually update it, instead of using main?

abernier commented 1 month ago

Another consideration is maintenance - I don't want to break everyone's blog with an update. Having the deployable github pages is a start, but I can't guarantee that the settings and data are always backwards compatible, not to mention certain dependencies with breaking changes. Perhaps we should pin this to a version and let the user manually update it, instead of using main?

For this, I've set a ref input, that defaults to @v2 so the checkouted timlrx/tailwind-nextjs-starter-blog version is v2 as of now this current @v2 version.

https://github.com/timlrx/tailwind-nextjs-starter-blog/blob/5aeedd58ad43c2ce226afeb40e21b43cfbe02c5b/.github/workflows/action.yml#L4-L22

so:

jobs:
  build:
    uses: timlrx/tailwind-nextjs-starter-blog/.github/workflows/action.yml@v2

is equivalent to:

jobs:
  build:
    uses: timlrx/tailwind-nextjs-starter-blog/.github/workflows/action.yml@v2
    with:
      ref: v2

=> actions/checkout will checkout v2 branch before rsync:

https://github.com/timlrx/tailwind-nextjs-starter-blog/blob/5aeedd58ad43c2ce226afeb40e21b43cfbe02c5b/.github/workflows/action.yml#L19-L22

abernier commented 1 month ago

finally, now that we have gh-page workflow, I'm not so sure it's a good idea compared to a simple fork, that stays "syncable"...

image
timlrx commented 1 month ago

finally, now that we have gh-page workflow, I'm not so sure it's a good idea compared to a simple fork, that stays "syncable"...

I think it's a interesting feature, probably more suited for someone who just wants to use the default config with minimal changes. Though if you are using a next.js blog, you are probably looking to customize it.