UNPKG

tiltlr-blog

Version:

A lightweight JavaScript library to embed Medium blog posts on any website

90 lines (81 loc) 2.92 kB
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Tiltlr Blog Embed Example</title> <link rel="stylesheet" href="style.css"> <style> body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif; line-height: 1.6; color: #333; max-width: 1200px; margin: 0 auto; padding: 2rem; } header { text-align: center; margin-bottom: 3rem; } h1 { margin-bottom: 0.5rem; } .subtitle { color: #666; font-size: 1.2rem; } .example-section { margin-bottom: 3rem; } .example-section h2 { border-bottom: 1px solid #eee; padding-bottom: 0.5rem; margin-top: 2rem; } code { background-color: #f5f5f5; padding: 0.2rem 0.5rem; border-radius: 3px; font-family: monospace; } pre { background-color: #f5f5f5; padding: 1rem; border-radius: 5px; overflow-x: auto; } </style> </head> <body> <header> <h1>Tiltlr Blog Embed Example</h1> <p class="subtitle">A lightweight JavaScript library to embed Medium blog posts on any website</p> </header> <div class="example-section"> <h2>Demo (Default - 5 posts)</h2> <p>Below is a live example showing the latest posts from Medium's official blog.</p> <!-- Replace 'medium' with any valid Medium username --> <tiltlr-blog username="zuhayr.codes"></tiltlr-blog> </div> <div class="example-section"> <h2>Demo (Limited to 3 posts)</h2> <p>You can limit the number of posts using the limit attribute:</p> <tiltlr-blog username="zuhayr.codes" limit="3"></tiltlr-blog> </div> <div class="example-section"> <h2>How to Use</h2> <p>Embedding your Medium blog posts on any website is as simple as:</p> <pre><code>&lt;tiltlr-blog username="yourusername"&gt;&lt;/tiltlr-blog&gt; &lt;script src="tiltlr-blog.js"&gt;&lt;/script&gt; &lt;link rel="stylesheet" href="style.css"&gt;</code></pre> <p>Just replace <code>yourusername</code> with your Medium username without the @ symbol.</p> <h3>With limit option:</h3> <pre><code>&lt;tiltlr-blog username="yourusername" limit="3"&gt;&lt;/tiltlr-blog&gt;</code></pre> </div> <footer> <p>Created with ❤️ | <a href="https://github.com/yourusername/tiltlr-blog" target="_blank">GitHub</a></p> </footer> <script src="tiltlr-blog.js"></script> </body> </html>