Skip to content

Commit 3ba77ae

Browse files
Merge pull request #5 from knowledgepixels/chore/nanopub-elements
Use `nanopub-elements` library
2 parents 2b5e823 + 6566c59 commit 3ba77ae

4 files changed

Lines changed: 30 additions & 207 deletions

File tree

assets/css/kp.css

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -277,6 +277,7 @@ p.imgsubtitle {
277277
margin-top: 20px;
278278
}
279279

280-
.news-items p {
280+
.news-items p,
281+
nanopub-list p {
281282
display: inline;
282283
}

index.html

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
<meta name="msapplication-TileColor" content="#db0b5b">
1515
<meta name="theme-color" content="#ffffff">
1616
<script defer src="https://umami.knowledgepixels.com/script.js" data-website-id="ae29ceea-570f-43d0-8979-6d6d11640250"></script>
17+
<script type="module" src="https://esm.sh/@nanopub/nanopub-elements@0.1.0"></script>
1718
</head>
1819

1920
<body>
@@ -79,7 +80,19 @@ <h2>Our software</h2>
7980

8081
<column>
8182
<h2>Our news</h2>
82-
<ul id="latest-news"></ul>
83+
<nanopub-list
84+
id="latest-news"
85+
query-template="RAOMMFrJj4SyF4vlvJhr_AQH0jRL2jI9RUAroP5ZKe0D8/get-news-content"
86+
params='{"resource":"https://w3id.org/spaces/knowledgepixels"}'
87+
date-field="datePublished"
88+
limit="3"
89+
><template>
90+
<li data-bind-data-date="datePublished" data-bind-data-nanopub="np">
91+
<span>
92+
<strong data-bind="headline"></strong><span data-bind-html="body"></span><a data-bind="datePublished" data-bind-href="np"></a>
93+
</span>
94+
</li>
95+
</template></nanopub-list>
8396

8497
<buttons>
8598
<a href="news.html" class="button">See all</a>
@@ -227,10 +240,5 @@ <h2>Contact</h2>
227240

228241
</container>
229242
</section>
230-
<script type="module">
231-
import { showLatestNews } from "./scripts/news.js";
232-
showLatestNews();
233-
</script>
234-
235243
</body>
236244
</html>

news.html

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
<meta name="msapplication-TileColor" content="#db0b5b">
1515
<meta name="theme-color" content="#ffffff">
1616
<script defer src="https://umami.knowledgepixels.com/script.js" data-website-id="ae29ceea-570f-43d0-8979-6d6d11640250"></script>
17+
<script type="module" src="https://esm.sh/@nanopub/nanopub-elements@0.1.0"></script>
1718
</head>
1819

1920
<body>
@@ -33,6 +34,19 @@ <h2>Our news</h2>
3334

3435
</section>
3536

37+
<nanopub-list
38+
query-template="RAOMMFrJj4SyF4vlvJhr_AQH0jRL2jI9RUAroP5ZKe0D8/get-news-content"
39+
params='{"resource":"https://w3id.org/spaces/knowledgepixels"}'
40+
date-field="datePublished"
41+
group-by-year
42+
><template>
43+
<li data-bind-data-date="datePublished" data-bind-data-nanopub="np">
44+
<span>
45+
<strong data-bind="headline"></strong><span data-bind-html="body"></span><a data-bind="datePublished" data-bind-href="np"></a>
46+
</span>
47+
</li>
48+
</template></nanopub-list>
49+
3650
<section data-year="2025">
3751
<h3>2025</h3>
3852

@@ -82,9 +96,5 @@ <h3>2022</h3>
8296
</ul>
8397
</section>
8498

85-
<script type="module">
86-
import { showNewsItems } from "./scripts/news.js";
87-
showNewsItems();
88-
</script>
8999
</body>
90100
</html>

scripts/news.js

Lines changed: 0 additions & 196 deletions
This file was deleted.

0 commit comments

Comments
 (0)