www icon indicating copy to clipboard operation
www copied to clipboard

Blog support

Open nighca opened this issue 9 months ago • 7 comments

nighca avatar Mar 06 '25 09:03 nighca

Like Go's official blog system (References: https://go.dev/blog/ and https://github.com/golang/website)

Blog List Page

Path: goplus.org/blog/ Like https://go.dev/blog/

  • Display recent blog posts in reverse chronological order
  • Each list item should include:
    • Title
    • Date
    • Author
    • Summary "More articles" button/link that leads to the complete blog list

Path: goplus.org/blog/all Like https://go.dev/blog/all

  • Display all blog posts in a list format

Blog Post Format

Following Go's blog post structure, each blog post should be written in Markdown with a metadata header:

---
title: "Post Title"
date: YYYY-MM-DD HH:mm
by:
- Author Name
summary: Brief description of the post.
---

Post content...

The Go website sorts blog posts based on the Date field in their metadata, using the YYYY-MM-DD format. While this approach includes a secondary sort by title, it may not always reflect the precise posting order.

https://github.com/golang/website/blob/master/cmd/golangorg/godev.go

Although introducing an ID field could solve this, it would add unnecessary cognitive overhead for post authors. I believe the current time-based sorting offers a significant advantage: it allows authors to write posts in a natural Markdown style (despite requiring metadata), similar to how they would write any other Markdown document. However, I suggest using the YYYY-MM-DD HH:mm format for the date field. This would:

  • Provide more precise sorting while maintaining chronological order
  • Not increase cognitive load for authors (they just need to include the posting time)
  • Preserve the simplicity of the current metadata approach

Blog Detail Page

Path: goplus.org/blog/[md_name] Like https://go.dev/blog/swisstable Renders the corresponding md_name.md file Includes navigation links to previous and next blog posts

Image Handling

Two approaches for handling images in blog posts: 1.Standard Markdown Format (Current GoPlus approach):

![Image description](path/to/image.png)
  1. HTML Format (Go's blog approach):
<div class="image"><div class="centered">
<figure>
<img src="path/to/image.png" alt="Image description"/>
</figure>
</div></div>

Note: For now, maintain the current markdown image syntax without modification. Use default styling for markdown images.

Expect Markdown source structure

in /goplus.org/public/blog/

blog/
├── 6years.md                                    # Blog post without images
├── community-outreach-working-group.md          # Blog post without images
├── fuzz-beta.md                                 # Blog post without images
├── 6years/                                      # Resources for 6years.md
│   ├── growth-chart.png
│   └── community-stats.svg
├── community-outreach-working-group/            # Resources for community post
│   └── team-structure.png
└── fuzz-beta/                                   # Resources for fuzz post
    ├── benchmark.png
    └── workflow.svg

luoliwoshang avatar Mar 08 '25 05:03 luoliwoshang

However, I suggest using the YYYY-MM-DD HH:mm format for the date field

It is better to include timezone info in date.

in /goplus.org/public/blog/

The public/ folder exposes its contents directly. Markdown files (*.md), being closer to code requiring processing, it may be better to place them elsewhere.

Note: For now, maintain the current markdown image syntax without modification. Use default styling for markdown images.

Implementing image embedding with arbitrary relative paths might present challenges in building & deploying. Let's try it first and then determine if extra path restrictions are necessary.

nighca avatar Mar 10 '25 02:03 nighca

However, I suggest using the YYYY-MM-DD HH:mm format for the date field

It is better to include timezone info in date.

using the format YYYY-MM-DD HH:mm±HH:mm for standardizing date and time notation

2024-03-21 14:30:00+08:00

The public/ folder exposes its contents directly. Markdown files (*.md), being closer to code requiring processing, it may be better to place them elsewhere.

maybe in the /goplus.org/blog

luoliwoshang avatar Mar 10 '25 03:03 luoliwoshang

using the format YYYY-MM-DD HH:mm±HH:mm for standardizing date and time notation

2024-03-21 14:30:00+08:00

LGTM

maybe in the /goplus.org/blog

I recommend /goplus.org/articles, because not all content related to "blog" will be placed in this folder.

For example, I thought the React component for page blog-article & blog-article-list will reside under /goplus.org/pages.

nighca avatar Mar 10 '25 03:03 nighca

For example, I thought the React component for page blog-article & blog-article-list will reside under /goplus.org/pages.

LGTM

I recommend /goplus.org/articles, because not all content related to "blog" will be placed in this folder.

if suggestion means placing blog.md files under /goplus/articles/blog, and the articles directory would contain other types of content in their respective subdirectories, like this:

/goplus
└── articles/
    ├── blog/
    │   ├── blog1.md
    │   └── blog2.md
    ├── releases/
    │   ├── v1.0.0.md
    │   └── v1.1.0.md
    ├── tutorials/
    │   ├── getting-started.md
    │   └── advanced-usage.md
    ├── docs/
    │   ├── installation.md
    │   └── configuration.md
    └── news/
        ├── announcement1.md
        └── announcement2.md

And when users visit goplus.org/blog/all, would it only display the content from /goplus.org/articles/blog directory?

luoliwoshang avatar Mar 10 '25 04:03 luoliwoshang

if suggestion means placing blog.md files under /goplus/articles/blog

I intend articles to hold only blog posts (short for blog-articles).

/goplus
└── articles/
    └── *.md

We can introduce subdirectories as needed in the future (while not neccessary now), which then results in:

/goplus
└── articles/
    ├── blog/*.md
    ├── releases/*.md
    └── news/*.md

And when users visit goplus.org/blog/all, would it only display the content from /goplus.org/articles/blog directory?

If sub-directories exist, yes.

nighca avatar Mar 10 '25 04:03 nighca

I intend articles to hold only blog posts (short for blog-articles).

I got it

luoliwoshang avatar Mar 10 '25 04:03 luoliwoshang