aboutsummaryrefslogtreecommitdiff
path: root/_plugins/twitter.rb
diff options
context:
space:
mode:
authorMiquel Sabaté Solà <msabate@suse.com>2019-10-21 17:47:18 +0200
committerMiquel Sabaté Solà <msabate@suse.com>2019-10-21 17:47:18 +0200
commit18cdcf8ddb8cbdc5a7c1cc8d0eb1666d9eac6d7a (patch)
tree0ccdcdb60f0a013658b3527079a863771a57eda0 /_plugins/twitter.rb
parent317960b98f2a0eb08c3bda4e87783ca706eb3de7 (diff)
downloadjo.mssola.com-18cdcf8ddb8cbdc5a7c1cc8d0eb1666d9eac6d7a.tar.gz
jo.mssola.com-18cdcf8ddb8cbdc5a7c1cc8d0eb1666d9eac6d7a.zip
plugins: added the article Jekyll plugin
This plugin adds og:type related tags depending on whether the given page is a website or an article. Signed-off-by: Miquel Sabaté Solà <msabate@suse.com>
Diffstat (limited to '_plugins/twitter.rb')
-rw-r--r--_plugins/twitter.rb15
1 files changed, 4 insertions, 11 deletions
diff --git a/_plugins/twitter.rb b/_plugins/twitter.rb
index e65831b..e04eecc 100644
--- a/_plugins/twitter.rb
+++ b/_plugins/twitter.rb
@@ -15,9 +15,13 @@
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
+require_relative "render_helper"
+
module Jekyll
# Render the OG image meta HTML tag for the currently rendered page.
class RenderOGImageTag < Liquid::Tag
+ include ::Jekyll::RenderHelper
+
# The path to be used when the current page does not have a specific image.
DEFAULT_PATH = "/images/default.png"
@@ -44,17 +48,6 @@ module Jekyll
def normalize(str)
str.gsub(/\s/, "-").downcase
end
-
- # Render an HTML meta tag with the given property and content
- # attributes. You may optionally pass a `name` argument. When true, it will
- # use "name" instead of "property". Defaults to nil.
- def render_meta(property, content, name: nil)
- if name
- "<meta name=\"#{property}\" content=\"#{content}\" />"
- else
- "<meta property=\"#{property}\" content=\"#{content}\" />"
- end
- end
end
end