Merge pull request #64 from opdavies/update-sculpin

Update Sculpin

Fixes #61
This commit is contained in:
Oliver Davies 2019-04-10 22:13:29 +01:00 committed by GitHub
commit 6aa1b01f77
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 678 additions and 350 deletions

View file

@ -13,7 +13,7 @@ class SculpinKernel extends AbstractKernel
/**
* {@inheritdoc}
*/
protected function getAdditionalSculpinBundles()
protected function getAdditionalSculpinBundles(): array
{
return [
SculpinContentGeneratorBundle::class,

View file

@ -7,12 +7,12 @@
"test": "phpunit"
},
"require": {
"php": "^5.5|^7.0",
"php": "^7.2",
"dflydev/embedded-composer": "^1.0@dev",
"josephlavin/tap": "^1.0",
"opdavies/sculpin-gist-embed-bundle": "^0.1",
"opdavies/sculpin-twig-markdown-bundle": "^0.1",
"sculpin/sculpin": "^2.1@dev",
"sculpin/sculpin": "^3",
"tsphethean/sculpin-related-posts-bundle": "~0.1.0",
"wikimedia/composer-merge-plugin": "^1.4"
},

990
composer.lock generated

File diff suppressed because it is too large Load diff

View file

@ -69,7 +69,7 @@ talks:
The Twig layout:
```language-twig
{% raw -%}
{% verbatim -%}
{% for talk in talks|reverse if talk.date >= now %}
{# Upcoming talks #}
{% endfor %}
@ -77,7 +77,7 @@ The Twig layout:
{% for talk in talks if talk.date < now %}
{# Previous talks #}
{% endfor%}
{%- endraw %}
{%- endverbatim %}
```
I also didnt want to have to push an empty commit or manually trigger a job in Jenkins after doing a talk in order for it to be positioned in the correct place on the page, so I also wanted Jenkins to schedule a regular build regardless of whether or not code had been pushed, so ensure that my talks page would be up to date.

View file

@ -50,7 +50,7 @@ Before:
<div v-pre markdown="1">
```language-twig
{% raw %}{{ filter.isArchive ? 'true' : 'false' }}{% endraw %}
{% verbatim %}{{ filter.isArchive ? 'true' : 'false' }}{% endverbatim %}
```
</div>
@ -58,7 +58,7 @@ After:
<div v-pre markdown="1">
```language-twig
{% raw %}{{ filter.isArchive|boolean_string }}{% endraw %}
{% verbatim %}{{ filter.isArchive|boolean_string }}{% endverbatim %}
```
</div>

View file

@ -61,7 +61,7 @@ export default {
`src/components/Welcome.vue`:
<div v-pre markdown="1">{% raw %}
<div v-pre markdown="1">{% verbatim %}
```vuejs
<template>
<div>
@ -163,7 +163,7 @@ export default {
}
</script>
```
{% endraw %}</div>
{% endverbatim %}</div>
## Making it responsive
@ -191,7 +191,7 @@ I also moved the links into `data` too - each link is its own object with it'
`src/components/MainMenu.vue`:
{% raw %}<div v-pre markdown="1">
{% verbatim %}<div v-pre markdown="1">
```vuejs
<template>
<div>
@ -275,7 +275,7 @@ I also moved the links into `data` too - each link is its own object with it'
}
</script>
```
</div>{% endraw %}
</div>{% endverbatim %}
## The result

View file

@ -54,7 +54,7 @@ The `v-cloak` directive exists on an element until Vue finishes compiling, after
In my `base.html.twig` template, Ive added `v-cloak` to the wrapper div within the `body`.
{% raw %}<div v-pre markdown="1">
{% verbatim %}<div v-pre markdown="1">
```twig
<body class="font-sans leading-normal">
<div id="app" v-cloak>
@ -62,11 +62,11 @@ In my `base.html.twig` template, Ive added `v-cloak` to the wrapper div withi
</div>
</body>
```
</div>{% endraw %}
</div>{% endverbatim %}
Within my `navbar.html.twig` partial, I have a placeholder div that also contains the site name, which is instantly visible but has the `v-cloak-block` class so its hidden once Vue has compiled and the `Navbar` Vue component is visible instead.
{% raw %}<div v-pre markdown="1">
{% verbatim %}<div v-pre markdown="1">
```twig
<div class="border-bottom border-b border-gray-300 mb-6">
<div class="container mx-auto">
@ -81,7 +81,7 @@ Within my `navbar.html.twig` partial, I have a placeholder div that also contain
</div>
</div>
```
</div>{% endraw %}
</div>{% endverbatim %}
I was originally surprised that these classes werent included as part of Tailwind or as part of an existing plugin, but as Ive already used these styles on several projects that include Vue.js with Symfony or Sculpin, it made sense to extract it into a plugin and make it available as a npm package which I can easily add to any project - as well as making it easier to maintain if I need to add additional variations at a later point.

View file

@ -52,7 +52,7 @@ In the first version, every link was individually styled which resulted in a lot
I added a `style` section within `Welcome.vue`, and added some default styling for links based on their location on the page - [extracting some Tailwind components](https://tailwindcss.com/docs/extracting-components).
<div v-pre markdown="1">{% raw %}
<div v-pre markdown="1">{% verbatim %}
```vuejs
<template>
...
@ -104,7 +104,7 @@ Within the `style` section, Im able to use Tailwinds custom `@apply` direc
@apply border-none
</style>
```
{% endraw %}</div>
{% endverbatim %}</div>
## Extracting a Vue component for Drupal blocks

View file

@ -1,5 +1,5 @@
---
title: Drupal 8: Rejoining the Herd
title: 'Drupal 8: Rejoining the Herd'
description: A talk highlighting some of the recent technical and non-technical changes in Drupal 8.
tags: [conference, php, drupal, drupal-8]
speakerdeck:

View file

@ -1,5 +1,5 @@
---
title: Drupal.org in 2015: What's Coming Next
title: "Drupal.org in 2015: What's Coming Next"
description: A retrospective of the Drupal Associations work in 2014 and a look forward to what well be working on in 2015.
tags: [conference, drupalcamp, drupalcamp-london, drupal-association]
speakerdeck: