Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add instructions how to write blog post #223

Closed
wants to merge 7 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/workflows/pr-autocloser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,6 @@ jobs:
run: |
gh pr close "${{ github.event.pull_request.url }}"
--comment "Pull requests to the live branch are not allowed. Use staging branch. Publish via workflow dispatch to Publish to live workflow"
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

123 changes: 123 additions & 0 deletions ADD_BLOG_ENTRY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
# Adding a blog entry

Blog entries can be added by following these steps:

- If submitting for the first time, an [author](#blog-author) YAML file must be added to the `data/blog/authors` directory.
- Add an MD file containing the [blog post's metadata and body](#blog-post-content).
- blog post files are named following a `yyyy-mm-dd-title` convention, e.g., `2024-10-24-blog-title.md`
- each file must be added to the appropriate year's directory, found in `data/blog/`
- use the following command to make sure your submission will be correctly built:

```bash
composer build-blog
```

- When ready, submit the blog post for review via pull request to the default branch.

> You can use the [file examples](#file-examples) as starting point
>
> All submissions must follow the [contributing guidelines](https://github.com/laminas/.github/blob/main/CONTRIBUTING.md) as well as the [Code of Conduct](https://github.com/laminas/.github/blob/main/CODE_OF_CONDUCT.md)

## Blog post content

Each blog post **must** begin with the YAML section found in the [template](#template-of-blog-yaml-section).

The `<!--- EXTENDED -->` tag is used to mark a preview section of the blog post on the listing page, with all following content being hidden.

> **Note** that markdown and yaml files should be linted.

## Blog author

The necessary author YAML file uses the following fields:

- ### `id` **required**

**string** - used internally, file name **must** match the given id.

- ### `email` **required**

**string** - to be displayed in RSS feeds.

- ### `uri` **required**

**string** - to be added to the author's name on the blog post's page.

- ### `name`

**string** - displayed name; if missing, a default value will be shown.

### Template of blog YAML section

```yaml
---
id: 2024-10-22-example-id
author: example-author-id
title: 'Example post title'
draft: true
public: true
created: '2024-10-22T11:00:00-01:00'
updated: '2024-10-22T11:00:00-01:00'
tags:
- example tag
- second example tag
---
```

### Blog entry metadata explained

All the following fields are **required**:

- `id` **string** - must be a unique identifier for the blog

_By convention the date of submission is used as a prefix, using the `yyyy-mm-dd` format._

- `author` **(string)** - the `id` of the author, as set in the corresponding YAML file

- `title` **(string)** - non-empty string used as the title of the post

- `draft` **(boolean)** - the status of the blogpost, defaulting to `false`; if set to `true`, the post is hidden

- `public` **(boolean)** - the visibility of the post, defaulting to `false`; if set to `true`, the post is visible on the listing page and feed

- `created` **(string)** - must be a valid Date and Time format; used by default to sort the posts

- `updated` **(string)** - must be a valid Date and Time format

- `tags` **(array of strings)** - used to filter blog posts by tag

### File examples

#### author.yml

```yaml
id: author
name: Sample Author
email: [email protected]
uri: 'https://example.com'

```

#### 2024-10-24-blog-post-example.md

```markdown
---
id: 2024-10-24-example-post
author: author
title: 'Example post'
draft: false
public: true
created: '2024-10-24'
updated: '2024-10-24'
tags:
- example tag
---

Section above extended tag, which will be visible in the post list.

<!--- EXTENDED -->

## Sample heading

Section below extended tag will be hidden in the listing, being visible only on the post's own page.

```
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,3 +79,10 @@ container:
```bash
$ docker-compose build php
```

## Adding blog entries

Everyone is welcome to post a blog entry. Once submitted, it will be reviewed by our team and approved to go live or rejected.
If it's rejected, the reason for the rejection will be included, so you can update it and resubmit the post if applicable.

The submission process is described in the [ADD_BLOG_ENTRY](ADD_BLOG_ENTRY.md) file.
54 changes: 22 additions & 32 deletions bootstrap/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
"laminas/laminas-servicemanager": "^3.22.1",
"laminas/laminas-stdlib": "^3.19.0",
"league/commonmark": "^2.5.1",
"mezzio/mezzio": "^3.20.0",
"mezzio/mezzio": "^3.20.1",
"mezzio/mezzio-fastroute": "^3.12.0",
"mezzio/mezzio-helpers": "^5.17.0",
"mezzio/mezzio-platesrenderer": "^2.11.0",
Expand Down
Loading
Loading