Start post tidy

This commit is contained in:
Oliver Davies 2017-12-10 23:38:49 +00:00
parent ccb97c0eff
commit ff05c587cd
10 changed files with 17 additions and 66 deletions

View file

@ -3,12 +3,8 @@ title: Drupal VM Generator 2.9.1 Released
tags: ['drupal-vm-generator', releases]
use: [posts]
---
{% block excerpt %}
I spent some time yesterday working on the [Drupal VM Generator][0], and have released versions 2.8.1, 2.9.0 and 2.9.1.
{% endblock %}
{% block content %}
I spent some time yesterday working on the [Drupal VM Generator][0], and have released versions 2.8.1, 2.9.0 and 2.9.1.
<!-- split -->
The main updates are:
@ -21,7 +17,6 @@ The main updates are:
Currently the project is based on Drupal VM 3.0.0 which is an outdated version ([4.1.0][3] was released today). Adding updates and supporting the newer versions is a high priority, as well as keeping in sync with new releases. This will be easier with the test suite in place.
My initial thoughts are that version 2.10.0 will support Drupal VM 4.0.0, and if needed, 2.11.0 will ship shortly afterwards and support Drupal VM 4.1.0.
{% endblock %}
[0]: http://www.drupalvmgenerator.com
[1]: https://github.com/opdavies/drupal-vm-generator/tree/master/tests/Command

View file

@ -31,6 +31,7 @@ Here are the scripts that Im using - they are slightly different from those i
```
Run with `composer run <name>`, e.g. `composer run dev`.
### package.json
```language-json

View file

@ -3,12 +3,8 @@ title: Nginx Redirects With Query String Arguments
tags: [nginx]
use: [posts]
---
{% block excerpt %}
This is an example of how my Nginx configuration looked to redirect from an old domain to a new one, and also to redirect from the root `example.com` domain to the canonical `www` subdomain.
{% endblock %}
{% block content %}
This is an example of how my Nginx configuration looked to redirect from an old domain to a new one, and also to redirect from the root `example.com` domain to the canonical `www` subdomain.
<!-- split -->
```language-nginx
server {
@ -48,4 +44,3 @@ Here is an demo of it working on this website:
- [Query string](https://en.wikipedia.org/wiki/Query_string)
- [Nginx ngx_http_core_module](http://nginx.org/en/docs/http/ngx_http_core_module.html)
{% endblock %}

View file

@ -13,6 +13,7 @@ Recently, I reviewed [a patch][1] in the [Override Node Options][2] module issue
It was quite an old issue and the latest patch needed to be re-rolled due to merge conflicts, but the existing tests still passed. Though as no new tests were added for the new functionality, these needed to be added before I committed it.
This post documents the steps that I took to update the tests to add the proposed functionality.
<!-- split -->
## Reviewing the Existing Tests

View file

@ -15,24 +15,15 @@ meta:
type: website
slug: drupalcamp-bristol-early-bird-tickets-sessions-sponsors
---
{% block intro_image %}
<img src="/assets/images/blog/drupalcamp-bristol-17-logo.jpg" alt="DrupalCamp Bristol 2017 logo">
{% endblock %}
<p class="text-center" markdown="1">![DrupalCamp Bristol 2017 logo](/assets/images/blog/drupalcamp-bristol-17-logo.jpg)</p>
{% block excerpt %}
In less than two months time, [DrupalCamp Bristol][0] will be back for our third year! (July seems to come around quicker each year). This is this years schedule and venues:
+ 30th June - CXO (Business) day - [Watershed][1]
+ 1st July - Developer conference - [University of Bristol, School of Chemistry][2]
+ 2nd July - Contribution sprints - Venue TBC
{% endblock %}
{% block content %}
In less than two months time, [DrupalCamp Bristol][0] will be back for our third year! (July seems to come around quicker each year). This is this years schedule and venues:
+ 30th June - CXO (Business) day - [Watershed][1]
+ 1st July - Developer conference - [University of Bristol, School of Chemistry][2]
+ 2nd July - Contribution sprints - Venue TBC
<!-- split -->
Today we announced [Emma Karayiannis][3] as our Saturday keynote speaker, and well be announcing some of the other speakers later this week.
@ -45,7 +36,6 @@ Not bought your tickets yet? [Early bird tickets][10] for the CXO and conference
We still have [sponsorships opportunities][6] available (big thanks to [Microserve][7], [Deeson][8] and [Proctors][9]) who have already signed up), but be quick if you want to be included in our brochure so that we can get you added before our print deadline! Without our sponsors, putting on this event each year would not be possible.
Any other questions? Take a look at [our website][0] or get in touch via [Twitter][5] or [email][11].
{% endblock %}
[0]: https://2017.drupalcampbristol.co.uk
[1]: http://www.watershed.co.uk

View file

@ -7,20 +7,12 @@ tags:
- features
slug: turning-drupal-module-into-feature
---
{% block excerpt %}
Yesterday I was fixing a bug in an inherited Drupal 7 custom module, and I decided that I was going to add some tests to ensure that the bug was fixed and doesnt get accidentially re-introduced in the future. The test though required me to have a particular content type and fields which are specific to this site, so werent present within the standard installation profile used to run tests.
I decided to convert the custom module into a [Feature][0] so that the content type and its fields could be added to it, and therefore present on the testing site once the module is installed.
To do this, I needed to expose the module to the Features API.
{% endblock %}
{% block content %}
Yesterday I was fixing a bug in an inherited Drupal 7 custom module, and I decided that I was going to add some tests to ensure that the bug was fixed and doesnt get accidentially re-introduced in the future. The test though required me to have a particular content type and fields which are specific to this site, so werent present within the standard installation profile used to run tests.
I decided to convert the custom module into a [Feature][0] so that the content type and its fields could be added to it, and therefore present on the testing site once the module is installed.
To do this, I needed to expose the module to the Features API.
<!-- split -->
All thats needed is to add this line to the `mymodule.info` file:
@ -31,6 +23,5 @@ features[features_api][] = api:2
After clearing the cache, the module is now visible in the Features list - and ready to have the appropriate configuration added to it.
!['The features list showing the custom module'](/assets/images/blog/custom-module-as-a-feature.png)
{% endblock %}
[0]: https://www.drupal.org/project/features

View file

@ -4,21 +4,14 @@ tags:
- twitter
- php
---
{% block intro_image %}
<img src="/assets/images/blog/drupal-meetups-twitterbot.png" alt="" class="is-centered">
{% endblock %}
<p class="text-center" markdown="1">![](/assets/images/blog/drupal-meetups-twitterbot.png)</p>
{% block excerpt %}
The [Drupal Meetups Twitterbot][0] is a small project that I worked on a few months ago, but hadn't got around to promoting yet. Its intention is to provide [one Twitter account][1] where people can get the up to date news from various Drupal meetups.
{% endblock %}
{% block content %}
The [Drupal Meetups Twitterbot][0] is a small project that I worked on a few months ago, but hadn't got around to promoting yet. Its intention is to provide [one Twitter account][1] where people can get the up to date news from various Drupal meetups.
<!-- split -->
It works by having a whitelist of [Twitter accounts and hashtags][2] to search for, uses [Codebird][3] to query the Twitter API and retweets any matching tweets on a scheduled basis.
If you would like your meetup group to be added to the list of searched accounts, please [open an issue][4] on the GitHub repo.
{% endblock %}
[0]: https://github.com/opdavies/drupal-meetups-twitterbot
[1]: https://twitter.com/drupal_meetups

View file

@ -10,20 +10,12 @@ meta:
height: 200
width: 451
---
{% block intro_image %}
<img src="/assets/images/blog/jackson-octocat.png" alt="">
{% endblock %}
<p class="text-center" markdown="1">![](/assets/images/blog/jackson-octocat.png)</p>
{% block excerpt %}
Earlier this week I moved this site from my personal Linode server to [GitHub Pages][0].
This made sense as I already kept the source code in [on GitHub][1], the issue was that GitHub Pages doesnt know how to dynamically parse and generate a Sculpin site like it does with some other static site generators. It can though parse and serve HTML files, which is what Sculpin generates. Its just a case of how those files are added to GitHub.
{% endblock %}
{% block content %}
Earlier this week I moved this site from my personal Linode server to [GitHub Pages][0].
This made sense as I already kept the source code in [on GitHub][1], the issue was that GitHub Pages doesnt know how to dynamically parse and generate a Sculpin site like it does with some other static site generators. It can though parse and serve HTML files, which is what Sculpin generates. Its just a case of how those files are added to GitHub.
<!-- split -->
Ive seen different implementations of this, mostly where the Sculpin code is on one branch, and the generated HTML code is on a separate `gh-pages` or `master` branch (depending on your repository name). Im not fond of this approach as it means automatically checking out and merging branches which can get messy, and also its weird to look at a repos branches page and see one branch maybe tens or hundreds of commits both ahead and behind the default branch.
@ -82,7 +74,6 @@ As the site was previously using HTTPS, I didnt want to have to go back to HT
- [Publishing your GitHub Pages site from a /docs folder on your master branch][2]
- [Bypassing Jekyll on GitHub Pages][5]
- [Secure and fast GitHub Pages with CloudFlare][6]
{% endblock %}
[0]: https://pages.github.com
[1]: https://github.com/opdavies/oliverdavies.uk

View file

@ -14,17 +14,10 @@ meta:
height: 1440
type: image/png
---
<p class="text-center" markdown="1">![](/assets/images/blog/drupalcamp-dublin.jpg)</p>
{% block intro_image %}
<img alt="" src="{{ site.images_url }}/assets/images/blog/drupalcamp-dublin.jpg">
{% endblock %}
{% block excerpt %}
I recently gave a [talk on automated testing in Drupal][0] talk at [DrupalCamp Dublin][1] and as a lunch and learn session for my colleagues at Microserve. As part of the talk, I gave an example of how to build a Drupal 8 module using a test driven approach. Ive released the [module code on GitHub][2], and this post outlines the steps of the process.
{% endblock %}
{% block content %}
I recently gave a [talk on automated testing in Drupal][0] talk at [DrupalCamp Dublin][1] and as a lunch and learn session for my colleagues at Microserve. As part of the talk, I gave an example of how to build a Drupal 8 module using a test driven approach. Ive released the [module code on GitHub][2], and this post outlines the steps of the process.
<!-- split -->
## Prerequisites
@ -581,7 +574,6 @@ They all pass, so we be confident that the code works as expected, we can contin
## Next Steps
Ive started looking into whether some of the tests can be rewritten as kernel tests, which should result in quicker test execution. I will post any updated code to the [GitHub repository][3], and will also do another blog post highlighting the differences between functional and kernel tests and the steps taken to do the conversion.
{% endblock %}
[0]: {{site.url}}/talks/tdd-test-driven-drupal
[1]: http://2017.drupal.ie

View file

@ -21,11 +21,13 @@ use: [posts]
{% if post.blocks.excerpt %}
{{ post.blocks.excerpt|raw }}
{% elseif '<!-- split -->' in post.blocks.content %}
{{ post.blocks.content|split('<!-- split -->')|first|raw }}
{% else %}
<p>{{ post.blocks.content|raw|striptags|split(' ')|slice(0,50)|join(' ')|replace({ 'h2': 'h3' }) }} &hellip;</p>
{% endif %}
<a href="{{ post.url }}">Read more &rarr;</a>
<p><a href="{{ post.url }}">Read more &rarr;</a></p>
</li>
{% endfor %}
</ul>