feat: upgrade local newspaper to full-text and images
This commit is contained in:
@@ -246,6 +246,12 @@
|
||||
const card = document.createElement('div');
|
||||
card.className = 'story-card';
|
||||
|
||||
// Wrap each scraped paragraph in a comfortable <p> block for readability
|
||||
const formattedSummary = story.summary
|
||||
.split('\n\n')
|
||||
.map(para => `<p style="margin-bottom:18px;">${para}</p>`)
|
||||
.join('');
|
||||
|
||||
card.innerHTML = `
|
||||
<div class="story-header" onclick="toggleStory(this)">
|
||||
<div class="story-headline">${story.title}</div>
|
||||
@@ -253,7 +259,8 @@
|
||||
</div>
|
||||
<div class="story-body">
|
||||
<div class="story-content">
|
||||
<div class="story-summary">${story.summary}</div>
|
||||
${story.image ? `<img src="${story.image}" style="width:100%; max-height:450px; object-fit:cover; border-radius:16px; margin-bottom:24px; box-shadow: 0 4px 15px rgba(0,0,0,0.35);" onerror="this.style.display='none'">` : ''}
|
||||
<div class="story-summary">${formattedSummary}</div>
|
||||
<div class="story-meta">⌚ Published: ${story.date || 'Recent'}</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user