Skip to content

Commit

Permalink
Prepare 1.3 release
Browse files Browse the repository at this point in the history
  • Loading branch information
Bellfalasch committed Nov 16, 2016
1 parent fd2b8d7 commit 6d64201
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 32 deletions.
29 changes: 22 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,14 @@ This app will add this functionality to your site:
1. SEO friendly titles
2. SEO meta description
3. Open Graph meta data
4. Google search console tag
5. Robots exclude setting
4. Twitter Cards meta data
5. Google Search Console meta data / tag
6. Canonical meta data
7. Robots exclude setting

## Building and deploying

There are two options. One is to simply download the app [JAR file](http://repo.enonic.com/public/com/enonic/app/metafields/1.2.0/metafields-1.2.0.jar) and move it to the XP installation's `$XP_HOME/deploy` folder.
There are two options. One is to simply download the app [JAR file](http://repo.enonic.com/public/com/enonic/app/metafields/1.3.0/metafields-1.3.0.jar) and move it to the XP installation's `$XP_HOME/deploy` folder.

Or you can build this app with Gradle. First, download the zip file of this repo. Unpack it locally. In the terminal, from the root of the project, type `./gradlew build`. On Windows, just type `gradlew build`. Next, move the JAR file from `build/libs` to your `$XP_HOME/deploy` directory. The SEO Meta Fields app will now be available to add to your websites through the Content Manager admin tool in Enonic XP.

Expand All @@ -30,6 +32,7 @@ This app introduces a few settings. They're controlled on the app itself on your
2. Search engine settings
3. Title behavior
4. Custom JSON paths
5. Other

### Default settings

Expand All @@ -56,6 +59,12 @@ Add field names as comma separated strings, like `field1, field2, long-fieldname

We only evaluate for matches in the JSON `data`-node for each content.

### Other

Turn generation of canonical meta field on or off. Default is off, since most sites ship whit this already. Otherwise it will generate the meta tag with current URL. The logic is simple, it will use the current contents path as value.

For Twitter Cards to work we need a Twitter user name (starting with `@`). When that is in place we can generate meta data for improved Twitter sharing.

## Waterfall logic for meta fields

We will always add the meta fields for title and description, and most of the meta fields for Open Graph. However, if we cannot find any image to use, we won't add the meta fields for Open Graph image.
Expand Down Expand Up @@ -91,19 +100,25 @@ For titles there is no way it can be empty, at least the last fallback will alwa

## Releases and Compatibility

| Version | XP version |
| Version | XP version |
| ------------- | ------------- |
| 1.2.0 | 6.7.3 |
| 1.1.4 | 6.7.3 |
| 1.3.0 | 6.7.0 |
| 1.2.0 | 6.7.0 |
| 1.1.4 | 6.7.0 |
| 1.1.3 | 6.4.0 |
| 1.1.2 | 6.4.0 |
| 1.1.1 | 6.4.0 |
| 1.1.0 | 6.4.0 |
| 1.0.0 | 6.3.1 |
| 1.0.0 | 6.3.0 |
| 0.5.0 | 6.3.0 |

## Changelog

### Version 1.3.0

* Added Twitter Card meta data generation.
* Added canonical meta data generation.

### Version 1.2.0

* Fixed bug where user-defined paths for meta description always failed.
Expand Down
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
# Project settings
#
group = com.enonic.app
version = 1.2.0
version = 1.3.0
projectName = metafields
appName = com.enonic.app.metafields
displayName = SEO Meta Fields
xpVersion = 6.7.3
xpVersion = 6.7.0
40 changes: 18 additions & 22 deletions src/main/resources/site/filters/add-metadata.html
Original file line number Diff line number Diff line change
@@ -1,24 +1,20 @@
<div data-th-remove="tag">
<div data-th-if="${twitterUserName}" data-th-remove="tag">
<meta name="twitter:card" content="summary_large_image" />
<meta name="twitter:title" data-th-attr="content=${title}" />
<meta name="twitter:description" data-th-attr="content=${description}"/>
<meta name="twitter:image:src" data-th-if="${image}" data-th-attr="content=${image}"/>
<meta name="twitter:site" data-th-attr="content=${twitterUserName}"/>
</div>

<meta data-th-if="${blockRobots}" name="robots" content="noindex,nofollow" />
<meta data-th-if="${siteVerification}" name="google-site-verification" content="" data-th-attr="content=${siteVerification}" />
<meta name="description" data-th-attr="content=${description}" />
<meta property="og:title" data-th-attr="content=${title}" />
<meta property="og:description" data-th-attr="content=${description}" />
<meta property="og:site_name" data-th-attr="content=${siteName}" />
<meta property="og:url" data-th-attr="content=${url}" />
<meta property="og:type" data-th-attr="content=${type}" />
<meta property="og:locale" data-th-attr="content=${locale}" />
<meta property="og:image" data-th-if="${image}" data-th-attr="content=${image}" />
<meta property="og:image:width" data-th-if="${image}" data-th-attr="content=${imageWidth}" />
<meta property="og:image:height" data-th-if="${image}" data-th-attr="content=${imageHeight}" />

<link data-th-if="${canonical}" data-th-attr="rel=canonical"data-th-href="${url}"/>
<meta data-th-if="${blockRobots}" name="robots" content="noindex,nofollow" />
<link data-th-if="${canonical}" data-th-attr="rel=canonical"data-th-href="${url}"/>
<meta data-th-if="${siteVerification}" name="google-site-verification" content="" data-th-attr="content=${siteVerification}" />
<meta name="description" data-th-attr="content=${description}" />
<meta property="og:title" data-th-attr="content=${title}" />
<meta property="og:description" data-th-attr="content=${description}" />
<meta property="og:site_name" data-th-attr="content=${siteName}" />
<meta property="og:url" data-th-attr="content=${url}" />
<meta property="og:type" data-th-attr="content=${type}" />
<meta property="og:locale" data-th-attr="content=${locale}" /><div data-th-if="${image}" data-th-remove="tag">
<meta property="og:image" data-th-attr="content=${image}" />
<meta property="og:image:width" data-th-attr="content=${imageWidth}" />
<meta property="og:image:height" data-th-attr="content=${imageHeight}" /></div><div data-th-if="${twitterUserName}" data-th-remove="tag">
<meta name="twitter:card" content="summary_large_image" />
<meta name="twitter:title" data-th-attr="content=${title}" />
<meta name="twitter:description" data-th-attr="content=${description}"/>
<meta name="twitter:image:src" data-th-if="${image}" data-th-attr="content=${image}"/>
<meta name="twitter:site" data-th-attr="content=${twitterUserName}"/></div>
</div>
2 changes: 1 addition & 1 deletion src/main/resources/site/site.xml
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
<occurrences minimum="0" maximum="1"/>
</input>
<input name="canonical" type="CheckBox">
<label>Canonical</label>
<label>Generate Canonical meta?</label>
<occurrences minimum="0" maximum="1"/>
</input>
</items>
Expand Down

0 comments on commit 6d64201

Please sign in to comment.