Skip to content

Latest commit

 

History

History
181 lines (131 loc) · 4.82 KB

README.adoc

File metadata and controls

181 lines (131 loc) · 4.82 KB

Twin4j Newsletter

Directory structure

Newsletters are inside the docs directory with one folder per newsletter using yyyy-MM-dd format. For instance, the Twin4j Newsletter of May 22th, 2021 is located inside 2021-05-22.

A newsletter contains:

images/

A directory that contains all the images used in the blog post. NOTE: The file name will be used as a slug, make sure to use a descriptive name.

blog-post.adoc

A blog post (AsciiDoc file). Must contain:

  • Document title

  • Attributes:

    • slug: unique slug

    • author: author name used on WordPress

    • categories: list of slugs

    • tags: list of slugs

      Example:

      = This Week in Neo4j – Graph Embeddings, Reddit, jQAssistant, Helidon, Corporate Data, Query Tuning
      :slug: this-week-in-neo4j-graph-embeddings-reddit-jqassistant-helidon-corporate-data-query-tuning
      :author: Elaine Rosenberg
      :categories: graph database
      // twin4j is added automatically
      :tags: application architecture, corporate knowledge, cypher, data modeling, fraud analysis
      
      // content
community-member.json

Information about the featured community member (JSON file). Must contain:

  • name: complete name (first name and last name) of the featured community member

  • title: job title of the featured community member

  • image: file name of a profile picture of the featured community member

    Example:

    {
      "name": "Chris Hay",
      "title": "Distinguised Enginer and Architect at IBM iX",
      "image": "chris-hay.jpeg" // (1)
    }
    1. Image must be located inside the images directory.

      Tip
      Featured community member images are usually taken from LinkedIn. On a LinkedIn profile, you can left-clik on the profile picture, it should open a popup with an high-resolution image, then right-click and "Save image as". Save the image in the images directory using a slug (for instance, chris-hay.jpeg).

Usage

First, make sure that you have Node >= 14 LTS installed on your machine. Then, install the dependencies using npm:

$ npm i

Once this is done, you can run tasks using npm.

Tip
You can run npm run to output the list of tasks available.

Tasks

Generate

$ npm run generate <issue-date>

For instance, if you want to generate the Twin4j newsletter of May 22th, 2021:

$ npm run generate 2021-05-22
Tip
Check that everything looks correct by reviewing files generated in the build/<issue-date> directory.

Publish

In order to publish images and blog posts to WordPress, you need to define the following environment variables:

  • WORDPRESS_USERNAME

  • WORDPRESS_PASSWORD

For convenience, you can make a copy of the .env-example file as .env then change the values there. The .env file is excluded from the repository, so you can safely keep your secrets there.

Important
You first need to generate an issue using npm run generate <issue-date> before publishing.

Publish tasks will create or update existing images or blog posts based on the slug. Therefore, you should not update slugs once the content has been published. you can run upload tasks multiple times if you

Publish images to WordPress
$ npm run publish-images <issue-date>
Publish blog post to WordPress
$ npm run publish-blog-post <issue-date>
Note
Please note that the blog post will be scheduled (using the status future) and will be automatically published by WordPress at 00:01 PST (i.e., 08:00 UTC) on Saturday (i.e., the issue date)

Debug

You can use the DEBUG environment variable to enable traces based on space or comma-delimited names.
Here are some examples:

$ DEBUG=generate npm run generate 2021-05-15

> [email protected] generate /home/guillaume/workspace/neo4j/twin4j
> node tasks/generate.js "2021-05-15"

Generating Twin4j newsletter 2021-05-15...
  generate Blog post generated: build/2021-05-15/this-week-in-neo4j-graph-embeddings-reddit-jqassistant-helidon-corporate-data-query-tuning.html +0ms
  generate Featured community member image generated: build/2021-05-15/images/this-week-in-neo4j-15-May-2021.jpeg +295ms
  generate Images copied to: build/2021-05-15/images +3ms

This project is using the following names:

  • images

  • generate

  • wordpress

  • blog-post

Tip
You can use the value * if you want to enable all traces.

Scheduling

Day Hour Description

Saturday

00:00 PST

Blog post published on WordPress

Saturday

00:00 PST

Community member tweet

Saturday

05:00 PST

Features 1 tweet

Saturday

14:00 PST

Features 2 tweet

Saturday

21:00 PST

Features 3 tweet

Sunday

09:00 PST

Features 4 tweet

Sunday

16:00 PST

Features 5 tweet

Sunday

23:00 PST

Features 6 tweet

Monday

02:00 PST

Features 7 tweet (if there’s a section 7)

Tuesday

12:00 PST

Summary of the entire issue tweet