Skip to content

Commit 269da20

Browse files
authored
Added SEO counter changes (#176)
1 parent f396227 commit 269da20

File tree

1 file changed

+13
-5
lines changed

1 file changed

+13
-5
lines changed

_includes/layouts/seo.html

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1-
1+
<!-- Capture language -->
2+
{% capture language %}{% if page.language == 'plotly_js' %}JavaScript{% elsif page.language == 'ggplot2'%}ggplot2{% elsif page.language == 'f_sharp' %}F#{% elsif page.language == 'matlab' %}MATLAB{% else %}{{page.language | capitalize }}{% endif %}{% endcapture %}
23
<!-- Create a title -->
34
{% capture title %}
45
{% if page.permalink == '/python/' or page.language == '/julia/' or page.language == '/r/' or page.language == '/ggplot2/' or page.language == '/f_sharp/' or page.language == '/matlab/' or page.language == '/javascript/' %}{{page.name}}
56
{% elsif page.name == '404' %} 404 Page Not Found
67
{% elsif page.permalink == '/api/' or page.permalink == '/graphing-libraries/' %} Plotly Open Source Graphing Libraries
7-
{% elsif page.name %} {{page.name | capitalize}} with {% if page.language == 'plotly_js' %}JavaScript{% elsif page.language == 'ggplot2'%}ggplot2{% elsif page.language == 'f_sharp' %}F#{% elsif page.language == 'matlab' %}MATLAB{% else %}{{page.language | capitalize }}{% endif %}{% else %} Plotly Open Source Graphing Libraries{% endif %}
8+
{% elsif page.name %} {{page.name | capitalize}} in {{language}}{% else %} Plotly Open Source Graphing Libraries{% endif %}
89
{% endcapture %}
910
<!-- Count number of plots on the page -->
1011
{% if page.language == 'python' %} {% assign split_class = 'plotly-graph-' %}
@@ -13,7 +14,7 @@
1314
{% elsif page.language == 'ggplot2' %} {% assign split_class = 'plotly html-widget' %}
1415
{% elsif page.language == 'plotly_js' %} {% assign split_class = 'Plotly.newPlot('myDiv_' %}
1516
{% elsif page.language == 'matlab' %} {% assign split_class = 'plotly-graph-' %}
16-
{% elsif page.language == 'f_sharp' %} {% assign split_class = 'output_html rendered_html output_subarea output_execute_result' %}
17+
{% elsif page.language == 'f_sharp' %} {% assign split_class = 'output_wrapper' %}
1718
{% else %} {% assign split_class = 'plotly-graph-' %}
1819
{% endif %}
1920

@@ -30,8 +31,15 @@
3031
{% assign counter = counter | plus: 1 %}
3132
{% endif %}
3233
{% endfor %}
33-
{% capture description %}"Over {{counter}} examples of {{page.name}} including changing color, size, log axes, and more."{% endcapture %}
34-
{% endif %}
34+
35+
{% if counter == 0 %}
36+
{% capture description %}{{page.description}}{% endcapture %}
37+
{% elsif counter < 8 %}
38+
{% capture description %}"Detailed examples of {{page.name}} including changing color, size, log axes, and more in {{language}}."{% endcapture %}
39+
{% else %}
40+
{% capture description %}"Over {{counter}} examples of {{page.name}} including changing color, size, log axes, and more in {{language}}."{% endcapture %}
41+
{% endif %}
42+
{% endif %}
3543

3644

3745
<!-- SEO Tags - title, meta_description -->

0 commit comments

Comments
 (0)