File tree Expand file tree Collapse file tree 2 files changed +13
-4
lines changed Expand file tree Collapse file tree 2 files changed +13
-4
lines changed Original file line number Diff line number Diff line change 4141{% endif %}
4242
4343{% if seo_url %}
44- < link rel ="canonical " href ="{{ seo_url }}{{ page.url }} " itemprop ="url " />
45- < meta property ='og:url ' content ='{{ seo_url }}{{ page.url }} ' />
44+ < link rel ="canonical " href ="{{ seo_url }}{{ page.url | replace:'/index.html','/' }} " itemprop ="url " />
45+ < meta property ='og:url ' content ='{{ seo_url }}{{ page.url | replace: '/index.html','/' }}' />
4646{% endif %}
4747
4848{% if site.title %}
6464{% if page.date %}
6565 < meta property ="og:type " content ="article " />
6666 {% if page.next.url %}
67- < link rel ="next " href ="{{ seo_url }}{{ page.next.url }} " title ="{{ page.next.title | escape }} " />
67+ < link rel ="next " href ="{{ seo_url }}{{ page.next.url | replace:'/index.html','/' }} " title ="{{ page.next.title | escape }} " />
6868 {% endif %}
6969 {% if page.previous.url %}
70- < link rel ="prev " href ="{{ seo_url }}{{ page.previous.url }} " title ="{{ page.previous.title | escape }} " />
70+ < link rel ="prev " href ="{{ seo_url }}{{ page.previous.url | replace:'/index.html','/' }} " title ="{{ page.previous.title | escape }} " />
7171 {% endif %}
7272 < script type ="application/ld+json ">
7373 {
Original file line number Diff line number Diff line change 7777 expect ( subject . render ( context ) ) . to match ( expected )
7878 end
7979
80+ it "uses replaces '/index.html' with '/'" do
81+ page = page ( { "permalink" => "/page/index.html" } )
82+ site = site ( { "url" => "http://example.invalid" } )
83+ context = context ( { :page => page , :site => site } )
84+ expected = %r!<link rel="canonical" href="http://example.invalid/page/" itemprop="url" />!
85+ expected = %r!<meta property='og:url' content='http://example.invalid/page/' />!
86+ expect ( subject . render ( context ) ) . to match ( expected )
87+ end
88+
8089 it "outputs the site title meta" do
8190 site = site ( { "title" => "Foo" , "url" => "http://example.invalid" } )
8291 context = context ( { :site => site } )
You can’t perform that action at this time.
0 commit comments