From 5d3f072a2ff0cb2afb37470e810d628d7b1b36d1 Mon Sep 17 00:00:00 2001 From: Albert Yi Date: Mon, 22 Oct 2018 13:15:33 -0700 Subject: [PATCH] fix wiki excerpt links --- app/logical/post_sets/post.rb | 6 +++++- app/views/posts/partials/index/_seo_meta_tags.html.erb | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/app/logical/post_sets/post.rb b/app/logical/post_sets/post.rb index b4a350c3c..ece388494 100644 --- a/app/logical/post_sets/post.rb +++ b/app/logical/post_sets/post.rb @@ -26,7 +26,11 @@ module PostSets end def has_wiki? - is_single_tag? && ::WikiPage.titled(tag_string).exists? && wiki_page.visible? && wiki_page.body.present? + is_single_tag? && ::WikiPage.titled(tag_string).exists? && wiki_page.visible? + end + + def has_wiki_text? + has_wiki? && wiki_page.body.present? end def has_blank_wiki? diff --git a/app/views/posts/partials/index/_seo_meta_tags.html.erb b/app/views/posts/partials/index/_seo_meta_tags.html.erb index 23fbef2c4..7462bd7e4 100644 --- a/app/views/posts/partials/index/_seo_meta_tags.html.erb +++ b/app/views/posts/partials/index/_seo_meta_tags.html.erb @@ -20,7 +20,7 @@ <%= tag.meta name: "canonical", content: posts_url(tags: params[:tags], host: Danbooru.config.hostname, protocol: "https") %> -<% if @post_set.has_wiki? %> +<% if @post_set.has_wiki_text? %> <% strip_dtext(@post_set.wiki_page.presenter.excerpt).tap do |desc| %> <%= tag.meta name: "description", content: desc %> <%= tag.meta name: "og:description", content: desc %>