Skip to content

Commit

Permalink
Merge branch 'release/4.0.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
janhenckens committed Jan 20, 2024
2 parents 204d551 + d4095c7 commit fe0adf3
Show file tree
Hide file tree
Showing 49 changed files with 1,826 additions and 734 deletions.
69 changes: 69 additions & 0 deletions .github/workflows/sonarcloud.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.

# This workflow helps you trigger a SonarCloud analysis of your code and populates
# GitHub Code Scanning alerts with the vulnerabilities found.
# Free for open source project.

# 1. Login to SonarCloud.io using your GitHub account

# 2. Import your project on SonarCloud
# * Add your GitHub organization first, then add your repository as a new project.
# * Please note that many languages are eligible for automatic analysis,
# which means that the analysis will start automatically without the need to set up GitHub Actions.
# * This behavior can be changed in Administration > Analysis Method.
#
# 3. Follow the SonarCloud in-product tutorial
# * a. Copy/paste the Project Key and the Organization Key into the args parameter below
# (You'll find this information in SonarCloud. Click on "Information" at the bottom left)
#
# * b. Generate a new token and add it to your Github repository's secrets using the name SONAR_TOKEN
# (On SonarCloud, click on your avatar on top-right > My account > Security
# or go directly to https://sonarcloud.io/account/security/)

# Feel free to take a look at our documentation (https://docs.sonarcloud.io/getting-started/github/)
# or reach out to our community forum if you need some help (https://community.sonarsource.com/c/help/sc/9)

name: SonarCloud analysis

on:
push:
branches: [ "develop" ]
pull_request:
branches: [ "develop" ]
workflow_dispatch:

permissions:
pull-requests: read # allows SonarCloud to decorate PRs with analysis results

jobs:
Analysis:
runs-on: ubuntu-latest

steps:
- name: Analyze with SonarCloud

# You can pin the exact commit or the version.
# uses: SonarSource/sonarcloud-github-action@de2e56b42aa84d0b1c5b622644ac17e505c9a049
uses: SonarSource/sonarcloud-github-action@de2e56b42aa84d0b1c5b622644ac17e505c9a049
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} # Generate a token on Sonarcloud.io, add it to the secrets of this repo with the name SONAR_TOKEN (Settings > Secrets > Actions > add new repository secret)
with:
# Additional arguments for the sonarcloud scanner
args:
# Unique keys of your project and organization. You can find them in SonarCloud > Information (bottom-left menu)
# mandatory
-Dsonar.projectKey=studioespresso_craft-seo-fields
-Dsonar.organization=studioespresso
-Dsonar.php.file.suffixes=php
# Comma-separated paths to directories containing main source files.
#-Dsonar.sources= # optional, default is project base directory
# When you need the analysis to take place in a directory other than the one from which it was launched
#-Dsonar.projectBaseDir= # optional, default is .
# Comma-separated paths to directories containing test source files.
#-Dsonar.tests= # optional. For more info about Code Coverage, please refer to https://docs.sonarcloud.io/enriching/test-coverage/overview/
# Adds more detail to both client and server-side analysis logs, activating DEBUG mode for the scanner, and adding client-side environment variables and system properties to the server-side log of analysis report processing.
#-Dsonar.verbose= # optional, default is false
9 changes: 8 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,19 @@ All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/).

## 4.0.0 - 2024-01-20
### Added
- JSON-LD Schema.org markup
- Automatic redirect creation on URI change

### Fixed
- Fixed overriding meta values in templates ([new docs here](https://studioespresso.github.io/craft-seo-fields/templating.html#overwriting-field-values))

## 3.3.8.1 - 2023-11-24
### Fixed
- Fixed a twig syntax error ([#88](https://github.com/studioespresso/craft-seo-fields/pull/88))



## 3.3.8 - 2023-11-23
### Fixed
- Redirects and 404's now works for users that only have access to 1 site. ([#87](https://github.com/studioespresso/craft-seo-fields/issues/87))
Expand Down
5 changes: 3 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "studioespresso/craft-seo-fields",
"description": "Fields for your SEO & OG meta data",
"type": "craft-plugin",
"version": "3.3.8.1",
"version": "4.0.0",
"keywords": [
"craft",
"cms",
Expand All @@ -27,7 +27,8 @@
],
"require": {
"craftcms/cms": "^4.0.0-RC1",
"league/csv": "^9.0"
"league/csv": "^9.0",
"spatie/schema-org": "^3.0.0"
},
"require-dev": {
"codeception/codeception": "^4.0.0",
Expand Down
52 changes: 37 additions & 15 deletions docs/.vitepress/config.ts
Original file line number Diff line number Diff line change
@@ -1,22 +1,43 @@
module.exports = {
title: 'SEO Fields for Craft',
title: 'SEO Fields',
description: "SEO Fields for Craft CMS",
base: '/craft-seo-fields',
head: [
['meta', {content: 'https://github.com/studioespresso', property: 'og:see_also',}],
[
'script',
{
defer: '',
'data-domain': 'studioespresso.github.io',
src: 'https://stats.studioespresso.co/js/script.tagged-events.outbound-links.js'
}
],
],
themeConfig: {

logo: {light: '/icon-vuepress.svg', dark: '/icon-vuepress-light.svg'},
logo: '/img/plugin-logo.svg',
sidebar: [
{
items: [
{text: 'General', link: '/general'},
{text: 'Field & settings', link: '/field'},
{text: 'Templating', link: '/templating'},
{text: 'Robots.txt', link: '/robots'},
{text: 'Sitemap.xml', link: '/sitemap'},
{text: 'Extra', link: '/extra'},
]
},

text: 'General',
items:
[
{text: 'Usage', link: '/general'},
{text: 'Field & settings', link: '/field'},
{text: 'Templating', link: '/templating'},
{text: 'Settings', link: '/settings'},

]
},
{
text: 'Features',
items:
[
{text: 'Robots.txt', link: '/robots'},
{text: 'Sitemap.xml', link: '/sitemap'},
{text: 'Redirects', link: '/redirects'},
{text: '404 tracking', link: '/notfound'},
{text: 'Schema.org markup', link: '/schema'},
]
}
],
nav: [
{
Expand All @@ -29,9 +50,10 @@ module.exports = {
},
{
text: 'GitHub',
link: 'https://github.com/studioespresso/craft-seo-fields/issues'
link: 'https://github.com/studioespresso/craft-seo-fields'
}
]

}
};
}
;
34 changes: 34 additions & 0 deletions docs/.vitepress/theme/FooterLogo.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<template>
<div class="studio-footer">
<span>Brought to you by:</span>
<a
href="https://github.com/sponsors/janhenckens"
target="_blank"
rel="noopener"
>
<img
src="/img/logo-studioespresso.svg"
aria-label="Studio Espresso logo"
/>
</a>
</div>
</template>

<script setup>
</script>

<style scoped>
.studio-footer {
padding: 0 1.5rem 2rem;
font-size: 0.8rem;
}
.studio-footer img {
box-sizing: border-box;
max-width: 200px;
height: 80px;
display: block;
margin: 1rem 0;
padding-left: 0.7rem;
}
</style>
30 changes: 26 additions & 4 deletions docs/.vitepress/theme/custom.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,27 @@
/* .vitepress/theme/custom.css */
:root {
--vp-c-brand: #3b68b5;
--vp-c-brand-light: #c0c3cb;
}
--vp-c-bg: rgb(251, 245, 240);
--vp-c-bg-alt: rgba(231, 231, 231);
--vp-c-bg-elv: #ffffff;
--vp-c-bg-soft: #f6f6f7;
--vp-c-brand-1: #598380;
}

.dark {
--vp-c-bg: #1b1b1f;
--vp-c-bg-alt: #161618;
--vp-c-bg-elv: #202127;
--vp-c-bg-soft: #202127;
--vp-c-brand-1: #fff;
}

.custom-block.tip {
border-color: var(--c-brand);
}

.DocSearch {
--docsearch-primary-color: var(--c-brand) !important;
}

a > img {
display: inline-block;
}
6 changes: 0 additions & 6 deletions docs/.vitepress/theme/index.js

This file was deleted.

15 changes: 15 additions & 0 deletions docs/.vitepress/theme/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import Theme from 'vitepress/theme'
import {h, watch} from 'vue'
import './custom.css'

import FooterLogo from './FooterLogo.vue';

export default {
...Theme,
Layout() {
return h(Theme.Layout, null, {
'aside-bottom': () => h(FooterLogo)
}
)
}
}
6 changes: 6 additions & 0 deletions docs/@types/shims.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
declare module "*.vue" {
import Vue from 'vue';
export default Vue;
}

declare module 'FooterLogo';
34 changes: 0 additions & 34 deletions docs/extra.md

This file was deleted.

4 changes: 3 additions & 1 deletion docs/field.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@ next: false
---
# Field
---
### ⚠️ Important ⚠️

::: warning Important
The plugin assumes that the handle of the `SEO Fields` field will be simply: __`seo`__. If it can't find that field, it won't output anything.

If you use a different handle for your field, simply copy [this file](https://github.com/studioespresso/craft-seo-fields/blob/master/src/config.php) to the `config` directory of your project and change the fieldhandle to your own.
:::

---
Here's what the field looks like the CP:
Expand Down
31 changes: 5 additions & 26 deletions docs/general.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,43 +3,22 @@ title: General - SEO Fields
prev: false
next: false
---
# General
# Usage

## 0. Requirements

This plugin requires Craft CMS 3.1.0 or later.

## 1. Installation

To install the plugin, follow these instructions.

1. Open your terminal and go to your Craft project:

```bash
# go to the project directory
cd /path/to/my-craft-project.dev

# tell Composer to install the plugin
composer require studioespresso/craft-seo-fields

# tell Craft to install the plugin
./craft install/plugin seo-fields
```

## 2. Defaults
## 1.Setting defaults
After installing the plugin, you'll want to set defaults for your site.
You can set:
- a default site title (that will be added after the entry's title
- a title seperator to go between to entry title and the site title
- a default meta image.

<img src="./images/defaults.png" width="400">
<img src="./images/defaults.png">

If you have multiple sites in your install, you can specify different defaults for each site.

## 3. The field
## 2. The field
Next up, you create an `SEO Fields` field and add it to your section's layout. More about the field and it's options can be found [here](field.html#field).

## 4. Rendering
## 3. Rendering

Add `{% hook 'seo-fields' %}` to your layout.
Binary file modified docs/images/banner.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/images/defaults.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/notfound.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit fe0adf3

Please sign in to comment.