Add active classes based on the URL

This commit is contained in:
Oliver Davies 2016-06-06 18:30:24 +01:00
parent e1d01a2714
commit b1ba8f201a
108 changed files with 19 additions and 119 deletions

View file

@ -97,13 +97,6 @@ latest_posts: 3
linkedin:
url: http://uk.linkedin.com/in/opdavies
main_menu:
about: { href: /, title: About }
talks: { href: /talks/, title: Talks }
experience: { href: /experience/, title: Experience }
blog: { href: /blog/, title: Blog }
contact: { href: /contact/, title: Contact }
meetups:
drupalbristol:
name: Drupal Bristol

View file

@ -12,11 +12,25 @@
<div id="navbar" class="collapse navbar-collapse" role="navigation">
<ul class="nav navbar-nav">
{% for id, link in site.main_menu %}
<li class="{{ page.nav == id ? 'active' }}">
<a href="{{ site.url }}{{ link.href }}">{{ link.title }}</a>
</li>
{% endfor %}
<li class="{{ page.url == '/.' ? 'active' }}">
<a href="/">About</a>
</li>
<li class="{{ page.url == '/talks' or '/talks/' in page.url ? 'active' }}">
<a href="/talks/">Talks</a>
</li>
<li class="{{ page.url == '/experience' ? 'active' }}">
<a href="/experience/">Experience</a>
</li>
<li class="{{ page.url == '/blog' or '/blog/' in page.url ? 'active' }}">
<a href="/blog/">Blog</a>
</li>
<li class="{{ page.url == '/contact' or '/contact-' in page.url ? 'active' }}">
<a href="/contact/">Contact</a>
</li>
</ul>
</div>{# .nav-collapse #}
</div>

View file

@ -1,5 +1,4 @@
---
nav: blog
title: Style Drupal 6's Taxonomy Lists with PHP, CSS and jQuery
slug: style-drupal-6s-taxonomy-lists-php-css-and-jquery
tags:

View file

@ -1,5 +1,4 @@
---
nav: blog
title: Using ImageCache and ImageCrop for my Portfolio
slug: using-imagecache-and-imagecrop-my-portfolio
tags:

View file

@ -1,5 +1,4 @@
---
nav: blog
title: Conditional Email Addresses in a Webform
slug: conditional-email-addresses-webform
tags:

View file

@ -1,5 +1,4 @@
---
nav: blog
title: Quickly Create Zen Subthemes Using Zenophile
tags:
- drupal-planet

View file

@ -1,5 +1,4 @@
---
nav: blog
title: Create a Slideshow of Multiple Images Using Fancy Slide
slug: create-slideshow-multiple-images-using-fancy-slide
tags:

View file

@ -1,5 +1,4 @@
---
nav: blog
title: Quickly Import Multiples Images Using the Imagefield_Import Module
slug: quickly-import-multiples-images-using-imagefieldimport-module
tags:

View file

@ -1,5 +1,4 @@
---
nav: blog
title: Improve JPG Quality in Imagecache and ImageAPI
slug: improve-jpg-quality-imagecache-and-imageapi
tags:

View file

@ -1,5 +1,4 @@
---
nav: blog
title: Create a Block of Social Media Icons using CCK, Views and Nodequeue
slug: create-block-social-media-icons-using-cck-views-and-nodequeue
tags:

View file

@ -1,5 +1,4 @@
---
nav: blog
title: 10 Useful Drupal 6 Modules
tags:
- drupal-planet

View file

@ -1,5 +1,4 @@
---
nav: blog
title: Create a Flickr Photo Gallery Using Feeds, CCK and Views
slug: create-flickr-photo-gallery-using-feeds-cck-and-views
tags:

View file

@ -1,5 +1,4 @@
---
nav: blog
title: Change the Content Type of Multiple Nodes Using SQL
slug: change-content-type-multiple-nodes-using-sql
tags:

View file

@ -1,5 +1,4 @@
---
nav: blog
title: Create Virtual Hosts on Mac OS X Using VirtualHostX
slug: create-virtual-hosts-mac-os-x-using-virtualhostx
tags:

View file

@ -1,5 +1,4 @@
---
nav: blog
title: Add a Taxonomy Term to Multiple Nodes Using SQL
slug: add-taxonomy-term-multiple-nodes-using-sql
tags:

View file

@ -1,5 +1,4 @@
---
nav: blog
title: Review of the Teleport Module
slug: review-teleport-module
tags:

View file

@ -1,5 +1,4 @@
---
nav: blog
title: Review of the Admin:hover Module
slug: review-adminhover-module
tags:

View file

@ -1,5 +1,4 @@
---
nav: blog
title: Create a Better Photo Gallery in Drupal - Part 1
slug: create-better-photo-gallery-drupal-part-1
tags:

View file

@ -1,5 +1,4 @@
---
nav: blog
title: Create a Better Photo Gallery in Drupal - Part 2
slug: create-better-photo-gallery-drupal-part-2
tags:

View file

@ -1,5 +1,4 @@
---
nav: blog
title: Review of the Image Caption Module
slug: review-image-caption-module
tags:

View file

@ -1,5 +1,4 @@
---
nav: blog
title: The Inaugural Meetup for the South Wales Drupal User Group
slug: south-wales-drupal-user-group
tags:

View file

@ -1,5 +1,4 @@
---
nav: blog
title: How to Create and Apply Patches
slug: create-and-apply-patches
tags:

View file

@ -1,5 +1,4 @@
---
nav: blog
title: Create a Better Photo Gallery in Drupal - Part 3
slug: create-better-photo-gallery-drupal-part-3
tags:

View file

@ -1,5 +1,4 @@
---
nav: blog
title: Create a Better Photo Gallery in Drupal - Part 2.1
slug: create-better-photo-gallery-drupal-part-21
tags:

View file

@ -1,5 +1,4 @@
---
nav: blog
title: Use Regular Expressions to Search and Replace in Coda or TextMate
slug: use-regular-expressions-search-and-replace-coda-or-textmate
tags:

View file

@ -1,5 +1,4 @@
---
nav: blog
title: Easily Embed TypeKit Fonts into your Drupal Website
slug: easily-embed-typekit-fonts-your-drupal-website
tags:

View file

@ -1,5 +1,4 @@
---
nav: blog
title: Proctor & Stevenson
slug: proctor-stevenson
tags:

View file

@ -1,5 +1,4 @@
---
nav: blog
title: Proctors Hosting the next Drupal Meetup
slug: proctors-hosting-next-drupal-meetup
tags:

View file

@ -1,5 +1,4 @@
---
nav: blog
title: Imagefield Import Archive
tags:
- drupal-planet

View file

@ -1,5 +1,4 @@
---
nav: blog
title: Create Multigroups in Drupal 7 using Field Collections
slug: create-multigroups-drupal-7-using-field-collections
tags:

View file

@ -1,5 +1,4 @@
---
nav: blog
title: How to Install and Configure Subversion (SVN) Server on Ubuntu
slug: install-and-configure-subversion-svn-server-ubuntu
tags:

View file

@ -1,5 +1,4 @@
---
nav: blog
title: Site Upgraded to Drupal 7
slug: site-upgraded-drupal-7
---

View file

@ -1,5 +1,4 @@
---
nav: blog
title: How to use Authorized Keys to Create a Passwordless SSH Connection
slug: use-authorized-keys-create-passwordless-ssh-connection
tags:

View file

@ -1,5 +1,4 @@
---
nav: blog
title: Create an Omega Subtheme with LESS CSS Preprocessor using Omega Tools and Drush
slug: create-omega-subtheme-less-css-preprocessor-using-omega-tools-and-drush
tags:

View file

@ -1,5 +1,4 @@
---
nav: blog
title: Installing Nagios on CentOS
slug: installing-nagios-centos
tags:

View file

@ -1,5 +1,4 @@
---
nav: blog
title: Adding Custom Theme Templates in Drupal 7
description: >
Today, I had a situation where I was displaying a list of teasers for news article nodes. The article content type had several different fields assigned to it, including main and thumbnail images. In this case, I wanted to have different output and fields displayed when a teaser was displayed compared to when a complete node was displayed.

View file

@ -1,5 +1,4 @@
---
nav: blog
title: Prevent Apache from displaying text files within a web browser
slug: prevent-apache-displaying-text-files-within-web-browser
tags:

View file

@ -1,5 +1,4 @@
---
nav: blog
title: Checkout a specific revision from SVN from the command line
slug: checkout-specific-revision-svn-command-line
tags:

View file

@ -1,5 +1,4 @@
---
nav: blog
title: How to add a date popup calendar onto a custom form
slug: add-date-popup-calendar-custom-form
tags:

View file

@ -1,5 +1,4 @@
---
nav: blog
title: Forward one domain to another using mod_rewrite and .htaccess
slug: forward-one-domain-another-using-modrewrite-and-htaccess
tags:

View file

@ -1,5 +1,4 @@
---
nav: blog
title: Writing a .info file for a Drupal 7 theme
slug: writing-info-file-drupal-7-theme
tags:

View file

@ -1,5 +1,4 @@
---
nav: blog
title: Dividing Drupal's process and preprocess functions into separate files
description: If you use a lot of process and preprocess functions within your Drupal theme, then your template.php can get very long and it can become difficult to find a certain piece of code. Following the example of the Omega theme, I've started separating my process and preprocess functions into their own files.
slug: dividing-drupals-process-and-preprocess-functions-separate-files

View file

@ -1,5 +1,4 @@
---
nav: blog
title: My new Drupal modules
description: After a busy few days, I've released two new contrib Drupal modules.
tags:

View file

@ -1,5 +1,4 @@
---
nav: blog
title: Install and Configure the Nomensa Accessible Media Player in Drupal
slug: install-nomensa-media-player-drupal
tags:

View file

@ -1,5 +1,4 @@
---
nav: blog
title: Writing an Article for Linux Journal
description: I'm absolutely delighted to announce that I'm going to be writing an article for Linux Journal magazine's upcoming Drupal special.
slug: writing-article-linux-journal

View file

@ -1,5 +1,4 @@
---
nav: blog
title: Display a Custom Menu in a Drupal 7 Theme Template File
description: For reference, this is the code needed to display a menu in a Drupal 7 template file.
slug: display-custom-menu-drupal-7-theme-template-file

View file

@ -1,5 +1,4 @@
---
nav: blog
title: Reflections on speaking at UnifiedDiff
description: Yesterday evening I went to and spoke at the <a href="http://www.unifieddiff.co.uk" title="UnifiedDiff">UnifiedDiff meetup</a> in Cardiff, having offered previously to do a presentation providing an introduction to Drupal.
slug: reflections-speaking-unifieddiff

View file

@ -1,5 +1,4 @@
---
nav: blog
title: My Sublime Text 2 settings
description: <a href="http://www.sublimetext.com/2" title="Sublime Text 2">Sublime Text 2</a> has been my text editor of choice for the past few months, and I use it at home, in work, and on any virtual machines that I run. So rather than having to manually re-enter my settings each time, I thought that I'd document them here for future reference.
tags:

View file

@ -1,5 +1,4 @@
---
nav: blog
title: Accessible Bristol site launched
description: I'm happy to report that the Accessible Bristol was launched this week, on Drupal 7.
tags:

View file

@ -1,5 +1,4 @@
---
nav: blog
title: Open Sublime Text 2 from the Mac OS X Command Line
slug: open-sublime-text-2-mac-os-x-command-line
tags:

View file

@ -1,5 +1,4 @@
---
nav: blog
title: How to use SASS and Compass in Drupal 7 using Sassy
slug: use-sass-and-compass-drupal-7-using-sassy
tags:

View file

@ -1,5 +1,4 @@
---
nav: blog
title: Checking if a user is logged into Drupal (the right way)
description: How to check if a user is logged into Drupal by using the user_is_logged_in() and user_is_anonymous() functions.
slug: checking-if-user-logged-drupal-right-way

View file

@ -1,5 +1,4 @@
---
nav: blog
title: Creating and using custom tokens in Drupal 7
slug: creating-and-using-custom-tokens-drupal-7
tags:

View file

@ -1,5 +1,4 @@
---
nav: blog
title: The Quickest way to Install Sublime Text 2 in Ubuntu
slug: quickest-way-install-sublime-text-2-ubuntu
tags:

View file

@ -1,5 +1,4 @@
---
nav: blog
title: Leaving Nomensa, Joining Precedent
description: Yesterday was my last day working at Nomensa. Next week, I'll be starting as a Senior Developer at Precedent.
tags:

View file

@ -1,5 +1,4 @@
---
nav: blog
title: Display Git Branch or Tag Names in your Bash Prompt
description: Whilst watching Drupalize.me's recent Introduction to Git series, I thought it was useful the way that the current Git branch or tag name was displayed in the bash prompt. Here's how to do it.
slug: display-git-branch-or-tag-names-your-bash-prompt

View file

@ -1,5 +1,4 @@
---
nav: blog
title: Some useful links for using SimpleTest in Drupal
slug: some-useful-links-using-simpletest-drupal
tags:

View file

@ -1,5 +1,4 @@
---
nav: blog
title: Creating Local and Staging sites with Drupal's Domain Module Enabled
slug: creating-local-and-staging-sites-drupals-domain-module-enabled
tags:

View file

@ -1,5 +1,4 @@
---
nav: blog
title: Going to DrupalCon
slug: going-drupalcon
tags:

View file

@ -1,5 +1,4 @@
---
nav: blog
title: Create a Zen Sub-theme Using Drush
description: How to quickly create a Zen sub-theme using Drush.
tags:

View file

@ -1,5 +1,4 @@
---
nav: blog
title: Don't Bootstrap Drupal, Use Drush
tags:
- drush

View file

@ -1,5 +1,4 @@
---
nav: blog
title: Useful Vagrant Commands
description: Here are the basic commands that you need to adminster a virtual machine using <a href="http://vagrantup.com" title="The Vagrant Home page">Vagrant</a>.
tags:

View file

@ -1,5 +1,4 @@
---
nav: blog
title: Quickly Apply Patches Using Git and curl or wget
description: How to quickly download a patch file and apply it to a Git repository in one line
tags:

View file

@ -1,5 +1,4 @@
---
nav: blog
title: Download Different Versions of Drupal with Drush
description: How to download different versions of Drupal core using Drush.
slug: download-different-versions-drupal-drush

View file

@ -1,5 +1,4 @@
---
nav: blog
title: Some Useful Git Aliases
tags:
- git

View file

@ -1,5 +1,4 @@
---
nav: blog
title: DrupalCamp London 2014
description: It's all booked, I'm going to be attending DrupalCamp London.
tags:

View file

@ -1,5 +1,4 @@
---
nav: blog
title: DrupalCamp London: What is Git Flow?
description: Slides and notes from my talk, "What is Git Flow?", that I presented at DrupalCamp London 2014.
slug: what-git-flow

View file

@ -1,5 +1,4 @@
---
nav: blog
title: Drupal Association
tags:
- drupal

View file

@ -1,5 +1,4 @@
---
nav: blog
title: Thanks
tags:
- drupal

View file

@ -1,5 +1,4 @@
---
nav: blog
title: git format-patch is your Friend
slug: git-format-patch
tags:

View file

@ -1,5 +1,4 @@
---
nav: blog
title: drush make drupalbristol
tags:
- drupal

View file

@ -1,5 +1,4 @@
---
nav: blog
title: How to fix Vagrant Loading the Wrong Virtual Machine
slug: fix-vagrant-loading-wrong-virtual-machine
tags:

View file

@ -1,5 +1,4 @@
---
nav: blog
title: Updating Features and Adding Components Using Drush
slug: updating-features-and-adding-components-using-drush
tags:

View file

@ -1,5 +1,4 @@
---
nav: blog
title: Include CSS Fonts by Using a SASS each Loop
description: How to use an SASS each loop to easily add multiple fonts to your CSS.
slug: include-css-fonts-using-sass-each-loop

View file

@ -1,5 +1,4 @@
---
nav: blog
title: Using Remote Files when Developing Locally with Stage File Proxy Module
tags:
- drupal

View file

@ -1,5 +1,4 @@
---
nav: blog
title: Include environment-specific settings files on Pantheon
slug: pantheon-settings-files
tags:

View file

@ -1,5 +1,4 @@
---
nav: blog
title: Include a Local Drupal Settings file for Environment Configuration and Overrides
slug: include-local-drupal-settings-file-environment-configuration-and-overrides
tags:

View file

@ -1,5 +1,4 @@
---
nav: blog
title: Configuring the Reroute Email Module
tags:
- drupal

View file

@ -1,5 +1,4 @@
---
nav: blog
title: 2014
description: A look back at 2014.
tags:

View file

@ -1,5 +1,4 @@
---
nav: blog
title: How to Define a Minimum Drupal Core Version
description: How to define a minimum Drupal core version for your module or theme.
tags:

View file

@ -1,5 +1,4 @@
---
nav: blog
title: Updating Forked Repositories on GitHub
date: 2015-06-18 11:35:00
meta:

View file

@ -1,5 +1,4 @@
---
nav: blog
title: Sculpin and Twig Resources
date: 2015-07-19
meta:

View file

@ -1,5 +1,4 @@
---
nav: blog
title: Automating Sculpin Builds with Jenkins CI
date: 2015-07-21
tags:

View file

@ -1,5 +1,4 @@
---
nav: blog
title: Programmatically Load an Entityform in Drupal 7
tags:
- drupal

View file

@ -1,6 +1,5 @@
---
title: Announcing the Drupal VM Generator
nav: blog
tags:
- drupal
- drupal-planet

View file

@ -1,6 +1,5 @@
---
title: Simplifying Drupal Migrations with xautoload
nav: blog
tags:
- autoloading
- drupal

View file

@ -1,5 +1,4 @@
---
nav: talks
title: So, what is this Drupal thing?
event:
name: Unified Diff

View file

@ -1,5 +1,4 @@
---
nav: talks
title: Drupal and the LDAP Module
event:
name: SWDUG (South Wales Drupal user group)

View file

@ -1,5 +1,4 @@
---
nav: talks
title: Never Commit to Master - An Introduction to Git Flow
event:
name: DrupalCamp London 2014

View file

@ -1,5 +1,4 @@
---
nav: talks
title: drush make drupalbristol
event:
name: Bristol Drupal

View file

@ -1,5 +1,4 @@
---
nav: talks
title: About the Drupal Association
event:
name: SWDUG

View file

@ -1,5 +1,4 @@
---
nav: talks
title: Drupal.org in 2015: What's Coming Next
event:
name: DrupalCamp Brighton 2015

View file

@ -1,5 +1,4 @@
---
nav: talks
title: Drupal.org in 2015: What's Coming Next
event:
name: DrupalCamp London 2015

View file

@ -1,5 +1,4 @@
---
nav: talks
title: Drupal 8
event:
name: PHPSW

View file

@ -1,5 +1,4 @@
---
nav: talks
title: Test Drive Twig with Sculpin
event:
name: DrupalCamp North 2015

View file

@ -1,5 +1,4 @@
---
nav: talks
title: Dancing for Drupal
event:
name: umBristol (Bristol Umbraco user group)

View file

@ -1,5 +1,4 @@
---
nav: talks
title: Building Static Websites with Sculpin
event:
name: PHPSW

View file

@ -1,5 +1,4 @@
---
nav: talks
title: Getting Started with Drupal 8 Module Development
event:
name: DrupalCamp London 2016

View file

@ -1,5 +1,4 @@
---
nav: talks
title: Drupal VM Generator
event:
name: NWDUG

View file

@ -1,5 +1,4 @@
---
nav: talks
title: Drupal VM Generator
event:
name: Drupal Bristol

Some files were not shown because too many files have changed in this diff Show more