Browse Source

fix(shortcode/navmenu): improve microdata semantics & add test tool to docs

resolves #100
Josh Habdas 11 months ago
parent
commit
31992f5dea
Signed by: Josh Habdas <jhabdas@protonmail.com> GPG Key ID: B148B31154C75A74

+ 9
- 3
docs/content/feature/structured-data.md View File

@@ -13,8 +13,14 @@ Schema Property | Frontmatter Value
13 13
 author?         | `author`
14 14
 datePublished   | `publishdate` or `date`
15 15
 articleSection  | `[categories]`
16
-wordCount       | `wordcount`
17 16
 
18
-Consider adding your own structured data when creating [Custom Layouts](../custom-layouts) for improved page semantics and better SEO.
17
+Consider adding structured data when creating [Custom Layouts](../custom-layouts) for improved page semantics and better SEO.
19 18
 
20
-Learn more about {{< external href="https://moz.com/learn/seo/schema-structured-data" text="Schema Structured Data on Moz" />}}.
19
+Learn more about structured data using the following resources:
20
+
21
+- {{< external href="https://www.w3.org/TR/microdata/" text="HTML Microdata on W3C" />}}
22
+- {{< external href="https://developer.mozilla.org/en-US/docs/Web/HTML/Microdata" text="Microdata on MDN" />}}
23
+- {{< external href="https://moz.com/learn/seo/schema-structured-data" text="Schema Structured Data on Moz" />}}
24
+
25
+
26
+Use [Webmaster Tools](../webmaster-tools/) to validate structured data. This can be done from a development machine using [ephemeral hosting](http://localhost:1313/feature/air-gapping/#ephemeral-hosting-with-end-to-end-encryption).

+ 22
- 6
docs/content/feature/webmaster-tools.md View File

@@ -1,14 +1,16 @@
1 1
 +++
2 2
 title = "Webmaster Tools"
3
-description = "Submit your site to Google, Yandex, Bing and more."
3
+description = "Test and submit your site with popular search engines."
4 4
 categories = ["search"]
5 5
 tags = ["SEO", "robots", "metadata"]
6 6
 features = ["code highlighter", "related content", "snippets"]
7 7
 +++
8 8
 
9
-Use homepage `meta` to verify your site with Google, Bing, Alexa and Yandex. All verifications are optional and [some not required](#submit-manually) to get your site listed.
9
+## Webmaster verification
10 10
 
11
-To verify with any of the available providers add the following to your {{< external href="https://gohugo.io/getting-started/configuration/" text="Site Configuration" />}} and fill in the value given to you by the provider:
11
+Use homepage `meta` to verify your site with Google, Bing, Alexa and Yandex. All verifications are optional and some providers allow you to [submit manually](#submit-manually).
12
+
13
+To verify with `meta` add the following to your {{< external href="https://gohugo.io/getting-started/configuration/" text="Site Configuration" />}} and fill in the value provided to you by the search engine webmaster console or similar:
12 14
 
13 15
 ```toml
14 16
 [params.seo.webmaster_verifications]
@@ -22,11 +24,11 @@ To verify with any of the available providers add the following to your {{< exte
22 24
 <strong>Note:</strong> Claiming your site with Alexa {{< external text="was retired" href="https://support.alexa.com/hc/en-us/articles/219135887-Claiming-has-been-retired-May-2016" />}} in May 2016.
23 25
 {{< /hackcss-alert >}}
24 26
 
25
-Remove verifications you don't need or no longer use.
27
+You may later remove verifications you no longer need or decide not to use.
26 28
 
27
-## Submit manually
29
+### Submit manually
28 30
 
29
-Manually submit your Sitemap for search indexing.
31
+Manually submit your Sitemap for search indexing:
30 32
 
31 33
 {{< hackcss-form target="_blank" action="https://www.google.com/webmasters/tools/ping" >}}
32 34
   {{< hackcss-formgroup >}}
@@ -40,3 +42,17 @@ Manually submit your Sitemap for search indexing.
40 42
     {{< hackcss-textinput id="bing" name="siteMap" placeholder="https://domain.example/sitemap.xml" >}}
41 43
   {{< /hackcss-formgroup >}}
42 44
 {{< /hackcss-form >}}
45
+
46
+## Test Structured Data
47
+
48
+To test with Yandex use their {{< external href="https://webmaster.yandex.com/tools/microtest" text="Structured data validator" />}} testing tool. For Google submit the form below with the URL you wish to test:
49
+
50
+{{< hackcss-form target="_blank" action="https://search.google.com/structured-data/testing-tool" >}}
51
+  {{< hackcss-formgroup >}}
52
+    {{< hackcss-textinput type="hidden" name="hl" value="en" >}}
53
+    {{< hackcss-label for="google" text="Test URL:" />}}
54
+    {{< hackcss-textinput id="google" name="url" placeholder="https://domain.example/post/" >}}
55
+  {{< /hackcss-formgroup >}}
56
+{{< /hackcss-form >}}
57
+
58
+For more information on structured data please consult the search engines.

+ 2
- 1
layouts/partials/shortcode/navmenu.html View File

@@ -1,6 +1,7 @@
1 1
 <nav itemscope itemtype="http://schema.org/SiteNavigationElement">
2
+  <meta itemprop="name" content="Navigation Menu">
2 3
   {{ range (index .menus .name) }}
3 4
     {{ $is_active := or ($.page.IsMenuCurrent $.name .) ($.page.HasMenuCurrent $.name .) }}
4
-    <a itemprop="url" {{ if $is_active }}class="active"{{ end }} href="{{ .URL }}"><span itemprop="name">{{ .Name }}</span></a>
5
+    <a itemprop="url" {{ if $is_active }}class="active"{{ end }} href="{{ .URL }}">{{ .Name }}</a>
5 6
   {{- end }}
6 7
 </nav>

Loading…
Cancel
Save