Skip to content

Gradle Plugin for Publishing (Generated) HTML files to Wordpress Post Types

License

Notifications You must be signed in to change notification settings

neo4j-contrib/wordpress-publish-gradle-plugin

Repository files navigation

WordPress Publish Plugin for Gradle

Build status Gradle Plugin

A plugin to publish posts or pages to WordPress from an HTML file and a YAML file that contains metadata.

Usage

import com.neo4j.gradle.wordpress.WordPressUploadTask

plugins {
  id('com.neo4j.gradle.wordpress.WordPressPlugin')
}

wordpress {
  username = 'username'
  password = 'password'
  host = 'localhost'
  scheme = 'http'
}

task wordPressUpload(type: WordPressUploadTask) {
  source = "html"
  type = "post"
  status = "private"
}

The above configuration will publish all .html files from the html directory to WordPress.

Metadata

The plugin relies on a YAML metadata file to publish the HTML content. This file must at least contain a slug and a title:

intro-neo4j-about.yml
---
slug: 00-intro-neo4j-about
title: Introduction to Neo4j 4.0

You must provide one YAML file per HTML page using the same name. So if you have an intro-neo4j-about.html file, you must provide the metadata in a file named intro-neo4j-about.yml.

Here’s a complete example:

---
slug: 00-intro-neo4j-about
title: Introduction to Neo4j 4.0
author:
  name: Michael Hunger
  first_name: Michael
  last_name: Hunger
  email: info@neotechnology.com
taxonomies:
- key: os
  values:
  - linux
- key: programming_language
  values:
  - java
- key: neo4j_version
  values:
  - 3-5
  - 3-6
tags:
  - introduction
categories:
  - training

Publish a new version

The release process is automated and relies on GitHub Actions. We are using the 🤖 neo4j-oss-build account to publish on https://plugins.gradle.org.

The GRADLE_PUBLISH_KEY and GRADLE_PUBLISH_SECRET secrets are configured on GitHub. See the .github/workflows/release.yml file for details.

The release will be performed when a tag is pushed, the procedure is:

  1. Update the version in the build.gradle.kts file and commit

  2. Tag and push to master (don’t forget the v prefix and replace x.y.z with an actual version):

    $ git tag vx.y.z && git push origin master --tags

About

Gradle Plugin for Publishing (Generated) HTML files to Wordpress Post Types

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages