From 2b38aa073cfca6133b54bccfdb21987837efa622 Mon Sep 17 00:00:00 2001 From: Samuel Mortenson Date: Sun, 5 Aug 2018 08:58:51 -0700 Subject: [PATCH] Incremental save. --- composer.json | 13 ++- composer.lock | 74 +++++++++++- config/block.block.booknavigation.yml | 2 +- config/block.block.expandedbooknavigation.yml | 28 +++++ config/core.extension.yml | 2 + ...mple_sitemap.bundle_settings.node.book.yml | 4 + ...emap.bundle_settings.node.landing_page.yml | 4 + config/simple_sitemap.custom.yml | 7 ++ config/simple_sitemap.settings.yml | 15 +++ config/system.performance.yml | 4 +- config/system.rss.yml | 2 +- ....41a379f1-9578-43d6-9b62-977bfe857232.json | 6 +- content/meta/index.json | 6 + ....335d7491-d1a0-4428-b544-e317737c178f.json | 106 ++++++++++++++++++ ....6911b3bb-d110-4597-957f-452f9cba558c.json | 106 ++++++++++++++++++ extra/book_outlines.json | 34 ++++++ .../src/Plugin/Block/TomeFyiBookBlock.php | 85 ++++++++++++++ modules/tfyi_book/tfyi_book.info.yml | 8 ++ scripts/gh-pages.sh | 1 + themes/tomefyi/css/main.css | 3 +- 20 files changed, 491 insertions(+), 19 deletions(-) create mode 100644 config/block.block.expandedbooknavigation.yml create mode 100644 config/simple_sitemap.bundle_settings.node.book.yml create mode 100644 config/simple_sitemap.bundle_settings.node.landing_page.yml create mode 100644 config/simple_sitemap.custom.yml create mode 100644 config/simple_sitemap.settings.yml create mode 100644 content/node.335d7491-d1a0-4428-b544-e317737c178f.json create mode 100644 content/node.6911b3bb-d110-4597-957f-452f9cba558c.json create mode 100644 modules/tfyi_book/src/Plugin/Block/TomeFyiBookBlock.php create mode 100644 modules/tfyi_book/tfyi_book.info.yml diff --git a/composer.json b/composer.json index 80b05e6..233e09c 100644 --- a/composer.json +++ b/composer.json @@ -42,7 +42,8 @@ "drupal/metatag": "^1.5", "drupal/codesnippet": "^1.6", "ckeditor/codesnippet": "4.9.2", - "drupal-tome/tome_drush": "dev-master" + "drupal-tome/tome_drush": "dev-master", + "drupal/simple_sitemap": "^2.12" }, "scripts": { "gh-pages": "./scripts/gh-pages.sh", @@ -56,11 +57,6 @@ "@symlink" ] }, - "patches": { - "drupal/core": { - "Alt text lost when normalizing": "https://www.drupal.org/files/issues/2018-06-05/2935738-14.patch" - } - }, "extra": { "installer-paths": { "web/core": ["type:drupal-core"], @@ -69,6 +65,11 @@ "web/profiles/contrib/{$name}": ["type:drupal-profile"], "web/themes/contrib/{$name}": ["type:drupal-theme"], "drush/Commands/{$name}": ["type:drupal-drush"] + }, + "patches": { + "drupal/core": { + "Alt text lost when normalizing": "https://www.drupal.org/files/issues/2018-06-05/2935738-14.patch" + } } } } diff --git a/composer.lock b/composer.lock index 4e9dce2..b8c49ad 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "c7cdf40d780952717d75f2523045e245", + "content-hash": "8de4478e7dfc8c32dea89d69a2aab696", "packages": [ { "name": "asm89/stack-cors", @@ -1200,12 +1200,12 @@ "source": { "type": "git", "url": "https://github.com/drupal-tome/tome_drush.git", - "reference": "c30dd183634739f0f375b3ca8867c5efa6822a3d" + "reference": "72583173ba6594fe67a277a9d55e4b845347a2d6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/drupal-tome/tome_drush/zipball/c30dd183634739f0f375b3ca8867c5efa6822a3d", - "reference": "c30dd183634739f0f375b3ca8867c5efa6822a3d", + "url": "https://api.github.com/repos/drupal-tome/tome_drush/zipball/72583173ba6594fe67a277a9d55e4b845347a2d6", + "reference": "72583173ba6594fe67a277a9d55e4b845347a2d6", "shasum": "" }, "require": { @@ -1223,7 +1223,7 @@ } ], "description": "Contains global Drush commands for initializing and installing Tome.", - "time": "2018-07-10T15:56:27+00:00" + "time": "2018-07-14T19:50:03+00:00" }, { "name": "drupal/codesnippet", @@ -1487,6 +1487,9 @@ "recurse": false, "replace": false, "merge-extra": false + }, + "patches_applied": { + "Alt text lost when normalizing": "https://www.drupal.org/files/issues/2018-06-05/2935738-14.patch" } }, "autoload": { @@ -1758,6 +1761,67 @@ }, "time": "2018-03-29T14:38:16+00:00" }, + { + "name": "drupal/simple_sitemap", + "version": "2.12.0", + "source": { + "type": "git", + "url": "https://git.drupal.org/project/simple_sitemap", + "reference": "8.x-2.12" + }, + "dist": { + "type": "zip", + "url": "https://ftp.drupal.org/files/projects/simple_sitemap-8.x-2.12.zip", + "reference": "8.x-2.12", + "shasum": "fe1c1a636adfba8358399a5a1ccdf20685066573" + }, + "require": { + "drupal/core": "~8.0" + }, + "type": "drupal-module", + "extra": { + "branch-alias": { + "dev-2.x": "2.x-dev" + }, + "drupal": { + "version": "8.x-2.12", + "datestamp": "1523203180", + "security-coverage": { + "status": "covered", + "message": "Covered by Drupal's security advisory policy" + } + }, + "drush": { + "services": { + "drush.services.yml": "^9" + } + } + }, + "notification-url": "https://packages.drupal.org/8/downloads", + "license": [ + "GPL-2.0+" + ], + "authors": [ + { + "name": "Pawel Ginalski (gbyte.co)", + "homepage": "https://www.drupal.org/u/gbyte.co", + "email": "contact@gbyte.co", + "role": "Maintainer" + }, + { + "name": "Sam Becker (Sam152)", + "homepage": "https://www.drupal.org/u/sam152", + "role": "Co-maintainer" + } + ], + "description": "Simple XML sitemap creates a standard conform XML sitemap of your content.", + "homepage": "https://drupal.org/project/simple_sitemap", + "support": { + "source": "https://cgit.drupalcode.org/simple_sitemap", + "issues": "https://drupal.org/project/issues/simple_sitemap", + "irc": "irc://irc.freenode.org/drupal-contribute" + } + }, { "name": "drupal/svg_formatter", "version": "1.7.0", diff --git a/config/block.block.booknavigation.yml b/config/block.block.booknavigation.yml index afb514a..e122d45 100644 --- a/config/block.block.booknavigation.yml +++ b/config/block.block.booknavigation.yml @@ -1,6 +1,6 @@ uuid: 6699f3f2-a445-4f50-92c9-bda879a6d92e langcode: en -status: true +status: false dependencies: module: - book diff --git a/config/block.block.expandedbooknavigation.yml b/config/block.block.expandedbooknavigation.yml new file mode 100644 index 0000000..c99b1fe --- /dev/null +++ b/config/block.block.expandedbooknavigation.yml @@ -0,0 +1,28 @@ +uuid: eb824ba7-aed8-432a-a18f-15b0dbabcfe1 +langcode: en +status: true +dependencies: + module: + - node + - tfyi_book + theme: + - tomefyi +id: expandedbooknavigation +theme: tomefyi +region: sidebar +weight: 0 +provider: null +plugin: expanded_book_navigation +settings: + id: expanded_book_navigation + label: 'Expanded book navigation' + provider: tfyi_book + label_display: '0' +visibility: + node_type: + id: node_type + bundles: + book: book + negate: false + context_mapping: + node: '@node.node_route_context:node' diff --git a/config/core.extension.yml b/config/core.extension.yml index 83d45b7..8d47bcb 100644 --- a/config/core.extension.yml +++ b/config/core.extension.yml @@ -25,9 +25,11 @@ module: path: 0 responsive_image: 0 serialization: 0 + simple_sitemap: 0 svg_formatter: 0 system: 0 text: 0 + tfyi_book: 0 token: 0 tome: 0 toolbar: 0 diff --git a/config/simple_sitemap.bundle_settings.node.book.yml b/config/simple_sitemap.bundle_settings.node.book.yml new file mode 100644 index 0000000..d9bc479 --- /dev/null +++ b/config/simple_sitemap.bundle_settings.node.book.yml @@ -0,0 +1,4 @@ +index: 1 +priority: '0.5' +changefreq: '' +include_images: 0 diff --git a/config/simple_sitemap.bundle_settings.node.landing_page.yml b/config/simple_sitemap.bundle_settings.node.landing_page.yml new file mode 100644 index 0000000..d9bc479 --- /dev/null +++ b/config/simple_sitemap.bundle_settings.node.landing_page.yml @@ -0,0 +1,4 @@ +index: 1 +priority: '0.5' +changefreq: '' +include_images: 0 diff --git a/config/simple_sitemap.custom.yml b/config/simple_sitemap.custom.yml new file mode 100644 index 0000000..1df507f --- /dev/null +++ b/config/simple_sitemap.custom.yml @@ -0,0 +1,7 @@ +links: + - + path: / + priority: '1.0' + changefreq: daily +_core: + default_config_hash: 25hWeYa4sasuJtHqKKcEN_nYiuEC1lMPYHsn5dawJEw diff --git a/config/simple_sitemap.settings.yml b/config/simple_sitemap.settings.yml new file mode 100644 index 0000000..3335b89 --- /dev/null +++ b/config/simple_sitemap.settings.yml @@ -0,0 +1,15 @@ +max_links: 2000 +cron_generate: true +cron_generate_interval: 0 +remove_duplicates: true +skip_untranslated: false +batch_process_limit: 1500 +base_url: 'https://tome.fyi' +custom_links_include_images: false +excluded_languages: { } +enabled_entity_types: + - node + - taxonomy_term + - menu_link_content +_core: + default_config_hash: vFARRSP9-YgEArfDNYmRSg0cNFOgZPxqziffIalgLbU diff --git a/config/system.performance.yml b/config/system.performance.yml index d4f85d5..65d6e1a 100644 --- a/config/system.performance.yml +++ b/config/system.performance.yml @@ -2,7 +2,7 @@ cache: page: max_age: 0 css: - preprocess: true + preprocess: false gzip: true fast_404: enabled: true @@ -10,7 +10,7 @@ fast_404: exclude_paths: '/\/(?:styles|imagecache)\//' html: '404 Not Found

Not Found

The requested URL "@path" was not found on this server.

' js: - preprocess: true + preprocess: false gzip: true stale_file_threshold: 2592000 _core: diff --git a/config/system.rss.yml b/config/system.rss.yml index 858f127..d8d0051 100644 --- a/config/system.rss.yml +++ b/config/system.rss.yml @@ -2,7 +2,7 @@ channel: description: '' items: limit: 10 - view_mode: rss + view_mode: title langcode: en _core: default_config_hash: TlH7NNk46phfxu1mSUfwg1C0YqaGsUCeD4l9JQnQlDU diff --git a/content/block_content.41a379f1-9578-43d6-9b62-977bfe857232.json b/content/block_content.41a379f1-9578-43d6-9b62-977bfe857232.json index 6a085a7..9086eb5 100644 --- a/content/block_content.41a379f1-9578-43d6-9b62-977bfe857232.json +++ b/content/block_content.41a379f1-9578-43d6-9b62-977bfe857232.json @@ -36,7 +36,7 @@ ], "changed": [ { - "value": "2018-06-25T03:05:58+00:00", + "value": "2018-08-05T15:54:47+00:00", "format": "Y-m-d\\TH:i:sP" } ], @@ -53,12 +53,12 @@ "metatag": { "value": { "title": "| Tome", - "canonical_url": "http:\/\/drupal-tome.github.io\/home" + "canonical_url": "http:\/\/127.0.0.1:8888\/block\/1" } }, "body": [ { - "value": "

\"\"<\/p>\r\n\r\n

Github<\/a> - Drupal.org<\/a> - Twitter<\/a> - Slack (#tome)<\/a><\/p>\r\n\r\n

Tome is in development and likely has some bugs. Please be patient and respectful when reporting issues!<\/p>\r\n\r\n

This site is built with Tome! Check it out and build it locally from Github<\/a>.<\/p>\r\n", + "value": "

 <\/p>\r\n\r\n

Github<\/a> - Drupal.org<\/a> - Twitter<\/a> - Slack (#tome)<\/a><\/p>\r\n\r\n

Tome is in development and likely has some bugs. Please be patient and respectful when reporting issues!<\/p>\r\n\r\n

This site is built with Tome! Check it out and build it locally from Github<\/a>.<\/p>\r\n", "format": "rich_text", "summary": "" } diff --git a/content/meta/index.json b/content/meta/index.json index 7630464..80d8299 100644 --- a/content/meta/index.json +++ b/content/meta/index.json @@ -68,5 +68,11 @@ ], "node.beecb58c-096a-4ad1-b0cb-9d8da9bb380d": [ "user.ed803c7d-e897-4ebb-99a7-1de7754316c4" + ], + "node.6911b3bb-d110-4597-957f-452f9cba558c": [ + "user.ed803c7d-e897-4ebb-99a7-1de7754316c4" + ], + "node.335d7491-d1a0-4428-b544-e317737c178f": [ + "user.ed803c7d-e897-4ebb-99a7-1de7754316c4" ] } \ No newline at end of file diff --git a/content/node.335d7491-d1a0-4428-b544-e317737c178f.json b/content/node.335d7491-d1a0-4428-b544-e317737c178f.json new file mode 100644 index 0000000..17c51bb --- /dev/null +++ b/content/node.335d7491-d1a0-4428-b544-e317737c178f.json @@ -0,0 +1,106 @@ +{ + "uuid": [ + { + "value": "335d7491-d1a0-4428-b544-e317737c178f" + } + ], + "langcode": [ + { + "value": "en" + } + ], + "type": [ + { + "target_id": "book", + "target_type": "node_type", + "target_uuid": "870f5e4b-075f-48ba-972b-7b47064b4efd" + } + ], + "revision_timestamp": [ + { + "value": "2018-08-05T15:55:28+00:00", + "format": "Y-m-d\\TH:i:sP" + } + ], + "revision_uid": [ + { + "target_type": "user", + "target_uuid": "ed803c7d-e897-4ebb-99a7-1de7754316c4" + } + ], + "revision_log": [], + "status": [ + { + "value": true + } + ], + "title": [ + { + "value": "Github pages" + } + ], + "uid": [ + { + "target_type": "user", + "target_uuid": "ed803c7d-e897-4ebb-99a7-1de7754316c4" + } + ], + "created": [ + { + "value": "2018-08-05T15:55:05+00:00", + "format": "Y-m-d\\TH:i:sP" + } + ], + "changed": [ + { + "value": "2018-08-05T15:58:32+00:00", + "format": "Y-m-d\\TH:i:sP" + } + ], + "promote": [ + { + "value": false + } + ], + "sticky": [ + { + "value": false + } + ], + "default_langcode": [ + { + "value": true + } + ], + "revision_translation_affected": [ + { + "value": true + } + ], + "metatag": { + "value": { + "title": "Github pages | Tome", + "twitter_cards_type": "summary_large_image", + "canonical_url": "http:\/\/127.0.0.1:8888\/node\/11", + "twitter_cards_title": "Github pages", + "twitter_cards_description": "Github pages\u00a0is a free hosting service provided by Github, intended to be used for open source project documentation and simple, non-commercial sites. This document will go over the basics of using Tome for your (github.io) homepage, or in a sub-directory.\n\nUsing Tome with your github.io homepage\n\n\u00a0", + "description": "Github pages\u00a0is a free hosting service provided by Github, intended to be used for open source project documentation and simple, non-commercial sites. This document will go over the basics of using Tome for your (github.io) homepage, or in a sub-directory.\n\nUsing Tome with your github.io homepage\n\n\u00a0", + "twitter_cards_creator_id": "@DrupalSAM", + "twitter_cards_creator": "@DrupalSAM" + } + }, + "path": [ + { + "alias": "", + "pid": null, + "langcode": "en" + } + ], + "body": [ + { + "value": "

Github pages<\/a> is a free hosting service provided by Github, intended to be used for open source project documentation and simple, non-commercial sites. This document will go over the basics of using Tome for your (github.io) homepage, or in a sub-directory.<\/p>\r\n\r\n

Using Tome with your github.io homepage<\/h2>\r\n\r\n

 <\/p>\r\n", + "format": "rich_text", + "summary": "" + } + ] +} \ No newline at end of file diff --git a/content/node.6911b3bb-d110-4597-957f-452f9cba558c.json b/content/node.6911b3bb-d110-4597-957f-452f9cba558c.json new file mode 100644 index 0000000..8aba419 --- /dev/null +++ b/content/node.6911b3bb-d110-4597-957f-452f9cba558c.json @@ -0,0 +1,106 @@ +{ + "uuid": [ + { + "value": "6911b3bb-d110-4597-957f-452f9cba558c" + } + ], + "langcode": [ + { + "value": "en" + } + ], + "type": [ + { + "target_id": "book", + "target_type": "node_type", + "target_uuid": "870f5e4b-075f-48ba-972b-7b47064b4efd" + } + ], + "revision_timestamp": [ + { + "value": "2018-08-04T19:30:37+00:00", + "format": "Y-m-d\\TH:i:sP" + } + ], + "revision_uid": [ + { + "target_type": "user", + "target_uuid": "ed803c7d-e897-4ebb-99a7-1de7754316c4" + } + ], + "revision_log": [], + "status": [ + { + "value": true + } + ], + "title": [ + { + "value": "Hosting guides" + } + ], + "uid": [ + { + "target_type": "user", + "target_uuid": "ed803c7d-e897-4ebb-99a7-1de7754316c4" + } + ], + "created": [ + { + "value": "2018-08-04T19:17:51+00:00", + "format": "Y-m-d\\TH:i:sP" + } + ], + "changed": [ + { + "value": "2018-08-04T19:31:51+00:00", + "format": "Y-m-d\\TH:i:sP" + } + ], + "promote": [ + { + "value": false + } + ], + "sticky": [ + { + "value": false + } + ], + "default_langcode": [ + { + "value": true + } + ], + "revision_translation_affected": [ + { + "value": true + } + ], + "metatag": { + "value": { + "title": "Hosting guides | Tome", + "twitter_cards_type": "summary_large_image", + "canonical_url": "http:\/\/127.0.0.1:8888\/docs\/hosting", + "twitter_cards_title": "Hosting guides", + "twitter_cards_description": "This documentation section covers the various ways Tome can be hosted in production.", + "description": "This documentation section covers the various ways Tome can be hosted in production.", + "twitter_cards_creator_id": "@DrupalSAM", + "twitter_cards_creator": "@DrupalSAM" + } + }, + "path": [ + { + "alias": "\/docs\/hosting", + "pid": 10, + "langcode": "en" + } + ], + "body": [ + { + "value": "

This documentation section covers the various ways Tome can be hosted in production.<\/p>\r\n", + "format": "rich_text", + "summary": "" + } + ] +} \ No newline at end of file diff --git a/extra/book_outlines.json b/extra/book_outlines.json index 04357fa..5c74e42 100644 --- a/extra/book_outlines.json +++ b/extra/book_outlines.json @@ -134,5 +134,39 @@ "p7": "0", "p8": "0", "p9": "0" + }, + { + "nid": "6911b3bb-d110-4597-957f-452f9cba558c", + "bid": "174754f4-136e-4f1e-bc4a-c72ffebc33ae", + "pid": "174754f4-136e-4f1e-bc4a-c72ffebc33ae", + "has_children": "1", + "weight": "3", + "depth": "2", + "p1": "174754f4-136e-4f1e-bc4a-c72ffebc33ae", + "p2": "6911b3bb-d110-4597-957f-452f9cba558c", + "p3": "0", + "p4": "0", + "p5": "0", + "p6": "0", + "p7": "0", + "p8": "0", + "p9": "0" + }, + { + "nid": "335d7491-d1a0-4428-b544-e317737c178f", + "bid": "174754f4-136e-4f1e-bc4a-c72ffebc33ae", + "pid": "6911b3bb-d110-4597-957f-452f9cba558c", + "has_children": "0", + "weight": "0", + "depth": "3", + "p1": "174754f4-136e-4f1e-bc4a-c72ffebc33ae", + "p2": "6911b3bb-d110-4597-957f-452f9cba558c", + "p3": "335d7491-d1a0-4428-b544-e317737c178f", + "p4": "0", + "p5": "0", + "p6": "0", + "p7": "0", + "p8": "0", + "p9": "0" } ] \ No newline at end of file diff --git a/modules/tfyi_book/src/Plugin/Block/TomeFyiBookBlock.php b/modules/tfyi_book/src/Plugin/Block/TomeFyiBookBlock.php new file mode 100644 index 0000000..a4e5d51 --- /dev/null +++ b/modules/tfyi_book/src/Plugin/Block/TomeFyiBookBlock.php @@ -0,0 +1,85 @@ +bookManager = $book_manager; + } + + /** + * {@inheritdoc} + */ + public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) { + return new static( + $configuration, + $plugin_id, + $plugin_definition, + $container->get('book.manager') + ); + } + + /** + * {@inheritdoc} + */ + public function build() { + $book_menus = []; + foreach ($this->bookManager->getAllBooks() as $book_id => $book) { + $data = $this->bookManager->bookTreeAllData($book_id); + $book_menus[$book_id] = $this->bookManager->bookTreeOutput($data); + $book_menus[$book_id] += [ + '#book_title' => $book['title'], + ]; + } + if ($book_menus) { + return [ + '#theme' => 'book_all_books_block', + ] + $book_menus; + } + return []; + } + + /** + * {@inheritdoc} + */ + public function getCacheMaxAge() { + return 0; + } + +} diff --git a/modules/tfyi_book/tfyi_book.info.yml b/modules/tfyi_book/tfyi_book.info.yml new file mode 100644 index 0000000..9e46471 --- /dev/null +++ b/modules/tfyi_book/tfyi_book.info.yml @@ -0,0 +1,8 @@ +name: Tome FYI Book +type: module +description: 'Provides tome.fyi book integration stuff.' +package: Core +version: VERSION +core: 8.x +dependencies: + - book diff --git a/scripts/gh-pages.sh b/scripts/gh-pages.sh index 5a204f0..5b565a0 100755 --- a/scripts/gh-pages.sh +++ b/scripts/gh-pages.sh @@ -1,5 +1,6 @@ #!/usr/bin/env bash +drush cron -l https://tome.fyi drush tome:static -l https://tome.fyi rm -rf gh-pages git clone git@github.com:drupal-tome/drupal-tome.github.io.git -b master gh-pages diff --git a/themes/tomefyi/css/main.css b/themes/tomefyi/css/main.css index 4e13d8e..442f678 100644 --- a/themes/tomefyi/css/main.css +++ b/themes/tomefyi/css/main.css @@ -47,6 +47,7 @@ header { aside { padding: 1rem; min-width: 210px; + margin-right: 1rem; } a { @@ -95,7 +96,6 @@ a.site-logo:hover:before, .menu-item--expanded ul.menu { margin-left: 1rem; - margin-top: .5rem; } ul { @@ -314,6 +314,7 @@ ul.menu { width: 100%; padding: 0; margin-top: 1rem; + margin-right: 0; } .paragraph--type--hero { min-height: 250px;