forked from tanner/qotnews
add excerpt and scraper details.
This commit is contained in:
@@ -1,9 +1,8 @@
|
||||
<script>
|
||||
import StoryInfo from "../components/StoryInfo.svelte";
|
||||
import StoryMeta from "../components/StoryMeta.svelte";
|
||||
|
||||
export let story;
|
||||
|
||||
let host = new URL(story.url || story.link).hostname.replace(/^www\./, "");
|
||||
</script>
|
||||
|
||||
<style>
|
||||
@@ -63,12 +62,13 @@
|
||||
<h1 class="article-title">
|
||||
{@html story.title}
|
||||
</h1>
|
||||
{#if story.url}
|
||||
<div>source: <a class="article-source" href={story.url}>{host}</a></div>
|
||||
{/if}
|
||||
|
||||
<section class="article-info">
|
||||
<StoryInfo {story} />
|
||||
</section>
|
||||
<aside class="article-info">
|
||||
<StoryMeta {story} />
|
||||
</aside>
|
||||
</header>
|
||||
|
||||
<section class="article-body">
|
||||
|
@@ -48,9 +48,9 @@
|
||||
class="story-source"
|
||||
href={story.url || story.link}>{host(story.url || story.link)}</a>
|
||||
</header>
|
||||
<section class="story-info">
|
||||
<aside class="story-info">
|
||||
<StoryInfo {story} />
|
||||
</section>
|
||||
</aside>
|
||||
</article>
|
||||
{/each}
|
||||
|
||||
|
30
webapp/src/components/StoryMeta.svelte
Normal file
30
webapp/src/components/StoryMeta.svelte
Normal file
@@ -0,0 +1,30 @@
|
||||
<script>
|
||||
export let story;
|
||||
|
||||
let host = new URL(story.url || story.link).hostname.replace(/^www\./, "");
|
||||
</script>
|
||||
|
||||
<style>
|
||||
ul {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
li {
|
||||
display: inline-block;
|
||||
list-style-type: circle;
|
||||
}
|
||||
li:not(:first-of-type)::before {
|
||||
content: " | ";
|
||||
}
|
||||
</style>
|
||||
|
||||
<ul>
|
||||
{#if story.url}
|
||||
<li>source: <a class="article-source" href={story.url}>{host}</a></li>
|
||||
{/if}
|
||||
{#if story.scraper && story.scraper_link}
|
||||
<li>scraper: <a href={story.scraper_link}>{story.scraper}</a></li>
|
||||
{:else if story.scraper}
|
||||
<li>scraper: {story.scraper}</li>
|
||||
{/if}
|
||||
</ul>
|
@@ -42,6 +42,7 @@
|
||||
property="article:published_time"
|
||||
content={fromUnixTime(story.date).toISOString()} />
|
||||
<meta property="article:author" content={story.author || story.source} />
|
||||
<meta property="og:description" content={story.excerpt || story.title} />
|
||||
</svelte:head>
|
||||
|
||||
<section class="single">
|
||||
|
Reference in New Issue
Block a user