Commit graph

290 commits

Author SHA1 Message Date
Oliver Davies e996140f47 Add dark mode styles
References #27
2020-10-29 01:02:26 +00:00
Oliver Davies 530074f176 Override gray colours
Override the default Tailwind `gray` colours, and update anywhere that
the originals were used.

References #27
2020-10-29 00:50:09 +00:00
Oliver Davies dacbfebc26 Enable the dark mode variant
References #27
2020-10-29 00:50:00 +00:00
Oliver Davies 623d1924b7 Show if an event is online
References #241
2020-10-24 20:32:20 +01:00
Oliver Davies 79445b8641 Refactor existing event paragraph template
References #241
2020-10-24 20:06:50 +01:00
Oliver Davies 0411285046 Override theme templates for blog and talks views
Override the theme templates for the `talks` and `blog_posts` views,
adding classes to the header wrapper and some spacing between the header
text and the view results.
2020-10-24 11:23:38 +01:00
Oliver Davies 19c5529094 Add Send to social media checkbox to posts
Also add it to the `opdavies_blog_test` module config so that the
existing tests continue to work and pass.

References #249
2020-10-07 23:17:07 +01:00
Oliver Davies eb23d93fe0 Return early if should not be sent to social media
Return early and don't send the post to social media if the `Post to
social media` checkbox is not checked.

References #249
2020-10-07 23:11:22 +01:00
Oliver Davies 2d06f5e8d4 Add a method to check if send to social media
Add a method to check if a post should be sent automatically to social
media.

References #249
2020-10-07 22:57:40 +01:00
Oliver Davies 3dd7608a87 Update PurgeCSS config 2020-09-24 12:42:53 +01:00
Oliver Davies ef89f5f5c1 Add DDEV configuration 2020-09-16 19:41:48 +01:00
Oliver Davies b70b30bc99 Refactor existing CSS
Fixes #190
2020-09-16 01:47:00 +01:00
Oliver Davies 390c3ba44d Enable the 'apply complex classes' feature
Enable the experimental feature to use `@apply` with complex classes
including interactive states. I tried this on the Rebuilding Symfony
demo project and it worked well.

This would mean that I could refactor some of my existing styles on this
project.

References #190
2020-09-16 01:39:06 +01:00
Oliver Davies b8b1766429 Update tailwindcss to 1.8
References #190
2020-09-16 01:34:26 +01:00
Oliver Davies 3809d5a02f Add token for getting the number of talks given
Add a new custom token, `[opdavies_talks:talk_count]`, that replaces the
placeholder text with the talk count value from the `TalkCounter`
service.

References #31
2020-09-16 01:25:09 +01:00
Oliver Davies 0f01551f26 Update Hook Event Dispatcher module
- Update the Hook Event Dispatcher module from `8.x-1.29` to `8.x-2.02`.
- Update custom modules after breaking changes from upgrading.

References #112
2020-09-06 12:15:59 +01:00
Oliver Davies 61442ed74c Make opdavies theme Drupal 9 compatible
References #112
2020-09-06 11:57:41 +01:00
Oliver Davies 596ee4979d Fix PHPCS issues 2020-09-04 22:20:30 +01:00
Oliver Davies 98fba9306f Fix PHPStan issues 2020-09-04 22:20:30 +01:00
Oliver Davies cbe60209e6 Rename custom module directories
- Rename `opdavies_blog` to `blog`.
- Rename `opdavies_blog_test` to `blog_test`.
- Rename `opdavies_talks` to `talks`.
- Rename `opdavies_talks_test` to `talks_test`.

The files within the directories haven't changed, so there is no
breaking change caused by renaming the directories.

 Please enter the commit message for your changes. Lines starting
2020-09-04 21:25:36 +01:00
Oliver Davies 9b26d772a8 Remove dashes in hashtags, and don't lowercase
References #24
2020-09-04 19:45:30 +01:00
Oliver Davies 9219d10137 Run on insert and update rather than pre-save 2020-09-04 19:19:18 +01:00
Oliver Davies 061b1177f5 Fix config names 2020-09-04 19:18:25 +01:00
Oliver Davies 2617e29dec Refactor to use a factory class 2020-09-04 13:46:49 +01:00
Oliver Davies 10e4616e01 Don't include certain terms as hashtags in tweets
References #24
2020-09-04 12:31:53 +01:00
Oliver Davies c5c774290d Include tags as hashtags for automated tweets
References #24
2020-09-04 12:31:29 +01:00
Oliver Davies 150c974040 Add a test for converting a post to a tweet
References #24
2020-09-04 12:06:51 +01:00
Oliver Davies b77c301d8c Refactor to use a short function 2020-08-28 18:01:47 +01:00
Oliver Davies 59f85f02d5 Add new dependencies to fix PostTest 2020-08-28 13:08:40 +01:00
Oliver Davies 92f1c0f84c Refactor sending posts to social media 2020-08-28 13:02:20 +01:00
Oliver Davies 59a98b8d78 Automatically re-order tags on save
Fixes #167
2020-08-28 12:56:57 +01:00
Oliver Davies 5e107b48d6 Move test class
References #203
2020-08-28 10:59:07 +01:00
Oliver Davies ffe6fe9b68 Add tests for the TalkRepository
Fixes #203
2020-08-28 10:54:19 +01:00
Oliver Davies 87a9f28991 Update prose styling for code and pre elements
Fixes #210
2020-08-24 23:02:00 +01:00
Oliver Davies 9b1a8fb3be Rename and re-organise custom modules
- Rename `opd_talks` to `opdavies_talks`
- Rename `custom` to `opdavies_blog`
2020-08-24 10:27:49 +01:00
Oliver Davies e4e898f22c Update talk next event date on cron
Run the `TalkDateUpater` service on each cron run to ensure that the
next event date for each talk is up to date.

Fixes #204
2020-08-24 02:36:04 +01:00
Oliver Davies 6d9ecd8df0 Fix the ordering for future talks
Rather than the custom event sorting plugin being based on the `created`
value, this change adds a new `field_event_date` field to the talk node
type and uses this for the sorting instead.

This commit also adds a new `TalkDateUpdater` service that extracts
either the next event date if there is a future date, or the last past
event date if there is no future date, from `field_events` for each talk
and saves it into the event date field.

For consistency, and to ensure that the results are ordered correctly,
the talk date updater converts the date from a date string (e.g.
`2020-08-24`) into a UNIX timestamp, and the timestamp is saved in the
event date field. This can be changed at a later date if needed.

The talks view has been updated to use the updated sort plugin, and the
existing tests have been updated to use the new field.

References #204
2020-08-24 02:32:45 +01:00
Oliver Davies bdf225b05d Remove unused imports 2020-08-23 22:38:30 +01:00
Oliver Davies c44990643e Set talk type for existing talks 2020-08-21 11:35:04 +01:00
Oliver Davies 70681df30f Update logo and favicon 2020-08-20 07:40:21 +01:00
Oliver Davies f7b1e41977 Update lodash 2020-08-17 18:41:44 +01:00
Oliver Davies e4595afc81 Update elliptic 2020-08-17 18:17:27 +01:00
Oliver Davies 4f18552c5a Organise tailwind.config.js 2020-08-15 20:46:13 +01:00
Oliver Davies bed98b4f97 Increase font size in navbar 2020-08-15 14:31:20 +01:00
Oliver Davies 0f07d3d231 Add ability to add links to external posts
Add the ability to add links to external blog posts within my blog feed.
This is done based on a new `field_external_link` field that allows for
adding the external link URL and the domain name as the title.

The node links are then overridden to use the external link if there is
one, so the node title and 'read more' links are changed to use the
external link.

Currently, automated tweets are not generated for external posts.

Fixes #182
2020-08-14 16:43:04 +01:00
Oliver Davies 8385d6fef7 Don't send posts to social media multiple times
Check if a post has previously been sent to social media, by checking
the value of a `field_sent_to_social_media` field.

This field is hidden on the node add/edit forms, and populated when a
post is sent to social media. Once this happens, it will not be sent to
social media again.

This change also populates the field for all existing posts, so that
they won't be re-sent to social media either.
2020-08-12 22:33:16 +01:00
Oliver Davies 1b2cbc1a9b Add and use Tailwind CSS typography plugin
Replace custom markup styles with Tailwind CSS's typography/prose plugin
(https://github.com/tailwindlabs/tailwindcss-typography).
2020-08-11 00:59:40 +01:00
Oliver Davies fe7142e1f1 Improve accessibility of the nav toggle button
Improve the accessibility for the nav toggle button by adding a border
around the button when it is focussed on.

I've added a custom Tailwind CSS variant to do this using a custom
`focus-visible` variant in tailwind.config.js, and using the
https://www.npmjs.com/package/focus-visible polyfill.
2020-07-23 13:57:41 +01:00
Oliver Davies f488b5c023 Automatically create tweets for new posts 2020-07-19 20:15:44 +01:00
Oliver Davies eafcb103b8 Set NODE_ENV in Encore config 2020-07-18 10:17:40 +01:00
Oliver Davies 533095d87f Fix photo position 2020-07-16 20:52:37 +01:00
Oliver Davies ef500b5fd7 Change text colour for role 2020-07-16 20:43:59 +01:00
Oliver Davies ebe5a7dbba Recommendation styling 2020-07-16 20:39:43 +01:00
Oliver Davies dd42f3deac Fix missing edit links
Add the title prefix and suffix for recommendation block titles, which
fixes the missing edit links so the blocks are editable.

References #146
2020-07-16 13:12:30 +01:00
Oliver Davies 16350b02fc Remove grid gap on mobile 2020-07-16 09:26:17 +01:00
Oliver Davies ff77296e4c Style the recommendations block
References #146
2020-07-15 21:06:51 +01:00
Oliver Davies 097f60411d Adjust page widths 2020-07-14 21:57:22 +01:00
Oliver Davies 86c3edbcaf Adjust page widths 2020-07-14 13:20:24 +01:00
Oliver Davies 58036c7ab9 Fix collapsing page widths
Fix inconsistent page widths on some pages such as blog and talks, by
adding a width (i.e. a `w-full` class) as well as a maximum width.
2020-07-02 18:13:05 +01:00
Oliver Davies 6350054e45 Fix PHPCS errors 2020-06-30 17:34:42 +01:00
Oliver Davies 9e3064ca21 Add tests for counting previous talks
References #31
2020-06-30 12:50:21 +01:00
Oliver Davies 98ac66495f Set line heights for heaings 2020-06-27 11:24:20 +01:00
Oliver Davies 70ab7f56a0 Add spacing between footer and main content 2020-06-27 01:10:50 +01:00
Oliver Davies 3c814fca05 Use CSS Grid for page columns 2020-06-27 01:01:01 +01:00
Oliver Davies 2b061539d5 Fix spacing issues in various places 2020-06-27 00:25:55 +01:00
Oliver Davies d7aaeb0ca6 Add a test for if a post has a tweet 2020-06-26 20:20:12 +01:00
Oliver Davies f37e69f6f2 Refactor to use a Collection in the test
References #140
2020-06-26 02:14:23 +01:00
Oliver Davies 58d56220de Show upcoming talks in chronological order
Update the ordering of the future talks on the talks page so that
upcoming talks are shown in chronological order (soonest first),
followed by past talks in reverse chronological order (most recent
first).

This still uses the `created` date for ordering, which is updated
automatically on saving the node to match the furthest future talk, but
I may want to move that into a custom node property at some point.

Fixes #140
2020-06-26 02:06:32 +01:00
Oliver Davies deb6f26836 Add webpack aliases for CSS and JS directories 2020-06-16 00:12:47 +01:00
Oliver Davies 0215e31154 Move CSS and JS into assets 2020-06-16 00:04:46 +01:00
Oliver Davies fec0feff36 Re-add npm scripts for development and production
References #127
2020-06-12 02:17:30 +01:00
Oliver Davies d343b4cdf2 Switch from Laravel Mix to Webpack Encore
- Updated npm dependencies
- Replaced `webpack.mix.js` with `webpack.config.js`
- Added `postcss.config.js`
- Removed the `src` directory and moved `css` and `js` to the root level
  of the theme
- Renamed `dist` to `build` and updated in libraries file

References #41
2020-06-10 12:06:09 +01:00
Oliver Davies 53257d1709 Add a command for updating old tag names
Fixes #53
2020-06-01 20:12:27 +01:00
Oliver Davies b49b487590 Fix PHPStan and PHPCS errors 2020-06-01 19:03:25 +01:00
Oliver Davies 1207df285f Fix undefined index notice on non-node pages
Fixes #95
2020-06-01 11:48:55 +01:00
Oliver Davies 1e78139333 Update talk date test
Update the test for updating a talk node as it was essentially doing the
same as the test for creating a new talk node.

The test now ensures that the talk is saved before adding an event, and
that the talk created date is different to the original created date as
well as that it matches the latest event date.
2020-05-31 21:27:55 +01:00
Oliver Davies eb5b41262f Display events in an unordered list
References #74
2020-05-31 20:56:28 +01:00
Oliver Davies 56f3434c4a Automatically order events when a talk is saved
To ensure that the event dates for a talk are always in the correct
order, and to make the editing experience easier, this change
automatically re-orders the events on a talk node to be based on the
event date.

Fixes #74
2020-05-31 20:56:28 +01:00
Oliver Davies 45fda0fed1 Refactor existing tests
References #74
2020-05-31 18:43:10 +01:00
Oliver Davies a36654cfbb Remove custom migration code
References #77
2020-05-29 22:48:57 +01:00
Oliver Davies c25eaf4ee1 Split hooks into separate files, load with Finder 2020-05-29 22:35:33 +01:00
Oliver Davies fafe64dac7 Refactor talks to keep existing tests passing
References #78
2020-05-29 22:00:12 +01:00
Oliver Davies 165b6e8195 Refactor to use a Post class
References #78
2020-05-29 21:46:17 +01:00
Oliver Davies 79eb9bef0b Include widgets.js on blog posts that need it
Fixes #78
2020-05-29 21:07:59 +01:00
Oliver Davies 22533eba56 Only show posted date on full articles 2020-05-27 08:52:43 +01:00
Oliver Davies 1347c93b96 Load hash salt from file if it exists 2020-05-27 08:48:49 +01:00
Oliver Davies 3006cfab02 Update 'submitted by' text and styling
References #71
2020-05-27 02:01:24 +01:00
Oliver Davies 9f40174974 Update spacing in various places in the theme 2020-05-26 23:16:47 +01:00
Oliver Davies 4d3e0901d2 Fix some PHPStan errors 2020-05-26 12:01:03 +01:00
Oliver Davies f5767f7739 Use a pre-save hook for updating the talk date 2020-05-26 12:00:35 +01:00
Oliver Davies 96863ca261 Install Alpine JS with npm 2020-05-23 02:25:41 +01:00
Oliver Davies 4660831b9c Re-add highlightjs
Fixes #67
2020-05-23 02:16:28 +01:00
Oliver Davies 20c53e2b9e Add Operator Mono
Fixes #68
2020-05-23 01:40:36 +01:00
Oliver Davies 8cfa76e9f4 Add markup class to the featured posts block 2020-05-21 13:19:11 +01:00
Oliver Davies 0dddb17a2c Add favicon
Fixes #64
2020-05-21 02:00:08 +01:00
Oliver Davies 982d282b28 Add spacing after lists 2020-05-20 18:44:14 +01:00
Oliver Davies 1b4dd26c15 Include file in purge settings
Include the file containing the body field values within the `purge`
settings so that Tailwind uses it and prevents any classes within it
from being removed from the production CSS.

References #55
2020-05-20 11:59:55 +01:00
Oliver Davies 6ed644c8d3 Add custom command for exporting body content
Add a custom Drush command that exports the body field values for node
and block body fields into a file.

This file can then be included within Tailwind's `purge` settings to
prevent classes used within the body fields from being purged.

References #55
2020-05-20 11:57:47 +01:00
Oliver Davies bcfe01f62c Extract a base test case for talks tests 2020-05-19 17:14:57 +01:00
Oliver Davies 5393186141 Enable PurgeCSS via Tailwind config file
Fixes #40
2020-05-19 17:13:46 +01:00
Oliver Davies 0f2a918492 Only flex if there are sidebars
Fixes #52
2020-05-18 23:08:28 +01:00
Oliver Davies 0bb9bdd7a0 Prevent speakerdeck slides leaking out of container 2020-05-18 22:34:31 +01:00
Oliver Davies 93873f0623 Disable purge for now 2020-05-18 11:26:07 +01:00
Oliver Davies 8b722995c4 Fix event list formatting
Fixes #46
2020-05-18 11:16:32 +01:00
Oliver Davies 873009eef1 Add !important to Tailwind classes 2020-05-17 10:18:33 +01:00
Oliver Davies cebbe530d2 Update sidebar widths 2020-05-17 02:16:06 +01:00
Oliver Davies 4831caa7ca Make videos full width on talk pages
Fixes #45
2020-05-17 01:19:45 +01:00
Oliver Davies ee7b24d778 Add talk videos in the migration 2020-05-16 22:37:13 +01:00
Oliver Davies fbbcb8dce1 Add markup class to body fields 2020-05-16 14:44:16 +01:00
Oliver Davies b812176a04 Port navbar from Sculpin 2020-05-16 13:27:47 +01:00
Oliver Davies 2f730f21b5 Copy over CSS from Sculpin site
Fixes #39
2020-05-15 01:29:21 +01:00
Oliver Davies 1214662ac1 Delete README.txt and LICENSE.txt 2020-05-14 10:02:37 +01:00
Oliver Davies 31b23372ff Remove tw-prefix 2020-05-14 10:02:37 +01:00
Oliver Davies b10ac4ef8c Change the default theme 2020-05-14 10:02:36 +01:00
Oliver Davies 96ba8ed6d1 Fix typo in key 2020-05-13 02:18:47 +01:00
Oliver Davies a5aed11dd2 Remove old core key from info.yml 2020-05-13 02:12:58 +01:00
Oliver Davies 73b1d5cd57 Update export feed URLs in migrations
Fixes #33
2020-05-13 02:01:24 +01:00
Oliver Davies c0a132a1bb Re-add original conditions 2020-05-10 13:15:07 +01:00
Oliver Davies 314ba711af Stop overriding the config path 2020-05-10 01:44:18 +01:00
Oliver Davies a305558e98 Delete old files 2020-05-09 22:33:02 +01:00
Oliver Davies 1a2372f611 Add and use a custom Node class
Add and use a custom `Node` class within the custom module, and move the
method there for finding the last event date for a talk node.
2020-05-09 22:31:35 +01:00
Oliver Davies 7e2bd98d93 Use Carbon for dates 2020-05-09 21:51:04 +01:00
Oliver Davies 730b724ac4 Mark classes as final and enable strict types 2020-05-09 02:17:12 +01:00
Oliver Davies 7a9bf80a89 Automatically update the created date for talks
Automatically update the created dates for talk nodes so that they match
the most-future event. This means that the talks are ordered correctly
on the Talks page.
2020-05-09 02:16:25 +01:00
Oliver Davies f17eb0c154 Include event information in migrated events 2020-05-08 13:15:21 +01:00
Oliver Davies eedf06aa3e Add redirects migration 2020-05-07 12:53:01 +01:00
Oliver Davies 34db78bf47 Add talk migration 2020-05-06 10:44:42 +01:00
Oliver Davies 1a713db452 Map post excerpt field 2020-05-06 02:22:45 +01:00
Oliver Davies 703997f16d Add tag_term as a dependency 2020-05-06 02:04:47 +01:00
Oliver Davies 608039b407 Migrate tags to blog posts 2020-05-06 02:00:02 +01:00
Oliver Davies b5c2b72412 Add the tag term migration 2020-05-05 17:33:20 +01:00
Oliver Davies da350a3361 Start adding post node migration 2020-05-05 14:18:11 +01:00
Oliver Davies 724c43f88f Fix PHPCS issues 2020-04-12 19:23:47 +01:00
Oliver Davies 4ac087b88c Add command for updating old tag names 2020-04-12 16:52:21 +01:00
Oliver Davies bea6553cd8 Add start of theme 2020-04-10 10:57:30 +01:00
Oliver Davies 8623b98a0b Use Symfony server for local development 2020-04-10 10:48:35 +01:00
Oliver Davies 0b2ec0c2e4 Move images and symlink back in 2020-02-12 11:46:26 +00:00
Oliver Davies 9c81e35f21 Revert "Add post import script"
This reverts commit 80651966a7.
2020-02-12 01:43:32 +00:00
Oliver Davies 80651966a7 Add post import script 2020-02-12 01:28:54 +00:00
Oliver Davies aca2fd37d4 Copy over images directory 2020-02-12 01:28:36 +00:00