Page MenuHomePhabricator
Paste P12092

Diff-blog Telegram Instant View ruleset
ActivePublic

Authored by valerio.bozzolan on Tue, Jul 28, 6:57 PM.
# Inherited from blog.linuxdaytorino.org
# Use Instant View version 2.0
~version: "2.0"
# Use this template only blog article pages
?exists: //article[has-class("post")+has-class("page")]
# Get article text in <article>
body: //article
# Get title from <h1>
title: $body//h1[1]
subtitle: $title/next-sibling::h2
author: //span[has-class("author")]//a
author_url: //span[has-class("author")]//@href
# Get article cover image
cover: //img[has-class("wp-post-image")]
# Convert all iframe elements to inline element
@inline: $body//iframe[starts-with(@src, "/media/")]
# Remote header and footer
@remove: //article/header
@remove: //article/footer
# Remove day, author, year
@remove: $body//div[has-class("entry-meta")]
# Remove social sharing
@remove: $body//div[has-class("social-sharing")]
# Replace p to figure
@replace_tag(<figure>): $body//p[.//img]
# Youtube Embedded Fix
@replace_tag(<figure>): $body//p[.//iframe]