|
2 | 2 |
|
3 | 3 | {% if site.url %} |
4 | 4 | {% assign seo_url = site.url | append: site.baseurl %} |
5 | | -{% elsif site.github.url %} |
6 | | - {% assign seo_url = site.github.url %} |
7 | 5 | {% endif %} |
| 6 | +{% assign seo_url = seo_url | default: site.github.url %} |
8 | 7 |
|
9 | | -{% if site.title %} |
10 | | - {% assign seo_site_title = site.title %} |
11 | | -{% elsif site.name %} |
12 | | - {% assign seo_site_title = site.name %} |
13 | | -{% endif %} |
| 8 | +{% assign seo_site_title = site.title | default: site.name %} |
14 | 9 |
|
15 | 10 | {% if page.title %} |
16 | 11 | {% assign seo_title = page.title %} |
|
35 | 30 | {% assign seo_page_title = seo_page_title | markdownify | strip_html | strip_newlines | escape_once %} |
36 | 31 | {% endif %} |
37 | 32 |
|
38 | | -{% if page.description %} |
39 | | - {% assign seo_description = page.description %} |
40 | | -{% elsif page.excerpt %} |
41 | | - {% assign seo_description = page.excerpt %} |
42 | | -{% elsif site.description %} |
43 | | - {% assign seo_description = site.description %} |
44 | | -{% endif %} |
| 33 | +{% assign seo_description = page.description | default: page.excerpt | default: site.description %} |
45 | 34 | {% if seo_description %} |
46 | 35 | {% assign seo_description = seo_description | markdownify | strip_html | strip_newlines | escape_once %} |
47 | 36 | {% endif %} |
48 | 37 |
|
49 | 38 | {% if page.author %} |
50 | | - {% if page.author.name %} |
51 | | - {% assign seo_author_name = page.author.name %} |
52 | | - {% else %} |
53 | | - {% assign seo_author_name = page.author %} |
54 | | - {% endif %} |
55 | | - |
56 | | - {% if page.author.twitter %} |
57 | | - {% assign seo_author_twitter = page.author.twitter %} |
58 | | - {% else %} |
59 | | - {% assign seo_author_twitter = page.author %} |
60 | | - {% endif %} |
| 39 | + {% assign seo_author_name = page.author.name | default: page.author %} |
| 40 | + {% assign seo_author_twitter = page.author.twitter | default: page.author %} |
61 | 41 | {% endif %} |
62 | 42 | {% if seo_author_twitter %} |
63 | 43 | {% assign seo_author_twitter = seo_author_twitter | replace:"@","" | prepend:"@" %} |
|
0 commit comments