# Instant View Template for Simple Blog (Version 2.1) # Apply to static post pages generated by the static site generator ?path: /posts/.+ # Site info - specify your Telegram channel if you have one #channel: https://t.me/your_channel_name # Site name must match the name visible on the website (required for IV 2.1) site_name: "Simple Blog" # Title - extract from the h1 in the post-header title: //article[contains(@class, "post")]/header[contains(@class, "post-header")]/h1 # Cover image - if a featured image exists, use it as the cover @if_exists: //article[contains(@class, "post")]//img[1] cover: //article[contains(@class, "post")]//img[1] @end # Author - extract from the post-author span author: //span[contains(@class, "post-author")]/text() # Publication date - extract from the time element published_date: //div[contains(@class, "post-meta")]/time # Description for link preview - use the summary if available @if_exists: //*[contains(@class, "post-summary")] description: //*[contains(@class, "post-summary")] @end # Content extraction - main article content body: //div[contains(@class, "post-content")] # RTL support for languages like Arabic, Hebrew, Persian (if needed) # @if: //html[@dir="rtl" or @lang="ar" or @lang="he" or @lang="fa"] # @set_attr(dir): rtl # @end # Handle code blocks specially to ensure proper formatting @replace_tag(
):
@replace_tag(): $@
@match: //blockquote//cite
@wrap(): $@
# Process images to ensure they display properly, preserve captions if any
@match: //img
@wrap(): $@
@match: //img[@alt and not(parent::figure)]
@wrap(): $@
@append(): @alt
# Fix relative image paths
@replace: //img[@src and (not(starts-with(@src, "http://")) and not(starts-with(@src, "https://")))]
@attribute: src
@replace_value: $@
@prepend_value: https://your_domain.com/
# Process headings for proper semantics
@match: //h2
@wrap:
@match: //h3
@wrap:
@match: //h4
@wrap:
# Make sure links are properly handled
@replace: //a[@href and not(starts-with(@href, "http")) and not(starts-with(@href, "https")) and not(starts-with(@href, "#"))]
@attribute: href
@replace_value: $@
@prepend_value: https://your_domain.com/
# Handle lists properly (including nested lists)
@match: //ul
@wrap(): $@
@match: //ol
@wrap(): $@
# Add related articles block for tag links
@match: //div[contains(@class, "post-tags")]/a
@wrap_inner(): $@
# Remove unnecessary elements
@remove: //div[contains(@class, "social-share")]
@remove: //div[contains(@class, "table-of-contents")]
@remove: //script
# Handle tables if they exist
@if_exists: //table
@match: //table
@wrap(): $@
@end
# Mark any complex/unsupported content to prevent broken IVs
@unsupported: //iframe
@unsupported: //form
@unsupported: //canvas
# For any dynamic/interactive content that can't be represented in IV
@match: //div[contains(@class, "interactive-element")]
@unsupported: $@