Bladeren bron

Update Stasis version and add GraphQL example

master
Jonas Duri 1 jaar geleden
bovenliggende
commit
73078fb17a
10 gewijzigde bestanden met toevoegingen van 226 en 19 verwijderingen
  1. +29
    -9
      package-lock.json
  2. +1
    -1
      package.json
  3. +32
    -0
      src/graphql/index.js
  4. +6
    -4
      src/layouts/base.hbs
  5. +6
    -3
      src/layouts/blog-archive.hbs
  6. +70
    -0
      src/pages/blog/hello-universe.md
  7. +62
    -1
      src/pages/blog/hello-world.md
  8. +11
    -1
      src/pages/blog/index.md
  9. +8
    -0
      src/pages/index.md
  10. +1
    -0
      stasis.config.json

+ 29
- 9
package-lock.json Bestand weergeven

@@ -879,6 +879,11 @@
"@types/node": "*"
}
},
"@types/graphql": {
"version": "14.0.7",
"resolved": "https://registry.npmjs.org/@types/graphql/-/graphql-14.0.7.tgz",
"integrity": "sha512-BoLDjdvLQsXPZLJux3lEZANwGr3Xag56Ngy0U3y8uoRSDdeLcn43H3oBcgZlnd++iOQElBpaRVDHPzEDekyvXQ=="
},
"@types/lodash": {
"version": "4.14.121",
"resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.14.121.tgz",
@@ -3535,9 +3540,9 @@
"integrity": "sha512-3t6rVToeoZfYSGd8YoLFR2DJkiQrIiUrGcjvFX2mDw3bn6k2OtwHN0TNCLbBO+w8qTvimhDkv+LSscbJY1vE6w=="
},
"get-port": {
"version": "4.1.0",
"resolved": "https://registry.npmjs.org/get-port/-/get-port-4.1.0.tgz",
"integrity": "sha512-4/fqAYrzrzOiqDrdeZRKXGdTGgbkfTEumGlNQPeP6Jy8w0PzN9mzeNQ3XgHaTNie8pQ3hOUkrwlZt2Fzk5H9mA=="
"version": "4.2.0",
"resolved": "https://registry.npmjs.org/get-port/-/get-port-4.2.0.tgz",
"integrity": "sha512-/b3jarXkH8KJoOMQc3uVGHASwGLPq3gSFJ7tgJm2diza+bydJPTGOibin2steecKeOylE8oY2JERlVWkAJO6yw=="
},
"get-stdin": {
"version": "4.0.1",
@@ -3610,6 +3615,14 @@
"unicode-trie": "^0.3.1"
}
},
"graphql": {
"version": "14.1.1",
"resolved": "https://registry.npmjs.org/graphql/-/graphql-14.1.1.tgz",
"integrity": "sha512-C5zDzLqvfPAgTtP8AUPIt9keDabrdRAqSWjj2OPRKrKxI9Fb65I36s1uCs1UUBFnSWTdO7hyHi7z1ZbwKMKF6Q==",
"requires": {
"iterall": "^1.2.2"
}
},
"gray-matter": {
"version": "4.0.2",
"resolved": "https://registry.npmjs.org/gray-matter/-/gray-matter-4.0.2.tgz",
@@ -4691,6 +4704,11 @@
"resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz",
"integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8="
},
"iterall": {
"version": "1.2.2",
"resolved": "https://registry.npmjs.org/iterall/-/iterall-1.2.2.tgz",
"integrity": "sha512-yynBb1g+RFUPY64fTrFv7nsjRrENBQJaX2UL+2Szc9REFrSNm1rpSXHGzhmAy7a9uv3vlvgBlXnf9RqmPH1/DA=="
},
"js-base64": {
"version": "2.5.1",
"resolved": "https://registry.npmjs.org/js-base64/-/js-base64-2.5.1.tgz",
@@ -5447,9 +5465,9 @@
}
},
"node-releases": {
"version": "1.1.8",
"resolved": "https://registry.npmjs.org/node-releases/-/node-releases-1.1.8.tgz",
"integrity": "sha512-gQm+K9mGCiT/NXHy+V/ZZS1N/LOaGGqRAAJJs3X9Ah1g+CIbRcBgNyoNYQ+SEtcyAtB9KqDruu+fF7nWjsqRaA==",
"version": "1.1.9",
"resolved": "https://registry.npmjs.org/node-releases/-/node-releases-1.1.9.tgz",
"integrity": "sha512-oic3GT4OtbWWKfRolz5Syw0Xus0KRFxeorLNj0s93ofX6PWyuzKjsiGxsCtWktBwwmTF6DdRRf2KreGqeOk5KA==",
"requires": {
"semver": "^5.3.0"
}
@@ -7713,15 +7731,16 @@
"integrity": "sha512-ji9qxRnOVfcuLDySj9qzhGSEFVobyt1kIOSkj1qZzYLzq7Tos/oUUWvotUPQLlrsidqsK6tBH89Bc9kL5zHA6w=="
},
"stasis-generator": {
"version": "0.0.5",
"resolved": "https://registry.npmjs.org/stasis-generator/-/stasis-generator-0.0.5.tgz",
"integrity": "sha512-4O0PahkCdRU7AAyvlDdQNmwx3nlhrAf6osIoIRDoqpyXlYdCeHIVHnYPthCHqMviQXRLMWoWDjzapXgLoHsdmA==",
"version": "0.1.0",
"resolved": "https://registry.npmjs.org/stasis-generator/-/stasis-generator-0.1.0.tgz",
"integrity": "sha512-4dfUNWEyy5DrO5/RTYPBsyyxetw0IpfSym3szHlAtat9dbCEZbpSLAqLpP3NGF/uUFJKIWVh4QZui3ZF81/6zQ==",
"requires": {
"@types/chokidar": "^1.7.5",
"@types/fs-extra": "^5.0.4",
"@types/fs-extra-promise": "^1.0.7",
"@types/get-port": "^4.0.1",
"@types/glob": "^7.1.1",
"@types/graphql": "^14.0.7",
"@types/lodash": "^4.14.121",
"@types/node": "^11.9.0",
"@types/opn": "^5.1.0",
@@ -7733,6 +7752,7 @@
"fs-extra-promise": "^1.0.1",
"get-port": "^4.1.0",
"glob": "^7.1.3",
"graphql": "^14.1.1",
"gray-matter": "^4.0.2",
"handlebars": "^4.1.0",
"lodash": "^4.17.11",


+ 1
- 1
package.json Bestand weergeven

@@ -29,6 +29,6 @@
"sass": "^1.17.2"
},
"dependencies": {
"stasis-generator": "0.0.5"
"stasis-generator": "^0.1.0"
}
}

+ 32
- 0
src/graphql/index.js Bestand weergeven

@@ -0,0 +1,32 @@
module.exports = {
createSchema: (pages, config) => {
return `
type Query {
pageByIndex(index: Int!): Page
pageByTitle(title: String!): Page
pages: [Page]
posts: [Page]
}
type Page {
html: String
frontmatter: Frontmatter
excerpt: String
relativePath: String
active: Boolean
}
type Frontmatter {
title: String
date: String
layout: String
}
`
} ,
createRoot: (pages, config) => {
return {
pages: () => pages,
pageByIndex: args => pages[args.index],
pageByTitle: args => pages.filter(p => p.frontmatter.tile === args.title),
posts: args => pages.filter(p => p.frontmatter.type === 'blog')
}
}
}

+ 6
- 4
src/layouts/base.hbs Bestand weergeven

@@ -20,10 +20,12 @@
</nav>
</div>
<main>
<p>Loop over all your pages using the `pages` variable inside your templates</p>
<pre>
{{json pages}}
</pre>
<h1>Loop over all your pages using GraphQL</h1>
<ul>
{{#each this.query.data.pages}}
<li><a href="{{this.relativePath}}">{{this.frontmatter.title}}</a></li>
{{/each}}
</ul>
</main>
</div>
</body>

+ 6
- 3
src/layouts/blog-archive.hbs Bestand weergeven

@@ -21,10 +21,13 @@
</nav>
</div>
<main>
<div>
{{{body}}}
</div>
<ol class="terminal-toc">
{{#each pages}}
<li><a href="{{this.relativePath}}">{{this.meta.title}}</a></li>
{{/each}}
{{#each this.query.data.posts}}
<li><a href="{{this.relativePath}}">{{this.frontmatter.title}}</a></li>
{{/each}}
</ol>
</main>
</div>


+ 70
- 0
src/pages/blog/hello-universe.md Bestand weergeven

@@ -0,0 +1,70 @@
---
layout: blog
title: Hello Universe
type: blog
---

## Hello Universe.

Lorem markdownum Ulixem non animam relicta, mite pectus: **a** quam cupidine
clausa undae, nec quid sonuere sedes. Inhaerebat nudaque flammaque exclamant
nostrum servata optandi caput illo attollens comes sollertia unxit descendat,
Helenamque crebros obruta male. Saeviat et flammis accipe sedibus nervis
spolioque in molem *reparabile sulco* et brevi, et et, pro caedis. Ex te, rerum
ab cecinisse totas timeto reccidat tantumque *quoque dominoque* venti.

- Quassasque in servat cernitis cernentem extremas
- Fieri laetitiae undis
- Aqua aurea laetis invidiosus inculpata
- Armo traherent Hectore deos rursus

In in *rogum colebat*, est noxque vetustas pariter reticere, et tempora et
frustra extemplo. Dixere movit meta terrae [sopistis
est](http://mansura-nostraque.net/gurgitefelixque.php); lustrat regni, destituit
lacrimas propiore noctes animus poenas concurrere.

## Et solebat missa dubitet mea tam

Indice siccis vestrum dum manifesta arsit stimuletur utinam guttura recentes.
Meum praecingitur nurus?

Unus flammis pater. Est possit Achille ponitque adspicias temeraria terrent
sororis capiti.

## Premebat plura nostris nova cum infirmos mihi

Fuso pubis tollere ripae ponti res protinus, frustra [amat](http://www.una.io/),
potiturque. Metus quam flammas manu Triptolemus ante: mitis casusque sacrilega
deprendit contra stipe; hasta agmen quamquam? Deflent luminibus Numici ab
remissis iacentem sonantia.

Quae tulit dea, *pecudis nos* medias fastigia, veste. Fecit medio virgam pecoris
tamen: si [nurusque iuvabat](http://gavisus.com/) tu effugit calido Calydonius
Subaris inexpugnabile his.

if (zeroDbmsIntellectual == e_netbios) {
tutorialScareware -= nanometer_processor_finder / yahooHocWpa(
personal_virus, mirrored);
default_ide_intranet += lanDaemon + 2;
big_bar_banner.data_dial(mail(pipeline_domain_smm, 1,
virus_yottabyte_backup), disk_visual_wep.ruby_parallel(
lossless_io_internic));
} else {
megabyte_storage_matrix.module = nntp - logic_lpi_drive;
telecommunications.cpm.isp(-3);
}
if (bank(bit_code - 5, error_computer_stack)) {
wordConstant(diskMacStorage(google_aiff_circuit), word.standby(dpi,
copy_document_definition, 1), e_wireless - bittorrent);
} else {
cd(start, -5);
gps_disk_orientation += spider;
blob.software += 2;
}
var friend = characterScraping + partition_analyst;

Rettulit repetunt natus. Sic feris me vultus, e veribus ignaro, Hecaten in hanc,
cum cognoscenda. Quotiens sonum, o respicit est Aeneae venerat io solvit vesica.
Premunt respice violenta *animoque locum* inguinibus habebat summa suos aurum
opacas dives pharetratae Ixione essent. *Non nostri damnans* pondus cum possent
est.

+ 62
- 1
src/pages/blog/hello-world.md Bestand weergeven

@@ -1,7 +1,68 @@
---
layout: blog
title: Hello World
type: blog
---

## Hello world.
This is an example blog post.

Lorem markdownum spumisque sponte Aurora, si luminis dilexit sub pello harena,
nec, colebatur hausi obvertere illa. Dum Pelion, ictu impetus, fores coniunctior
rogat, laude. Leto fortuna, si lactentem illa natura tam; adhuc *villo
cruentior* eratis. Gradive iuvenum. Huc exaudi testis vindexque mundum.

var fat = mashup_lpi_boot(io, rippingGpuAddress);
resources.troubleshooting(page_publishing_motherboard.data(soundFile, plugXp
- idePhpInterface, internic));
if (multicasting) {
p_system(gigo + textCybersquatterDeprecated, cable.compiler(tween_dbms,
bar_system_capacity));
} else {
servletFile = 2;
}
var key = vle_halftone_android;
if (rdf_pharming(ip_pci_card, compression + avatarJfs, remote_biometrics)) {
formatUpload += cd_wysiwyg_module;
samba_unit_smartphone = native;
hashtag_ipx.newbie_printer_spider(post_view(memory_repeater));
} else {
desktop += -4;
barAd += 4 - banner + rjNetiquetteHard.android(nasRom, irq);
number_art_pseudocode(aiff_web, tagSliLogic);
}

## Umeris sine

Contemptor subitae ortus precor illa, deorum accipe? In epulis ab pietas putat,
ab **addunt** a dicta undam atque mentem decursa Paeonis.

Pedesque gemma ab Cassiope caedit admota. Montes bracchia securae Atlantiades
adde pectusque. Sed maris quoque, est magis hominesque tenebat ignes ornant:
casus lapsa promunturiumque pervenit se cumque pudorem!

## Tum donavi tetigit Phineu procul

Rursus hinc, ut latoque segetes deme invideatis potest igne tactis Actaea dabat
erat orbus hi numinis resistunt falsa obscenas. Vitreis suspiria, monitis
nomina, veniat. Lapsasque gratus tremit ima viget diximus paulatim undis colorem
subnixa **subposuisse cruciata** tantum se serae habenas. Negare in alis, ire
huc!

## Ferebat generosos lustrat concipias genuisse humus iaculum

Elimat dominasque avenis virgo meos rogabat nullam novissima hostes, et
harundine tamen; crudelis subita quam, **acu credere**. Saepe in iaculis quoque
ait est inter suam fontana lancea foret? Tenentem ab laeta; est postquam tura
hactenus pascua certis, litora.

## Est putat instabat et copia liquitur occubuisse

Retinet laudibus modo tristia adveniens angue mersitque resolvit perque tardae.
Arma imoque, matris sive modo **pedibus**!

Lumina egredere et virgo obliquis, *vita* chlamydem augebat secus id mediusve:
ferunt mortuaque urbe tuae scopulis officiis. A num matrem glaebam Cyllaron
lanificae ova prius adfixa uda specus seque cunas aut navale causa Tyrrhenaque
ambo; oblitis. Secum favorque sustinui manus. Sociati filia exstat temptat
refugit vero, et a coniunx intres. Virgineo additus mutatis ausorum; ipsa, ora
dixisse mutavit, sceleri!

+ 11
- 1
src/pages/blog/index.md Bestand weergeven

@@ -1,4 +1,14 @@
---
layout: blog-archive
title: All Blog Posts
---
query: '{
posts {
frontmatter {
title
}
relativePath
}
}'
---

## All blog post

+ 8
- 0
src/pages/index.md Bestand weergeven

@@ -1,6 +1,14 @@
---
layout: base
title: Stasis Basic Example
query: '{
pages {
frontmatter {
title
}
relativePath
}
}'
---

# Hello World

+ 1
- 0
stasis.config.json Bestand weergeven

@@ -3,6 +3,7 @@
"publicPath": "dist",
"assetsPath": "assets",
"staticPath": "static",
"graphQlPath": "graphql",
"entryAssets": [
"**/*"
]

Laden…
Annuleren
Opslaan