Skip to content

Commit d626904

Browse files
authored
Merge pull request #1803 from hydephp/fix-heading-permalinks-button-text-showing-in-google-search-previews
Improve the documentation heading permalinks
2 parents 222d1da + 5a8aff4 commit d626904

File tree

15 files changed

+32
-27
lines changed

15 files changed

+32
-27
lines changed

RELEASE_NOTES.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ This serves two purposes:
1616
- Updated the `Serializable` trait to provide a default automatic `toArray` method in https://github.com/hydephp/develop/pull/1791
1717
- Updated the `PostAuthor` class's `name` property to fall back to the `username` property if the `name` property is not set in https://github.com/hydephp/develop/pull/1794
1818
- Removed the nullable type hint from the `PostAuthor` class's `name` property as it is now always set in https://github.com/hydephp/develop/pull/1794
19+
- Improved the accessibility of the heading permalinks feature in https://github.com/hydephp/develop/pull/1803
20+
- Updated to HydeFront v3.4 in https://github.com/hydephp/develop/pull/1803
1921

2022
### Deprecated
2123
- The `PostAuthor::getName()` method is now deprecated and will be removed in v2. (use `$author->name` instead) in https://github.com/hydephp/develop/pull/1794
@@ -25,6 +27,7 @@ This serves two purposes:
2527

2628
### Fixed
2729
- Added missing collection key types in Hyde facade method annotations in https://github.com/hydephp/develop/pull/1784
30+
- Fixed heading permalinks button text showing in Google Search previews https://github.com/hydephp/develop/issues/1801 in https://github.com/hydephp/develop/pull/1803
2831

2932
### Security
3033
- in case of vulnerabilities.

_media/app.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package-lock.json

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/framework/src/Framework/Services/AssetService.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
class AssetService
3232
{
3333
/** @var string The default HydeFront SemVer tag to load. This constant is set to match the styles used for the installed framework version. */
34-
final public const HYDEFRONT_VERSION = 'v3.3';
34+
final public const HYDEFRONT_VERSION = 'v3.4';
3535

3636
/** @var string The default HydeFront CDN path pattern. The Blade-style placeholders are replaced with the proper values. */
3737
final public const HYDEFRONT_CDN_URL = 'https://cdn.jsdelivr.net/npm/hydefront@{{ $version }}/dist/{{ $file }}';

packages/framework/src/Framework/Services/MarkdownService.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,9 +206,10 @@ protected function configurePermalinksExtension(): void
206206
'heading_permalink' => [
207207
'id_prefix' => '',
208208
'fragment_prefix' => '',
209-
'symbol' => '#',
209+
'symbol' => '',
210210
'insert' => 'after',
211211
'min_heading_level' => 2,
212+
'aria_hidden' => false,
212213
],
213214
], $this->config);
214215
}

packages/framework/tests/Feature/MarkdownServiceTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ public function testServiceCanParseMarkdownToHtmlWithPermalinks()
3333

3434
$this->assertIsString($html);
3535
$this->assertSame(
36-
'<h2>Hello World!<a id="hello-world" href="#hello-world" class="heading-permalink" aria-hidden="true" '.
37-
'title="Permalink">#</a></h2>'."\n",
36+
'<h2>Hello World!<a id="hello-world" href="#hello-world" class="heading-permalink" '.
37+
'title="Permalink"></a></h2>'."\n",
3838
$html
3939
);
4040
}

packages/framework/tests/Feature/StaticSiteBuilderDocumentationModuleTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ public function testPageContainsExpectedContent()
4444
{
4545
$this->inspectHtml([
4646
'Adventures in Wonderland',
47-
'<h2>CHAPTER I. DOWN THE RABBIT-HOLE.<a id="chapter-i-down-the-rabbit-hole" href="#chapter-i-down-the-rabbit-hole" class="heading-permalink" aria-hidden="true" title="Permalink">#</a></h2>',
47+
'<h2>CHAPTER I. DOWN THE RABBIT-HOLE.<a id="chapter-i-down-the-rabbit-hole" href="#chapter-i-down-the-rabbit-hole" class="heading-permalink" title="Permalink"></a></h2>',
4848
'<p>So she was considering in her own mind, as well as she could',
4949
]);
5050
}
@@ -55,7 +55,7 @@ public function testCanCompilePageToRootOutputDirectory()
5555

5656
$this->inspectHtml([
5757
'Adventures in Wonderland',
58-
'<h2>CHAPTER I. DOWN THE RABBIT-HOLE.<a id="chapter-i-down-the-rabbit-hole" href="#chapter-i-down-the-rabbit-hole" class="heading-permalink" aria-hidden="true" title="Permalink">#</a></h2>',
58+
'<h2>CHAPTER I. DOWN THE RABBIT-HOLE.<a id="chapter-i-down-the-rabbit-hole" href="#chapter-i-down-the-rabbit-hole" class="heading-permalink" title="Permalink"></a></h2>',
5959
'<p>So she was considering in her own mind, as well as she could',
6060
], '_site/test-page.html');
6161
}

packages/framework/tests/Unit/AssetServiceUnitTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ protected function setUp(): void
2323

2424
public function testVersionStringConstant()
2525
{
26-
$this->assertSame('v3.3', AssetService::HYDEFRONT_VERSION);
26+
$this->assertSame('v3.4', AssetService::HYDEFRONT_VERSION);
2727
}
2828

2929
public function testServiceHasVersionString()
@@ -56,7 +56,7 @@ public function testCanSetCustomCdnUrlInConfig()
5656
public function testCanUseCustomCdnUrlWithVersion()
5757
{
5858
self::mockConfig(['hyde.hydefront_url' => '{{ $version }}']);
59-
$this->assertSame('v3.3', (new AssetService())->cdnLink(''));
59+
$this->assertSame('v3.4', (new AssetService())->cdnLink(''));
6060
}
6161

6262
public function testCanUseCustomCdnUrlWithFile()
@@ -68,7 +68,7 @@ public function testCanUseCustomCdnUrlWithFile()
6868
public function testCanUseCustomCdnUrlWithVersionAndFile()
6969
{
7070
self::mockConfig(['hyde.hydefront_url' => '{{ $version }}/{{ $file }}']);
71-
$this->assertSame('v3.3/styles.css', (new AssetService())->cdnLink('styles.css'));
71+
$this->assertSame('v3.4/styles.css', (new AssetService())->cdnLink('styles.css'));
7272
}
7373

7474
public function testCanUseCustomCdnUrlWithCustomVersion()
@@ -83,7 +83,7 @@ public function testCanUseCustomCdnUrlWithCustomVersion()
8383
public function testCdnLinkHelper()
8484
{
8585
$this->assertSame(
86-
'https://cdn.jsdelivr.net/npm/hydefront@v3.3/dist/styles.css',
86+
'https://cdn.jsdelivr.net/npm/hydefront@v3.4/dist/styles.css',
8787
(new AssetService())->cdnLink('styles.css')
8888
);
8989
}

packages/hyde/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"devDependencies": {
99
"@tailwindcss/typography": "^0.5.2",
1010
"autoprefixer": "^10.4.5",
11-
"hydefront": "^3.3.0",
11+
"hydefront": "^3.4.0",
1212
"laravel-mix": "^6.0.49",
1313
"postcss": "^8.4.31",
1414
"prettier": "3.3.2",

packages/hydefront/dist/app.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)