@@ -64,6 +64,8 @@ import {topics} from './page/topics.js'
6464import { topic } from './page/topic.js'
6565import { data } from './data.js'
6666
67+ const origin = 'https://unifiedjs.com'
68+
6769const users = /** @type {Array<ShowcaseUser> } */ (
6870 yaml . parse (
6971 await fs . readFile ( new URL ( '../doc/showcase.yml' , import . meta. url ) , 'utf8' )
@@ -101,6 +103,7 @@ for (const d of input) {
101103 meta . type = 'article'
102104 meta . tags = [ group ]
103105 if ( tags ) meta . tags . push ( ...tags )
106+ meta . origin = origin
104107 meta . pathname = [ '' , 'learn' , group , slug , '' ] . join ( '/' )
105108
106109 entries . push ( file )
@@ -138,6 +141,7 @@ for (const d of minidata) {
138141 sections . push ( {
139142 ...d ,
140143 entries : groupEntries ,
144+ origin,
141145 pathname : '/learn/' + slug + '/' ,
142146 tags : [ slug , 'learn' ]
143147 } )
@@ -150,6 +154,7 @@ page(
150154 {
151155 description :
152156 'Content as structured data: unified compiles content and provides hundreds of packages to work with content' ,
157+ origin,
153158 pathname : '/'
154159 }
155160)
@@ -165,7 +170,13 @@ for (const file of entries) {
165170
166171for ( const section of sections ) {
167172 const { description, entries, pathname, tags, title} = section
168- const meta = { description, pathname, tags, title}
173+ const meta = {
174+ description,
175+ origin,
176+ pathname,
177+ tags,
178+ title
179+ }
169180 assert ( entries )
170181 page ( function ( ) {
171182 return articles ( meta , entries )
@@ -178,6 +189,7 @@ page(
178189 } ,
179190 {
180191 description : 'Learn unified through guides and recipes' ,
192+ origin,
181193 pathname : '/learn/' ,
182194 tags : [ 'learn' , 'recipe' , 'guide' , 'tutorial' ] ,
183195 title : 'Learn'
@@ -190,6 +202,7 @@ page(
190202 } ,
191203 {
192204 description : 'Explore the unified ecosystem' ,
205+ origin,
193206 pathname : '/explore/' ,
194207 title : 'Explore'
195208 }
@@ -201,6 +214,7 @@ page(
201214 } ,
202215 {
203216 description : 'Explore packages in the unified ecosystem by keyword' ,
217+ origin,
204218 pathname : '/explore/keyword/' ,
205219 title : 'Keywords - Explore'
206220 }
@@ -216,6 +230,7 @@ for (const d of Object.keys(data.packagesByKeyword)) {
216230 'Explore packages in the unified ecosystem with the “' +
217231 d +
218232 '” keyword' ,
233+ origin,
219234 pathname : '/explore/keyword/' + d + '/' ,
220235 title : d + ' - Keywords'
221236 }
@@ -230,6 +245,7 @@ for (const d of Object.keys(data.packagesByScope)) {
230245 {
231246 description :
232247 'Explore packages in the unified ecosystem in the “' + d + '” scope' ,
248+ origin,
233249 pathname : '/explore/package/' + d + '/' ,
234250 title : d + ' - Scope'
235251 }
@@ -242,6 +258,7 @@ page(
242258 } ,
243259 {
244260 description : 'Explore projects in the unified ecosystem by topic' ,
261+ origin,
245262 pathname : '/explore/topic/' ,
246263 title : 'Topics - Explore'
247264 }
@@ -255,6 +272,7 @@ for (const d of Object.keys(data.projectsByTopic)) {
255272 {
256273 description :
257274 'Explore projects in the unified ecosystem with the “' + d + '” topic' ,
275+ origin,
258276 pathname : '/explore/topic/' + d + '/' ,
259277 title : d + ' - Topics'
260278 }
@@ -268,6 +286,7 @@ for (const d of Object.keys(data.projectsByOwner)) {
268286 } ,
269287 {
270288 description : 'Explore projects in the unified ecosystem by “@' + d + '”' ,
289+ origin,
271290 pathname : '/explore/project/' + d + '/' ,
272291 title : '@' + d + ' - Owner'
273292 }
@@ -280,6 +299,7 @@ page(
280299 } ,
281300 {
282301 description : 'Explore all packages in the unified ecosystem' ,
302+ origin,
283303 pathname : '/explore/package/' ,
284304 title : 'Packages - Explore'
285305 }
@@ -291,6 +311,7 @@ page(
291311 } ,
292312 {
293313 description : 'Explore all projects in the unified ecosystem' ,
314+ origin,
294315 pathname : '/explore/project/' ,
295316 title : 'Projects - Explore'
296317 }
@@ -302,6 +323,7 @@ page(
302323 } ,
303324 {
304325 description : 'Explore recent releases in the unified ecosystem' ,
326+ origin,
305327 pathname : '/explore/release/' ,
306328 title : 'Releases - Explore'
307329 }
@@ -316,6 +338,7 @@ for (const [d, p] of Object.entries(data.projectByRepo)) {
316338 } ,
317339 {
318340 description,
341+ origin,
319342 pathname : '/explore/project/' + d + '/' ,
320343 tags : [ ...topics ] ,
321344 title : d
@@ -330,7 +353,7 @@ for (const [d, pack] of Object.entries(data.packageByName)) {
330353
331354 tasks . push ( async function ( ) {
332355 const file = await read ( input )
333- const meta = { description, pathname, tags : keywords , title : d }
356+ const meta = { description, origin , pathname, tags : keywords , title : d }
334357
335358 file . data = { meta, repo}
336359 const inputTree = readmePipeline . parse ( file )
@@ -346,6 +369,7 @@ page(
346369 } ,
347370 {
348371 description : 'Get involved, meet the team, and support us' ,
372+ origin,
349373 pathname : '/community/' ,
350374 title : 'Community'
351375 }
@@ -357,6 +381,7 @@ page(
357381 } ,
358382 {
359383 description : 'Meet the team maintaining unified' ,
384+ origin,
360385 pathname : '/community/member/' ,
361386 title : 'Team - Community'
362387 }
@@ -368,6 +393,7 @@ page(
368393 } ,
369394 {
370395 description : 'Support unified by becoming a sponsor' ,
396+ origin,
371397 pathname : '/community/sponsor/' ,
372398 title : 'Sponsor - Community'
373399 }
@@ -379,6 +405,7 @@ page(
379405 } ,
380406 {
381407 description : 'Showcase of interesting use cases of unified' ,
408+ origin,
382409 pathname : '/community/case/' ,
383410 title : 'Showcase - Community'
384411 }
0 commit comments