Remove split, use excerpt block
This commit is contained in:
parent
aaa72e2186
commit
0858c7b6d5
|
@ -3,9 +3,11 @@ 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.
|
||||
<!-- split -->
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
The main updates are:
|
||||
|
||||
- Fixed an `InvalidResponseException` that was thrown from within the `boolean_as_string` Twig filter from the opdavies/twig-extensions library when the `config:generate` command was run in non-interactive mode.
|
||||
|
@ -17,6 +19,7 @@ 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
|
||||
|
|
|
@ -3,9 +3,11 @@ 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.
|
||||
<!-- split -->
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
```language-nginx
|
||||
server {
|
||||
listen 80;
|
||||
|
@ -44,3 +46,4 @@ 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 %}
|
||||
|
|
|
@ -8,13 +8,15 @@ tags:
|
|||
date: 2017-05-05
|
||||
draft: true
|
||||
---
|
||||
{% block excerpt %}
|
||||
Recently, I reviewed [a patch][1] in the [Override Node Options][2] module issue queue. For those not familiar with it, the module adds extra permissions for node options like "authored by" and "published on" which are normally only available to users with the `administer nodes` permission. What the patch does is to optionally add another set of permissions that enable options for all content types - e.g. "override published option for all node types", in addition to or instead of the content type specific ones.
|
||||
|
||||
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 -->
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
## Reviewing the Existing Tests
|
||||
|
||||
The first thing to do was to run the existing tests and check that they still passed. I do this on the command line by typing `php scripts/run-tests.sh --class OverrideNodeOptionsTestCase`.
|
||||
|
@ -195,6 +197,7 @@ Test run duration: 25 sec
|
|||
<img src="/assets/images/blog/override-node-options-refactor-tests-new-passing.png" alt="">
|
||||
|
||||
[Here][3] are my full changes from the previous patch, where I added the new tests as well as some small refactors.
|
||||
{% endblock %}
|
||||
|
||||
[1]: https://www.drupal.org/node/974730
|
||||
[2]: https://www.drupal.org/project/override_node_options
|
||||
|
|
|
@ -15,6 +15,7 @@ meta:
|
|||
type: website
|
||||
slug: drupalcamp-bristol-early-bird-tickets-sessions-sponsors
|
||||
---
|
||||
{% block excerpt %}
|
||||
<p class="text-center" markdown="1">![DrupalCamp Bristol 2017 logo](/assets/images/blog/drupalcamp-bristol-17-logo.jpg)</p>
|
||||
|
||||
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 year’s schedule and venues:
|
||||
|
@ -22,9 +23,9 @@ In less than two months time, [DrupalCamp Bristol][0] will be back for our third
|
|||
+ 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 %}
|
||||
|
||||
<!-- split -->
|
||||
|
||||
{% block content %}
|
||||
Today we announced [Emma Karayiannis][3] as our Saturday keynote speaker, and we’ll be announcing some of the other speakers later this week.
|
||||
|
||||
Not submitted your session yet? The [session submissions][12] are open until May 31st. We’re looking for talks not only on Drupal, but other related topics such as PHP, Symfony, server administration/DevOps, project management, case studies, being human etc. If you want to submit but want to ask something beforehand, please [send us an email][4] or ping us on [Twitter][5].
|
||||
|
@ -36,6 +37,7 @@ 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
|
||||
|
|
|
@ -7,13 +7,15 @@ 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 doesn’t 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 weren’t 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 it’s 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 -->
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
All that’s needed is to add this line to the `mymodule.info` file:
|
||||
|
||||
```language-ini
|
||||
|
@ -23,5 +25,6 @@ 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
|
||||
|
|
|
@ -4,14 +4,17 @@ tags:
|
|||
- twitter
|
||||
- php
|
||||
---
|
||||
{% block excerpt %}
|
||||
<p class="text-center" markdown="1">![](/assets/images/blog/drupal-meetups-twitterbot.png)</p>
|
||||
|
||||
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. It’s intention is to provide [one Twitter account][1] where people can get the up to date news from various Drupal meetups.
|
||||
<!-- split -->
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
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
|
||||
|
|
|
@ -10,13 +10,15 @@ meta:
|
|||
height: 200
|
||||
width: 451
|
||||
---
|
||||
{% block excerpt %}
|
||||
<p class="text-center" markdown="1">![](/assets/images/blog/jackson-octocat.png)</p>
|
||||
|
||||
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 doesn’t 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. It’s just a case of how those files are added to GitHub.
|
||||
<!-- split -->
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
I’ve 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). I’m not fond of this approach as it means automatically checking out and merging branches which can get messy, and also it’s weird to look at a repo’s branches page and see one branch maybe tens or hundreds of commits both ahead and behind the default branch.
|
||||
|
||||
This has been made simpler and tidier now that we can use a `docs` directory within the repository to serve content.
|
||||
|
@ -74,6 +76,7 @@ As the site was previously using HTTPS, I didn’t 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
|
||||
|
|
|
@ -14,11 +14,13 @@ meta:
|
|||
height: 1440
|
||||
type: image/png
|
||||
---
|
||||
{% block excerpt %}
|
||||
<p class="text-center" markdown="1">![](/assets/images/blog/drupalcamp-dublin.jpg)</p>
|
||||
|
||||
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. I’ve released the [module code on GitHub][2], and this post outlines the steps of the process.
|
||||
<!-- split -->
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
## Prerequisites
|
||||
|
||||
You have created a `core/phpunit.xml` file based on `core/phpunit.xml.dist`, and populated it with your database credentials so that PHPUnit can bootstrap the Drupal database as part of the tests. [Here is an example][5].
|
||||
|
@ -574,6 +576,7 @@ They all pass, so we be confident that the code works as expected, we can contin
|
|||
## Next Steps
|
||||
|
||||
I’ve 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
|
||||
|
|
|
@ -17,9 +17,11 @@ meta:
|
|||
height: 448
|
||||
type: image/img
|
||||
---
|
||||
{% block excerpt %}
|
||||
It’s with heavy hearts that we are announcing there won’t be a DrupalCamp Bristol 2018. The committee have looked at the amount of work required to put the camp on and the capacity we all have and the two numbers are irreconcilable.
|
||||
<!-- split -->
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
Seeing Drupalists from all over the country and from overseas come to Bristol to share knowledge and ideas is something we take pride in. The past three camps have been fantastic, but as a trend we have left it later and later to organise.
|
||||
|
||||
This year is the latest we have left to organise and we believe this is because we are all a bit fatigued right now, so it seems like a good place to stop and take stock.
|
||||
|
@ -33,3 +35,4 @@ We’ll take the gap this year to reevaluate who DrupalCamp Bristol is for and w
|
|||
The DrupalCamp Bristol organising committee
|
||||
|
||||
Tom, Ollie, Emily, Sophie, Rob, Mark
|
||||
{% endblock %}
|
||||
|
|
|
@ -21,8 +21,6 @@ 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' }) }} …</p>
|
||||
{% endif %}
|
||||
|
|
Loading…
Reference in a new issue