From 84be97413d89bfb0ca217b45f37ff0cf47b8c572 Mon Sep 17 00:00:00 2001 From: Oliver Davies Date: Sat, 22 Apr 2023 16:49:04 +0100 Subject: [PATCH] chore: fix syntax highlighting languages --- ...-taxonomy-term-multiple-nodes-using-sql.md | 8 ++-- .../adding-custom-theme-templates-drupal-7.md | 8 ++-- .../blog/automating-sculpin-jenkins.md | 12 ++--- .../blog/building-gmail-filters-in-php.md | 8 ++-- ...hecking-if-user-logged-drupal-right-way.md | 8 ++-- ...kout-specific-revision-svn-command-line.md | 4 +- .../conditional-email-addresses-webform.md | 2 +- .../configuring-the-reroute-email-module.md | 8 ++-- ...eate-better-photo-gallery-drupal-part-1.md | 16 +++---- ...eate-better-photo-gallery-drupal-part-2.md | 4 +- ...ate-better-photo-gallery-drupal-part-21.md | 2 +- ...eate-better-photo-gallery-drupal-part-3.md | 6 +-- ...reprocessor-using-omega-tools-and-drush.md | 8 ++-- ...eshow-multiple-images-using-fancy-slide.md | 2 +- .../blog/create-zen-sub-theme-using-drush.md | 4 +- ...ing-sites-drupals-domain-module-enabled.md | 4 +- .../creating-using-custom-tokens-drupal-7.md | 10 ++-- ...ustom-menu-drupal-7-theme-template-file.md | 2 +- ...it-branch-or-tag-names-your-bash-prompt.md | 10 ++-- .../blog/display-number-facebook-fans-php.md | 2 +- ...and-preprocess-functions-separate-files.md | 4 +- .../blog/dont-bootstrap-drupal-use-drush.md | 10 ++-- ...ownload-different-versions-drupal-drush.md | 8 ++-- ...-commerce-fixing-error-on-user-checkout.md | 4 +- ...easier-git-repository-cloning-insteadof.md | 4 +- ...r-sculpin-commands-composer-npm-scripts.md | 4 +- src/content/blog/entityform.md | 4 +- ...pletest-issues-inside-docker-containers.md | 10 ++-- .../blog/git-format-patch-your-friend.md | 8 ++-- ...how-add-date-popup-calendar-custom-form.md | 4 +- src/content/blog/how-create-apply-patches.md | 6 +-- ...-configure-subversion-svn-server-ubuntu.md | 30 ++++++------ ...-variables-your-drupal-settings-docksal.md | 4 +- .../include-css-fonts-using-sass-each-loop.md | 6 +-- ...onment-specific-settings-files-pantheon.md | 6 +-- ...environment-configuration-and-overrides.md | 6 +-- .../install-nomensa-media-player-drupal.md | 8 ++-- .../live-blogging-symfonylive-london-2019.md | 2 +- src/content/blog/minimum-core-version.md | 8 ++-- .../blog/my-sublime-text-2-settings.md | 4 +- .../nginx-redirects-query-string-arguments.md | 6 +-- .../blog/null-users-system-users-drupal.md | 6 +-- ...en-sublime-text-2-mac-os-x-command-line.md | 2 +- ...isplaying-text-files-within-web-browser.md | 2 +- ...lishing-sculpin-sites-with-github-pages.md | 2 +- ...ckest-way-install-sublime-text-2-ubuntu.md | 2 +- ...ly-apply-patches-using-git-curl-or-wget.md | 4 +- ...default-theme-vuejs-tailwind-css-part-2.md | 8 ++-- ...rupals-default-theme-vuejs-tailwind-css.md | 4 +- .../running-drupal-88-symfony-local-server.md | 2 +- ...simplifying-drupal-migrations-xautoload.md | 10 ++-- src/content/blog/some-useful-git-aliases.md | 2 +- .../splitting-new-drupal-project-from-repo.md | 2 +- ...al-6s-taxonomy-lists-php-css-and-jquery.md | 8 ++-- .../blog/testing-tailwind-css-plugins-jest.md | 4 +- .../turning-drupal-module-into-feature.md | 2 +- ...-features-adding-components-using-drush.md | 2 +- .../blog/updating-forked-github-repos.md | 4 +- .../updating-override-node-options-tests.md | 16 +++---- ...essions-search-replace-coda-or-textmate.md | 4 +- ...e-sass-and-compass-drupal-7-using-sassy.md | 6 +-- ...g-pcss-extension-postcss-webpack-encore.md | 2 +- ...eloping-locally-stage-file-proxy-module.md | 4 +- .../using-tailwind-css-your-drupal-theme.md | 6 +-- .../blog/writing-info-file-drupal-7-theme.md | 2 +- ...odule-using-test-driven-development-tdd.md | 46 +++++++++---------- src/content/daily-email/2022-12-10.md | 2 +- src/content/daily-email/2023-04-15.md | 2 +- 68 files changed, 215 insertions(+), 215 deletions(-) diff --git a/src/content/blog/add-taxonomy-term-multiple-nodes-using-sql.md b/src/content/blog/add-taxonomy-term-multiple-nodes-using-sql.md index 1993649e..7b9ca026 100644 --- a/src/content/blog/add-taxonomy-term-multiple-nodes-using-sql.md +++ b/src/content/blog/add-taxonomy-term-multiple-nodes-using-sql.md @@ -32,7 +32,7 @@ database. Then, using [Sequel Pro](http://www.sequelpro.com), I ran the following SQL query to give me a list of Blog posts on my site - showing just their titles and nid values. -```language-sql +```sql SELECT title, nid FROM node WHERE TYPE = 'blog' ORDER BY title ASC; ``` @@ -40,7 +40,7 @@ I made a note of the nid's of the returned nodes, and kept them for later. I then ran a similar query against the term_data table. This returned a list of Taxonomy terms - showing the term's name, and it's unique tid value. -```language-sql +```sql SELECT NAME, tid FROM term_data ORDER BY NAME ASC; ``` @@ -50,7 +50,7 @@ query against the database. I'm using aliases within this query to link the node, term_node and term_data tables. For more information on SQL aliases, take a look at . -```language-sql +```sql SELECT * FROM node n, term_data td, term_node tn WHERE td.tid = 84 AND n.nid = tn.nid AND tn.tid = td.tid; ``` @@ -65,7 +65,7 @@ To confirm everything, I ran a simple query against an old post. I know that the only taxonomy term associated with this post is 'Personal', which has a tid value of 44. -```language-sql +```sql SELECT nid, tid FROM term_node WHERE nid = 216; ``` diff --git a/src/content/blog/adding-custom-theme-templates-drupal-7.md b/src/content/blog/adding-custom-theme-templates-drupal-7.md index b9e3c08d..3387875f 100644 --- a/src/content/blog/adding-custom-theme-templates-drupal-7.md +++ b/src/content/blog/adding-custom-theme-templates-drupal-7.md @@ -21,7 +21,7 @@ when a complete node was displayed. I have previously seen it done this way by adding this into in a node.tpl.php file: -```language-php +```php if ($teaser) { // The teaser output. } @@ -40,7 +40,7 @@ looks for and attempts to use when displaying a node, and this is where I'll be adding a new suggestion for my teaser-specific template. Using the `debug()` function, I can easily see what's already there. -```language-php +```php array ( 0 => 'node__article', 1 => 'node__343', @@ -51,7 +51,7 @@ array ( So, within my theme's template.php file: -```language-php +```php /** * Implementation of hook_preprocess_HOOK(). */ @@ -67,7 +67,7 @@ function mytheme_preprocess_node(&$variables) { After adding the new suggestion: -```language-php +```php array ( 0 => 'node__article', 1 => 'node__343', diff --git a/src/content/blog/automating-sculpin-jenkins.md b/src/content/blog/automating-sculpin-jenkins.md index fca55b8c..f42cc60d 100644 --- a/src/content/blog/automating-sculpin-jenkins.md +++ b/src/content/blog/automating-sculpin-jenkins.md @@ -67,7 +67,7 @@ Within the **Builds** section of the item, I added an _Execute Shell_ step, where I could enter a command to execute. Here, I pasted a modified version of the original publish.sh script. -```language-bash +```bash #!/bin/bash set -uex @@ -94,7 +94,7 @@ or greater than the time of the build. The YAML front matter: -```language-yaml +```yaml --- ... talks: @@ -105,7 +105,7 @@ talks: The Twig layout: -```language-twig +```twig {% for talk in talks|reverse if talk.date >= now %} {# Upcoming talks #} @@ -155,7 +155,7 @@ script. ### Updating Composer -```language-bash +```bash if [ -f composer.json ]; then /usr/local/bin/composer install fi @@ -167,7 +167,7 @@ composer.json exists. ### Updating Sculpin Dependencies -```language-bash +```bash if [ -f sculpin.json ]; then sculpin install fi @@ -178,7 +178,7 @@ that the required custom bundles and dependencies are installed. ### Managing Redirects -```language-bash +```bash if [ -f scripts/redirects.php ]; then /usr/bin/php scripts/redirects.php fi diff --git a/src/content/blog/building-gmail-filters-in-php.md b/src/content/blog/building-gmail-filters-in-php.md index 869a918c..684d014f 100644 --- a/src/content/blog/building-gmail-filters-in-php.md +++ b/src/content/blog/building-gmail-filters-in-php.md @@ -24,7 +24,7 @@ using a [Twig][2] template. For example: -```language-php +```php # test.php require __DIR__ '/vendor/autoload.php'; @@ -64,7 +64,7 @@ and replace them with the `boolean_string` filter. Before:
-```language-twig +```twig {{ filter.isArchive ? 'true' : 'false' }} ```
@@ -72,7 +72,7 @@ Before: After:
-```language-twig +```twig {{ filter.isArchive|boolean_string }} ```
@@ -80,7 +80,7 @@ After: This can then be used to generate output like this, whereas having blank values would have resulted in errors when importing to Gmail. -```language-xml +```xml ``` diff --git a/src/content/blog/checking-if-user-logged-drupal-right-way.md b/src/content/blog/checking-if-user-logged-drupal-right-way.md index 87c23ac7..071fc89d 100644 --- a/src/content/blog/checking-if-user-logged-drupal-right-way.md +++ b/src/content/blog/checking-if-user-logged-drupal-right-way.md @@ -14,7 +14,7 @@ I see this regularly when working on Drupal sites when someone wants to check whether the current user is logged in to Drupal (authenticated) or not (anonymous). -```language-php +```php global $user; if ($user->uid) { // The user is logged in. @@ -23,7 +23,7 @@ if ($user->uid) { or -```language-php +```php global $user; if (!$user->uid) { // The user is not logged in. @@ -34,7 +34,7 @@ The better way to do this is to use the [user_is_logged_in()](http://api.drupal.org/api/drupal/modules!user!user.module/function/user_is_logged_in/7) function. -```language-php +```php if (user_is_logged_in()) { // Do something. } @@ -47,7 +47,7 @@ load the global variable. A great use case for this is within a `hook_menu()` implementation within a custom module. -```language-php +```php /** * Implements hook_menu(). */ diff --git a/src/content/blog/checkout-specific-revision-svn-command-line.md b/src/content/blog/checkout-specific-revision-svn-command-line.md index 38c042ee..c3019c01 100644 --- a/src/content/blog/checkout-specific-revision-svn-command-line.md +++ b/src/content/blog/checkout-specific-revision-svn-command-line.md @@ -11,12 +11,12 @@ How to checkout a specific revision from a SVN (Subversion) repository. If you're checking out the repository for the first time: -```language-bash +```bash $ svn checkout -r 1234 url://repository/path ``` If you already have the repository checked out: -```language-bash +```bash $ svn up -r 1234 ``` diff --git a/src/content/blog/conditional-email-addresses-webform.md b/src/content/blog/conditional-email-addresses-webform.md index 30635a57..dda57b8e 100644 --- a/src/content/blog/conditional-email-addresses-webform.md +++ b/src/content/blog/conditional-email-addresses-webform.md @@ -16,7 +16,7 @@ configuration until after I created the form components. I added 'Name', 'Email', 'Subject' and 'Message' fields, as well as a 'Category' select list. Below 'Options', I entered each of my desired options in the following format: -```language-ini +```ini Email address|Visible name ``` diff --git a/src/content/blog/configuring-the-reroute-email-module.md b/src/content/blog/configuring-the-reroute-email-module.md index 9c96c180..27ece0a8 100644 --- a/src/content/blog/configuring-the-reroute-email-module.md +++ b/src/content/blog/configuring-the-reroute-email-module.md @@ -31,7 +31,7 @@ have one) or the standard settings.php file. The first thing that we need to do is to enable rerouting. Without doing this, nothing will happen. -```language-php +```php $conf['reroute_email_enable'] = TRUE; ``` @@ -39,14 +39,14 @@ The next option is to whether to show rerouting description in mail body. I usually have this enabled. Set this to TRUE or FALSE depending on your preference. -```language-php +```php $conf['reroute_email_enable_message'] = TRUE; ``` The last setting is the email address to use. If you're entering a single address, you can add it as a simple string. -```language-php +```php $conf['reroute_email_address'] = 'person1@example.com'; ``` @@ -57,7 +57,7 @@ If you want to add multiple addresses, these should be added in a semicolon-delimited list. Whilst you could add these also as a string, I prefer to use an array of addresses and the `implode()` function. -```language-php +```php $conf['reroute_email_address'] = implode(';', array( 'person1@example.com', 'person2@example.com', diff --git a/src/content/blog/create-better-photo-gallery-drupal-part-1.md b/src/content/blog/create-better-photo-gallery-drupal-part-1.md index 35916d81..3566cf5d 100644 --- a/src/content/blog/create-better-photo-gallery-drupal-part-1.md +++ b/src/content/blog/create-better-photo-gallery-drupal-part-1.md @@ -39,7 +39,7 @@ have a list of all the galleries on my site which are published, and what they're unique node ID values are. To do this, I opened Sequel Pro and entered the following code: -```language-sql +```sql SELECT title AS title, nid AS gallery_idFROM node @@ -55,7 +55,7 @@ For example, using [aliasing](http://www.w3schools.com/sql/sql_alias.asp) within my SQL statement, I can retrieve a list of all the published photos within the 'British Squad 2008' gallery by using the following code: -```language-sql +```sql SELECT n.title, n.nid, p.field_gallery_nid FROM node n, content_type_photo p WHERE p.field_gallery_nid = 105 @@ -66,7 +66,7 @@ AND n.nid = p.nid; I can easily change this to count the number of published nodes by changing the first line of the query to read SELECT COUNT(\*). -```language-sql +```sql SELECT COUNT(*) FROM node n, content_type_photo p WHERE p.field_gallery_nid = 105 @@ -80,7 +80,7 @@ to each gallery by creating a custom node-gallery.tpl.php file within my theme. I can then use the following PHP code to retrieve the node ID for that specific gallery: -```language-php +```php There are currently ' . $selected_gallery_total . ' photos in this gallery.'; @@ -140,7 +140,7 @@ You will notice that the returned date value for the latest photo added is displaying the UNIX timestamp instead of in a more readable format. This can be changed by altering the 'print' statement to include a PHP 'date' function: -```language-php +```php There are currently ' . $selected_gallery_total . ' photos in this gallery.'; diff --git a/src/content/blog/create-better-photo-gallery-drupal-part-2.md b/src/content/blog/create-better-photo-gallery-drupal-part-2.md index fb1d6c81..9bc6e0b4 100644 --- a/src/content/blog/create-better-photo-gallery-drupal-part-2.md +++ b/src/content/blog/create-better-photo-gallery-drupal-part-2.md @@ -19,7 +19,7 @@ before, and create something different that also displays the created and modified dates. Picking the node ID of the required gallery, I used the following SQL query to display a list of photos. -```language-sql +```sql SELECT n.title, n.nid, n.created, n.changed, p.field_gallery_nid FROM node n, content_type_photo pWHERE n.type = 'photo' AND p.field_gallery_nid = 103AND n.nid = p.nid @@ -36,7 +36,7 @@ gallery to the same time. The result that I'm given is '1217149200'. I can now use an UPDATE statement within another SQL query to update the created and modified dates. -```language-sql +```sql UPDATE node INNER JOIN content_type_photo ON node.nid = content_type_photo.nid diff --git a/src/content/blog/create-better-photo-gallery-drupal-part-21.md b/src/content/blog/create-better-photo-gallery-drupal-part-21.md index 379a4b95..d4ec05c4 100644 --- a/src/content/blog/create-better-photo-gallery-drupal-part-21.md +++ b/src/content/blog/create-better-photo-gallery-drupal-part-21.md @@ -14,7 +14,7 @@ that I'd include it in [Part 3](/blog/create-better-photo-gallery-drupal-part-3/ 'Create a Better Photo Gallery in Drupal - Part 3'), but I forgot). So, here it is: -```language-php +```php ``` So, to display the galleries that are assigned the taxonomy of 'tournaments', I can use the following: -```language-php +```php ``` @@ -38,7 +38,7 @@ generate the same code for each taxonomy term. It dynamically retrieves the relevant taxonomy terms from the database, and uses each name as the argument for the view. -```language-php +```php ``` diff --git a/src/content/blog/create-zen-sub-theme-using-drush.md b/src/content/blog/create-zen-sub-theme-using-drush.md index c327c3d6..ee7981e6 100644 --- a/src/content/blog/create-zen-sub-theme-using-drush.md +++ b/src/content/blog/create-zen-sub-theme-using-drush.md @@ -16,13 +16,13 @@ sub-theme of [Zen](https://drupal.org/project/zen). First, download the [Zen](https://drupal.org/project/zen 'The Zen theme') theme if you haven't already done so. -```language-bash +```bash $ drush dl zen ``` This will now enable you to use the "drush zen" command. -```language-bash +```bash $ drush zen "Oliver Davies" oliverdavies --description="A Zen sub-theme for oliverdavies.co.uk" --without-rtl ``` diff --git a/src/content/blog/creating-local-and-staging-sites-drupals-domain-module-enabled.md b/src/content/blog/creating-local-and-staging-sites-drupals-domain-module-enabled.md index 4a4d5b2a..a016af6c 100644 --- a/src/content/blog/creating-local-and-staging-sites-drupals-domain-module-enabled.md +++ b/src/content/blog/creating-local-and-staging-sites-drupals-domain-module-enabled.md @@ -23,7 +23,7 @@ best solution I think is to use table prefixes and create a different domain table per environment. With a live, staging and local domains, the tables would be named as follows: -```language-bash +```bash live_domain local_domain staging_domain @@ -33,7 +33,7 @@ Within each site's settings.php file, define the prefix for the domain table within the databases array so that each site is looking at the correct table for its environment. -```language-php +```php $databases['default']['default'] = array( 'driver' => 'mysql', 'database' => 'foobar', diff --git a/src/content/blog/creating-using-custom-tokens-drupal-7.md b/src/content/blog/creating-using-custom-tokens-drupal-7.md index 6f624f7e..978569f1 100644 --- a/src/content/blog/creating-using-custom-tokens-drupal-7.md +++ b/src/content/blog/creating-using-custom-tokens-drupal-7.md @@ -40,7 +40,7 @@ itself, along with it's descriptive text. To view the existing tokens and types, use `dpm(token_get_info());`, assuming that you have the [Devel module](http://drupal.org/project/devel) installed. -```language-php +```php /** * Implements hook_token_info(). */ @@ -66,7 +66,7 @@ Now that the Token module is aware of our new token, we now need to determine what the token is replaced with. This is done using `hook_tokens()`. Here is the basic code needed for an implementation: -```language-php +```php /** * Implements hook_tokens(). */ @@ -88,7 +88,7 @@ available tokens using a `switch()`. For each token, you can perform some logic to work out the replacement text and then add it into the replacements array using `$replacements[$original] = $new;`. -```language-php +```php /** * Implements hook_tokens(). */ @@ -123,7 +123,7 @@ function foo_tokens($type, $tokens, array $data = array(), array $options = arra An example from Copyright Block module: -```language-php +```php /** * Implements hook_tokens(). */ @@ -153,7 +153,7 @@ With everything defined, all that we now need to do is pass some text through the `token_replace()` function to replace it with the values defined within `hook_token()`. -```language-php +```php $a = t('Something'); // This would use any token type - node, user etc. $b = token_replace($a); diff --git a/src/content/blog/display-custom-menu-drupal-7-theme-template-file.md b/src/content/blog/display-custom-menu-drupal-7-theme-template-file.md index 5589fe17..092916fd 100644 --- a/src/content/blog/display-custom-menu-drupal-7-theme-template-file.md +++ b/src/content/blog/display-custom-menu-drupal-7-theme-template-file.md @@ -13,7 +13,7 @@ tags: For reference, this is the code needed to display a menu in a Drupal 7 template file, including the navigation ARIA role. -```language-php +```php $menu_name = 'menu-footer-menu'; $menu_id = 'footer-menu'; print theme('links', array( diff --git a/src/content/blog/display-git-branch-or-tag-names-your-bash-prompt.md b/src/content/blog/display-git-branch-or-tag-names-your-bash-prompt.md index f41e563f..0403bdfa 100644 --- a/src/content/blog/display-git-branch-or-tag-names-your-bash-prompt.md +++ b/src/content/blog/display-git-branch-or-tag-names-your-bash-prompt.md @@ -18,7 +18,7 @@ Here's how to do it. For example (with some slight modifications): -```language-bash +```bash oliver@oliver-mbp:~/Development/drupal(master) $ oliver@oliver-mbp:~/Development/a11y_checklist(7.x-1.0) $ ``` @@ -27,13 +27,13 @@ Here's how to do it. To begin with, create a new file to contain the functions, -```language-bash +```bash vim ~/.bash/git-prompt ``` Paste the following code into the file, and save it. -```language-bash +```bash parse_git_branch () { git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/' } @@ -53,13 +53,13 @@ parse_git_branch_or_tag() { Edit your `.bashrc` or `.bash_profile` file to override the PS1 value. -```language-bash +```bash vim ~/.bashrc ``` Add the following code at the bottom of the file, and save it. -```language-bash +```bash source ~/.bash/git-prompt PS1="\u@\h:\w\$(parse_git_branch_or_tag) $ " ``` diff --git a/src/content/blog/display-number-facebook-fans-php.md b/src/content/blog/display-number-facebook-fans-php.md index 5b763843..fcf28c28 100644 --- a/src/content/blog/display-number-facebook-fans-php.md +++ b/src/content/blog/display-number-facebook-fans-php.md @@ -19,7 +19,7 @@ formatted with commas etc - like where I've used it within the [Gold Event listing](http://www.horseandcountry.tv/events/paid) on the Horse & Country TV website. -```language-php +```php $page_id = "143394365692197"; $xml = @simplexml_load_file("http://api.facebook.com/restserver.php?method=facebook.fql.query&query=SELECT%20fan_count%20FROM%20page%20WHERE%20page_id=".$page_id."") or die ("a lot"); $fans = $xml->page->fan_count; diff --git a/src/content/blog/dividing-drupals-process-and-preprocess-functions-separate-files.md b/src/content/blog/dividing-drupals-process-and-preprocess-functions-separate-files.md index 14aa3033..3e8fec99 100644 --- a/src/content/blog/dividing-drupals-process-and-preprocess-functions-separate-files.md +++ b/src/content/blog/dividing-drupals-process-and-preprocess-functions-separate-files.md @@ -21,7 +21,7 @@ process/page.inc. The first step is to use the default mytheme_process() and mytheme_preprocess() functions to utilise my custom function. So within my template.php file: -```language-php +```php `, e.g. `composer run dev`. ### package.json -```language-json +```json "scripts": { "init": "yarn && bower install", "dev": "gulp watch", diff --git a/src/content/blog/entityform.md b/src/content/blog/entityform.md index 290abe1c..e6029884 100644 --- a/src/content/blog/entityform.md +++ b/src/content/blog/entityform.md @@ -23,7 +23,7 @@ The first thing that I needed to do to render the form was to load an empty instance of the entityform using `entityform_empty_load()`. In this example, `newsletter` is the name of my form type. -```language-php +```php $form = entityform_empty_load('newsletter'); ``` @@ -38,7 +38,7 @@ As this function is within the `entityform.admin.inc` file and not autoloaded by Drupal, I needed to include it using `module_load_include()` so that the function was available. -```language-php +```php module_load_include('inc', 'entityform', 'entityform.admin'); $output = entityform_form_wrapper($form, 'submit', 'embedded'), diff --git a/src/content/blog/fixing-drupal-simpletest-issues-inside-docker-containers.md b/src/content/blog/fixing-drupal-simpletest-issues-inside-docker-containers.md index 941269ec..ad7e045b 100644 --- a/src/content/blog/fixing-drupal-simpletest-issues-inside-docker-containers.md +++ b/src/content/blog/fixing-drupal-simpletest-issues-inside-docker-containers.md @@ -29,7 +29,7 @@ lot of them would fail where they would pass when run within Drupal VM. Here’s an excerpt from my `docker-compose.yml` file: -```language-yaml +```yaml services: php: image: wodby/drupal-php:5.6 @@ -53,7 +53,7 @@ across both and the Nginx backend is set to use the `php` container. This is the command that I was using to run the tests: -```language-bash +```bash $ docker-compose run --rm \ -w /var/www/html/web \ php \ @@ -71,7 +71,7 @@ the `--rm` option. This resulted in 60 of the 112 tests failing, whereas they all passed when run within a Drupal VM instance. -```language-markup +``` Test summary ------------ @@ -95,7 +95,7 @@ site, I got this error message: Whereas `curl http://nginx` returns the HTML for the page, so included it with the `--url` option to `run-tests.sh`, and this resulted in my tests all passing. -```language-bash +```bash $ docker-compose run --rm \ -w /var/www/html/web \ php \ @@ -105,7 +105,7 @@ $ docker-compose run --rm \ --class OverrideNodeOptionsTestCase ``` -```language-markup +``` Test summary ------------ diff --git a/src/content/blog/git-format-patch-your-friend.md b/src/content/blog/git-format-patch-your-friend.md index 0f1d3183..4f929dd3 100644 --- a/src/content/blog/git-format-patch-your-friend.md +++ b/src/content/blog/git-format-patch-your-friend.md @@ -29,7 +29,7 @@ message. For example: -```language-bash +```bash --author="opdavies " ``` @@ -61,7 +61,7 @@ From the [manual page](http://git-scm.com/docs/git-format-patch): Here is a section of a patch that I created for the [Metatag module](http://drupal.org/project/metatag) using `git format-patch`: -```language-bash +```bash From 80c8fa14de7f4a83c2e70367aab0aedcadf4f3b0 Mon Sep 17 00:00:00 2001 From: Oliver Davies <oliver@oliverdavies.co.uk> Subject: [PATCH] Exclude comment entities when checking if this is the page, @@ -116,14 +116,14 @@ best command to do this with is the `git am` command. For example, within your repository, run: -```language-bash +```bash $ git am /path/to/file $ git am ~/Code/metatag-comment-fragment-conflict-2265447-4.patch ``` You should end up with some output similar to the following: -```language-bash +```bash Applying: #2272799 Added supporters section Applying: #2272799 Added navigation tabs Applying: #2272799 Fixed indentation diff --git a/src/content/blog/how-add-date-popup-calendar-custom-form.md b/src/content/blog/how-add-date-popup-calendar-custom-form.md index d5ad0150..807b6b54 100644 --- a/src/content/blog/how-add-date-popup-calendar-custom-form.md +++ b/src/content/blog/how-add-date-popup-calendar-custom-form.md @@ -19,13 +19,13 @@ First, I need to download the make my module dependent on date_popup by adding the following line into my module's .info file. -```language-ini +```ini dependencies[] = date_popup ``` Within my form builder function: -```language-php +```php $form['date'] = array( '#title' => t('Arrival date'), diff --git a/src/content/blog/how-create-apply-patches.md b/src/content/blog/how-create-apply-patches.md index 08bb4a05..ab1e67a8 100644 --- a/src/content/blog/how-create-apply-patches.md +++ b/src/content/blog/how-create-apply-patches.md @@ -22,7 +22,7 @@ original user.pages.inc file. Within the duplicate file, I made the same changes to the function that I did in earlier code, and saved the changes. Now, within my Terminal, I can navigate to Drupal's root directory and create the patch. -```language-bash +```bash diff -rup modules/user/user.pages.inc modules/user/user.pages2.inc > /Users/oliver/Desktop/different_messages_for_blocked_users.patch ``` @@ -32,13 +32,13 @@ specified patch file. To apply the patch to my Drupal installation, I go back to Terminal and run the following code: -```language-bash +```bash patch -p0 < /Users/oliver/Desktop/different_messages_for_blocked_users.patch ``` If, for some reason, I need to reverse the patch, I can run this code: -```language-bash +```bash patch -p0 -R < /Users/oliver/Desktop/different_messages_for_blocked_users.patch ``` diff --git a/src/content/blog/how-install-configure-subversion-svn-server-ubuntu.md b/src/content/blog/how-install-configure-subversion-svn-server-ubuntu.md index ede00353..4cfac16e 100644 --- a/src/content/blog/how-install-configure-subversion-svn-server-ubuntu.md +++ b/src/content/blog/how-install-configure-subversion-svn-server-ubuntu.md @@ -20,14 +20,14 @@ already installed. Firstly, I'm going to ensure that all of my installed packages are up to date, and install any available updates. -```language-bash +```bash $ sudo apt-get update ``` Now, I need to download the subversion, subversion-tools and libapache2 packages. -```language-bash +```bash $ sudo apt-get install subversion subversion-tools libapache2-svn ``` @@ -39,7 +39,7 @@ Now, I need to create the directory where my repositories are going to sit. I've chosen this directory as I know that it's one that is accessible to my managed backup service. -```language-bash +```bash $ sudo mkdir /home/svn ``` @@ -48,7 +48,7 @@ $ sudo mkdir /home/svn First, I'll create a new folder in which I'll create my test project, and then I'll create a repository for it. -```language-bash +```bash $ sudo mkdir ~/test $ sudo svnadmin create /home/svn/test -m 'initial project structure' ``` @@ -57,14 +57,14 @@ This will create a new repository containing the base file structure. ## Adding files into the test project -```language-bash +```bash $ cd ~/test
 $ mkdir trunk tags branches ``` I can now import these new directories into the test repository. -```language-bash +```bash $ sudo svn import ~/test file:///home/svn/test -m 'Initial project directories' ``` @@ -75,7 +75,7 @@ needs to be owned by the same user and group that Apache runs as. In Ubuntu, this is usually www-data. To change the owner of a directory, use the chown command. -```language-bash +```bash $ sudo chown -R www-data:www-data /home/svn ``` @@ -84,13 +84,13 @@ $ sudo chown -R www-data:www-data /home/svn The first thing that I need to do is enable the dav_svn Apache module, using the a2enmod command. -```language-bash +```bash $ sudo a2enmod dav_svn ``` With this enabled, now I need to modify the Apache configuration file. -```language-bash +```bash $ cd /etc/apache2 $ sudo nano apache2.conf ``` @@ -98,7 +98,7 @@ $ sudo nano apache2.conf At the bottom of the file, add the following lines, and then save the file by pressing Ctrl+X. -```language-apacheconf +``` DAV svn SVNParentPath /home/svn @@ -107,7 +107,7 @@ pressing Ctrl+X. With this saved, restart the Apache service for the changes to be applied. -```language-bash +```bash sudo service apache2 restart ``` @@ -125,7 +125,7 @@ password before viewing or performing any actions with the repository. Re-open apache2.conf, and replace the SVN Location information with this: -```language-apacheconf +``` DAV svn SVNParentPath /home/svn @@ -138,7 +138,7 @@ Re-open apache2.conf, and replace the SVN Location information with this: Now I need to create the password file. -```language-bash +```bash $ htpasswd -cm /etc/svn-auth oliver ``` @@ -152,7 +152,7 @@ For example, now want to checkout the files within my repository into a new directory called 'test2' within my home directory. Firstly, I need to create the new directory, and then I can issue the checkout command. -```language-bash +```bash $ cd ~ $ mkdir test2 $ svn checkout http://127.0.0.1/svn/test/trunk test2 @@ -168,7 +168,7 @@ Now you can start adding files into the directory. Once you've created your files, perform a svn add command, passing in individual filenames as further arguments. -```language-bash +```bash $ svn add index.php $ svn add * ``` diff --git a/src/content/blog/how-use-environment-variables-your-drupal-settings-docksal.md b/src/content/blog/how-use-environment-variables-your-drupal-settings-docksal.md index b0c546d2..54b4431c 100644 --- a/src/content/blog/how-use-environment-variables-your-drupal-settings-docksal.md +++ b/src/content/blog/how-use-environment-variables-your-drupal-settings-docksal.md @@ -12,7 +12,7 @@ Within the [Docksal documentation for Drupal settings][0], the example database settings include hard-coded credentials to connect to the Drupal database. For example, within a `settings.php` file, you could add this: -```language-php +```php $databases['default']['default'] = [ 'driver' => 'mysql', 'host' => 'db', @@ -76,7 +76,7 @@ If you see this, the environment variables aren’t being passed into Docksal’ `.docksal/docksal.yml` and add `MYSQL_DATABASE`, `MYSQL_PASSWORD` and `MYSQL_USER` to the `environment` section of the `cli` service. -```language-yml +```yaml version: '2.1' services: cli: diff --git a/src/content/blog/include-css-fonts-using-sass-each-loop.md b/src/content/blog/include-css-fonts-using-sass-each-loop.md index 0d6595b2..f3e07f3d 100644 --- a/src/content/blog/include-css-fonts-using-sass-each-loop.md +++ b/src/content/blog/include-css-fonts-using-sass-each-loop.md @@ -16,7 +16,7 @@ Using a file structure similar to this, organise your font files into directories, using the the font name for both the directory name and for the file names. -```language-bash +```bash . ├── FuturaBold │ ├── FuturaBold.eot @@ -44,7 +44,7 @@ Within your SASS file, start an `@each` loop, listing the names of the fonts. In the same way as PHP's `foreach` loop, each font name will get looped through using the `$family` variable and then compiled into CSS. -```language-scss +```scss @each $family in FuturaBook, FuturaBold, FuturaBoldItalic, FuturaItalic { @font-face { font-family: #{$family}; @@ -62,6 +62,6 @@ using the `$family` variable and then compiled into CSS. When the CSS has been compiled, you can then use in your CSS in the standard way. -```language-scss +```scss font-family: "FuturaBook"; ``` diff --git a/src/content/blog/include-environment-specific-settings-files-pantheon.md b/src/content/blog/include-environment-specific-settings-files-pantheon.md index ec26d107..237a248e 100644 --- a/src/content/blog/include-environment-specific-settings-files-pantheon.md +++ b/src/content/blog/include-environment-specific-settings-files-pantheon.md @@ -17,7 +17,7 @@ defined within settings.php (this is also best practice on all Drupal sites). The way that was recommended was by using a `switch()` function based on Pantheon's environment variable. For example: -```language-php +```php switch ($_SERVER['PANTHEON_ENVIRONMENT']) { case 'dev': // Development environment. @@ -48,7 +48,7 @@ file. To do this, add the following code to the bottom of settings.php: -```language-php +```php if (isset($_SERVER['PANTHEON_ENVIRONMENT'])) { if ($_SERVER['PANTHEON_ENVIRONMENT'] != 'live') { // You can still add things here, for example to apply to all sites apart @@ -79,7 +79,7 @@ Within the sites/default directory, I also include an example file (example.settings.env.php) for reference. This is duplicated, renamed and populated accordingly. -```language-php +```php Checking colour contrast ``` ### Vimeo -```language-html +```html Screen readers are strange, when you're a stranger by Leonie Watson ``` @@ -66,7 +66,7 @@ captions file: For example: -```language-html +```html Checking colour contrast Captions for Checking Colour Contrast ``` diff --git a/src/content/blog/live-blogging-symfonylive-london-2019.md b/src/content/blog/live-blogging-symfonylive-london-2019.md index f8bcb33f..1cdc3a9a 100644 --- a/src/content/blog/live-blogging-symfonylive-london-2019.md +++ b/src/content/blog/live-blogging-symfonylive-london-2019.md @@ -312,7 +312,7 @@ foreach ($client->stream($responses) as $response => $chunk) { #### FrameworkBundle/Autowiring -```yml +```yaml framework: http_client: max_host_connections: 4 diff --git a/src/content/blog/minimum-core-version.md b/src/content/blog/minimum-core-version.md index f0721cb4..aaeb69e6 100644 --- a/src/content/blog/minimum-core-version.md +++ b/src/content/blog/minimum-core-version.md @@ -41,7 +41,7 @@ file. You can define a simple dependency for your module by adding a line this this to your project's .info file: -```language-bash +```bash dependencies[] = views ``` @@ -55,13 +55,13 @@ In the previous example, our module would enable if _any_ version of Views was enabled, but we need to specify a specific version. We can do this by including version numbers within the dependencies field in the following format: -```language-bash +```bash dependencies[] = modulename (major.minor) ``` This can be a for a specific module release or a branch name: -```language-bash +```bash dependencies[] = modulename (1.0) dependencies[] = modulename (1.x) ``` @@ -79,7 +79,7 @@ In the original scenario, we want to specify that the module can only be enabled on Drupal core 7.36 or later. To do this, we can use the "greater than or equal to" option. -```language-ini +```ini dependencies[] = system (>=7.36) ``` diff --git a/src/content/blog/my-sublime-text-2-settings.md b/src/content/blog/my-sublime-text-2-settings.md index 3d2fc109..375ace33 100644 --- a/src/content/blog/my-sublime-text-2-settings.md +++ b/src/content/blog/my-sublime-text-2-settings.md @@ -20,7 +20,7 @@ of a file etc. These can be changed by going to Preferences > Settings - User. -```language-json +```json { "color_scheme": "Packages/Theme - Aqua/Color Schemes/Tomorrow Night Aqua.tmTheme", "default_line_ending": "unix", @@ -87,7 +87,7 @@ These can be changed by going to Preferences > Settings - User. These can be changed by going to Preferences > Key Bindings - User. -```language-json +```json [ { "keys": ["alt+s"], "command": "toggle_side_bar" }, { "keys": ["alt+r"], "command": "reindent" } diff --git a/src/content/blog/nginx-redirects-query-string-arguments.md b/src/content/blog/nginx-redirects-query-string-arguments.md index 06f6534c..cc7be79b 100644 --- a/src/content/blog/nginx-redirects-query-string-arguments.md +++ b/src/content/blog/nginx-redirects-query-string-arguments.md @@ -10,7 +10,7 @@ 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. -```language-nginx +```nginx server { listen 80; @@ -33,13 +33,13 @@ This was fixed by making a small change to my `return` statement. Before: -```language-nginx +```nginx return 301 https://www.example.com$uri; ``` After: -```language-nginx +```nginx return 301 https://www.example.com$uri$is_args$args; ``` diff --git a/src/content/blog/null-users-system-users-drupal.md b/src/content/blog/null-users-system-users-drupal.md index 4fe5a7d1..b63109cf 100644 --- a/src/content/blog/null-users-system-users-drupal.md +++ b/src/content/blog/null-users-system-users-drupal.md @@ -98,7 +98,7 @@ for users in Drupal 8. In this case, a [NullUser][4] is an extension of Drupal for a non-existent User. Though, through inheritance, the `id`, `getRoles` and `hasPermission` methods are overridden to return relevant values. -```language-php +```php use Drupal\Core\Session\AnonymousUserSession; class NullUser extends AnonymousUserSession { @@ -111,7 +111,7 @@ user is found from the `getFirst()` method, a `NullUser` is returned. Whilst I could alternatively have returned `NULL` or `FALSE`, we then would need to check if the returned value was an object or not before calling methods on it. -```language-php +```php $system_user = $this->systemUserManager->getFirst(); // Returns NULL or FALSE. // Need to check if a user was returned or not. @@ -129,7 +129,7 @@ has the same methods and properties as a regular user, there is no need to do the additional check as you will always receive a relevant object, and the expected methods will always be present. -```language-php +```php $system_user = $this->systemUserManager->getFirst(); // Returns a NullUser. if ($system_user->isActive()) { diff --git a/src/content/blog/open-sublime-text-2-mac-os-x-command-line.md b/src/content/blog/open-sublime-text-2-mac-os-x-command-line.md index 6b799c02..596589c0 100644 --- a/src/content/blog/open-sublime-text-2-mac-os-x-command-line.md +++ b/src/content/blog/open-sublime-text-2-mac-os-x-command-line.md @@ -13,7 +13,7 @@ How to open Sublime Text from the command line. Paste the following code into the Mac OS X Terminal, assuming that you've installed Sublime Text 2 into the /Applications folder. -```language-bash +```bash $ ln -s "/Applications/Sublime Text 2.app/Contents/SharedSupport/bin/subl" ~/bin/sublime ``` diff --git a/src/content/blog/prevent-apache-displaying-text-files-within-web-browser.md b/src/content/blog/prevent-apache-displaying-text-files-within-web-browser.md index dc6dfb52..5427894b 100644 --- a/src/content/blog/prevent-apache-displaying-text-files-within-web-browser.md +++ b/src/content/blog/prevent-apache-displaying-text-files-within-web-browser.md @@ -17,7 +17,7 @@ running and could therefore have security implications. Rather than delete these files or change the file permissions manually for each file, I can add the following lines into my VirtualHost configuration. -```language-apacheconf +``` Order deny,allow Deny from all diff --git a/src/content/blog/publishing-sculpin-sites-with-github-pages.md b/src/content/blog/publishing-sculpin-sites-with-github-pages.md index 10f1a29e..25ccce3a 100644 --- a/src/content/blog/publishing-sculpin-sites-with-github-pages.md +++ b/src/content/blog/publishing-sculpin-sites-with-github-pages.md @@ -47,7 +47,7 @@ perform a merge. To simplify this, I’ve added a new [publish.sh script][3] into my repository to automate the sites. This is how it currently looks: -```language-bash +```bash #!/usr/bin/env bash SITE_ENV="prod" diff --git a/src/content/blog/quickest-way-install-sublime-text-2-ubuntu.md b/src/content/blog/quickest-way-install-sublime-text-2-ubuntu.md index b7c88728..96b67336 100644 --- a/src/content/blog/quickest-way-install-sublime-text-2-ubuntu.md +++ b/src/content/blog/quickest-way-install-sublime-text-2-ubuntu.md @@ -14,7 +14,7 @@ After reading numerous blog posts about how to install Just paste the following lines into your Terminal: -```language-bash +```bash $ sudo add-apt-repository ppa:webupd8team/sublime-text-2 $ sudo apt-get update $ sudo apt-get install sublime-text diff --git a/src/content/blog/quickly-apply-patches-using-git-curl-or-wget.md b/src/content/blog/quickly-apply-patches-using-git-curl-or-wget.md index 3303bcf8..4af01720 100644 --- a/src/content/blog/quickly-apply-patches-using-git-curl-or-wget.md +++ b/src/content/blog/quickly-apply-patches-using-git-curl-or-wget.md @@ -12,13 +12,13 @@ file from the source, and then you run a separate command to apply it. You can save time and typing by running the two commands on one line: -```language-bash +```bash $ curl http://drupal.org/files/[patch-name].patch | git apply -v ``` Or, if you don't have curl installed, you can use wget: -```language-bash +```bash $ wget -q -O - http://drupal.org/files/[patch-name].patch | git apply -v ``` diff --git a/src/content/blog/rebuilding-bartik-drupals-default-theme-vuejs-tailwind-css-part-2.md b/src/content/blog/rebuilding-bartik-drupals-default-theme-vuejs-tailwind-css-part-2.md index ceb84971..0a100145 100644 --- a/src/content/blog/rebuilding-bartik-drupals-default-theme-vuejs-tailwind-css-part-2.md +++ b/src/content/blog/rebuilding-bartik-drupals-default-theme-vuejs-tailwind-css-part-2.md @@ -71,7 +71,7 @@ for links based on their location on the page - [extracting some Tailwind components](https://tailwindcss.com/docs/extracting-components).
-```vuejs +```html