Skip to content

Commit

Permalink
Merge branch 'develop' into feature/preview-redirect-post-link
Browse files Browse the repository at this point in the history
  • Loading branch information
nicholasio committed Mar 6, 2024
2 parents 9e05f44 + 3f1b4f7 commit de5c030
Show file tree
Hide file tree
Showing 16 changed files with 733 additions and 87 deletions.
5 changes: 5 additions & 0 deletions .changeset/fuzzy-kiwis-decide.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@headstartwp/headstartwp": patch
---

fix: hreflangs tags on multilingual sites
4 changes: 4 additions & 0 deletions packages/next/src/components/Yoast.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,10 @@ export function Yoast({ seo, useHtml = false }: Props) {
props.href = convertUrl(props.href, hostUrl, sourceUrl);
}

if (props.rel === 'alternate') {
props.href = convertUrl(props.href, hostUrl, sourceUrl);
}

if (props.property === 'og:url') {
props.content = convertUrl(props.content, hostUrl, sourceUrl);
}
Expand Down
2 changes: 1 addition & 1 deletion projects/wp-nextjs/.env
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
NEXT_PUBLIC_HEADLESS_WP_URL=https://js1.10up.com
HOST_URL=https://js1.10up.com
NEXT_PUBLIC_HOST_URL=https://js1.10up.com
2 changes: 1 addition & 1 deletion projects/wp-nextjs/.env.development
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
NEXT_PUBLIC_HEADLESS_WP_URL=http://localhost:8888
HOST_URL=http://localhost:3000
NEXT_PUBLIC_HOST_URL=http://localhost:3000
ENABLE_POLYLANG_INTEGRATION=false
ENABLE_REQUEST_DEBUG=true
ENABLE_REDIRECT_DEBUG=true
Expand Down
4 changes: 2 additions & 2 deletions projects/wp-nextjs/headstartwp.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ module.exports = {
* The WordPress Source Url
*/
sourceUrl: process.env.NEXT_PUBLIC_HEADLESS_WP_URL,
hostUrl: process.env.HOST_URL,
hostUrl: process.env.NEXT_PUBLIC_HOST_URL,
customPostTypes: [
// this is just an example
{
Expand Down Expand Up @@ -43,7 +43,7 @@ module.exports = {
enable: true,
},
polylang: {
enable: process.env?.ENABLE_POLYLANG_INTEGRATION === 'true',
enable: process?.env?.NEXT_PUBLIC_ENABLE_POLYLANG_INTEGRATION === 'true',
},
},

Expand Down
3 changes: 1 addition & 2 deletions projects/wp-nextjs/next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,9 @@ const nextConfig = {
ignoreDuringBuilds: true,
},
};

// if you are not using polylang integration you can remove this code
// if you are replace the locales with the ones you are using
if (process.env?.ENABLE_POLYLANG_INTEGRATION === 'true') {
if (process.env?.NEXT_PUBLIC_ENABLE_POLYLANG_INTEGRATION === 'true') {
nextConfig.i18n = {
locales: ['en', 'pt'],
defaultLocale: 'en',
Expand Down
13 changes: 12 additions & 1 deletion wp/headless-wp/.wp-env.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,16 @@
"../local-plugin",
"https://downloads.wordpress.org/plugin/wordpress-seo.22.1.zip",
"https://downloads.wordpress.org/plugin/safe-redirect-manager.2.1.1.zip"
]
],
"env": {
"tests": {
"plugins": [
".",
"../local-plugin",
"https://downloads.wordpress.org/plugin/wordpress-seo.22.1.zip",
"https://downloads.wordpress.org/plugin/safe-redirect-manager.2.1.1.zip",
"https://downloads.wordpress.org/plugin/polylang.3.5.4.zip"
]
}
}
}
12 changes: 11 additions & 1 deletion wp/headless-wp/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,14 @@
"reference": "trunk"
}
}
},
{
"type": "composer",
"url": "https://wpackagist.org",
"only": [
"wpackagist-plugin/*",
"wpackagist-theme/*"
]
}
],
"require-dev": {
Expand Down Expand Up @@ -56,7 +64,9 @@
},
"extra": {
"installer-paths": {
"vendor/{$name}/": ["type:wordpress-plugin"]
"vendor/{$name}/": [
"type:wordpress-plugin"
]
}
}
}
Loading

0 comments on commit de5c030

Please sign in to comment.