├── .coveralls.yml ├── .github └── ISSUE_TEMPLATE.md ├── .gitignore ├── .rspec ├── .rubocop.yml ├── .travis.yml ├── CONTRIBUTING.md ├── Gemfile ├── Guardfile ├── Guardfile_integration ├── LICENSE ├── MAINTAINERS ├── README.md ├── Rakefile ├── docs-src ├── .editorconfig ├── .eslintignore ├── .eslintrc.js ├── .gitignore ├── .nvmrc ├── .travis.yml ├── .vscode │ ├── extensions.json │ └── settings.json ├── config.js ├── lib │ ├── .eslintrc.js │ ├── build.js │ ├── builder.js │ ├── devServer.js │ ├── middlewares.js │ ├── plugins │ │ ├── assets.js │ │ ├── autoprefixer.js │ │ ├── helpers.js │ │ ├── ignore.js │ │ ├── markdown.js │ │ ├── onlyChanged.js │ │ ├── rev-assets.js │ │ ├── sidebar-menu.js │ │ ├── syntaxHighlighting.js │ │ └── webpackEntryMetadata.js │ └── serve.js ├── package.json ├── scripts │ ├── build │ └── serve ├── src │ ├── assets │ │ ├── fonts │ │ │ ├── DejaVuSansMono.eot │ │ │ ├── DejaVuSansMono.svg │ │ │ ├── DejaVuSansMono.ttf │ │ │ ├── DejaVuSansMono.woff │ │ │ ├── DejaVuSansMonoBold.eot │ │ │ ├── DejaVuSansMonoBold.svg │ │ │ ├── DejaVuSansMonoBold.ttf │ │ │ ├── DejaVuSansMonoBold.woff │ │ │ ├── FontAwesome.otf │ │ │ ├── Montserrat-Black.otf │ │ │ ├── Montserrat-Bold.otf │ │ │ ├── Montserrat-ExtraBold.otf │ │ │ ├── Montserrat-ExtraLight.otf │ │ │ ├── Montserrat-Light.otf │ │ │ ├── Montserrat-Medium.otf │ │ │ ├── Montserrat-Regular.otf │ │ │ ├── Montserrat-SemiBold.otf │ │ │ ├── Montserrat-Thin.otf │ │ │ ├── algolia-brands-iconfont.eot │ │ │ ├── algolia-brands-iconfont.svg │ │ │ ├── algolia-brands-iconfont.ttf │ │ │ ├── algolia-brands-iconfont.woff │ │ │ ├── algolia-website-iconfont.eot │ │ │ ├── algolia-website-iconfont.svg │ │ │ ├── algolia-website-iconfont.ttf │ │ │ ├── algolia-website-iconfont.woff │ │ │ ├── fontawesome-webfont.eot │ │ │ ├── fontawesome-webfont.svg │ │ │ ├── fontawesome-webfont.ttf │ │ │ ├── fontawesome-webfont.woff │ │ │ ├── fontawesome-webfont.woff2 │ │ │ ├── montserrat-v10-latin-300.woff │ │ │ ├── montserrat-v10-latin-300.woff2 │ │ │ ├── montserrat-v10-latin-500.woff │ │ │ ├── montserrat-v10-latin-500.woff2 │ │ │ ├── montserrat-v10-latin-600.woff │ │ │ ├── montserrat-v10-latin-600.woff2 │ │ │ ├── montserrat-v10-latin-regular.woff │ │ │ └── montserrat-v10-latin-regular.woff2 │ │ ├── images │ │ │ ├── aerial-background-bottom.svg │ │ │ ├── aerial-background-top.svg │ │ │ ├── algolia-community-dark.svg │ │ │ ├── algolia-fast-bg.svg │ │ │ ├── algolia-logo-whitebg.svg │ │ │ ├── card.png │ │ │ ├── dry-run.gif │ │ │ ├── favicon.png │ │ │ ├── funnel.svg │ │ │ ├── getting-started.gif │ │ │ ├── github-icon.svg │ │ │ ├── illu-funnel.svg │ │ │ ├── instantsearch-nostyling.png │ │ │ ├── instantsearch-styling.png │ │ │ ├── light-speed.svg │ │ │ ├── markdown.svg │ │ │ ├── minima-search.gif │ │ │ ├── netlify-env.png │ │ │ ├── servers.svg │ │ │ ├── touch-point.svg │ │ │ ├── travis-config.png │ │ │ └── travis-env.png │ │ └── js │ │ │ ├── activateClipboard.js │ │ │ ├── editThisPage.js │ │ │ ├── freezeGifs.js │ │ │ ├── main.js │ │ │ └── sidebar.js │ ├── blog.md │ ├── commandline.md │ ├── data │ │ └── communityHeader.json │ ├── faq.md │ ├── getting-started.md │ ├── github-pages.md │ ├── hooks.md │ ├── how-it-works.md │ ├── includes │ │ └── mixins.pug │ ├── index.md │ ├── layouts │ │ ├── common │ │ │ ├── footer.pug │ │ │ ├── header.pug │ │ │ ├── hero.pug │ │ │ ├── marketing.pug │ │ │ └── meta.pug │ │ ├── content-with-menu.pug │ │ ├── index.pug │ │ └── single-column.pug │ ├── migration-guide.md │ ├── netlify.md │ ├── options.md │ ├── stylesheets │ │ ├── components │ │ │ ├── _buttons.scss │ │ │ ├── _code-highlighting.scss │ │ │ ├── _code-snippets.scss │ │ │ ├── _documentation.scss │ │ │ ├── _footer.scss │ │ │ ├── _hero.scss │ │ │ ├── _icons.scss │ │ │ ├── _medias.scss │ │ │ ├── _navigation.scss │ │ │ ├── _sidebar.scss │ │ │ └── open-doc-menu_icon.svg │ │ ├── index.scss │ │ ├── modules │ │ │ ├── _base.scss │ │ │ ├── _deprecating.scss │ │ │ └── _mixins.scss │ │ ├── pages │ │ │ ├── _examples.scss │ │ │ └── _index.scss │ │ ├── partials │ │ │ ├── _bootstrap.scss │ │ │ └── _helpers.sass │ │ └── vendors │ │ │ ├── bootstrap │ │ │ ├── _alerts.scss │ │ │ ├── _badges.scss │ │ │ ├── _breadcrumbs.scss │ │ │ ├── _button-groups.scss │ │ │ ├── _buttons.scss │ │ │ ├── _carousel.scss │ │ │ ├── _close.scss │ │ │ ├── _code.scss │ │ │ ├── _component-animations.scss │ │ │ ├── _dropdowns.scss │ │ │ ├── _forms.scss │ │ │ ├── _glyphicons.scss │ │ │ ├── _grid.scss │ │ │ ├── _input-groups.scss │ │ │ ├── _jumbotron.scss │ │ │ ├── _labels.scss │ │ │ ├── _list-group.scss │ │ │ ├── _media.scss │ │ │ ├── _mixins.scss │ │ │ ├── _modals.scss │ │ │ ├── _navbar.scss │ │ │ ├── _navs.scss │ │ │ ├── _normalize.scss │ │ │ ├── _pager.scss │ │ │ ├── _pagination.scss │ │ │ ├── _panels.scss │ │ │ ├── _popovers.scss │ │ │ ├── _print.scss │ │ │ ├── _progress-bars.scss │ │ │ ├── _responsive-embed.scss │ │ │ ├── _responsive-utilities.scss │ │ │ ├── _scaffolding.scss │ │ │ ├── _tables.scss │ │ │ ├── _theme.scss │ │ │ ├── _thumbnails.scss │ │ │ ├── _tooltip.scss │ │ │ ├── _type.scss │ │ │ ├── _utilities.scss │ │ │ ├── _variables.scss │ │ │ ├── _wells.scss │ │ │ └── mixins │ │ │ │ ├── _alerts.scss │ │ │ │ ├── _background-variant.scss │ │ │ │ ├── _border-radius.scss │ │ │ │ ├── _buttons.scss │ │ │ │ ├── _center-block.scss │ │ │ │ ├── _clearfix.scss │ │ │ │ ├── _forms.scss │ │ │ │ ├── _gradients.scss │ │ │ │ ├── _grid-framework.scss │ │ │ │ ├── _grid.scss │ │ │ │ ├── _hide-text.scss │ │ │ │ ├── _image.scss │ │ │ │ ├── _labels.scss │ │ │ │ ├── _list-group.scss │ │ │ │ ├── _nav-divider.scss │ │ │ │ ├── _nav-vertical-align.scss │ │ │ │ ├── _opacity.scss │ │ │ │ ├── _pagination.scss │ │ │ │ ├── _panels.scss │ │ │ │ ├── _progress-bar.scss │ │ │ │ ├── _reset-filter.scss │ │ │ │ ├── _resize.scss │ │ │ │ ├── _responsive-visibility.scss │ │ │ │ ├── _size.scss │ │ │ │ ├── _tab-focus.scss │ │ │ │ ├── _table-row.scss │ │ │ │ ├── _text-emphasis.scss │ │ │ │ ├── _text-overflow.scss │ │ │ │ └── _vendor-prefixes.scss │ │ │ └── tachyons-algolia │ │ │ ├── tachyons-algolia.css │ │ │ └── tachyons-algolia.min.css │ └── themes.md ├── webpack.config.build.js ├── webpack.config.js ├── webpack.config.start.js └── yarn.lock ├── docs ├── assets │ ├── fonts │ │ ├── DejaVuSansMono-76b7309f1fa21ead44e08c917b4ad756.svg │ │ ├── DejaVuSansMono.eot │ │ ├── DejaVuSansMono.ttf │ │ ├── DejaVuSansMono.woff │ │ ├── DejaVuSansMonoBold-fd21a27eb3b51cf24991ddbebac9447e.svg │ │ ├── DejaVuSansMonoBold.eot │ │ ├── DejaVuSansMonoBold.ttf │ │ ├── DejaVuSansMonoBold.woff │ │ ├── FontAwesome.otf │ │ ├── Montserrat-Black.otf │ │ ├── Montserrat-Bold.otf │ │ ├── Montserrat-ExtraBold.otf │ │ ├── Montserrat-ExtraLight.otf │ │ ├── Montserrat-Light.otf │ │ ├── Montserrat-Medium.otf │ │ ├── Montserrat-Regular.otf │ │ ├── Montserrat-SemiBold.otf │ │ ├── Montserrat-Thin.otf │ │ ├── algolia-brands-iconfont-d01c8ae49de097f10d78dd3702fb7cae.svg │ │ ├── algolia-brands-iconfont.eot │ │ ├── algolia-brands-iconfont.ttf │ │ ├── algolia-brands-iconfont.woff │ │ ├── algolia-website-iconfont-7580da6e34d1e820855fc2ab3f53bb25.svg │ │ ├── algolia-website-iconfont.eot │ │ ├── algolia-website-iconfont.ttf │ │ ├── algolia-website-iconfont.woff │ │ ├── fontawesome-webfont-912ec66d7572ff821749319396470bde.svg │ │ ├── fontawesome-webfont.eot │ │ ├── fontawesome-webfont.ttf │ │ ├── fontawesome-webfont.woff │ │ ├── fontawesome-webfont.woff2 │ │ ├── montserrat-v10-latin-300.woff │ │ ├── montserrat-v10-latin-300.woff2 │ │ ├── montserrat-v10-latin-500.woff │ │ ├── montserrat-v10-latin-500.woff2 │ │ ├── montserrat-v10-latin-600.woff │ │ ├── montserrat-v10-latin-600.woff2 │ │ ├── montserrat-v10-latin-regular.woff │ │ └── montserrat-v10-latin-regular.woff2 │ └── images │ │ ├── aerial-background-bottom-cc93fcfc10fae373c9b8ffc47160f752.svg │ │ ├── aerial-background-top-d45eeb90d327d3da151f404ddf2ae8fc.svg │ │ ├── algolia-community-dark-5c2d864686c4685353e1d3403eb83d5a.svg │ │ ├── algolia-fast-bg-581fe05069ab3b8778f1e622c329a15d.svg │ │ ├── algolia-logo-whitebg-8cca0306ca5a267b4c0ae51498e5cd66.svg │ │ ├── card-d601b3714c5bd2fd25a0cd1179cef970.png │ │ ├── dry-run-a51601eead2c4a160f88b1594682f25e.gif │ │ ├── favicon-54339122a2393b28d82d46ac8b785542.png │ │ ├── funnel-2e5a83e8a072a3808941f42d02d18e0d.svg │ │ ├── getting-started-ff88ef93194e04687d7f08079df54ce9.gif │ │ ├── github-icon-5afb2ba9b7e186c8f6390cbd14c7015a.svg │ │ ├── illu-funnel-2e5a83e8a072a3808941f42d02d18e0d.svg │ │ ├── instantsearch-nostyling-375beaab74d5f18245d64466c88ecea5.png │ │ ├── instantsearch-styling-a520d5b5b520d9582669eb9d42fb18a3.png │ │ ├── light-speed-c4d77faa336eb4743aca31d8536bcdd5.svg │ │ ├── markdown-980f12108c94ff0c679180808c4c9747.svg │ │ ├── minima-search-bf2705cab83e8d1e92396079c6151d1f.gif │ │ ├── netlify-env-d41d4c3cacf7f918b09debd2f907a5b8.png │ │ ├── servers-9f190605ae1d0307e859b1940b304b11.svg │ │ ├── touch-point-2eab1bcf8f172af9a42b1ebe006cd64e.svg │ │ ├── travis-config-911ca5c615fd946e887d2cf872a3c11e.png │ │ └── travis-env-3a78f33fda9ab47bb06f410684838d7d.png ├── blog.html ├── commandline.html ├── data │ └── communityHeader-69e76fff54a892f7fe3a08c01f35c955.json ├── faq.html ├── getting-started.html ├── github-pages.html ├── hooks.html ├── how-it-works.html ├── includes │ └── mixins.pug ├── index.html ├── js │ ├── common-build-d9bb17198ab9c9f1b71123862c7d1397.js │ ├── common-build-d9bb17198ab9c9f1b71123862c7d1397.js.map │ ├── main-build-6dda02b567024cb3711660bf411fd74f.js │ └── main-build-6dda02b567024cb3711660bf411fd74f.js.map ├── migration-guide.html ├── netlify.html ├── options.html ├── stylesheets │ ├── components │ │ └── open-doc-menu_icon-32a0f3e0afd42c93ceeb43b91d1b7657.svg │ ├── index-60822e9a940590d440a8f783f2000126.css │ ├── index-60822e9a940590d440a8f783f2000126.css.map │ └── vendors │ │ └── tachyons-algolia │ │ ├── tachyons-algolia-18c2a3f6435df03e47ed256dc8879d92.css │ │ └── tachyons-algolia.min-72c658331e0ef2c2466e74d3fab5a94c.css └── themes.html ├── jekyll-algolia.gemspec ├── lib ├── errors │ ├── invalid_credentials.txt │ ├── invalid_index_name.txt │ ├── missing_api_key.txt │ ├── missing_application_id.txt │ ├── missing_index_name.txt │ ├── no_records_found.txt │ ├── record_too_big.txt │ ├── record_too_big_api.txt │ ├── settings_manually_edited.txt │ ├── too_many_records.txt │ ├── unknown_application_id.txt │ └── unknown_settings.txt ├── jekyll-algolia.rb └── jekyll │ ├── algolia │ ├── configurator.rb │ ├── error_handler.rb │ ├── extractor.rb │ ├── file_browser.rb │ ├── hooks.rb │ ├── indexer.rb │ ├── logger.rb │ ├── overwrites │ │ ├── githubpages-configuration.rb │ │ ├── jekyll-algolia-site.rb │ │ ├── jekyll-document.rb │ │ ├── jekyll-paginate-pager.rb │ │ └── jekyll-tags-link.rb │ ├── progress_bar.rb │ ├── shrinker.rb │ ├── utils.rb │ └── version.rb │ └── commands │ └── algolia.rb ├── scripts ├── git_hooks │ ├── pre-commit │ └── pre-push ├── test_all_ruby_versions ├── test_ci ├── test_integration ├── test_integration_prepare └── test_integration_watch └── spec ├── integration ├── main_spec.rb ├── object_ids_spec.rb ├── settings_spec.rb ├── site │ ├── 404.md │ ├── Gemfile │ ├── _config.yml │ ├── _my-collection │ │ └── sample-item.md │ ├── _plugins │ │ └── hooks.rb │ ├── _posts │ │ ├── 2015-07-02-test-post.md │ │ ├── 2018-05-13-post1.md │ │ └── 2018-05-14-post2.md │ ├── excluded-from-hook.html │ ├── index.html │ ├── math.md │ └── page-with-include-from-theme.md └── spec_helper.rb ├── jekyll-algolia_spec.rb ├── jekyll └── algolia │ ├── configurator_spec.rb │ ├── error_handler_spec.rb │ ├── extractor_spec.rb │ ├── file_browser_spec.rb │ ├── hooks_spec.rb │ ├── indexer_spec.rb │ ├── logger_spec.rb │ ├── overwrites_spec.rb │ ├── progress_bar_spec.rb │ ├── shrinker_spec.rb │ └── utils_spec.rb ├── site ├── 404.html ├── 404.md ├── Gemfile ├── MIXed-CaSe.md ├── _algolia_api_key ├── _config.yml ├── _layouts │ ├── default.html │ └── tag.html ├── _my-collection │ ├── collection-item-with-categories.html │ ├── collection-item-with-excerpt.md │ ├── collection-item-with-tags.html │ ├── collection-item.html │ ├── collection-item.md │ └── sample-item.md ├── _plugins │ └── algolia.rb ├── _posts │ ├── 2015-07-02-test-post.md │ ├── 2015-07-03-test-post-again.md │ ├── 2017-11-10-post-with-custom-excerpt.md │ ├── 2017-11-10-post-with-default-excerpt.md │ ├── 2018-03-13-post-with-categories.md │ ├── 2018-03-13-post-with-tags.md │ ├── 2018-03-13-post-without-categories.md │ ├── 2018-03-13-post-without-tags.md │ └── 2018-03-20-post-with-date.md ├── about.md ├── assets │ └── ring.png ├── authors.html ├── blog │ └── pages │ │ └── 2 │ │ └── index.html ├── custom_extension.dhtml ├── default-excerpt.md ├── dhtml.dhtml ├── excluded-from-hook.html ├── excluded.html ├── excluded_dir │ ├── file.html │ └── file.md ├── front_matter.md ├── hierarchy.md ├── html.html ├── index.html ├── links.md ├── markdown.markdown ├── math.md ├── md.md ├── mkd.mkd ├── mkdn.mkdn ├── mkdown.mkdown ├── only-divs.md ├── only-paragraphs.md ├── page-with-categories.md ├── page-with-tags.md ├── png.png ├── subdir │ └── subpage.md └── weight.md ├── spec_helper.rb └── spec_helper_simplecov.rb /.coveralls.yml: -------------------------------------------------------------------------------- 1 | service_name: travis-ci 2 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | 14 | 15 | ## I want to report a bug: 16 | 17 | ### What is the current behavior? 18 | 19 | ### What is your expected behavior? 20 | 21 | ### Git repository to reproduce the issue: 22 | 27 | 28 | ### Ruby version used: 29 | 30 | 31 | ### Jekyll version used: 32 | 33 | 34 | 35 | 36 | ## I want to suggest a feature: 37 | 38 | ### What is your use case for such a feature? 39 | 40 | 41 | ### What is your proposed API? Is this a new option? A new behavior? 42 | 43 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | Gemfile.lock 2 | .envrc 3 | pkg/ 4 | coverage/ 5 | docs-dev/ 6 | gemfiles/*.lock 7 | spec/site/_site 8 | spec/integration/site/_site 9 | 10 | spec/site/.jekyll-cache/ 11 | .jekyll-cache/ 12 | 13 | .DS_Store 14 | .*.sw[a-z] 15 | Thumbs.db 16 | nohup.out 17 | tmp 18 | *~ 19 | *.crcdownload 20 | *.orig 21 | -------------------------------------------------------------------------------- /.rspec: -------------------------------------------------------------------------------- 1 | --color 2 | --format progress 3 | -------------------------------------------------------------------------------- /.rubocop.yml: -------------------------------------------------------------------------------- 1 | require: 2 | - rubocop/rspec/focused 3 | 4 | AllCops: 5 | DisplayCopNames: true 6 | TargetRubyVersion: 2.3 7 | Exclude: 8 | - spec/site/**/* 9 | # Travis stores its cache in ./vendor so we need to exclude it 10 | - vendor/**/* 11 | 12 | Metrics/AbcSize: 13 | Max: 100 14 | 15 | Metrics/ClassLength: 16 | Max: 200 17 | 18 | Metrics/ModuleLength: 19 | Max: 200 20 | 21 | Metrics/MethodLength: 22 | Max: 50 23 | 24 | Metrics/BlockLength: 25 | Max: 50 26 | 27 | Metrics/CyclomaticComplexity: 28 | Max: 10 29 | 30 | Metrics/PerceivedComplexity: 31 | Max: 10 32 | 33 | Naming/FileName: 34 | Enabled: false 35 | 36 | Layout/MultilineOperationIndentation: 37 | Enabled: false 38 | 39 | RSpec/Focused: 40 | Enabled: true 41 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: ruby 2 | cache: bundler 3 | before_script: bundle update 4 | script: bundle exec rake test 5 | rvm: 6 | - 2.6.2 7 | - 2.4.2 8 | - 2.3.5 9 | notifications: 10 | email: 11 | on_success: never 12 | on_failure: never 13 | -------------------------------------------------------------------------------- /Gemfile: -------------------------------------------------------------------------------- 1 | source 'https://rubygems.org' 2 | 3 | # Dependencies are defined in the .gemspec file 4 | gemspec 5 | -------------------------------------------------------------------------------- /Guardfile: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | # Live-reload unit tests 4 | guard :rspec, cmd: 'bundle exec rspec --color --format progress' do 5 | watch(%r{^spec/.+_spec\.rb$}) 6 | watch(%r{^lib/(.+)\.rb$}) do |match| 7 | "spec/#{match[1]}_spec.rb" 8 | end 9 | watch(%r{^lib/jekyll/algolia/overwrites/jekyll-algolia-site\.rb$}) do 10 | 'spec/jekyll-algolia_spec.rb' 11 | end 12 | watch('spec/spec_helper.rb') { 'spec' } 13 | end 14 | 15 | notification :off 16 | -------------------------------------------------------------------------------- /Guardfile_integration: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | # Live-reload integration tests 4 | guard :rspec, cmd: 'bundle exec rspec --color --format progress' do 5 | watch(%r{^spec/integration/.+_spec\.rb$}) 6 | watch('spec/integration/spec_helper.rb') { 'spec/integration' } 7 | end 8 | 9 | notification :off 10 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015-present Algolia, Inc. 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /MAINTAINERS: -------------------------------------------------------------------------------- 1 | # Maintainers list to contact for any security issue 2 | # You can find all contributors in the GitHub interface or the git log 3 | 4 | Tim Carry (@pixelastic) 5 | -------------------------------------------------------------------------------- /docs-src/.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | indent_style = space 5 | indent_size = 2 6 | end_of_line = lf 7 | insert_final_newline = true 8 | trim_trailing_whitespace = true 9 | -------------------------------------------------------------------------------- /docs-src/.eslintignore: -------------------------------------------------------------------------------- 1 | # eslint by default only ignores root node_modules/ 2 | src/*/node_modules 3 | docs/ 4 | docs-dev/ 5 | -------------------------------------------------------------------------------- /docs-src/.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | extends: ['algolia'] 3 | }; 4 | -------------------------------------------------------------------------------- /docs-src/.gitignore: -------------------------------------------------------------------------------- 1 | /docs-dev/ 2 | node_modules/ 3 | npm-debug.log 4 | yarn-error.log 5 | .happypack/ 6 | -------------------------------------------------------------------------------- /docs-src/.nvmrc: -------------------------------------------------------------------------------- 1 | 9.2.0 2 | -------------------------------------------------------------------------------- /docs-src/.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | before_install: 3 | - curl -o- -L yarnpkg.com/install.sh | bash -s -- --version 1.3.2 4 | - export PATH=$HOME/.yarn/bin:$PATH 5 | branches: 6 | only: 7 | - master 8 | cache: 9 | yarn: true 10 | -------------------------------------------------------------------------------- /docs-src/.vscode/extensions.json: -------------------------------------------------------------------------------- 1 | { 2 | // See http://go.microsoft.com/fwlink/?LinkId=827846 3 | // for the documentation about the extensions.json format 4 | "recommendations": [ 5 | "dbaeumer.vscode-eslint" 6 | ] 7 | } 8 | -------------------------------------------------------------------------------- /docs-src/.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "eslint.autoFixOnSave": true 3 | } 4 | -------------------------------------------------------------------------------- /docs-src/config.js: -------------------------------------------------------------------------------- 1 | const fs = require('fs'); 2 | const path = require('path'); 3 | const algoliaComponents = require('algolia-frontend-components'); 4 | const headerData = require('./src/data/communityHeader.json'); 5 | 6 | function readFile(filepath) { 7 | return fs.readFileSync(path.join(__dirname, filepath), 'utf8').toString(); 8 | } 9 | 10 | const header = algoliaComponents.communityHeader(headerData, { 11 | algoliaLogo: readFile('src/assets/images/algolia-logo-whitebg.svg'), 12 | communityLogo: readFile('src/assets/images/algolia-community-dark.svg'), 13 | }); 14 | 15 | const environmentConfig = { 16 | production: { 17 | docsDist: path.join(__dirname, '..', 'docs'), 18 | }, 19 | development: { 20 | docsDist: path.join(__dirname, '..', 'docs-dev'), 21 | }, 22 | }; 23 | 24 | const sidebarMenu = [ 25 | { 26 | title: 'Essentials', 27 | items: [ 28 | { title: 'Getting Started', url: 'getting-started.html' }, 29 | { title: 'How it works', url: 'how-it-works.html' }, 30 | { title: 'FAQ', url: 'faq.html' }, 31 | ], 32 | }, 33 | { 34 | title: 'Configuration', 35 | items: [ 36 | { title: 'Options', url: 'options.html' }, 37 | { title: 'Commandline', url: 'commandline.html' }, 38 | { title: 'Hooks', url: 'hooks.html' }, 39 | ], 40 | }, 41 | { 42 | title: 'Advanced', 43 | items: [ 44 | { title: 'Deploying on Netlify', url: 'netlify.html' }, 45 | { title: 'Deploying on Github Pages', url: 'github-pages.html' }, 46 | { title: 'Themes', url: 'themes.html' }, 47 | { title: 'Migration guide', url: 'migration-guide.html' }, 48 | ], 49 | }, 50 | { 51 | title: 'Tutorials', 52 | items: [{ title: 'Blog', url: 'blog.html' }], 53 | }, 54 | ]; 55 | 56 | module.exports = { 57 | ...environmentConfig[process.env.NODE_ENV], 58 | publicPath: process.env.PUBLIC_PATH || '/', 59 | header, 60 | sidebarMenu, 61 | }; 62 | -------------------------------------------------------------------------------- /docs-src/lib/.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | extends: ['../.eslintrc.js'], 3 | rules: { 4 | 'import/no-commonjs': 'off' 5 | } 6 | }; 7 | -------------------------------------------------------------------------------- /docs-src/lib/build.js: -------------------------------------------------------------------------------- 1 | const builder = require('./builder.js'); 2 | const revAssets = require('./plugins/rev-assets.js'); 3 | const { build: middlewares } = require('./middlewares'); 4 | 5 | builder({ middlewares }, err => { 6 | if (err) { 7 | throw err; 8 | } 9 | 10 | revAssets(); 11 | }); 12 | -------------------------------------------------------------------------------- /docs-src/lib/builder.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable no-console */ 2 | 3 | const metalsmith = require('metalsmith'); 4 | const config = require('../config.js'); 5 | const path = require('path'); 6 | 7 | module.exports = function builder({ clean = true, middlewares }, cb) { 8 | console.time('metalsmith build'); 9 | // default source directory ./src 10 | // https://github.com/metalsmith/metalsmith#sourcepath 11 | metalsmith(path.join(__dirname, '..')) 12 | .metadata(config) 13 | .clean(clean) 14 | .destination(config.docsDist) 15 | .use(middlewares) 16 | .build(err => { 17 | console.timeEnd('metalsmith build'); 18 | cb(err); 19 | }); 20 | }; 21 | -------------------------------------------------------------------------------- /docs-src/lib/devServer.js: -------------------------------------------------------------------------------- 1 | // this file will start a browsersync server that will serve /docs 2 | // it will automatically inject any css 3 | // it will also use webpack and watch/build/hot reload 4 | 5 | const webpack = require('webpack'); 6 | const browserSync = require('browser-sync'); 7 | const webpackConfig = require('../webpack.config.start'); 8 | const webpackDevMiddleware = require('webpack-dev-middleware'); 9 | const webpackHotMiddleware = require('webpack-hot-middleware'); 10 | const compression = require('compression'); 11 | const config = require('../config.js'); 12 | 13 | module.exports = function() { 14 | const compiler = webpack(webpackConfig); 15 | const bs = browserSync.create(); 16 | bs.init({ 17 | server: config.docsDist, 18 | open: false, 19 | files: `${config.docsDist}/**/*`, 20 | watchOptions: { 21 | ignored: [ 22 | /\.js$/, // any change to a JavaScript file must be ignored, webpack handles it 23 | /\.css\.map$/, // no need to reload the whole page for CSS source maps 24 | ], 25 | awaitWriteFinish: { 26 | stabilityThreshold: 150, // wait 150ms for the filesize to be stable (= write finished) 27 | }, 28 | }, 29 | notify: { 30 | styles: { 31 | bottom: 0, 32 | top: 'auto', 33 | }, 34 | }, 35 | middleware: [ 36 | compression(), 37 | webpackDevMiddleware(compiler, { 38 | publicPath: webpackConfig.output.publicPath, 39 | }), 40 | webpackHotMiddleware(compiler), 41 | ], 42 | }); 43 | }; 44 | -------------------------------------------------------------------------------- /docs-src/lib/middlewares.js: -------------------------------------------------------------------------------- 1 | const headings = require('metalsmith-headings'); 2 | const layouts = require('metalsmith-layouts'); 3 | const msWebpack = require('ms-webpack'); 4 | const sass = require('metalsmith-sass'); 5 | const cleanCSS = require('metalsmith-clean-css'); 6 | const assets = require('./plugins/assets.js'); 7 | const ignore = require('./plugins/ignore.js'); 8 | const sidebarMenu = require('./plugins/sidebar-menu.js'); 9 | const markdown = require('./plugins/markdown.js'); 10 | const onlyChanged = require('./plugins/onlyChanged.js'); 11 | const webpackEntryMetadata = require('./plugins/webpackEntryMetadata.js'); 12 | const autoprefixer = require('./plugins/autoprefixer.js'); 13 | const webpackStartConfig = require('../webpack.config.start.js'); 14 | const webpackBuildConfig = require('../webpack.config.build.js'); 15 | 16 | const common = [ 17 | assets({ 18 | source: './src/assets', 19 | destination: 'assets', 20 | }), 21 | ignore(fileName => { 22 | // if it's a build js file, keep it (`build`) 23 | if (/-build\.js$/.test(fileName)) return false; 24 | 25 | // if it's any other JavaScript file, ignore it, it's handled by build files above 26 | if (/\.js$/.test(fileName)) return true; 27 | 28 | // ignore scss partials, only include scss entrypoints 29 | if (/_.*\.s[ac]ss/.test(fileName)) return true; 30 | 31 | // we ignore layout files 32 | if (/^layouts\//.test(fileName)) return true; 33 | 34 | // otherwise, keep file 35 | return false; 36 | }), 37 | markdown, 38 | headings('h2'), 39 | sidebarMenu(), 40 | sass({ 41 | sourceMap: true, 42 | sourceMapContents: true, 43 | outputStyle: 'nested', 44 | }), 45 | // since we use @import, autoprefixer is used after sass 46 | autoprefixer, 47 | ]; 48 | 49 | // development mode 50 | module.exports = { 51 | start: [ 52 | webpackEntryMetadata(webpackStartConfig), 53 | ...common, 54 | onlyChanged, 55 | layouts({ 56 | engine: 'pug', 57 | directory: 'src/layouts', 58 | }), 59 | ], 60 | build: [ 61 | msWebpack({ 62 | ...webpackBuildConfig, 63 | stats: { 64 | chunks: false, 65 | modules: false, 66 | chunkModules: false, 67 | reasons: false, 68 | cached: false, 69 | cachedAssets: false, 70 | }, 71 | }), 72 | ...common, 73 | cleanCSS({ 74 | files: 'stylesheets/**/*.css', 75 | cleanCSS: { 76 | rebase: false, 77 | }, 78 | }), 79 | layouts({ 80 | engine: 'pug', 81 | directory: 'src/layouts', 82 | }), 83 | ], 84 | }; 85 | -------------------------------------------------------------------------------- /docs-src/lib/plugins/assets.js: -------------------------------------------------------------------------------- 1 | // extracted from https://github.com/treygriffith/metalsmith-assets 2 | // converted to es6 (http://lebab.io/try-it) 3 | // tweaked to add `stats` to the file object 4 | 5 | const fs = require('fs'); 6 | const path = require('path'); 7 | const readdir = require('recursive-readdir'); 8 | const mode = require('stat-mode'); 9 | const async = require('async'); 10 | 11 | /** 12 | * Expose `assets`. 13 | */ 14 | 15 | module.exports = assets; 16 | 17 | /** 18 | * Default plugin options 19 | */ 20 | const defaults = { 21 | source: './public', 22 | destination: '.', 23 | }; 24 | 25 | /** 26 | * Metalsmith plugin to include static assets. 27 | * 28 | * @param {Object} userOptions (optional) 29 | * @property {String} source Path to copy static assets from (relative to working directory). Defaults to './public' 30 | * @property {String} destination Path to copy static assets to (relative to destination directory). Defaults to '.' 31 | * @return {Function} a Metalsmith plugin 32 | */ 33 | function assets(userOptions = {}) { 34 | const options = { 35 | ...defaults, 36 | ...userOptions, 37 | }; 38 | 39 | return (files, metalsmith, cb) => { 40 | const src = metalsmith.path(options.source); 41 | const dest = options.destination; 42 | 43 | // copied almost line for line from https://github.com/segmentio/metalsmith/blob/master/lib/index.js 44 | readdir(src, (readDirError, arr) => { 45 | if (readDirError) { 46 | cb(readDirError); 47 | return; 48 | } 49 | 50 | async.each(arr, read, err => cb(err, files)); 51 | }); 52 | 53 | function read(file, done) { 54 | const name = path.join(dest, path.relative(src, file)); 55 | fs.stat(file, (statError, stats) => { 56 | if (statError) { 57 | done(statError); 58 | return; 59 | } 60 | 61 | fs.readFile(file, (err, buffer) => { 62 | if (err) { 63 | done(err); 64 | return; 65 | } 66 | 67 | const newFile = {}; 68 | 69 | newFile.contents = buffer; 70 | newFile.stats = stats; 71 | 72 | newFile.mode = mode(stats).toOctal(); 73 | // eslint-disable-next-line no-param-reassign 74 | files[name] = newFile; 75 | done(); 76 | }); 77 | }); 78 | } 79 | }; 80 | } 81 | -------------------------------------------------------------------------------- /docs-src/lib/plugins/autoprefixer.js: -------------------------------------------------------------------------------- 1 | const postcss = require('postcss'); 2 | const syntax = require('postcss-scss'); 3 | const autoprefixer = require('autoprefixer'); 4 | 5 | module.exports = function sassAutoprefixer(files, metalsmith, done) { 6 | const processor = postcss([autoprefixer]); 7 | Object.keys(files) 8 | .filter(file => /\.css$/.test(file)) 9 | .forEach(file => { 10 | const originalContent = files[file].contents.toString(); 11 | const autoprefixedContent = processor.process(originalContent, { 12 | syntax, 13 | }).css; 14 | // eslint-disable-next-line no-param-reassign 15 | files[file].contents = new Buffer(autoprefixedContent); 16 | }); 17 | 18 | done(); 19 | }; 20 | -------------------------------------------------------------------------------- /docs-src/lib/plugins/helpers.js: -------------------------------------------------------------------------------- 1 | const highlight = require('./syntaxHighlighting.js'); 2 | 3 | // this plugin provides ATM one helper to easily compute the publicPath of assets 4 | module.exports = function helpers(filenames, metalsmith, cb) { 5 | // eslint-disable-next-line no-param-reassign 6 | metalsmith.metadata().h = { 7 | highlight(src, opts) { 8 | const lang = opts && opts.lang; 9 | return highlight(src, lang); 10 | }, 11 | maybeActive(navPath, singlePathOrArrayOfPaths) { 12 | const pathsToTest = [].concat(singlePathOrArrayOfPaths); 13 | return pathsToTest.some(pathToTest => navPath.indexOf(pathToTest) === 0) 14 | ? 'active' 15 | : ''; 16 | }, 17 | }; 18 | 19 | cb(); 20 | }; 21 | -------------------------------------------------------------------------------- /docs-src/lib/plugins/ignore.js: -------------------------------------------------------------------------------- 1 | module.exports = function ignore(testFn) { 2 | return (files, metalsmith, cb) => { 3 | Object.keys(files).forEach(fileName => { 4 | // eslint-disable-next-line no-param-reassign 5 | if (testFn(fileName) === true) delete files[fileName]; 6 | }); 7 | 8 | cb(null); 9 | }; 10 | }; 11 | -------------------------------------------------------------------------------- /docs-src/lib/plugins/markdown.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable no-param-reassign */ 2 | const path = require('path'); 3 | const _ = require('lodash'); 4 | const MarkdownIt = require('markdown-it'); 5 | const markdownItAnchor = require('markdown-it-anchor'); 6 | const highlight = require('./syntaxHighlighting.js'); 7 | const md = new MarkdownIt('default', { 8 | highlight: (str, lang) => highlight(str, lang), 9 | linkify: true, 10 | typographer: true, 11 | html: true, 12 | }).use(markdownItAnchor, { 13 | permalink: true, 14 | permalinkClass: 'anchor', 15 | permalinkSymbol: '', 16 | // generate proper Getting_started.html#install hrefs since we are 17 | // using the base href trick to handle different base urls (dev, prod) 18 | permalinkHref: (slug, state) => `${state.env.path}#${slug}`, 19 | }); 20 | 21 | const isMarkdown = filepath => /\.md|\.markdown/.test(path.extname(filepath)); 22 | 23 | module.exports = function markdown(files, metalsmith, done) { 24 | _.each(files, (data, filepath) => { 25 | // We keep all non-markdown files as-is 26 | if (!isMarkdown(filepath)) { 27 | return; 28 | } 29 | 30 | // We convert markdown path to html path 31 | const dirname = path.dirname(filepath); 32 | let htmlpath = `${path.basename(filepath, path.extname(filepath))}.html`; 33 | if (dirname !== '.') { 34 | htmlpath = `${dirname}/${htmlpath}`; 35 | } 36 | 37 | // We convert the markdown content to HTML 38 | const content = md.render(data.contents.toString(), { path: htmlpath }); 39 | 40 | delete files[filepath]; 41 | files[htmlpath] = { 42 | ...data, 43 | contents: new Buffer(content), 44 | }; 45 | }); 46 | 47 | done(); 48 | }; 49 | -------------------------------------------------------------------------------- /docs-src/lib/plugins/rev-assets.js: -------------------------------------------------------------------------------- 1 | const fs = require('fs'); 2 | const path = require('path'); 3 | const glob = require('glob'); 4 | const hasha = require('hasha'); 5 | const replace = require('replace-in-file'); 6 | const config = require('../../config.js'); 7 | 8 | const DIST_PATH = path.resolve(config.docsDist); 9 | 10 | // HELPERS TO ADD REVISION HASH TO FILENAMES 11 | // ----------------------------------------- 12 | function computeHashForFiles(files) { 13 | const promises = files.map(file => 14 | hasha.fromFile(file, { algorithm: 'md5' }).then(hash => ({ file, hash })) 15 | ); 16 | 17 | return Promise.all(promises); 18 | } 19 | 20 | function renameFiles(files) { 21 | return files.map(({ file, hash }) => { 22 | const ext = path.extname(file); 23 | const newPath = `${file.replace(ext, `-${hash}`)}${ext}`; 24 | 25 | // rename original with hash file 26 | fs.renameSync(file, newPath); 27 | 28 | // check for `.[css|js].map` files to rename also 29 | if ((ext === '.css' || ext === '.js') && fs.existsSync(`${file}.map`)) { 30 | fs.renameSync(`${file}.map`, `${newPath}.map`); 31 | } 32 | 33 | return { oldPath: file, newPath }; 34 | }); 35 | } 36 | 37 | function renameReferences(inFiles, files) { 38 | const { from, to } = files.reduce( 39 | (toRename, { oldPath, newPath }) => ({ 40 | from: [ 41 | ...toRename.from, 42 | new RegExp(oldPath.replace(`${DIST_PATH}/`, ''), 'g'), 43 | ], 44 | to: [...toRename.to, newPath.replace(`${DIST_PATH}/`, '')], 45 | }), 46 | { from: [], to: [] } 47 | ); 48 | 49 | return replace({ from, to, files: inFiles }); 50 | } 51 | 52 | function computeFiles([filesGlob, replaceFilesGlob]) { 53 | const files = glob.sync(`${DIST_PATH}/${filesGlob}`); 54 | return computeHashForFiles(files) 55 | .then(renameFiles) 56 | .then(result => 57 | renameReferences(`${DIST_PATH}/${replaceFilesGlob}`, result) 58 | ); 59 | } 60 | 61 | module.exports = function revAssets() { 62 | // 1. compute MD5 for images / json -> replace in CSS, JS, HTML 63 | // 2. compute MD5 for CSS -> replace in JS, HTML 64 | // 3. compute MD5 for JS -> replace in HTML 65 | const imagesJson = ['**/*.{json,svg,png,jpeg,jpg,gif}', '**/*.{js,html,css}']; 66 | const css = ['**/*.css', '**/*.{js,html}']; 67 | const js = ['**/*.js', '**/*.html']; 68 | 69 | return computeFiles(imagesJson) 70 | .then(() => computeFiles(css)) 71 | .then(() => computeFiles(js)); 72 | }; 73 | -------------------------------------------------------------------------------- /docs-src/lib/plugins/sidebar-menu.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable no-param-reassign */ 2 | const _ = require('lodash'); 3 | const config = require('../../config'); 4 | 5 | module.exports = function() { 6 | // All the pages accessible from the menu 7 | let pagesInMenu = []; 8 | _.each(config.sidebarMenu, category => { 9 | pagesInMenu = _.concat(pagesInMenu, _.map(category.items, 'url')); 10 | }); 11 | return function(files, metalsmith, done) { 12 | _.each(files, (data, path) => { 13 | // Skip files that are not in the menu, they don't need a menu 14 | if (!_.includes(pagesInMenu, path)) { 15 | return; 16 | } 17 | 18 | // Overriding the global sidebarMenu var with one with more info on 19 | // subchild 20 | const sidebarMenu = _.cloneDeep(config.sidebarMenu); 21 | _.each(sidebarMenu, category => { 22 | _.each(category.items, item => { 23 | // Looping until we find the menu entry 24 | if (item.url !== path) return; 25 | 26 | item.isActive = true; 27 | 28 | // Adding a subchild entry 29 | item.items = _.map(data.headings, heading => ({ 30 | title: heading.text, 31 | url: `${path}#${heading.id}`, 32 | })); 33 | }); 34 | }); 35 | 36 | data.sidebarMenu = sidebarMenu; 37 | }); 38 | done(); 39 | }; 40 | }; 41 | -------------------------------------------------------------------------------- /docs-src/lib/plugins/syntaxHighlighting.js: -------------------------------------------------------------------------------- 1 | const { runMode } = require('codemirror/addon/runmode/runmode.node'); 2 | require('codemirror/mode/css/css'); 3 | require('codemirror/mode/htmlmixed/htmlmixed'); 4 | require('codemirror/mode/jsx/jsx'); 5 | require('codemirror/mode/toml/toml'); 6 | require('codemirror/mode/ruby/ruby'); 7 | require('codemirror/mode/shell/shell'); 8 | require('codemirror/mode/yaml/yaml'); 9 | const escape = require('escape-html'); 10 | 11 | module.exports = function highlight(source, languageCode) { 12 | let tokenizedSource = ''; 13 | 14 | const languageMapping = { 15 | html: 'htmlmixed', 16 | javascript: 'jsx', 17 | json: 'jsx', 18 | js: 'jsx', 19 | ruby: 'ruby', 20 | shell: 'shell', 21 | toml: 'toml', 22 | yaml: 'yaml', 23 | yml: 'yaml', 24 | }; 25 | const languageParser = languageMapping[languageCode]; 26 | 27 | const codeType = languageParser === 'shell' ? 'Command' : 'Code'; 28 | 29 | // this is a synchronous callback API 30 | runMode(source, languageParser, (text, style) => { 31 | const escapedText = escape(text); 32 | 33 | if (!style) { 34 | tokenizedSource += escapedText; 35 | return; 36 | } 37 | 38 | tokenizedSource += `${ 39 | escapedText 40 | }`; 41 | }); 42 | 43 | return `
${ 46 | tokenizedSource 47 | }
`; 48 | }; 49 | -------------------------------------------------------------------------------- /docs-src/lib/plugins/webpackEntryMetadata.js: -------------------------------------------------------------------------------- 1 | // this plugin adds the webpack entry points to metadata.webpack.assets 2 | // useful in dev mode when not using ms-webpack 3 | module.exports = function webpackEntryMetadata(webpackConfig) { 4 | return (filenames, metalsmith, cb) => { 5 | const assets = Object.keys(webpackConfig.entry).reduce( 6 | (memo, entryName) => ({ 7 | ...memo, 8 | [`${entryName}.js`]: `${webpackConfig.output.publicPath}${ 9 | entryName 10 | }.js`, 11 | }), 12 | {} 13 | ); 14 | // eslint-disable-next-line no-param-reassign 15 | metalsmith.metadata().webpack = { 16 | assets: { 17 | ...assets, 18 | 'js/common.js': `${webpackConfig.output.publicPath}js/common.js`, 19 | }, 20 | }; 21 | 22 | cb(); 23 | }; 24 | }; 25 | -------------------------------------------------------------------------------- /docs-src/lib/serve.js: -------------------------------------------------------------------------------- 1 | const chokidar = require('chokidar'); 2 | const devServer = require('./devServer.js'); 3 | const builder = require('./builder.js'); 4 | const { start: middlewares } = require('./middlewares'); 5 | const path = require('path'); 6 | 7 | // we build once at start 8 | builder({ middlewares }, err => { 9 | if (err) { 10 | throw err; 11 | } 12 | 13 | // watch and serve docs/ (browser sync) 14 | devServer(); 15 | }); 16 | 17 | // then we watch and rebuild 18 | chokidar 19 | .watch([path.join(__dirname, '../src/**/*')], { 20 | ignoreInitial: true, 21 | ignored: /assets\/js\/(.*)?\.js$/, 22 | }) 23 | .on('all', () => { 24 | builder({ clean: false, middlewares }, err => { 25 | if (err) { 26 | throw err; 27 | } 28 | }); 29 | }) 30 | .on('error', err => { 31 | throw err; 32 | }); 33 | -------------------------------------------------------------------------------- /docs-src/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "jekyll-algolia-docs", 3 | "private": true, 4 | "version": "1.0.0", 5 | "scripts": { 6 | "serve": "./scripts/serve", 7 | "build": "./scripts/build" 8 | }, 9 | "devDependencies": { 10 | "@babel/core": "7.0.0-beta.34", 11 | "@babel/preset-env": "7.0.0-beta.34", 12 | "@babel/preset-react": "7.0.0-beta.34", 13 | "algolia-aerial": "1.2.6", 14 | "algolia-frontend-components": "0.0.34", 15 | "async": "2.6.0", 16 | "autoprefixer": "7.2.1", 17 | "babel-eslint": "8.0.3", 18 | "babel-loader": "8.0.0-beta.0", 19 | "babel-polyfill": "6.26.0", 20 | "browser-sync": "2.18.13", 21 | "chokidar": "1.7.0", 22 | "clipboard": "1.7.1", 23 | "codemirror": "5.32.0", 24 | "compression": "1.7.1", 25 | "css-loader": "0.28.7", 26 | "doctoc": "1.3.0", 27 | "escape-html": "1.0.3", 28 | "eslint": "4.12.1", 29 | "eslint-config-algolia": "13.0.1", 30 | "eslint-config-prettier": "2.9.0", 31 | "eslint-plugin-import": "2.8.0", 32 | "eslint-plugin-prettier": "2.3.1", 33 | "glob": "7.1.2", 34 | "happypack": "4.0.0", 35 | "hasha": "3.0.0", 36 | "http-server": "0.10.0", 37 | "jstransformer-markdown-it": "2.0.0", 38 | "lodash": "4.17.5", 39 | "markdown-it": "8.4.0", 40 | "markdown-it-anchor": "4.0.0", 41 | "metalsmith": "2.3.0", 42 | "metalsmith-clean-css": "5.0.1", 43 | "metalsmith-headings": "0.2.0", 44 | "metalsmith-layouts": "1.8.1", 45 | "metalsmith-sass": "1.4.0", 46 | "ms-webpack": "2.0.0", 47 | "node-sass": "4.7.2", 48 | "nodemon": "1.18.7", 49 | "postcss": "6.0.14", 50 | "postcss-loader": "2.0.9", 51 | "postcss-scss": "1.0.2", 52 | "prettier": "1.8.2", 53 | "pug": "2.0.0-rc.4", 54 | "react": "16.2.0", 55 | "react-dom": "16.2.0", 56 | "react-hot-loader": "3.1.3", 57 | "recursive-readdir": "2.2.1", 58 | "replace-in-file": "3.0.0", 59 | "sass-loader": "6.0.6", 60 | "stat-mode": "0.2.2", 61 | "style-loader": "0.19.0", 62 | "uglifyjs-webpack-plugin": "1.1.2", 63 | "vdom-to-html": "^2.3.1", 64 | "webpack": "3.10.0", 65 | "webpack-dev-middleware": "1.12.2", 66 | "webpack-hot-middleware": "2.21.0" 67 | }, 68 | "engines": { 69 | "node": ">=9.2.0", 70 | "yarn": ">=1.3.2" 71 | }, 72 | "renovate": { 73 | "extends": [ 74 | "config:application", 75 | "schedule:weekends", 76 | ":automergeMinor", 77 | ":automergeBranchPush", 78 | ":semanticCommits", 79 | ":rebaseStalePrs", 80 | ":timezone(Europe/Paris)" 81 | ] 82 | }, 83 | "workspaces": [ 84 | "src/*" 85 | ], 86 | "license": "MIT", 87 | "author": "Algolia, Inc. (https://www.algolia.com)" 88 | } 89 | -------------------------------------------------------------------------------- /docs-src/scripts/build: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | 3 | NODE_ENV=production PUBLIC_PATH='/jekyll-algolia/' node lib/build.js 4 | -------------------------------------------------------------------------------- /docs-src/scripts/serve: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | 3 | NODE_ENV=development node lib/serve.js 4 | -------------------------------------------------------------------------------- /docs-src/src/assets/fonts/DejaVuSansMono.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algolia/jekyll-algolia/ad7db782551dd5f9bfcb2f1c2a13b5504fa5b5a8/docs-src/src/assets/fonts/DejaVuSansMono.eot -------------------------------------------------------------------------------- /docs-src/src/assets/fonts/DejaVuSansMono.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algolia/jekyll-algolia/ad7db782551dd5f9bfcb2f1c2a13b5504fa5b5a8/docs-src/src/assets/fonts/DejaVuSansMono.ttf -------------------------------------------------------------------------------- /docs-src/src/assets/fonts/DejaVuSansMono.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algolia/jekyll-algolia/ad7db782551dd5f9bfcb2f1c2a13b5504fa5b5a8/docs-src/src/assets/fonts/DejaVuSansMono.woff -------------------------------------------------------------------------------- /docs-src/src/assets/fonts/DejaVuSansMonoBold.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algolia/jekyll-algolia/ad7db782551dd5f9bfcb2f1c2a13b5504fa5b5a8/docs-src/src/assets/fonts/DejaVuSansMonoBold.eot -------------------------------------------------------------------------------- /docs-src/src/assets/fonts/DejaVuSansMonoBold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algolia/jekyll-algolia/ad7db782551dd5f9bfcb2f1c2a13b5504fa5b5a8/docs-src/src/assets/fonts/DejaVuSansMonoBold.ttf -------------------------------------------------------------------------------- /docs-src/src/assets/fonts/DejaVuSansMonoBold.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algolia/jekyll-algolia/ad7db782551dd5f9bfcb2f1c2a13b5504fa5b5a8/docs-src/src/assets/fonts/DejaVuSansMonoBold.woff -------------------------------------------------------------------------------- /docs-src/src/assets/fonts/FontAwesome.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algolia/jekyll-algolia/ad7db782551dd5f9bfcb2f1c2a13b5504fa5b5a8/docs-src/src/assets/fonts/FontAwesome.otf -------------------------------------------------------------------------------- /docs-src/src/assets/fonts/Montserrat-Black.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algolia/jekyll-algolia/ad7db782551dd5f9bfcb2f1c2a13b5504fa5b5a8/docs-src/src/assets/fonts/Montserrat-Black.otf -------------------------------------------------------------------------------- /docs-src/src/assets/fonts/Montserrat-Bold.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algolia/jekyll-algolia/ad7db782551dd5f9bfcb2f1c2a13b5504fa5b5a8/docs-src/src/assets/fonts/Montserrat-Bold.otf -------------------------------------------------------------------------------- /docs-src/src/assets/fonts/Montserrat-ExtraBold.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algolia/jekyll-algolia/ad7db782551dd5f9bfcb2f1c2a13b5504fa5b5a8/docs-src/src/assets/fonts/Montserrat-ExtraBold.otf -------------------------------------------------------------------------------- /docs-src/src/assets/fonts/Montserrat-ExtraLight.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algolia/jekyll-algolia/ad7db782551dd5f9bfcb2f1c2a13b5504fa5b5a8/docs-src/src/assets/fonts/Montserrat-ExtraLight.otf -------------------------------------------------------------------------------- /docs-src/src/assets/fonts/Montserrat-Light.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algolia/jekyll-algolia/ad7db782551dd5f9bfcb2f1c2a13b5504fa5b5a8/docs-src/src/assets/fonts/Montserrat-Light.otf -------------------------------------------------------------------------------- /docs-src/src/assets/fonts/Montserrat-Medium.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algolia/jekyll-algolia/ad7db782551dd5f9bfcb2f1c2a13b5504fa5b5a8/docs-src/src/assets/fonts/Montserrat-Medium.otf -------------------------------------------------------------------------------- /docs-src/src/assets/fonts/Montserrat-Regular.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algolia/jekyll-algolia/ad7db782551dd5f9bfcb2f1c2a13b5504fa5b5a8/docs-src/src/assets/fonts/Montserrat-Regular.otf -------------------------------------------------------------------------------- /docs-src/src/assets/fonts/Montserrat-SemiBold.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algolia/jekyll-algolia/ad7db782551dd5f9bfcb2f1c2a13b5504fa5b5a8/docs-src/src/assets/fonts/Montserrat-SemiBold.otf -------------------------------------------------------------------------------- /docs-src/src/assets/fonts/Montserrat-Thin.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algolia/jekyll-algolia/ad7db782551dd5f9bfcb2f1c2a13b5504fa5b5a8/docs-src/src/assets/fonts/Montserrat-Thin.otf -------------------------------------------------------------------------------- /docs-src/src/assets/fonts/algolia-brands-iconfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algolia/jekyll-algolia/ad7db782551dd5f9bfcb2f1c2a13b5504fa5b5a8/docs-src/src/assets/fonts/algolia-brands-iconfont.eot -------------------------------------------------------------------------------- /docs-src/src/assets/fonts/algolia-brands-iconfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algolia/jekyll-algolia/ad7db782551dd5f9bfcb2f1c2a13b5504fa5b5a8/docs-src/src/assets/fonts/algolia-brands-iconfont.ttf -------------------------------------------------------------------------------- /docs-src/src/assets/fonts/algolia-brands-iconfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algolia/jekyll-algolia/ad7db782551dd5f9bfcb2f1c2a13b5504fa5b5a8/docs-src/src/assets/fonts/algolia-brands-iconfont.woff -------------------------------------------------------------------------------- /docs-src/src/assets/fonts/algolia-website-iconfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algolia/jekyll-algolia/ad7db782551dd5f9bfcb2f1c2a13b5504fa5b5a8/docs-src/src/assets/fonts/algolia-website-iconfont.eot -------------------------------------------------------------------------------- /docs-src/src/assets/fonts/algolia-website-iconfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algolia/jekyll-algolia/ad7db782551dd5f9bfcb2f1c2a13b5504fa5b5a8/docs-src/src/assets/fonts/algolia-website-iconfont.ttf -------------------------------------------------------------------------------- /docs-src/src/assets/fonts/algolia-website-iconfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algolia/jekyll-algolia/ad7db782551dd5f9bfcb2f1c2a13b5504fa5b5a8/docs-src/src/assets/fonts/algolia-website-iconfont.woff -------------------------------------------------------------------------------- /docs-src/src/assets/fonts/fontawesome-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algolia/jekyll-algolia/ad7db782551dd5f9bfcb2f1c2a13b5504fa5b5a8/docs-src/src/assets/fonts/fontawesome-webfont.eot -------------------------------------------------------------------------------- /docs-src/src/assets/fonts/fontawesome-webfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algolia/jekyll-algolia/ad7db782551dd5f9bfcb2f1c2a13b5504fa5b5a8/docs-src/src/assets/fonts/fontawesome-webfont.ttf -------------------------------------------------------------------------------- /docs-src/src/assets/fonts/fontawesome-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algolia/jekyll-algolia/ad7db782551dd5f9bfcb2f1c2a13b5504fa5b5a8/docs-src/src/assets/fonts/fontawesome-webfont.woff -------------------------------------------------------------------------------- /docs-src/src/assets/fonts/fontawesome-webfont.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algolia/jekyll-algolia/ad7db782551dd5f9bfcb2f1c2a13b5504fa5b5a8/docs-src/src/assets/fonts/fontawesome-webfont.woff2 -------------------------------------------------------------------------------- /docs-src/src/assets/fonts/montserrat-v10-latin-300.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algolia/jekyll-algolia/ad7db782551dd5f9bfcb2f1c2a13b5504fa5b5a8/docs-src/src/assets/fonts/montserrat-v10-latin-300.woff -------------------------------------------------------------------------------- /docs-src/src/assets/fonts/montserrat-v10-latin-300.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algolia/jekyll-algolia/ad7db782551dd5f9bfcb2f1c2a13b5504fa5b5a8/docs-src/src/assets/fonts/montserrat-v10-latin-300.woff2 -------------------------------------------------------------------------------- /docs-src/src/assets/fonts/montserrat-v10-latin-500.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algolia/jekyll-algolia/ad7db782551dd5f9bfcb2f1c2a13b5504fa5b5a8/docs-src/src/assets/fonts/montserrat-v10-latin-500.woff -------------------------------------------------------------------------------- /docs-src/src/assets/fonts/montserrat-v10-latin-500.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algolia/jekyll-algolia/ad7db782551dd5f9bfcb2f1c2a13b5504fa5b5a8/docs-src/src/assets/fonts/montserrat-v10-latin-500.woff2 -------------------------------------------------------------------------------- /docs-src/src/assets/fonts/montserrat-v10-latin-600.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algolia/jekyll-algolia/ad7db782551dd5f9bfcb2f1c2a13b5504fa5b5a8/docs-src/src/assets/fonts/montserrat-v10-latin-600.woff -------------------------------------------------------------------------------- /docs-src/src/assets/fonts/montserrat-v10-latin-600.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algolia/jekyll-algolia/ad7db782551dd5f9bfcb2f1c2a13b5504fa5b5a8/docs-src/src/assets/fonts/montserrat-v10-latin-600.woff2 -------------------------------------------------------------------------------- /docs-src/src/assets/fonts/montserrat-v10-latin-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algolia/jekyll-algolia/ad7db782551dd5f9bfcb2f1c2a13b5504fa5b5a8/docs-src/src/assets/fonts/montserrat-v10-latin-regular.woff -------------------------------------------------------------------------------- /docs-src/src/assets/fonts/montserrat-v10-latin-regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algolia/jekyll-algolia/ad7db782551dd5f9bfcb2f1c2a13b5504fa5b5a8/docs-src/src/assets/fonts/montserrat-v10-latin-regular.woff2 -------------------------------------------------------------------------------- /docs-src/src/assets/images/aerial-background-top.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /docs-src/src/assets/images/card.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algolia/jekyll-algolia/ad7db782551dd5f9bfcb2f1c2a13b5504fa5b5a8/docs-src/src/assets/images/card.png -------------------------------------------------------------------------------- /docs-src/src/assets/images/dry-run.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algolia/jekyll-algolia/ad7db782551dd5f9bfcb2f1c2a13b5504fa5b5a8/docs-src/src/assets/images/dry-run.gif -------------------------------------------------------------------------------- /docs-src/src/assets/images/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algolia/jekyll-algolia/ad7db782551dd5f9bfcb2f1c2a13b5504fa5b5a8/docs-src/src/assets/images/favicon.png -------------------------------------------------------------------------------- /docs-src/src/assets/images/getting-started.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algolia/jekyll-algolia/ad7db782551dd5f9bfcb2f1c2a13b5504fa5b5a8/docs-src/src/assets/images/getting-started.gif -------------------------------------------------------------------------------- /docs-src/src/assets/images/github-icon.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /docs-src/src/assets/images/instantsearch-nostyling.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algolia/jekyll-algolia/ad7db782551dd5f9bfcb2f1c2a13b5504fa5b5a8/docs-src/src/assets/images/instantsearch-nostyling.png -------------------------------------------------------------------------------- /docs-src/src/assets/images/instantsearch-styling.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algolia/jekyll-algolia/ad7db782551dd5f9bfcb2f1c2a13b5504fa5b5a8/docs-src/src/assets/images/instantsearch-styling.png -------------------------------------------------------------------------------- /docs-src/src/assets/images/light-speed.svg: -------------------------------------------------------------------------------- 1 | Rectangle-path 2 | -------------------------------------------------------------------------------- /docs-src/src/assets/images/minima-search.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algolia/jekyll-algolia/ad7db782551dd5f9bfcb2f1c2a13b5504fa5b5a8/docs-src/src/assets/images/minima-search.gif -------------------------------------------------------------------------------- /docs-src/src/assets/images/netlify-env.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algolia/jekyll-algolia/ad7db782551dd5f9bfcb2f1c2a13b5504fa5b5a8/docs-src/src/assets/images/netlify-env.png -------------------------------------------------------------------------------- /docs-src/src/assets/images/touch-point.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /docs-src/src/assets/images/travis-config.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algolia/jekyll-algolia/ad7db782551dd5f9bfcb2f1c2a13b5504fa5b5a8/docs-src/src/assets/images/travis-config.png -------------------------------------------------------------------------------- /docs-src/src/assets/images/travis-env.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algolia/jekyll-algolia/ad7db782551dd5f9bfcb2f1c2a13b5504fa5b5a8/docs-src/src/assets/images/travis-env.png -------------------------------------------------------------------------------- /docs-src/src/assets/js/activateClipboard.js: -------------------------------------------------------------------------------- 1 | import Clipboard from 'clipboard'; 2 | 3 | export default function activateClipboard(codeSamples) { 4 | codeSamples.forEach(codeSample => { 5 | const cleanAfter = 800; 6 | let timeout; 7 | const copyToClipboard = document.createElement('button'); 8 | const codeAttribute = codeSample.getAttribute('data-code-type'); 9 | 10 | const setup = () => { 11 | clearTimeout(timeout); 12 | copyToClipboard.innerHTML = ''; 13 | copyToClipboard.setAttribute('title', 'copy'); 14 | copyToClipboard.classList.remove('clipboard-done'); 15 | copyToClipboard.classList.add('clipboard'); 16 | }; 17 | 18 | const done = () => { 19 | copyToClipboard.classList.add('clipboard-done'); 20 | copyToClipboard.textContent = 'Copied!'; 21 | }; 22 | 23 | const clipboard = new Clipboard(copyToClipboard, { 24 | text: () => codeSample.querySelector('code').textContent, 25 | }); 26 | 27 | setup(); 28 | 29 | const heading = document.createElement('div'); 30 | heading.className = 'heading'; 31 | 32 | // eslint-disable-next-line no-unused-expressions 33 | codeAttribute === 'Command' 34 | ? (heading.innerHTML = 'Command') 35 | : (heading.innerHTML = 'Code'); 36 | heading.appendChild(copyToClipboard); 37 | codeSample.parentNode.insertBefore(heading, codeSample); 38 | 39 | copyToClipboard.addEventListener('mouseleave', setup, true); 40 | clipboard.on('success', () => { 41 | done(); 42 | timeout = setTimeout(setup, cleanAfter); 43 | }); 44 | }); 45 | } 46 | -------------------------------------------------------------------------------- /docs-src/src/assets/js/editThisPage.js: -------------------------------------------------------------------------------- 1 | if (document.querySelector('.documentation-container')) { 2 | const $edit = document.createElement('a'); 3 | $edit.classList.add('editThisPage'); 4 | $edit.textContent = 'Edit this page'; 5 | 6 | let href = 'https://github.com/algolia/jekyll-algolia/edit/develop/'; 7 | const doc = 'docs-src/src'; 8 | 9 | let pathname = document.location.pathname.replace('/jekyll-algolia', ''); 10 | 11 | if (/\/$/.test(pathname)) pathname += 'index.html'; 12 | href += `${doc}${pathname.replace('.html', '.md')}`; 13 | 14 | pathname = pathname.replace('.html', '.md'); 15 | $edit.href = href; 16 | document.querySelector('.documentation-container').appendChild($edit); 17 | } 18 | -------------------------------------------------------------------------------- /docs-src/src/assets/js/freezeGifs.js: -------------------------------------------------------------------------------- 1 | function createElement(type, callback) { 2 | const element = document.createElement(type); 3 | 4 | callback(element); 5 | 6 | return element; 7 | } 8 | 9 | function freezeGif(img) { 10 | const width = img.width; 11 | const height = img.height; 12 | const canvas = createElement('canvas', clone => { 13 | clone.width = width; 14 | clone.height = height; 15 | }); 16 | let attr; 17 | 18 | const freeze = function() { 19 | canvas.getContext('2d').drawImage(img, 0, 0, width, height); 20 | 21 | for (let i = 0; i < img.attributes.length; i++) { 22 | attr = img.attributes[i]; 23 | 24 | if (attr.name !== '"') { 25 | canvas.setAttribute(attr.name, attr.value); 26 | } 27 | } 28 | 29 | canvas.style.position = 'absolute'; 30 | 31 | img.parentNode.insertBefore(canvas, img); 32 | img.style.opacity = 0; 33 | img.style.visibility = 'hidden'; 34 | canvas.style.visibility = 'visible'; 35 | canvas.style.opacity = 1; 36 | 37 | img.parentNode.addEventListener('mouseover', () => { 38 | img.style.opacity = 1; 39 | img.style.visibility = 'visible'; 40 | canvas.style.visibility = 'hidden'; 41 | canvas.style.opacity = 0; 42 | }); 43 | img.parentNode.addEventListener('mouseout', () => { 44 | img.style.opacity = 0; 45 | img.style.visibility = 'hidden'; 46 | canvas.style.visibility = 'visible'; 47 | canvas.style.opacity = 1; 48 | }); 49 | }; 50 | 51 | if (img.complete) { 52 | freeze(); 53 | } else { 54 | img.addEventListener('load', freeze, true); 55 | window.addEventListener('resize', freeze, true); 56 | } 57 | } 58 | 59 | export function freezeAllGifs() { 60 | return [].slice 61 | .apply(document.querySelectorAll('.js-freeze')) 62 | .map(freezeGif); 63 | } 64 | -------------------------------------------------------------------------------- /docs-src/src/assets/js/main.js: -------------------------------------------------------------------------------- 1 | import { 2 | repositionSidebarOnScroll, 3 | updateReadLinkOnScroll, 4 | } from './sidebar.js'; 5 | import activateClipboard from './activateClipboard.js'; 6 | import alg from 'algolia-frontend-components/javascripts.js'; 7 | import './editThisPage.js'; 8 | import { freezeAllGifs } from './freezeGifs.js'; 9 | 10 | const docSearch = { 11 | apiKey: '5e2de32b362723ffdb03414c5c3d2ec8', 12 | indexName: 'jekyll_algolia', 13 | inputSelector: '#searchbox', 14 | }; 15 | 16 | /* eslint-disable no-unused-vars */ 17 | /* eslint-disable new-cap */ 18 | const header = new alg.communityHeader(docSearch); 19 | 20 | const container = document.querySelector('.documentation-container'); 21 | const codeSamples = document.querySelectorAll('.code-sample'); 22 | 23 | activateClipboard(codeSamples); 24 | freezeAllGifs(); 25 | 26 | if (document.querySelector('.sidebar')) { 27 | repositionSidebarOnScroll(); 28 | updateReadLinkOnScroll(); 29 | } 30 | -------------------------------------------------------------------------------- /docs-src/src/commandline.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Command line 3 | layout: content-with-menu.pug 4 | --- 5 | 6 | # Commandline 7 | 8 | List of all the commandline arguments that can be passed to the plugin and what 9 | they do. Includes ENV variables as well. 10 | 11 | 12 | 13 | ## Arguments 14 | 15 | Here is the list of command line options you can pass to the `jekyll algolia` command: 16 | 17 | | Flag | Description | 18 | | ---- | ----- | 19 | | `--config ./_config.yml` | You can here specify the config file to use. Default is `_config.yml` | 20 | | `--dry-run` or `-n` | Do a dry run, do not actually push anything to your index | 21 | | `--verbose` | Display more information about what is going to be indexed | 22 | | `--force-settings` | Force update of the index settings | 23 | 24 | 25 | ## Environment variables 26 | 27 | The recommended place to store your Algolia application ID and index name are in 28 | the `_config.yml` file but there are a few environment variables your can define 29 | to overwrite those values. 30 | 31 | key | value 32 | ---------------------- | ---------------------- 33 | ALGOLIA_APPLICATION_ID | Your Application ID, available in [your dashboard](https://www.algolia.com/api-keys). 34 | ALGOLIA_INDEX_NAME | Your Index name, any string will work 35 | ALGOLIA_API_KEY | Your Admin API Key, available in [your dashboard](https://www.algolia.com/api-keys). 36 | 37 | ## `_algolia_api_key` file 38 | 39 | The recommended way to define your Algolia admin API key is to use the 40 | `ALGOLIA_API_KEY` environment variable. Because this key should be kept secret, 41 | its better if it's loaded directly from the environment. But the plugin can also 42 | load the key from another source. 43 | 44 | You can create a file named `_algolia_api_key` in your source directory that 45 | contains your admin API key. If no `ALGOLIA_API_KEY` environment variable is 46 | defined, the plugin will fallback to the value set in the `_algolia_api_key` 47 | file. 48 | 49 | **Note that this method trades off security for convenience, so be very careful 50 | when using it. Do not commit this file in your versioning system (add it to your 51 | `.gitignore` for example).** 52 | -------------------------------------------------------------------------------- /docs-src/src/includes/mixins.pug: -------------------------------------------------------------------------------- 1 | mixin feature(options) 2 | - var title = options.title 3 | - var image = options.image || './assets/images/placeholder.png' 4 | - var isFlipped = options.flip || false 5 | section.row.p-xlarge.m-l-none.m-r-none.pos-rel 6 | .container 7 | .inline.spacer40.hidden-sm 8 | .col-md-12.z-10 9 | if isFlipped === false 10 | .col-md-6.hidden-sm 11 | img.section-illustration(src=image, alt=title, width="525") 12 | 13 | .col-md-6.p-r-xlarge 14 | header 15 | h3.no-p-t.m-t-none.text-thin=title 16 | .spacer16.visible-sm 17 | img.section-illustration.visible-sm(src=image, alt=title, width="525") 18 | .spacer24 19 | p.color-east-bay.text-regular.text-normal 20 | block 21 | .spacer24 22 | 23 | if isFlipped === true 24 | .col-md-6.hidden-sm 25 | img.section-illustration(src=image, alt=title, width="525") 26 | -------------------------------------------------------------------------------- /docs-src/src/index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Algolia for Jekyll 3 | layout: index.pug 4 | --- 5 | 6 | 7 | -------------------------------------------------------------------------------- /docs-src/src/layouts/common/header.pug: -------------------------------------------------------------------------------- 1 | - var project = "Algolia for Jekyll" 2 | - var url = "https://community.algolia.com/jekyll-algolia/" 3 | - var image = "https://community.algolia.com/jekyll-algolia/assets/images/card.png" 4 | - var long_desc = "Add fast and relevant search to your Jekyll site" 5 | - var short_desc = "Add fast and relevant search to your Jekyll site" 6 | 7 | base(href=publicPath) 8 | meta(content='IE=edge', http-equiv='X-UA-Compatible') 9 | meta(charset='utf-8') 10 | meta(content='width=device-width,initial-scale=1.0,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no', name='viewport') 11 | meta(name='ROBOTS', content='NOINDEX, NOFOLLOW') 12 | link(rel='icon', href="assets/images/favicon.png") 13 | meta(content='IE=edge,chrome=1', http-equiv='X-UA-Compatible') 14 | meta(content=long_desc, name='description') 15 | meta(content='width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0', name='viewport') 16 | // Twitter card 17 | meta(content='summary_large_image', name='twitter:card') 18 | meta(content=url, name='twitter:site') 19 | meta(content='Algolia', name='twitter:creator') 20 | meta(content=project, name='twitter:title') 21 | meta(content=short_desc, name='twitter:description') 22 | meta(content=image, name='twitter:image') 23 | // OG meta 24 | meta(content=url, property='og:url') 25 | meta(content=project, property='og:title') 26 | meta(content=image, property='og:image') 27 | meta(content='website', property='og:type') 28 | meta(content=short_desc, property='og:description') 29 | meta(content=project, property='og:site_name') 30 | 31 | title #{project} | #{short_desc} 32 | link(rel="stylesheet", href="https://cdn.jsdelivr.net/docsearch.js/2/docsearch.min.css") 33 | link(rel='stylesheet', href="stylesheets/index.css") 34 | -------------------------------------------------------------------------------- /docs-src/src/layouts/common/hero.pug: -------------------------------------------------------------------------------- 1 | section.hero.fill-titan 2 | .container.z-10 3 | .spacer80 4 | h1.heading-text Something something 5 | 6 | h2.color-logan.text-lg.text-thin Something something is super cool 7 | 8 | .spacer32 9 | a.btn.btn-static-theme.elevation0(href="about.html", title="About"). 10 | Get started with About 11 | 12 | .inline.m-l-small.m-r-small.hidden-xs 13 | a.btn.btn-static-theme.elevation0(href="support.html", title="Support"). 14 | Get started with Support 15 | 16 | 17 | .spacer80.hidden-sm 18 | .row.z-10.m-l-none.m-r-none 19 | .spacer40 20 | .spacer40.hidden-md 21 | figure 22 | img(src="assets/images/InstantSearch-React-medal.svg") 23 | .spacer40.hidden-sm 24 | .spacer120 25 | .spacer40.hidden-sm 26 | -------------------------------------------------------------------------------- /docs-src/src/layouts/common/marketing.pug: -------------------------------------------------------------------------------- 1 | //Google Tag Manager 2 | noscript 3 | iframe(src='//www.googletagmanager.com/ns.html?id=GTM-N8JP8G', height='0', width='0', style='display:none;visibility:hidden') 4 | script. 5 | (function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start': new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src='//www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);})(window,document,'script','dataLayer','GTM-N8JP8G'); 6 | -------------------------------------------------------------------------------- /docs-src/src/layouts/common/meta.pug: -------------------------------------------------------------------------------- 1 | include ../../includes/mixins 2 | 3 | doctype html 4 | html(lang="en") 5 | head 6 | include ./header.pug 7 | 8 | body 9 | div !{header} 10 | .spacer56 11 | .fill-koromiko.p-mini.text-center.text-bold.color-bunting This plugin is deprecated and no longer maintained by Algolia. 12 | block body 13 | 14 | include ./footer.pug 15 | 16 | script(src="https://cdn.jsdelivr.net/docsearch.js/2/docsearch.min.js") 17 | script(src=webpack.assets['js/common.js']) 18 | script(src=webpack.assets['js/main.js']) 19 | script(src=webpack.assets['js/freezeGifs.js']) 20 | -------------------------------------------------------------------------------- /docs-src/src/layouts/content-with-menu.pug: -------------------------------------------------------------------------------- 1 | extends ./common/meta.pug 2 | 3 | block body 4 | section.documentation-section 5 | .container.relative 6 | nav.sidebar.z-100.sidebar_fixed 7 | .sidebar-container 8 | each category in sidebarMenu 9 | h2.sidebar-header.text-bold=category.title 10 | ul.sidebar-elements 11 | each item in category.items 12 | li.sidebar-element 13 | - var className = item.isActive ? 'sidebar-element_active': ''; 14 | a(href=item.url class=className)=item.title 15 | if item.items 16 | ul 17 | each subitem in item.items 18 | li.sidebar-element 19 | a(href=subitem.url)=subitem.title 20 | 21 | a.sidebar-opener 22 | .documentation-container 23 | !=contents 24 | -------------------------------------------------------------------------------- /docs-src/src/layouts/single-column.pug: -------------------------------------------------------------------------------- 1 | extends ./common/meta.pug 2 | 3 | block body 4 | .content!=contents 5 | -------------------------------------------------------------------------------- /docs-src/src/stylesheets/components/_buttons.scss: -------------------------------------------------------------------------------- 1 | .btn-static-theme, 2 | .btn-cta { 3 | border: none; 4 | color: #fff; 5 | background-image: linear-gradient(80deg, $theme-color, #00A7FF); 6 | &:hover, &:focus { 7 | color: #fff; 8 | background-image: linear-gradient(80deg, $theme-color, #00A7FF); } 9 | &:active, &.active { 10 | background-image: linear-gradient(80deg, darken($theme-color, 4%), darken(#00A7FF, 4%)); } 11 | &.btn-shadow, 12 | &.btn-cta { 13 | box-shadow: 0 2px 6px 0 rgba($theme-color, 0.4); 14 | &:hover, &:focus { 15 | box-shadow: 0 4px 12px rgba($theme-color, 0.4); } } 16 | 17 | svg { 18 | width: 16px; 19 | height: 16px; 20 | vertical-align: middle; 21 | margin-left: 0.5em; 22 | 23 | use { 24 | fill: #fff; } } } 25 | -------------------------------------------------------------------------------- /docs-src/src/stylesheets/components/_code-snippets.scss: -------------------------------------------------------------------------------- 1 | // This file is defining code snippets styling for the homepage 2 | 3 | $light-theme: ( 4 | ('keyword', '#8e43e7'), 5 | ('operator', '#f95faa'), 6 | ('property', '#75de00'), 7 | ('variable', '#3369e7'), 8 | ('string', '#00aeff'), 9 | ('comment', '#bbbbbb') 10 | ); 11 | 12 | 13 | 14 | $size: 13px; 15 | $line-height: round(($size / 2)*2.6999999); 16 | $gutter-width: 3.5em; 17 | $padding: 13px; 18 | $line-number-size: round(($size / 2)*1.538462); 19 | 20 | pre.al-snippet code { 21 | transform: scale(0.765); 22 | font-size: $size; 23 | } 24 | pre { 25 | &.al-snippet { 26 | color: $bunting; 27 | box-sizing: border-box; 28 | line-height: initial; 29 | word-break: initial; 30 | word-wrap: initial; 31 | border-radius: 5px; 32 | display: inline-block; 33 | margin: initial !important; 34 | line-height: $line-height*1.02; 35 | font-size: 12px; 36 | border: none; 37 | 38 | 39 | code { 40 | position: relative; 41 | top: -0.5em; 42 | } 43 | 44 | // Theme 45 | &[data-snippet-theme="dark"] { 46 | 47 | // Now, let' give it colors 48 | // Namespace : sn- 49 | @each $name, $color in $light-theme { 50 | .sn-#{$name} { 51 | color: #{$color} 52 | } 53 | } 54 | } 55 | } 56 | } 57 | 58 | [debug-code-snippet] pre.al-snippet { 59 | background-image: linear-gradient(transparent 50%, rgba(69, 142, 209, 0.04) 50%); 60 | background-size: $size $size; 61 | background-origin: content-box; 62 | } -------------------------------------------------------------------------------- /docs-src/src/stylesheets/components/_footer.scss: -------------------------------------------------------------------------------- 1 | 2 | $footer-shade-1: #2E2A51; 3 | $footer-shade-2: #1F1C3F; 4 | $footer-shade-3: #12102E; 5 | 6 | // Footer CTA 7 | .footer-new-cta { 8 | background: url('../assets/images/algolia-fast-bg.svg') no-repeat center center / cover; 9 | margin-bottom: -90px; 10 | padding-bottom: 60px; 11 | height: 750px; 12 | 13 | .homepage & { 14 | height: 940px; } 15 | 16 | @media (min-width: $screen-md) { 17 | margin-top: -200px; } 18 | 19 | @media (max-width: $screen-md) { 20 | height: 860px; 21 | text-align: center; } 22 | 23 | @media (max-width: $screen-sm) { 24 | height: 820px; 25 | 26 | .stellar-container { 27 | width: 100% !important; } } 28 | 29 | @media (max-width: $screen-xs) { 30 | height: 960px; } 31 | 32 | @include diagonal(-6deg, $white, 180px, before) { 33 | top: -80px; 34 | z-index: 1; 35 | 36 | @media (max-width: $screen-sm) { 37 | height: 80px; 38 | top: -40px; } } 39 | 40 | .button-holder { 41 | background: url('../assets/images/light-speed.svg')no-repeat center top / contain; 42 | span.inline { 43 | float: right; 44 | 45 | @media (max-width: $screen-lg) { 46 | top: 4%; } 47 | 48 | i.icon-search { 49 | vertical-align: middle; } } 50 | 51 | 52 | @media (max-width: ($screen-lg) ) { 53 | background: url('../assets/images/light-speed.svg')no-repeat right top / 92%; } 54 | 55 | @media (max-width: ($screen-md) ) { 56 | background: transparent; 57 | span.inline { 58 | width: 100%; 59 | text-align: center; } 60 | 61 | .btn { 62 | margin: auto; } } } } 63 | 64 | #footer { 65 | position: relative; 66 | 67 | 68 | @include diagonal(-4deg, $footer-shade-2, 130px, after) { 69 | bottom: 64px; 70 | left: 0; } 71 | 72 | .credits { 73 | margin-top: 80px; 74 | text-align: center; 75 | position: relative; 76 | background-color: $footer-shade-3; 77 | color: $portage; 78 | z-index: 99; 79 | line-height: 40px; 80 | @include diagonal(-2deg, $footer-shade-3, 80px, before) { 81 | top: -40px; 82 | left: 0; } 83 | 84 | @media (max-width: $screen-md) { 85 | margin-top: 40px; } } } 86 | 87 | 88 | 89 | .search-icon, 90 | .arrow-icon { 91 | margin-left: 1em; 92 | width: 22px; 93 | height: 42px; 94 | vertical-align: middle; 95 | 96 | @media (max-width: $screen-sm) { 97 | display: none; } } 98 | 99 | 100 | .arrow-icon { 101 | width: 16px; 102 | use { 103 | fill: $bunting; } } 104 | 105 | -------------------------------------------------------------------------------- /docs-src/src/stylesheets/components/_hero.scss: -------------------------------------------------------------------------------- 1 | .hero { 2 | padding-top: 56px; 3 | text-align: center; 4 | position: relative; 5 | 6 | 7 | h1 { 8 | font-size: 56px !important; } 9 | h2 { 10 | font-size: 20px !important; 11 | font-weight: 300 !important; 12 | display: inline-block; 13 | max-width: 80%; 14 | line-height: 1.5; } 15 | 16 | 17 | img { 18 | max-width: 334px; } 19 | 20 | &:not(.hero-doc) { 21 | @include diagonal(-6deg, $white, 300px, before) { 22 | bottom: -190px; 23 | z-index: 1; 24 | box-shadow: rgba(112, 128, 175, 0.05) 0 -16px 24px; 25 | 26 | @media (max-width: $screen-sm) { 27 | height: 100px; 28 | bottom: -80px; } } } 29 | 30 | @media (max-width: $screen-sm) { 31 | .btn { 32 | width: 100%; 33 | margin-bottom: 1em; } 34 | 35 | figure { 36 | img { 37 | width: 80%; 38 | max-width: 320px; } } 39 | 40 | h1 { 41 | font-size: 36px !important; 42 | font-weight: bold; } 43 | h2 { 44 | font-size: 18px !important; } } 45 | 46 | 47 | .row { 48 | background: url(../assets/images/background-hero.svg)no-repeat center left / 80%; 49 | 50 | @media (max-width: $screen-sm) { 51 | background: url(../assets/images/background-hero.svg)no-repeat center left / cover; } 52 | 53 | @media (min-width: 1600px) { 54 | height: 600px; 55 | background: url(../assets/images/background-hero.svg)no-repeat center left / 80%; } } } 56 | 57 | 58 | // Hero documentation 59 | .hero.hero-doc { 60 | background: { 61 | image: url('../assets/images/logo_isjs.svg'), linear-gradient(to right, $purple-heart, $algolia-blue); 62 | repeat: no-repeat; 63 | size: 330px, 100%; 64 | position: top 90% right 5em, center left; } } 65 | 66 | -------------------------------------------------------------------------------- /docs-src/src/stylesheets/components/_medias.scss: -------------------------------------------------------------------------------- 1 | 2 | figure { 3 | figcaption { 4 | visibility: hidden; } } 5 | -------------------------------------------------------------------------------- /docs-src/src/stylesheets/components/_navigation.scss: -------------------------------------------------------------------------------- 1 | /** 2 | * Algolia components - community header 3 | * Light theme 4 | */ 5 | 6 | // Navigation 7 | .algc-navigation { 8 | background: $white; 9 | box-shadow: 0 10px 40px 0 rgba($bunting,0.07), 0 2px 9px 0 rgba($bunting,0.06); } 10 | 11 | 12 | .algc-navigation__brands a, 13 | .algc-navigation__menu .algc-menu__list a { 14 | color: $bunting; 15 | font-weight: 400; 16 | 17 | &:hover { 18 | color: $deep-cove; 19 | text-decoration: none; } } 20 | 21 | 22 | .algc-menu__search .algc-search__input button svg path { 23 | fill: $bunting !important; } 24 | 25 | 26 | .algc-menu__search--holder.open input[type="search"] { 27 | max-width: 240px; 28 | background: rgba($bunting, 0.1); 29 | color: $bunting; 30 | transform: translate(-240px); 31 | 32 | @media (max-width: $screen-sm) { 33 | transform: translate(-140px); } 34 | 35 | &::-webkit-input-placeholder { 36 | color: $bunting; } 37 | &:-moz-placeholder { 38 | color: $bunting; } 39 | &::-moz-placeholder { 40 | color: $bunting; } 41 | &:-ms-input-placeholder { 42 | color: $bunting; } } 43 | 44 | 45 | 46 | 47 | .algc-menu__search--holder.open button#search { 48 | transform: translate(calc(-240px + 4em), -50%); 49 | @media (max-width: $screen-sm) { 50 | transform: translate(calc(-140px + 4em), -50%); } } 51 | 52 | .algc-navigation__brands svg.algc-arrowseparator path { 53 | fill: $logan; } 54 | 55 | 56 | // Dropdown 57 | .algc-navigation__menu .algc-menu__sublist:before { 58 | display: none; } 59 | 60 | .algc-dropdownroot { 61 | .algc-dropdownroot__dropdownarrow { 62 | background: #F7F7FF; } 63 | 64 | 65 | &.activeDropdown .algc-dropdownroot__dropdownbg { 66 | box-shadow: 0 50px 100px rgba(50, 50, 93, 0.1), 0 15px 35px rgba(50, 50, 93, 0.15), 0 5px 15px rgba(0, 0, 0, 0.1), 0 -4px 16px rgba(50, 50, 93,0.1); } } 67 | 68 | 69 | .algc-dropdownroot__widelist li h4 { 70 | white-space: nowrap; 71 | overflow: hidden; 72 | text-overflow: ellipsis; 73 | width: 70%; 74 | display: block; } 75 | // Mobile 76 | .algc-openmobile { 77 | background: #332e58; 78 | border-radius: 6px; } 79 | 80 | .algc-mobilemenu { 81 | background: #f8faff; 82 | &:after { 83 | display: none; } 84 | 85 | a { 86 | color: $bunting; } 87 | .algc-mobilemenu__item:after { 88 | background: linear-gradient(76deg, rgba(#211e39, 0.01) 0%, rgba(#211e39, 0) 18%, #211e39 46%, rgba(#6a7599, 0.7) 93%, rgba(#6a7599, 0) 100%); } } 89 | 90 | 91 | 92 | @media only screen and (max-width: $screen-sm) { 93 | .algc-navigation__brands .algc-navigation__li.algc-navigation__li--community { 94 | width: 45px !important; 95 | overflow: hidden !important; } } 96 | 97 | -------------------------------------------------------------------------------- /docs-src/src/stylesheets/components/open-doc-menu_icon.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Combined Shape 5 | Created with Sketch. 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /docs-src/src/stylesheets/index.scss: -------------------------------------------------------------------------------- 1 | @charset 'utf-8'; 2 | 3 | @import 'node_modules/algolia-frontend-components/dist/_communityHeader'; 4 | @import 'node_modules/algolia-aerial/src/stylesheet/aerial'; 5 | 6 | @import 'modules/base'; 7 | @import 'modules/mixins'; 8 | 9 | @import 'components/navigation'; 10 | // @import 'components/hero'; 11 | @import 'components/medias'; 12 | @import 'components/icons'; 13 | @import 'components/buttons'; 14 | @import 'components/footer'; 15 | @import 'components/documentation'; 16 | @import 'components/sidebar'; 17 | @import 'components/code-snippets'; 18 | @import 'components/code-highlighting'; 19 | @import 'partials/helpers'; 20 | 21 | 22 | @import 'pages/index'; 23 | @import 'pages/examples'; 24 | 25 | // Custom styles added to mark the project as deprecated 26 | @import 'modules/deprecating'; 27 | 28 | 29 | * { 30 | box-sizing: border-box; 31 | -webkit-font-smoothing: antialiased; 32 | -moz-osx-font-smoothing: grayscale; } 33 | 34 | .debug * { outline: 1px solid gold; } 35 | .absolute { position: absolute; } 36 | .relative { position: relative; } 37 | .fixed { position: fixed; } 38 | .bottom-0 { bottom: 0; } 39 | 40 | .flex-none { flex: none; } 41 | .flex-auto { flex: 1 1 auto; min-width: 0; min-height: 0; } 42 | .flex-row-center-vertical { display: flex; align-items: center; } 43 | .flex-row-center-horizontal { display: flex; justify-content: center; } 44 | .flex-column-center-vertical { display: flex; justify-content: center; } 45 | .flex-column-center-horizontal { display: flex; align-items: center; } 46 | .flex-center { display: flex; align-items: center; justify-content: center; } 47 | .flex-row-align-left { justify-content: flex-start; } 48 | .flex-row-align-right { justify-content: flex-end; } 49 | .flex-column-align-top { justify-content: flex-start; } 50 | .flex-column-align-bottom { justify-content: flex-end; } 51 | 52 | .w50 { width: 50%; } 53 | .w75 { width: 75%; } 54 | .color-titan-white { color: $titan-white; } 55 | .fill-titan-white { background-color: $titan-white; } 56 | .align-right { text-align: right; } 57 | -------------------------------------------------------------------------------- /docs-src/src/stylesheets/modules/_deprecating.scss: -------------------------------------------------------------------------------- 1 | // Hide the header Community dropdown 2 | .algc-navigation__dropdown-holder { 3 | position: absolute; 4 | top:-100%; 5 | left:-100%; 6 | opacity:0; 7 | display: none; 8 | pointer-events: none; 9 | } 10 | -------------------------------------------------------------------------------- /docs-src/src/stylesheets/pages/_examples.scss: -------------------------------------------------------------------------------- 1 | .examples-container { 2 | padding: 40px 0; 3 | .flex-it-2 { 4 | @include small-mq { 5 | flex: 0 1 100% !important; } } 6 | .flex-it-2 > div { 7 | background: #fefefe; 8 | border: 1px solid #ebebeb; 9 | position: relative; 10 | text-align: center; 11 | overflow: hidden; 12 | 13 | img { 14 | width: 100%; } 15 | 16 | .links { 17 | width: 100%; 18 | height: 100%; 19 | text-indent: 0; 20 | color: inherit; 21 | left: 0; 22 | background: darken($accent-color, 0.95); 23 | background: linear-gradient(to bottom right, $algolia-blue, darken($accent-color, 0.95)); 24 | color: #fff; 25 | transform: scale(0); 26 | z-index: 2; 27 | line-height: 12; 28 | transition: transform 0.2s ease; 29 | position: absolute; 30 | visibility: visible; } 31 | &:hover { 32 | .links { 33 | transform: scale(1); 34 | top: 0; } } } } 35 | -------------------------------------------------------------------------------- /docs-src/src/stylesheets/partials/_bootstrap.scss: -------------------------------------------------------------------------------- 1 | @import "modules/_base"; 2 | 3 | // Core variables and mixins 4 | @import "../vendors/bootstrap/variables"; 5 | @import "../vendors/bootstrap/mixins"; 6 | // Reset and dependencies 7 | @import "../vendors/bootstrap/normalize"; 8 | //@import "../vendors/bootstrap/print" 9 | //@import "../vendors/bootstrap/glyphicons" 10 | // Core CSS 11 | @import "../vendors/bootstrap/scaffolding"; 12 | @import "../vendors/bootstrap/type"; 13 | // @import "../vendors/bootstrap/code" 14 | // @import "../vendors/bootstrap/grid" 15 | @import "../vendors/bootstrap/tables"; 16 | // @import "../vendors/bootstrap/forms" 17 | // @import "../vendors/bootstrap/buttons" 18 | // Components 19 | // @import "../vendors/bootstrap/component-animations" 20 | // @import "../vendors/bootstrap/dropdowns" 21 | //@import "../vendors/bootstrap/button-groups" 22 | //@import "../vendors/bootstrap/input-groups" 23 | // @import "../vendors/bootstrap/navs" 24 | // @import "../vendors/bootstrap/navbar" 25 | //@import "../vendors/bootstrap/breadcrumbs" 26 | //@import "../vendors/bootstrap/pagination" 27 | //@import "../vendors/bootstrap/pager" 28 | //@import "../vendors/bootstrap/labels" 29 | //@import "../vendors/bootstrap/badges" 30 | //@import "../vendors/bootstrap/jumbotron" 31 | // @import "../vendors/bootstrap/thumbnails" 32 | //@import "../vendors/bootstrap/alerts" 33 | //@import "../vendors/bootstrap/progress-bars" 34 | // @import "../vendors/bootstrap/media" 35 | // @import "../vendors/bootstrap/list-group" 36 | //@import "../vendors/bootstrap/panels" 37 | //@import "../vendors/bootstrap/responsive-embed" 38 | //@import "../vendors/bootstrap/wells" 39 | //@import "../vendors/bootstrap/close" 40 | // Components w/ JavaScript 41 | // @import "../vendors/bootstrap/modals" 42 | //@import "../vendors/bootstrap/tooltip" 43 | //@import "../vendors/bootstrap/popovers" 44 | // @import "../vendors/bootstrap/carousel" 45 | // Utility classes 46 | // @import "../vendors/bootstrap/utilities" 47 | @import "../vendors/bootstrap/responsive-utilities"; 48 | 49 | -------------------------------------------------------------------------------- /docs-src/src/stylesheets/partials/_helpers.sass: -------------------------------------------------------------------------------- 1 | // Override some aerial.css classes 2 | .text-heading 3 | font-size: 48px 4 | 5 | .h-auto 6 | height: auto 7 | 8 | .m-l-n-large 9 | margin-left: -26px 10 | 11 | 12 | -------------------------------------------------------------------------------- /docs-src/src/stylesheets/vendors/bootstrap/_alerts.scss: -------------------------------------------------------------------------------- 1 | // 2 | // Alerts 3 | // -------------------------------------------------- 4 | 5 | 6 | // Base styles 7 | // ------------------------- 8 | 9 | .alert { 10 | padding: $alert-padding; 11 | margin-bottom: $line-height-computed; 12 | border: 1px solid transparent; 13 | border-radius: $alert-border-radius; 14 | 15 | // Headings for larger alerts 16 | h4 { 17 | margin-top: 0; 18 | // Specified for the h4 to prevent conflicts of changing $headings-color 19 | color: inherit; 20 | } 21 | // Provide class for links that match alerts 22 | .alert-link { 23 | font-weight: $alert-link-font-weight; 24 | } 25 | 26 | // Improve alignment and spacing of inner content 27 | > p, 28 | > ul { 29 | margin-bottom: 0; 30 | } 31 | > p + p { 32 | margin-top: 5px; 33 | } 34 | } 35 | 36 | // Dismissible alerts 37 | // 38 | // Expand the right padding and account for the close button's positioning. 39 | 40 | .alert-dismissable, // The misspelled .alert-dismissable was deprecated in 3.2.0. 41 | .alert-dismissible { 42 | padding-right: ($alert-padding + 20); 43 | 44 | // Adjust close link position 45 | .close { 46 | position: relative; 47 | top: -2px; 48 | right: -21px; 49 | color: inherit; 50 | } 51 | } 52 | 53 | // Alternate styles 54 | // 55 | // Generate contextual modifier classes for colorizing the alert. 56 | 57 | .alert-success { 58 | @include alert-variant($alert-success-bg, $alert-success-border, $alert-success-text); 59 | } 60 | .alert-info { 61 | @include alert-variant($alert-info-bg, $alert-info-border, $alert-info-text); 62 | } 63 | .alert-warning { 64 | @include alert-variant($alert-warning-bg, $alert-warning-border, $alert-warning-text); 65 | } 66 | .alert-danger { 67 | @include alert-variant($alert-danger-bg, $alert-danger-border, $alert-danger-text); 68 | } 69 | -------------------------------------------------------------------------------- /docs-src/src/stylesheets/vendors/bootstrap/_badges.scss: -------------------------------------------------------------------------------- 1 | // 2 | // Badges 3 | // -------------------------------------------------- 4 | 5 | 6 | // Base class 7 | .badge { 8 | display: inline-block; 9 | min-width: 10px; 10 | padding: 3px 7px; 11 | font-size: $font-size-small; 12 | font-weight: $badge-font-weight; 13 | color: $badge-color; 14 | line-height: $badge-line-height; 15 | vertical-align: baseline; 16 | white-space: nowrap; 17 | text-align: center; 18 | background-color: $badge-bg; 19 | border-radius: $badge-border-radius; 20 | 21 | // Empty badges collapse automatically (not available in IE8) 22 | &:empty { 23 | display: none; 24 | } 25 | 26 | // Quick fix for badges in buttons 27 | .btn & { 28 | position: relative; 29 | top: -1px; 30 | } 31 | .btn-xs & { 32 | top: 0; 33 | padding: 1px 5px; 34 | } 35 | 36 | // [converter] extracted a& to a.badge 37 | 38 | // Account for badges in navs 39 | .list-group-item.active > &, 40 | .nav-pills > .active > a > & { 41 | color: $badge-active-color; 42 | background-color: $badge-active-bg; 43 | } 44 | .list-group-item > & { 45 | float: right; 46 | } 47 | .list-group-item > & + & { 48 | margin-right: 5px; 49 | } 50 | .nav-pills > li > a > & { 51 | margin-left: 3px; 52 | } 53 | } 54 | 55 | // Hover state, but only for links 56 | a.badge { 57 | &:hover, 58 | &:focus { 59 | color: $badge-link-hover-color; 60 | text-decoration: none; 61 | cursor: pointer; 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /docs-src/src/stylesheets/vendors/bootstrap/_breadcrumbs.scss: -------------------------------------------------------------------------------- 1 | // 2 | // Breadcrumbs 3 | // -------------------------------------------------- 4 | 5 | 6 | .breadcrumb { 7 | padding: $breadcrumb-padding-vertical $breadcrumb-padding-horizontal; 8 | margin-bottom: $line-height-computed; 9 | list-style: none; 10 | background-color: $breadcrumb-bg; 11 | border-radius: $border-radius-base; 12 | 13 | > li { 14 | display: inline-block; 15 | 16 | + li:before { 17 | content: "#{$breadcrumb-separator}\00a0"; // Unicode space added since inline-block means non-collapsing white-space 18 | padding: 0 5px; 19 | color: $breadcrumb-color; 20 | } 21 | } 22 | 23 | > .active { 24 | color: $breadcrumb-active-color; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /docs-src/src/stylesheets/vendors/bootstrap/_close.scss: -------------------------------------------------------------------------------- 1 | // 2 | // Close icons 3 | // -------------------------------------------------- 4 | 5 | 6 | .close { 7 | float: right; 8 | font-size: ($font-size-base * 1.5); 9 | font-weight: $close-font-weight; 10 | line-height: 1; 11 | color: $close-color; 12 | text-shadow: $close-text-shadow; 13 | @include opacity(.2); 14 | 15 | &:hover, 16 | &:focus { 17 | color: $close-color; 18 | text-decoration: none; 19 | cursor: pointer; 20 | @include opacity(.5); 21 | } 22 | 23 | // [converter] extracted button& to button.close 24 | } 25 | 26 | // Additional properties for button version 27 | // iOS requires the button element instead of an anchor tag. 28 | // If you want the anchor version, it requires `href="#"`. 29 | button.close { 30 | padding: 0; 31 | cursor: pointer; 32 | background: transparent; 33 | border: 0; 34 | -webkit-appearance: none; 35 | } 36 | -------------------------------------------------------------------------------- /docs-src/src/stylesheets/vendors/bootstrap/_code.scss: -------------------------------------------------------------------------------- 1 | // 2 | // Code (inline and block) 3 | // -------------------------------------------------- 4 | 5 | 6 | // Inline and block code styles 7 | code, 8 | kbd, 9 | pre, 10 | samp { 11 | font-family: $font-family-monospace; 12 | } 13 | 14 | // Inline code 15 | code { 16 | padding: 2px 4px; 17 | font-size: 90%; 18 | color: $code-color; 19 | background-color: $code-bg; 20 | border-radius: $border-radius-base; 21 | } 22 | 23 | // User input typically entered via keyboard 24 | kbd { 25 | padding: 2px 4px; 26 | font-size: 90%; 27 | color: $kbd-color; 28 | background-color: $kbd-bg; 29 | border-radius: $border-radius-small; 30 | box-shadow: inset 0 -1px 0 rgba(0,0,0,.25); 31 | 32 | kbd { 33 | padding: 0; 34 | font-size: 100%; 35 | font-weight: bold; 36 | box-shadow: none; 37 | } 38 | } 39 | 40 | // Blocks of code 41 | pre { 42 | display: block; 43 | padding: (($line-height-computed - 1) / 2); 44 | margin: 0 0 ($line-height-computed / 2); 45 | font-size: ($font-size-base - 1); // 14px to 13px 46 | line-height: $line-height-base; 47 | word-break: break-all; 48 | word-wrap: break-word; 49 | color: $pre-color; 50 | border: 1px solid $pre-border-color; 51 | border-radius: $border-radius-base; 52 | 53 | // Account for some code outputs that place code tags in pre tags 54 | code { 55 | padding: 0; 56 | font-size: inherit; 57 | color: inherit; 58 | white-space: pre-wrap; 59 | background-color: transparent; 60 | border-radius: 0; 61 | } 62 | } 63 | 64 | // Enable scrollable blocks of code 65 | .pre-scrollable { 66 | max-height: $pre-scrollable-max-height; 67 | overflow-y: scroll; 68 | } 69 | -------------------------------------------------------------------------------- /docs-src/src/stylesheets/vendors/bootstrap/_component-animations.scss: -------------------------------------------------------------------------------- 1 | // 2 | // Component animations 3 | // -------------------------------------------------- 4 | 5 | // Heads up! 6 | // 7 | // We don't use the `.opacity()` mixin here since it causes a bug with text 8 | // fields in IE7-8. Source: https://github.com/twbs/bootstrap/pull/3552. 9 | 10 | .fade { 11 | opacity: 0; 12 | @include transition(opacity .15s linear); 13 | &.in { 14 | opacity: 1; 15 | } 16 | } 17 | 18 | .collapse { 19 | display: none; 20 | visibility: hidden; 21 | 22 | &.in { display: block; visibility: visible; } 23 | // [converter] extracted tr&.in to tr.collapse.in 24 | // [converter] extracted tbody&.in to tbody.collapse.in 25 | } 26 | 27 | tr.collapse.in { display: table-row; } 28 | 29 | tbody.collapse.in { display: table-row-group; } 30 | 31 | .collapsing { 32 | position: relative; 33 | height: 0; 34 | overflow: hidden; 35 | @include transition-property(height, visibility); 36 | @include transition-duration(.35s); 37 | @include transition-timing-function(ease); 38 | } 39 | -------------------------------------------------------------------------------- /docs-src/src/stylesheets/vendors/bootstrap/_grid.scss: -------------------------------------------------------------------------------- 1 | // 2 | // Grid system 3 | // -------------------------------------------------- 4 | 5 | 6 | // Container widths 7 | // 8 | // Set the container width, and override it for fixed navbars in media queries. 9 | 10 | .container { 11 | @include container-fixed; 12 | 13 | @media (min-width: $screen-sm-min) { 14 | width: $container-sm; 15 | } 16 | @media (min-width: $screen-md-min) { 17 | width: $container-md; 18 | } 19 | @media (min-width: $screen-lg-min) { 20 | width: $container-lg; 21 | } 22 | } 23 | 24 | 25 | // Fluid container 26 | // 27 | // Utilizes the mixin meant for fixed width containers, but without any defined 28 | // width for fluid, full width layouts. 29 | 30 | .container-fluid { 31 | @include container-fixed; 32 | } 33 | 34 | 35 | // Row 36 | // 37 | // Rows contain and clear the floats of your columns. 38 | 39 | .row { 40 | @include make-row; 41 | } 42 | 43 | 44 | // Columns 45 | // 46 | // Common styles for small and large grid columns 47 | 48 | @include make-grid-columns; 49 | 50 | 51 | // Extra small grid 52 | // 53 | // Columns, offsets, pushes, and pulls for extra small devices like 54 | // smartphones. 55 | 56 | @include make-grid(xs); 57 | 58 | 59 | // Small grid 60 | // 61 | // Columns, offsets, pushes, and pulls for the small device range, from phones 62 | // to tablets. 63 | 64 | @media (min-width: $screen-sm-min) { 65 | @include make-grid(sm); 66 | } 67 | 68 | 69 | // Medium grid 70 | // 71 | // Columns, offsets, pushes, and pulls for the desktop device range. 72 | 73 | @media (min-width: $screen-md-min) { 74 | @include make-grid(md); 75 | } 76 | 77 | 78 | // Large grid 79 | // 80 | // Columns, offsets, pushes, and pulls for the large desktop device range. 81 | 82 | @media (min-width: $screen-lg-min) { 83 | @include make-grid(lg); 84 | } 85 | -------------------------------------------------------------------------------- /docs-src/src/stylesheets/vendors/bootstrap/_jumbotron.scss: -------------------------------------------------------------------------------- 1 | // 2 | // Jumbotron 3 | // -------------------------------------------------- 4 | 5 | 6 | .jumbotron { 7 | padding: $jumbotron-padding ($jumbotron-padding / 2); 8 | margin-bottom: $jumbotron-padding; 9 | color: $jumbotron-color; 10 | background-color: $jumbotron-bg; 11 | 12 | h1, 13 | .h1 { 14 | color: $jumbotron-heading-color; 15 | } 16 | p { 17 | margin-bottom: ($jumbotron-padding / 2); 18 | font-size: $jumbotron-font-size; 19 | font-weight: 200; 20 | } 21 | 22 | > hr { 23 | border-top-color: darken($jumbotron-bg, 10%); 24 | } 25 | 26 | .container &, 27 | .container-fluid & { 28 | border-radius: $border-radius-large; // Only round corners at higher resolutions if contained in a container 29 | } 30 | 31 | .container { 32 | max-width: 100%; 33 | } 34 | 35 | @media screen and (min-width: $screen-sm-min) { 36 | padding: ($jumbotron-padding * 1.6) 0; 37 | 38 | .container &, 39 | .container-fluid & { 40 | padding-left: ($jumbotron-padding * 2); 41 | padding-right: ($jumbotron-padding * 2); 42 | } 43 | 44 | h1, 45 | .h1 { 46 | font-size: ($font-size-base * 4.5); 47 | } 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /docs-src/src/stylesheets/vendors/bootstrap/_labels.scss: -------------------------------------------------------------------------------- 1 | // 2 | // Labels 3 | // -------------------------------------------------- 4 | 5 | .label { 6 | display: inline; 7 | padding: .2em .6em .3em; 8 | font-size: 75%; 9 | font-weight: bold; 10 | line-height: 1; 11 | color: $label-color; 12 | text-align: center; 13 | white-space: nowrap; 14 | vertical-align: baseline; 15 | border-radius: .25em; 16 | 17 | // [converter] extracted a& to a.label 18 | 19 | // Empty labels collapse automatically (not available in IE8) 20 | &:empty { 21 | display: none; 22 | } 23 | 24 | // Quick fix for labels in buttons 25 | .btn & { 26 | position: relative; 27 | top: -1px; 28 | } 29 | } 30 | 31 | // Add hover effects, but only for links 32 | a.label { 33 | &:hover, 34 | &:focus { 35 | color: $label-link-hover-color; 36 | text-decoration: none; 37 | cursor: pointer; 38 | } 39 | } 40 | 41 | // Colors 42 | // Contextual variations (linked labels get darker on :hover) 43 | 44 | .label-default { 45 | @include label-variant($label-default-bg); 46 | } 47 | 48 | .label-primary { 49 | @include label-variant($label-primary-bg); 50 | } 51 | 52 | .label-success { 53 | @include label-variant($label-success-bg); 54 | } 55 | 56 | .label-info { 57 | @include label-variant($label-info-bg); 58 | } 59 | 60 | .label-warning { 61 | @include label-variant($label-warning-bg); 62 | } 63 | 64 | .label-danger { 65 | @include label-variant($label-danger-bg); 66 | } 67 | -------------------------------------------------------------------------------- /docs-src/src/stylesheets/vendors/bootstrap/_media.scss: -------------------------------------------------------------------------------- 1 | .media { 2 | // Proper spacing between instances of .media 3 | margin-top: 15px; 4 | 5 | &:first-child { 6 | margin-top: 0; 7 | } 8 | } 9 | 10 | .media-right, 11 | .media > .pull-right { 12 | padding-left: 10px; 13 | } 14 | 15 | .media-left, 16 | .media > .pull-left { 17 | padding-right: 10px; 18 | } 19 | 20 | .media-left, 21 | .media-right, 22 | .media-body { 23 | display: table-cell; 24 | vertical-align: top; 25 | } 26 | 27 | .media-middle { 28 | vertical-align: middle; 29 | } 30 | 31 | .media-bottom { 32 | vertical-align: bottom; 33 | } 34 | 35 | // Reset margins on headings for tighter default spacing 36 | .media-heading { 37 | margin-top: 0; 38 | margin-bottom: 5px; 39 | } 40 | 41 | // Media list variation 42 | // 43 | // Undo default ul/ol styles 44 | .media-list { 45 | padding-left: 0; 46 | list-style: none; 47 | } 48 | -------------------------------------------------------------------------------- /docs-src/src/stylesheets/vendors/bootstrap/_mixins.scss: -------------------------------------------------------------------------------- 1 | // Mixins 2 | // -------------------------------------------------- 3 | 4 | // Utilities 5 | @import "mixins/hide-text"; 6 | @import "mixins/opacity"; 7 | @import "mixins/image"; 8 | @import "mixins/labels"; 9 | @import "mixins/reset-filter"; 10 | @import "mixins/resize"; 11 | @import "mixins/responsive-visibility"; 12 | @import "mixins/size"; 13 | @import "mixins/tab-focus"; 14 | @import "mixins/text-emphasis"; 15 | @import "mixins/text-overflow"; 16 | @import "mixins/vendor-prefixes"; 17 | 18 | // Components 19 | @import "mixins/alerts"; 20 | @import "mixins/buttons"; 21 | @import "mixins/panels"; 22 | @import "mixins/pagination"; 23 | @import "mixins/list-group"; 24 | @import "mixins/nav-divider"; 25 | @import "mixins/forms"; 26 | @import "mixins/progress-bar"; 27 | @import "mixins/table-row"; 28 | 29 | // Skins 30 | @import "mixins/background-variant"; 31 | @import "mixins/border-radius"; 32 | @import "mixins/gradients"; 33 | 34 | // Layout 35 | @import "mixins/clearfix"; 36 | @import "mixins/center-block"; 37 | @import "mixins/nav-vertical-align"; 38 | @import "mixins/grid-framework"; 39 | @import "mixins/grid"; 40 | -------------------------------------------------------------------------------- /docs-src/src/stylesheets/vendors/bootstrap/_pager.scss: -------------------------------------------------------------------------------- 1 | // 2 | // Pager pagination 3 | // -------------------------------------------------- 4 | 5 | 6 | .pager { 7 | padding-left: 0; 8 | margin: $line-height-computed 0; 9 | list-style: none; 10 | text-align: center; 11 | @include clearfix; 12 | li { 13 | display: inline; 14 | > a, 15 | > span { 16 | display: inline-block; 17 | padding: 5px 14px; 18 | background-color: $pager-bg; 19 | border: 1px solid $pager-border; 20 | border-radius: $pager-border-radius; 21 | } 22 | 23 | > a:hover, 24 | > a:focus { 25 | text-decoration: none; 26 | background-color: $pager-hover-bg; 27 | } 28 | } 29 | 30 | .next { 31 | > a, 32 | > span { 33 | float: right; 34 | } 35 | } 36 | 37 | .previous { 38 | > a, 39 | > span { 40 | float: left; 41 | } 42 | } 43 | 44 | .disabled { 45 | > a, 46 | > a:hover, 47 | > a:focus, 48 | > span { 49 | color: $pager-disabled-color; 50 | background-color: $pager-bg; 51 | cursor: $cursor-disabled; 52 | } 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /docs-src/src/stylesheets/vendors/bootstrap/_pagination.scss: -------------------------------------------------------------------------------- 1 | // 2 | // Pagination (multiple pages) 3 | // -------------------------------------------------- 4 | .pagination { 5 | display: inline-block; 6 | padding-left: 0; 7 | margin: $line-height-computed 0; 8 | border-radius: $border-radius-base; 9 | 10 | > li { 11 | display: inline; // Remove list-style and block-level defaults 12 | > a, 13 | > span { 14 | position: relative; 15 | float: left; // Collapse white-space 16 | padding: $padding-base-vertical $padding-base-horizontal; 17 | line-height: $line-height-base; 18 | text-decoration: none; 19 | color: $pagination-color; 20 | background-color: $pagination-bg; 21 | border: 1px solid $pagination-border; 22 | margin-left: -1px; 23 | } 24 | &:first-child { 25 | > a, 26 | > span { 27 | margin-left: 0; 28 | @include border-left-radius($border-radius-base); 29 | } 30 | } 31 | &:last-child { 32 | > a, 33 | > span { 34 | @include border-right-radius($border-radius-base); 35 | } 36 | } 37 | } 38 | 39 | > li > a, 40 | > li > span { 41 | &:hover, 42 | &:focus { 43 | color: $pagination-hover-color; 44 | background-color: $pagination-hover-bg; 45 | border-color: $pagination-hover-border; 46 | } 47 | } 48 | 49 | > .active > a, 50 | > .active > span { 51 | &, 52 | &:hover, 53 | &:focus { 54 | z-index: 2; 55 | color: $pagination-active-color; 56 | background-color: $pagination-active-bg; 57 | border-color: $pagination-active-border; 58 | cursor: default; 59 | } 60 | } 61 | 62 | > .disabled { 63 | > span, 64 | > span:hover, 65 | > span:focus, 66 | > a, 67 | > a:hover, 68 | > a:focus { 69 | color: $pagination-disabled-color; 70 | background-color: $pagination-disabled-bg; 71 | border-color: $pagination-disabled-border; 72 | cursor: $cursor-disabled; 73 | } 74 | } 75 | } 76 | 77 | // Sizing 78 | // -------------------------------------------------- 79 | 80 | // Large 81 | .pagination-lg { 82 | @include pagination-size($padding-large-vertical, $padding-large-horizontal, $font-size-large, $border-radius-large); 83 | } 84 | 85 | // Small 86 | .pagination-sm { 87 | @include pagination-size($padding-small-vertical, $padding-small-horizontal, $font-size-small, $border-radius-small); 88 | } 89 | -------------------------------------------------------------------------------- /docs-src/src/stylesheets/vendors/bootstrap/_print.scss: -------------------------------------------------------------------------------- 1 | /*! Source: https://github.com/h5bp/html5-boilerplate/blob/master/src/css/main.css */ 2 | 3 | // ========================================================================== 4 | // Print styles. 5 | // Inlined to avoid the additional HTTP request: h5bp.com/r 6 | // ========================================================================== 7 | 8 | @media print { 9 | *, 10 | *:before, 11 | *:after { 12 | background: transparent !important; 13 | color: #000 !important; // Black prints faster: h5bp.com/s 14 | box-shadow: none !important; 15 | text-shadow: none !important; 16 | } 17 | 18 | a, 19 | a:visited { 20 | text-decoration: underline; 21 | } 22 | 23 | a[href]:after { 24 | content: " (" attr(href) ")"; 25 | } 26 | 27 | abbr[title]:after { 28 | content: " (" attr(title) ")"; 29 | } 30 | 31 | // Don't show links that are fragment identifiers, 32 | // or use the `javascript:` pseudo protocol 33 | a[href^="#"]:after, 34 | a[href^="javascript:"]:after { 35 | content: ""; 36 | } 37 | 38 | pre, 39 | blockquote { 40 | border: 1px solid #999; 41 | page-break-inside: avoid; 42 | } 43 | 44 | thead { 45 | display: table-header-group; // h5bp.com/t 46 | } 47 | 48 | tr, 49 | img { 50 | page-break-inside: avoid; 51 | } 52 | 53 | img { 54 | max-width: 100% !important; 55 | } 56 | 57 | p, 58 | h2, 59 | h3 { 60 | orphans: 3; 61 | widows: 3; 62 | } 63 | 64 | h2, 65 | h3 { 66 | page-break-after: avoid; 67 | } 68 | 69 | // Bootstrap specific changes start 70 | // 71 | // Chrome (OSX) fix for https://github.com/twbs/bootstrap/issues/11245 72 | // Once fixed, we can just straight up remove this. 73 | select { 74 | background: #fff !important; 75 | } 76 | 77 | // Bootstrap components 78 | .navbar { 79 | display: none; 80 | } 81 | .btn, 82 | .dropup > .btn { 83 | > .caret { 84 | border-top-color: #000 !important; 85 | } 86 | } 87 | .label { 88 | border: 1px solid #000; 89 | } 90 | 91 | .table { 92 | border-collapse: collapse !important; 93 | 94 | td, 95 | th { 96 | background-color: #fff !important; 97 | } 98 | } 99 | .table-bordered { 100 | th, 101 | td { 102 | border: 1px solid #ddd !important; 103 | } 104 | } 105 | 106 | // Bootstrap specific changes end 107 | } 108 | -------------------------------------------------------------------------------- /docs-src/src/stylesheets/vendors/bootstrap/_progress-bars.scss: -------------------------------------------------------------------------------- 1 | // 2 | // Progress bars 3 | // -------------------------------------------------- 4 | 5 | 6 | // Bar animations 7 | // ------------------------- 8 | 9 | // WebKit 10 | @-webkit-keyframes progress-bar-stripes { 11 | from { background-position: 40px 0; } 12 | to { background-position: 0 0; } 13 | } 14 | 15 | // Spec and IE10+ 16 | @keyframes progress-bar-stripes { 17 | from { background-position: 40px 0; } 18 | to { background-position: 0 0; } 19 | } 20 | 21 | 22 | // Bar itself 23 | // ------------------------- 24 | 25 | // Outer container 26 | .progress { 27 | overflow: hidden; 28 | height: $line-height-computed; 29 | margin-bottom: $line-height-computed; 30 | background-color: $progress-bg; 31 | border-radius: $progress-border-radius; 32 | @include box-shadow(inset 0 1px 2px rgba(0,0,0,.1)); 33 | } 34 | 35 | // Bar of progress 36 | .progress-bar { 37 | float: left; 38 | width: 0%; 39 | height: 100%; 40 | font-size: $font-size-small; 41 | line-height: $line-height-computed; 42 | color: $progress-bar-color; 43 | text-align: center; 44 | background-color: $progress-bar-bg; 45 | @include box-shadow(inset 0 -1px 0 rgba(0,0,0,.15)); 46 | @include transition(width .6s ease); 47 | } 48 | 49 | // Striped bars 50 | // 51 | // `.progress-striped .progress-bar` is deprecated as of v3.2.0 in favor of the 52 | // `.progress-bar-striped` class, which you just add to an existing 53 | // `.progress-bar`. 54 | .progress-striped .progress-bar, 55 | .progress-bar-striped { 56 | @include gradient-striped; 57 | background-size: 40px 40px; 58 | } 59 | 60 | // Call animation for the active one 61 | // 62 | // `.progress.active .progress-bar` is deprecated as of v3.2.0 in favor of the 63 | // `.progress-bar.active` approach. 64 | .progress.active .progress-bar, 65 | .progress-bar.active { 66 | @include animation(progress-bar-stripes 2s linear infinite); 67 | } 68 | 69 | 70 | // Variations 71 | // ------------------------- 72 | 73 | .progress-bar-success { 74 | @include progress-bar-variant($progress-bar-success-bg); 75 | } 76 | 77 | .progress-bar-info { 78 | @include progress-bar-variant($progress-bar-info-bg); 79 | } 80 | 81 | .progress-bar-warning { 82 | @include progress-bar-variant($progress-bar-warning-bg); 83 | } 84 | 85 | .progress-bar-danger { 86 | @include progress-bar-variant($progress-bar-danger-bg); 87 | } 88 | -------------------------------------------------------------------------------- /docs-src/src/stylesheets/vendors/bootstrap/_responsive-embed.scss: -------------------------------------------------------------------------------- 1 | // Embeds responsive 2 | // 3 | // Credit: Nicolas Gallagher and SUIT CSS. 4 | 5 | .embed-responsive { 6 | position: relative; 7 | display: block; 8 | height: 0; 9 | padding: 0; 10 | overflow: hidden; 11 | 12 | .embed-responsive-item, 13 | iframe, 14 | embed, 15 | object, 16 | video { 17 | position: absolute; 18 | top: 0; 19 | left: 0; 20 | bottom: 0; 21 | height: 100%; 22 | width: 100%; 23 | border: 0; 24 | } 25 | 26 | // Modifier class for 16:9 aspect ratio 27 | &.embed-responsive-16by9 { 28 | padding-bottom: 56.25%; 29 | } 30 | 31 | // Modifier class for 4:3 aspect ratio 32 | &.embed-responsive-4by3 { 33 | padding-bottom: 75%; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /docs-src/src/stylesheets/vendors/bootstrap/_thumbnails.scss: -------------------------------------------------------------------------------- 1 | // 2 | // Thumbnails 3 | // -------------------------------------------------- 4 | 5 | 6 | // Mixin and adjust the regular image class 7 | .thumbnail { 8 | display: block; 9 | padding: $thumbnail-padding; 10 | margin-bottom: $line-height-computed; 11 | line-height: $line-height-base; 12 | background-color: $thumbnail-bg; 13 | border: 1px solid $thumbnail-border; 14 | border-radius: $thumbnail-border-radius; 15 | @include transition(border .2s ease-in-out); 16 | 17 | > img, 18 | a > img { 19 | @include img-responsive; 20 | margin-left: auto; 21 | margin-right: auto; 22 | } 23 | 24 | // [converter] extracted a&:hover, a&:focus, a&.active to a.thumbnail:hover, a.thumbnail:focus, a.thumbnail.active 25 | 26 | // Image captions 27 | .caption { 28 | padding: $thumbnail-caption-padding; 29 | color: $thumbnail-caption-color; 30 | } 31 | } 32 | 33 | // Add a hover state for linked versions only 34 | a.thumbnail:hover, 35 | a.thumbnail:focus, 36 | a.thumbnail.active { 37 | border-color: $link-color; 38 | } 39 | -------------------------------------------------------------------------------- /docs-src/src/stylesheets/vendors/bootstrap/_utilities.scss: -------------------------------------------------------------------------------- 1 | // 2 | // Utility classes 3 | // -------------------------------------------------- 4 | 5 | 6 | // Floats 7 | // ------------------------- 8 | 9 | .clearfix { 10 | @include clearfix; 11 | } 12 | .center-block { 13 | @include center-block; 14 | } 15 | .pull-right { 16 | float: right !important; 17 | } 18 | .pull-left { 19 | float: left !important; 20 | } 21 | 22 | 23 | // Toggling content 24 | // ------------------------- 25 | 26 | // Note: Deprecated .hide in favor of .hidden or .sr-only (as appropriate) in v3.0.1 27 | .hide { 28 | display: none !important; 29 | } 30 | .show { 31 | display: block !important; 32 | } 33 | .invisible { 34 | visibility: hidden; 35 | } 36 | .text-hide { 37 | @include text-hide; 38 | } 39 | 40 | 41 | // Hide from screenreaders and browsers 42 | // 43 | // Credit: HTML5 Boilerplate 44 | 45 | .hidden { 46 | display: none !important; 47 | visibility: hidden !important; 48 | } 49 | 50 | 51 | // For Affix plugin 52 | // ------------------------- 53 | 54 | .affix { 55 | position: fixed; 56 | } 57 | -------------------------------------------------------------------------------- /docs-src/src/stylesheets/vendors/bootstrap/_wells.scss: -------------------------------------------------------------------------------- 1 | // 2 | // Wells 3 | // -------------------------------------------------- 4 | 5 | 6 | // Base class 7 | .well { 8 | min-height: 20px; 9 | padding: 19px; 10 | margin-bottom: 20px; 11 | background-color: $well-bg; 12 | border: 1px solid $well-border; 13 | border-radius: $border-radius-base; 14 | @include box-shadow(inset 0 1px 1px rgba(0,0,0,.05)); 15 | blockquote { 16 | border-color: #ddd; 17 | border-color: rgba(0,0,0,.15); 18 | } 19 | } 20 | 21 | // Sizes 22 | .well-lg { 23 | padding: 24px; 24 | border-radius: $border-radius-large; 25 | } 26 | .well-sm { 27 | padding: 9px; 28 | border-radius: $border-radius-small; 29 | } 30 | -------------------------------------------------------------------------------- /docs-src/src/stylesheets/vendors/bootstrap/mixins/_alerts.scss: -------------------------------------------------------------------------------- 1 | // Alerts 2 | 3 | @mixin alert-variant($background, $border, $text-color) { 4 | background-color: $background; 5 | border-color: $border; 6 | color: $text-color; 7 | 8 | hr { 9 | border-top-color: darken($border, 5%); 10 | } 11 | .alert-link { 12 | color: darken($text-color, 10%); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /docs-src/src/stylesheets/vendors/bootstrap/mixins/_background-variant.scss: -------------------------------------------------------------------------------- 1 | // Contextual backgrounds 2 | 3 | // [converter] $parent hack 4 | @mixin bg-variant($parent, $color) { 5 | #{$parent} { 6 | background-color: $color; 7 | } 8 | a#{$parent}:hover { 9 | background-color: darken($color, 10%); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /docs-src/src/stylesheets/vendors/bootstrap/mixins/_border-radius.scss: -------------------------------------------------------------------------------- 1 | // Single side border-radius 2 | 3 | @mixin border-top-radius($radius) { 4 | border-top-right-radius: $radius; 5 | border-top-left-radius: $radius; 6 | } 7 | @mixin border-right-radius($radius) { 8 | border-bottom-right-radius: $radius; 9 | border-top-right-radius: $radius; 10 | } 11 | @mixin border-bottom-radius($radius) { 12 | border-bottom-right-radius: $radius; 13 | border-bottom-left-radius: $radius; 14 | } 15 | @mixin border-left-radius($radius) { 16 | border-bottom-left-radius: $radius; 17 | border-top-left-radius: $radius; 18 | } 19 | -------------------------------------------------------------------------------- /docs-src/src/stylesheets/vendors/bootstrap/mixins/_buttons.scss: -------------------------------------------------------------------------------- 1 | // Button variants 2 | // 3 | // Easily pump out default styles, as well as :hover, :focus, :active, 4 | // and disabled options for all buttons 5 | 6 | @mixin button-variant($color, $background, $border) { 7 | color: $color; 8 | background-color: $background; 9 | border-color: $border; 10 | 11 | &:hover, 12 | &:focus, 13 | &.focus, 14 | &:active, 15 | &.active, 16 | .open > &.dropdown-toggle { 17 | color: $color; 18 | background-color: darken($background, 10%); 19 | border-color: darken($border, 12%); 20 | } 21 | &:active, 22 | &.active, 23 | .open > &.dropdown-toggle { 24 | background-image: none; 25 | } 26 | &.disabled, 27 | &[disabled], 28 | fieldset[disabled] & { 29 | &, 30 | &:hover, 31 | &:focus, 32 | &.focus, 33 | &:active, 34 | &.active { 35 | background-color: $background; 36 | border-color: $border; 37 | 38 | &.btn-primary { 39 | color: #fff; 40 | } 41 | } 42 | } 43 | 44 | .badge { 45 | color: $background; 46 | background-color: $color; 47 | } 48 | } 49 | 50 | // Button sizes 51 | @mixin button-size($padding-vertical, $padding-horizontal, $font-size, $line-height, $border-radius) { 52 | padding: $padding-vertical $padding-horizontal; 53 | font-size: $font-size; 54 | line-height: $line-height; 55 | border-radius: $border-radius; 56 | } 57 | -------------------------------------------------------------------------------- /docs-src/src/stylesheets/vendors/bootstrap/mixins/_center-block.scss: -------------------------------------------------------------------------------- 1 | // Center-align a block level element 2 | 3 | @mixin center-block() { 4 | display: block; 5 | margin-left: auto; 6 | margin-right: auto; 7 | } 8 | -------------------------------------------------------------------------------- /docs-src/src/stylesheets/vendors/bootstrap/mixins/_clearfix.scss: -------------------------------------------------------------------------------- 1 | // Clearfix 2 | // 3 | // For modern browsers 4 | // 1. The space content is one way to avoid an Opera bug when the 5 | // contenteditable attribute is included anywhere else in the document. 6 | // Otherwise it causes space to appear at the top and bottom of elements 7 | // that are clearfixed. 8 | // 2. The use of `table` rather than `block` is only necessary if using 9 | // `:before` to contain the top-margins of child elements. 10 | // 11 | // Source: http://nicolasgallagher.com/micro-clearfix-hack/ 12 | 13 | @mixin clearfix() { 14 | &:before, 15 | &:after { 16 | content: " "; // 1 17 | display: table; // 2 18 | } 19 | &:after { 20 | clear: both; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /docs-src/src/stylesheets/vendors/bootstrap/mixins/_grid-framework.scss: -------------------------------------------------------------------------------- 1 | // Framework grid generation 2 | // 3 | // Used only by Bootstrap to generate the correct number of grid classes given 4 | // any value of `$grid-columns`. 5 | 6 | // [converter] This is defined recursively in LESS, but Sass supports real loops 7 | @mixin make-grid-columns($i: 1, $list: ".col-xs-#{$i}, .col-sm-#{$i}, .col-md-#{$i}, .col-lg-#{$i}") { 8 | @for $i from (1 + 1) through $grid-columns { 9 | $list: "#{$list}, .col-xs-#{$i}, .col-sm-#{$i}, .col-md-#{$i}, .col-lg-#{$i}"; 10 | } 11 | #{$list} { 12 | position: relative; 13 | // Prevent columns from collapsing when empty 14 | min-height: 1px; 15 | // Inner gutter via padding 16 | padding-left: ($grid-gutter-width / 2); 17 | padding-right: ($grid-gutter-width / 2); 18 | } 19 | } 20 | 21 | 22 | // [converter] This is defined recursively in LESS, but Sass supports real loops 23 | @mixin float-grid-columns($class, $i: 1, $list: ".col-#{$class}-#{$i}") { 24 | @for $i from (1 + 1) through $grid-columns { 25 | $list: "#{$list}, .col-#{$class}-#{$i}"; 26 | } 27 | #{$list} { 28 | float: left; 29 | } 30 | } 31 | 32 | 33 | @mixin calc-grid-column($index, $class, $type) { 34 | @if ($type == width) and ($index > 0) { 35 | .col-#{$class}-#{$index} { 36 | width: percentage(($index / $grid-columns)); 37 | } 38 | } 39 | @if ($type == push) and ($index > 0) { 40 | .col-#{$class}-push-#{$index} { 41 | left: percentage(($index / $grid-columns)); 42 | } 43 | } 44 | @if ($type == push) and ($index == 0) { 45 | .col-#{$class}-push-0 { 46 | left: auto; 47 | } 48 | } 49 | @if ($type == pull) and ($index > 0) { 50 | .col-#{$class}-pull-#{$index} { 51 | right: percentage(($index / $grid-columns)); 52 | } 53 | } 54 | @if ($type == pull) and ($index == 0) { 55 | .col-#{$class}-pull-0 { 56 | right: auto; 57 | } 58 | } 59 | @if ($type == offset) { 60 | .col-#{$class}-offset-#{$index} { 61 | margin-left: percentage(($index / $grid-columns)); 62 | } 63 | } 64 | } 65 | 66 | // [converter] This is defined recursively in LESS, but Sass supports real loops 67 | @mixin loop-grid-columns($columns, $class, $type) { 68 | @for $i from 0 through $columns { 69 | @include calc-grid-column($i, $class, $type); 70 | } 71 | } 72 | 73 | 74 | // Create grid for specific class 75 | @mixin make-grid($class) { 76 | @include float-grid-columns($class); 77 | @include loop-grid-columns($grid-columns, $class, width); 78 | @include loop-grid-columns($grid-columns, $class, pull); 79 | @include loop-grid-columns($grid-columns, $class, push); 80 | @include loop-grid-columns($grid-columns, $class, offset); 81 | } 82 | -------------------------------------------------------------------------------- /docs-src/src/stylesheets/vendors/bootstrap/mixins/_hide-text.scss: -------------------------------------------------------------------------------- 1 | // CSS image replacement 2 | // 3 | // Heads up! v3 launched with with only `.hide-text()`, but per our pattern for 4 | // mixins being reused as classes with the same name, this doesn't hold up. As 5 | // of v3.0.1 we have added `.text-hide()` and deprecated `.hide-text()`. 6 | // 7 | // Source: https://github.com/h5bp/html5-boilerplate/commit/aa0396eae757 8 | 9 | // Deprecated as of v3.0.1 (will be removed in v4) 10 | @mixin hide-text() { 11 | font: #{0/0} a; 12 | color: transparent; 13 | text-shadow: none; 14 | background-color: transparent; 15 | border: 0; 16 | } 17 | 18 | // New mixin to use as of v3.0.1 19 | @mixin text-hide() { 20 | @include hide-text; 21 | } 22 | -------------------------------------------------------------------------------- /docs-src/src/stylesheets/vendors/bootstrap/mixins/_image.scss: -------------------------------------------------------------------------------- 1 | // Image Mixins 2 | // - Responsive image 3 | // - Retina image 4 | 5 | 6 | // Responsive image 7 | // 8 | // Keep images from scaling beyond the width of their parents. 9 | @mixin img-responsive($display: block) { 10 | display: $display; 11 | max-width: 100%; // Part 1: Set a maximum relative to the parent 12 | height: auto; // Part 2: Scale the height according to the width, otherwise you get stretching 13 | } 14 | 15 | 16 | // Retina image 17 | // 18 | // Short retina mixin for setting background-image and -size. Note that the 19 | // spelling of `min--moz-device-pixel-ratio` is intentional. 20 | @mixin img-retina($file-1x, $file-2x, $width-1x, $height-1x) { 21 | background-image: url(if($bootstrap-sass-asset-helper, twbs-image-path("#{$file-1x}"), "#{$file-1x}")); 22 | 23 | @media 24 | only screen and (-webkit-min-device-pixel-ratio: 2), 25 | only screen and ( min--moz-device-pixel-ratio: 2), 26 | only screen and ( -o-min-device-pixel-ratio: 2/1), 27 | only screen and ( min-device-pixel-ratio: 2), 28 | only screen and ( min-resolution: 192dpi), 29 | only screen and ( min-resolution: 2dppx) { 30 | background-image: url(if($bootstrap-sass-asset-helper, twbs-image-path("#{$file-2x}"), "#{$file-2x}")); 31 | background-size: $width-1x $height-1x; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /docs-src/src/stylesheets/vendors/bootstrap/mixins/_labels.scss: -------------------------------------------------------------------------------- 1 | // Labels 2 | 3 | @mixin label-variant($color) { 4 | background-color: $color; 5 | 6 | &[href] { 7 | &:hover, 8 | &:focus { 9 | background-color: darken($color, 10%); 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /docs-src/src/stylesheets/vendors/bootstrap/mixins/_list-group.scss: -------------------------------------------------------------------------------- 1 | // List Groups 2 | 3 | @mixin list-group-item-variant($state, $background, $color) { 4 | .list-group-item-#{$state} { 5 | color: $color; 6 | background-color: $background; 7 | 8 | // [converter] extracted a& to a.list-group-item-#{$state} 9 | } 10 | 11 | a.list-group-item-#{$state} { 12 | color: $color; 13 | 14 | .list-group-item-heading { 15 | color: inherit; 16 | } 17 | 18 | &:hover, 19 | &:focus { 20 | color: $color; 21 | background-color: darken($background, 5%); 22 | } 23 | &.active, 24 | &.active:hover, 25 | &.active:focus { 26 | color: #fff; 27 | background-color: $color; 28 | border-color: $color; 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /docs-src/src/stylesheets/vendors/bootstrap/mixins/_nav-divider.scss: -------------------------------------------------------------------------------- 1 | // Horizontal dividers 2 | // 3 | // Dividers (basically an hr) within dropdowns and nav lists 4 | 5 | @mixin nav-divider($color: #e5e5e5) { 6 | height: 1px; 7 | margin: (($line-height-computed / 2) - 1) 0; 8 | overflow: hidden; 9 | background-color: $color; 10 | } 11 | -------------------------------------------------------------------------------- /docs-src/src/stylesheets/vendors/bootstrap/mixins/_nav-vertical-align.scss: -------------------------------------------------------------------------------- 1 | // Navbar vertical align 2 | // 3 | // Vertically center elements in the navbar. 4 | // Example: an element has a height of 30px, so write out `.navbar-vertical-align(30px);` to calculate the appropriate top margin. 5 | 6 | @mixin navbar-vertical-align($element-height) { 7 | margin-top: (($navbar-height - $element-height) / 2); 8 | margin-bottom: (($navbar-height - $element-height) / 2); 9 | } 10 | -------------------------------------------------------------------------------- /docs-src/src/stylesheets/vendors/bootstrap/mixins/_opacity.scss: -------------------------------------------------------------------------------- 1 | // Opacity 2 | 3 | @mixin opacity($opacity) { 4 | opacity: $opacity; 5 | // IE8 filter 6 | $opacity-ie: ($opacity * 100); 7 | filter: #{alpha(opacity=$opacity-ie)}; 8 | } 9 | -------------------------------------------------------------------------------- /docs-src/src/stylesheets/vendors/bootstrap/mixins/_pagination.scss: -------------------------------------------------------------------------------- 1 | // Pagination 2 | 3 | @mixin pagination-size($padding-vertical, $padding-horizontal, $font-size, $border-radius) { 4 | > li { 5 | > a, 6 | > span { 7 | padding: $padding-vertical $padding-horizontal; 8 | font-size: $font-size; 9 | } 10 | &:first-child { 11 | > a, 12 | > span { 13 | @include border-left-radius($border-radius); 14 | } 15 | } 16 | &:last-child { 17 | > a, 18 | > span { 19 | @include border-right-radius($border-radius); 20 | } 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /docs-src/src/stylesheets/vendors/bootstrap/mixins/_panels.scss: -------------------------------------------------------------------------------- 1 | // Panels 2 | 3 | @mixin panel-variant($border, $heading-text-color, $heading-bg-color, $heading-border) { 4 | border-color: $border; 5 | 6 | & > .panel-heading { 7 | color: $heading-text-color; 8 | background-color: $heading-bg-color; 9 | border-color: $heading-border; 10 | 11 | + .panel-collapse > .panel-body { 12 | border-top-color: $border; 13 | } 14 | .badge { 15 | color: $heading-bg-color; 16 | background-color: $heading-text-color; 17 | } 18 | } 19 | & > .panel-footer { 20 | + .panel-collapse > .panel-body { 21 | border-bottom-color: $border; 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /docs-src/src/stylesheets/vendors/bootstrap/mixins/_progress-bar.scss: -------------------------------------------------------------------------------- 1 | // Progress bars 2 | 3 | @mixin progress-bar-variant($color) { 4 | background-color: $color; 5 | 6 | // Deprecated parent class requirement as of v3.2.0 7 | .progress-striped & { 8 | @include gradient-striped; 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /docs-src/src/stylesheets/vendors/bootstrap/mixins/_reset-filter.scss: -------------------------------------------------------------------------------- 1 | // Reset filters for IE 2 | // 3 | // When you need to remove a gradient background, do not forget to use this to reset 4 | // the IE filter for IE9 and below. 5 | 6 | @mixin reset-filter() { 7 | filter: progid:DXImageTransform.Microsoft.gradient(enabled = false); 8 | } 9 | -------------------------------------------------------------------------------- /docs-src/src/stylesheets/vendors/bootstrap/mixins/_resize.scss: -------------------------------------------------------------------------------- 1 | // Resize anything 2 | 3 | @mixin resizable($direction) { 4 | resize: $direction; // Options: horizontal, vertical, both 5 | overflow: auto; // Per CSS3 UI, `resize` only applies when `overflow` isn't `visible` 6 | } 7 | -------------------------------------------------------------------------------- /docs-src/src/stylesheets/vendors/bootstrap/mixins/_responsive-visibility.scss: -------------------------------------------------------------------------------- 1 | // Responsive utilities 2 | 3 | // 4 | // More easily include all the states for responsive-utilities.less. 5 | // [converter] $parent hack 6 | @mixin responsive-visibility($parent) { 7 | #{$parent} { 8 | display: block !important; 9 | } 10 | table#{$parent} { display: table; } 11 | tr#{$parent} { display: table-row !important; } 12 | th#{$parent}, 13 | td#{$parent} { display: table-cell !important; } 14 | } 15 | 16 | // [converter] $parent hack 17 | @mixin responsive-invisibility($parent) { 18 | #{$parent} { 19 | display: none !important; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /docs-src/src/stylesheets/vendors/bootstrap/mixins/_size.scss: -------------------------------------------------------------------------------- 1 | // Sizing shortcuts 2 | 3 | @mixin size($width, $height) { 4 | width: $width; 5 | height: $height; 6 | } 7 | 8 | @mixin square($size) { 9 | @include size($size, $size); 10 | } 11 | -------------------------------------------------------------------------------- /docs-src/src/stylesheets/vendors/bootstrap/mixins/_tab-focus.scss: -------------------------------------------------------------------------------- 1 | // WebKit-style focus 2 | 3 | @mixin tab-focus() { 4 | // Default 5 | outline: thin dotted; 6 | // WebKit 7 | outline: 5px auto -webkit-focus-ring-color; 8 | outline-offset: -2px; 9 | } 10 | -------------------------------------------------------------------------------- /docs-src/src/stylesheets/vendors/bootstrap/mixins/_table-row.scss: -------------------------------------------------------------------------------- 1 | // Tables 2 | 3 | @mixin table-row-variant($state, $background) { 4 | // Exact selectors below required to override `.table-striped` and prevent 5 | // inheritance to nested tables. 6 | .table > thead > tr, 7 | .table > tbody > tr, 8 | .table > tfoot > tr { 9 | > td.#{$state}, 10 | > th.#{$state}, 11 | &.#{$state} > td, 12 | &.#{$state} > th { 13 | background-color: $background; 14 | } 15 | } 16 | 17 | // Hover states for `.table-hover` 18 | // Note: this is not available for cells or rows within `thead` or `tfoot`. 19 | .table-hover > tbody > tr { 20 | > td.#{$state}:hover, 21 | > th.#{$state}:hover, 22 | &.#{$state}:hover > td, 23 | &:hover > .#{$state}, 24 | &.#{$state}:hover > th { 25 | background-color: darken($background, 5%); 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /docs-src/src/stylesheets/vendors/bootstrap/mixins/_text-emphasis.scss: -------------------------------------------------------------------------------- 1 | // Typography 2 | 3 | // [converter] $parent hack 4 | @mixin text-emphasis-variant($parent, $color) { 5 | #{$parent} { 6 | color: $color; 7 | } 8 | a#{$parent}:hover { 9 | color: darken($color, 10%); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /docs-src/src/stylesheets/vendors/bootstrap/mixins/_text-overflow.scss: -------------------------------------------------------------------------------- 1 | // Text overflow 2 | // Requires inline-block or block for proper styling 3 | 4 | @mixin text-overflow() { 5 | overflow: hidden; 6 | text-overflow: ellipsis; 7 | white-space: nowrap; 8 | } 9 | -------------------------------------------------------------------------------- /docs-src/src/themes.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Themes 3 | layout: content-with-menu.pug 4 | --- 5 | 6 | # Themes 7 | 8 | The [tutorial][1] explains how to update the default Jekyll theme ([minima][2]) 9 | to allow searching into all posts. You should be able to follow similar steps 10 | to add search into your own design. 11 | 12 | Some themes already have `jekyll-algolia` embedded by default: 13 | 14 | - [Minimal Mistakes][3], by [@mmistakes][4] 15 | - [GaeBlogx][5], by [@SeraphRoy][6] 16 | - [Sakura][7] ([live demo][8]), by [@kimfucious][9] 17 | - [tactile-advanced-template][10] 18 | 19 | ## Add your own 20 | 21 | If you're maintaining a theme using `jekyll-algolia`, feel free to [edit this 22 | page][11] to add your theme to the list. 23 | 24 | 25 | [1]: ./blog.html 26 | [2]: https://github.com/jekyll/minima 27 | [3]: https://mmistakes.github.io/minimal-mistakes/ 28 | [4]: https://github.com/mmistakes 29 | [5]: https://github.com/SeraphRoy/GaeBlogx 30 | [6]: https://www.gaeblogx.com/ 31 | [7]: https://github.com/kimfucious/sakura 32 | [8]: https://sakura.abts.io/ 33 | [9]: https://github.com/kimfucious 34 | [10]: https://github.com/Pathsis/tactile-advanced-template-with-algolia 35 | [11]: https://github.com/algolia/jekyll-algolia/edit/develop/docs-src/src/themes.md 36 | -------------------------------------------------------------------------------- /docs-src/webpack.config.build.js: -------------------------------------------------------------------------------- 1 | // this is the webpack config when building docs for production 2 | 3 | const webpackConfig = require('./webpack.config.js'); 4 | const UglifyJsPlugin = require('uglifyjs-webpack-plugin'); 5 | 6 | module.exports = { 7 | ...webpackConfig, 8 | devtool: 'source-map', 9 | output: { 10 | ...webpackConfig.output, 11 | filename: '[name]-build.js', // hash is made with `plugins/rev-assets.js` 12 | }, 13 | plugins: [ 14 | new UglifyJsPlugin({ 15 | sourceMap: true, 16 | }), 17 | ...webpackConfig.plugins, 18 | ], 19 | }; 20 | -------------------------------------------------------------------------------- /docs-src/webpack.config.js: -------------------------------------------------------------------------------- 1 | const webpack = require('webpack'); 2 | const path = require('path'); 3 | const config = require('./config.js'); 4 | const HappyPack = require('happypack'); 5 | 6 | module.exports = { 7 | entry: { 8 | 'js/main': path.join(__dirname, 'src/assets/js/main.js'), 9 | }, 10 | output: { 11 | path: config.docsDist, 12 | publicPath: config.publicPath, 13 | filename: '[name].js', 14 | }, 15 | module: { 16 | rules: [ 17 | { 18 | test: /\.js$/, 19 | exclude: /node_modules/, 20 | loader: 'happypack/loader?id=babel', 21 | }, 22 | { 23 | test: /\.scss$/, 24 | exclude: /node_modules/, 25 | loader: 'happypack/loader?id=style', 26 | }, 27 | ], 28 | }, 29 | plugins: [ 30 | new webpack.EnvironmentPlugin({ 31 | NODE_ENV: 'development', // use 'development' unless process.env.NODE_ENV is defined 32 | }), 33 | new webpack.optimize.CommonsChunkPlugin({ 34 | name: 'js/common', 35 | minChunks: module => 36 | /\/react\//.test(module.context) || 37 | /\/react-dom\//.test(module.context) || 38 | /\/lodash\//.test(module.context) || 39 | /\/fbjs\//.test(module.context) || 40 | /\/algolia-frontend-components\//.test(module.context), 41 | }), 42 | new HappyPack({ 43 | loaders: [ 44 | { 45 | loader: 'babel-loader', 46 | options: { 47 | presets: [['@babel/preset-env'], '@babel/preset-react'], 48 | }, 49 | }, 50 | ], 51 | id: 'babel', 52 | }), 53 | new HappyPack({ 54 | loaders: [ 55 | 'style-loader?insertAt=top', 56 | 'css-loader', 57 | 'postcss-loader', 58 | 'sass-loader', 59 | ], 60 | id: 'style', 61 | }), 62 | ], 63 | }; 64 | -------------------------------------------------------------------------------- /docs-src/webpack.config.start.js: -------------------------------------------------------------------------------- 1 | // this is the webpack config when running `npm start` 2 | 3 | const webpack = require('webpack'); 4 | const webpackConfig = require('./webpack.config.js'); 5 | 6 | module.exports = { 7 | ...webpackConfig, 8 | devtool: 'cheap-module-eval-source-map', 9 | entry: { 10 | ...Object.entries(webpackConfig.entry).reduce( 11 | (memo, [entryName, entryValue]) => ({ 12 | ...memo, 13 | [entryName]: [ 14 | 'babel-polyfill', 15 | 'react-hot-loader/patch', 16 | 'webpack-hot-middleware/client?reload=true', 17 | entryValue, 18 | ], 19 | }), 20 | {} 21 | ), 22 | }, 23 | plugins: [ 24 | new webpack.HotModuleReplacementPlugin(), 25 | new webpack.NoEmitOnErrorsPlugin(), 26 | ...webpackConfig.plugins, 27 | ], 28 | }; 29 | -------------------------------------------------------------------------------- /docs/assets/fonts/DejaVuSansMono.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algolia/jekyll-algolia/ad7db782551dd5f9bfcb2f1c2a13b5504fa5b5a8/docs/assets/fonts/DejaVuSansMono.eot -------------------------------------------------------------------------------- /docs/assets/fonts/DejaVuSansMono.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algolia/jekyll-algolia/ad7db782551dd5f9bfcb2f1c2a13b5504fa5b5a8/docs/assets/fonts/DejaVuSansMono.ttf -------------------------------------------------------------------------------- /docs/assets/fonts/DejaVuSansMono.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algolia/jekyll-algolia/ad7db782551dd5f9bfcb2f1c2a13b5504fa5b5a8/docs/assets/fonts/DejaVuSansMono.woff -------------------------------------------------------------------------------- /docs/assets/fonts/DejaVuSansMonoBold.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algolia/jekyll-algolia/ad7db782551dd5f9bfcb2f1c2a13b5504fa5b5a8/docs/assets/fonts/DejaVuSansMonoBold.eot -------------------------------------------------------------------------------- /docs/assets/fonts/DejaVuSansMonoBold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algolia/jekyll-algolia/ad7db782551dd5f9bfcb2f1c2a13b5504fa5b5a8/docs/assets/fonts/DejaVuSansMonoBold.ttf -------------------------------------------------------------------------------- /docs/assets/fonts/DejaVuSansMonoBold.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algolia/jekyll-algolia/ad7db782551dd5f9bfcb2f1c2a13b5504fa5b5a8/docs/assets/fonts/DejaVuSansMonoBold.woff -------------------------------------------------------------------------------- /docs/assets/fonts/FontAwesome.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algolia/jekyll-algolia/ad7db782551dd5f9bfcb2f1c2a13b5504fa5b5a8/docs/assets/fonts/FontAwesome.otf -------------------------------------------------------------------------------- /docs/assets/fonts/Montserrat-Black.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algolia/jekyll-algolia/ad7db782551dd5f9bfcb2f1c2a13b5504fa5b5a8/docs/assets/fonts/Montserrat-Black.otf -------------------------------------------------------------------------------- /docs/assets/fonts/Montserrat-Bold.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algolia/jekyll-algolia/ad7db782551dd5f9bfcb2f1c2a13b5504fa5b5a8/docs/assets/fonts/Montserrat-Bold.otf -------------------------------------------------------------------------------- /docs/assets/fonts/Montserrat-ExtraBold.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algolia/jekyll-algolia/ad7db782551dd5f9bfcb2f1c2a13b5504fa5b5a8/docs/assets/fonts/Montserrat-ExtraBold.otf -------------------------------------------------------------------------------- /docs/assets/fonts/Montserrat-ExtraLight.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algolia/jekyll-algolia/ad7db782551dd5f9bfcb2f1c2a13b5504fa5b5a8/docs/assets/fonts/Montserrat-ExtraLight.otf -------------------------------------------------------------------------------- /docs/assets/fonts/Montserrat-Light.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algolia/jekyll-algolia/ad7db782551dd5f9bfcb2f1c2a13b5504fa5b5a8/docs/assets/fonts/Montserrat-Light.otf -------------------------------------------------------------------------------- /docs/assets/fonts/Montserrat-Medium.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algolia/jekyll-algolia/ad7db782551dd5f9bfcb2f1c2a13b5504fa5b5a8/docs/assets/fonts/Montserrat-Medium.otf -------------------------------------------------------------------------------- /docs/assets/fonts/Montserrat-Regular.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algolia/jekyll-algolia/ad7db782551dd5f9bfcb2f1c2a13b5504fa5b5a8/docs/assets/fonts/Montserrat-Regular.otf -------------------------------------------------------------------------------- /docs/assets/fonts/Montserrat-SemiBold.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algolia/jekyll-algolia/ad7db782551dd5f9bfcb2f1c2a13b5504fa5b5a8/docs/assets/fonts/Montserrat-SemiBold.otf -------------------------------------------------------------------------------- /docs/assets/fonts/Montserrat-Thin.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algolia/jekyll-algolia/ad7db782551dd5f9bfcb2f1c2a13b5504fa5b5a8/docs/assets/fonts/Montserrat-Thin.otf -------------------------------------------------------------------------------- /docs/assets/fonts/algolia-brands-iconfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algolia/jekyll-algolia/ad7db782551dd5f9bfcb2f1c2a13b5504fa5b5a8/docs/assets/fonts/algolia-brands-iconfont.eot -------------------------------------------------------------------------------- /docs/assets/fonts/algolia-brands-iconfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algolia/jekyll-algolia/ad7db782551dd5f9bfcb2f1c2a13b5504fa5b5a8/docs/assets/fonts/algolia-brands-iconfont.ttf -------------------------------------------------------------------------------- /docs/assets/fonts/algolia-brands-iconfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algolia/jekyll-algolia/ad7db782551dd5f9bfcb2f1c2a13b5504fa5b5a8/docs/assets/fonts/algolia-brands-iconfont.woff -------------------------------------------------------------------------------- /docs/assets/fonts/algolia-website-iconfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algolia/jekyll-algolia/ad7db782551dd5f9bfcb2f1c2a13b5504fa5b5a8/docs/assets/fonts/algolia-website-iconfont.eot -------------------------------------------------------------------------------- /docs/assets/fonts/algolia-website-iconfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algolia/jekyll-algolia/ad7db782551dd5f9bfcb2f1c2a13b5504fa5b5a8/docs/assets/fonts/algolia-website-iconfont.ttf -------------------------------------------------------------------------------- /docs/assets/fonts/algolia-website-iconfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algolia/jekyll-algolia/ad7db782551dd5f9bfcb2f1c2a13b5504fa5b5a8/docs/assets/fonts/algolia-website-iconfont.woff -------------------------------------------------------------------------------- /docs/assets/fonts/fontawesome-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algolia/jekyll-algolia/ad7db782551dd5f9bfcb2f1c2a13b5504fa5b5a8/docs/assets/fonts/fontawesome-webfont.eot -------------------------------------------------------------------------------- /docs/assets/fonts/fontawesome-webfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algolia/jekyll-algolia/ad7db782551dd5f9bfcb2f1c2a13b5504fa5b5a8/docs/assets/fonts/fontawesome-webfont.ttf -------------------------------------------------------------------------------- /docs/assets/fonts/fontawesome-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algolia/jekyll-algolia/ad7db782551dd5f9bfcb2f1c2a13b5504fa5b5a8/docs/assets/fonts/fontawesome-webfont.woff -------------------------------------------------------------------------------- /docs/assets/fonts/fontawesome-webfont.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algolia/jekyll-algolia/ad7db782551dd5f9bfcb2f1c2a13b5504fa5b5a8/docs/assets/fonts/fontawesome-webfont.woff2 -------------------------------------------------------------------------------- /docs/assets/fonts/montserrat-v10-latin-300.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algolia/jekyll-algolia/ad7db782551dd5f9bfcb2f1c2a13b5504fa5b5a8/docs/assets/fonts/montserrat-v10-latin-300.woff -------------------------------------------------------------------------------- /docs/assets/fonts/montserrat-v10-latin-300.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algolia/jekyll-algolia/ad7db782551dd5f9bfcb2f1c2a13b5504fa5b5a8/docs/assets/fonts/montserrat-v10-latin-300.woff2 -------------------------------------------------------------------------------- /docs/assets/fonts/montserrat-v10-latin-500.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algolia/jekyll-algolia/ad7db782551dd5f9bfcb2f1c2a13b5504fa5b5a8/docs/assets/fonts/montserrat-v10-latin-500.woff -------------------------------------------------------------------------------- /docs/assets/fonts/montserrat-v10-latin-500.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algolia/jekyll-algolia/ad7db782551dd5f9bfcb2f1c2a13b5504fa5b5a8/docs/assets/fonts/montserrat-v10-latin-500.woff2 -------------------------------------------------------------------------------- /docs/assets/fonts/montserrat-v10-latin-600.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algolia/jekyll-algolia/ad7db782551dd5f9bfcb2f1c2a13b5504fa5b5a8/docs/assets/fonts/montserrat-v10-latin-600.woff -------------------------------------------------------------------------------- /docs/assets/fonts/montserrat-v10-latin-600.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algolia/jekyll-algolia/ad7db782551dd5f9bfcb2f1c2a13b5504fa5b5a8/docs/assets/fonts/montserrat-v10-latin-600.woff2 -------------------------------------------------------------------------------- /docs/assets/fonts/montserrat-v10-latin-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algolia/jekyll-algolia/ad7db782551dd5f9bfcb2f1c2a13b5504fa5b5a8/docs/assets/fonts/montserrat-v10-latin-regular.woff -------------------------------------------------------------------------------- /docs/assets/fonts/montserrat-v10-latin-regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algolia/jekyll-algolia/ad7db782551dd5f9bfcb2f1c2a13b5504fa5b5a8/docs/assets/fonts/montserrat-v10-latin-regular.woff2 -------------------------------------------------------------------------------- /docs/assets/images/aerial-background-top-d45eeb90d327d3da151f404ddf2ae8fc.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /docs/assets/images/card-d601b3714c5bd2fd25a0cd1179cef970.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algolia/jekyll-algolia/ad7db782551dd5f9bfcb2f1c2a13b5504fa5b5a8/docs/assets/images/card-d601b3714c5bd2fd25a0cd1179cef970.png -------------------------------------------------------------------------------- /docs/assets/images/dry-run-a51601eead2c4a160f88b1594682f25e.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algolia/jekyll-algolia/ad7db782551dd5f9bfcb2f1c2a13b5504fa5b5a8/docs/assets/images/dry-run-a51601eead2c4a160f88b1594682f25e.gif -------------------------------------------------------------------------------- /docs/assets/images/favicon-54339122a2393b28d82d46ac8b785542.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algolia/jekyll-algolia/ad7db782551dd5f9bfcb2f1c2a13b5504fa5b5a8/docs/assets/images/favicon-54339122a2393b28d82d46ac8b785542.png -------------------------------------------------------------------------------- /docs/assets/images/getting-started-ff88ef93194e04687d7f08079df54ce9.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algolia/jekyll-algolia/ad7db782551dd5f9bfcb2f1c2a13b5504fa5b5a8/docs/assets/images/getting-started-ff88ef93194e04687d7f08079df54ce9.gif -------------------------------------------------------------------------------- /docs/assets/images/github-icon-5afb2ba9b7e186c8f6390cbd14c7015a.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /docs/assets/images/instantsearch-nostyling-375beaab74d5f18245d64466c88ecea5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algolia/jekyll-algolia/ad7db782551dd5f9bfcb2f1c2a13b5504fa5b5a8/docs/assets/images/instantsearch-nostyling-375beaab74d5f18245d64466c88ecea5.png -------------------------------------------------------------------------------- /docs/assets/images/instantsearch-styling-a520d5b5b520d9582669eb9d42fb18a3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algolia/jekyll-algolia/ad7db782551dd5f9bfcb2f1c2a13b5504fa5b5a8/docs/assets/images/instantsearch-styling-a520d5b5b520d9582669eb9d42fb18a3.png -------------------------------------------------------------------------------- /docs/assets/images/light-speed-c4d77faa336eb4743aca31d8536bcdd5.svg: -------------------------------------------------------------------------------- 1 | Rectangle-path 2 | -------------------------------------------------------------------------------- /docs/assets/images/minima-search-bf2705cab83e8d1e92396079c6151d1f.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algolia/jekyll-algolia/ad7db782551dd5f9bfcb2f1c2a13b5504fa5b5a8/docs/assets/images/minima-search-bf2705cab83e8d1e92396079c6151d1f.gif -------------------------------------------------------------------------------- /docs/assets/images/netlify-env-d41d4c3cacf7f918b09debd2f907a5b8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algolia/jekyll-algolia/ad7db782551dd5f9bfcb2f1c2a13b5504fa5b5a8/docs/assets/images/netlify-env-d41d4c3cacf7f918b09debd2f907a5b8.png -------------------------------------------------------------------------------- /docs/assets/images/touch-point-2eab1bcf8f172af9a42b1ebe006cd64e.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /docs/assets/images/travis-config-911ca5c615fd946e887d2cf872a3c11e.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algolia/jekyll-algolia/ad7db782551dd5f9bfcb2f1c2a13b5504fa5b5a8/docs/assets/images/travis-config-911ca5c615fd946e887d2cf872a3c11e.png -------------------------------------------------------------------------------- /docs/assets/images/travis-env-3a78f33fda9ab47bb06f410684838d7d.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algolia/jekyll-algolia/ad7db782551dd5f9bfcb2f1c2a13b5504fa5b5a8/docs/assets/images/travis-env-3a78f33fda9ab47bb06f410684838d7d.png -------------------------------------------------------------------------------- /docs/includes/mixins.pug: -------------------------------------------------------------------------------- 1 | mixin feature(options) 2 | - var title = options.title 3 | - var image = options.image || './assets/images/placeholder.png' 4 | - var isFlipped = options.flip || false 5 | section.row.p-xlarge.m-l-none.m-r-none.pos-rel 6 | .container 7 | .inline.spacer40.hidden-sm 8 | .col-md-12.z-10 9 | if isFlipped === false 10 | .col-md-6.hidden-sm 11 | img.section-illustration(src=image, alt=title, width="525") 12 | 13 | .col-md-6.p-r-xlarge 14 | header 15 | h3.no-p-t.m-t-none.text-thin=title 16 | .spacer16.visible-sm 17 | img.section-illustration.visible-sm(src=image, alt=title, width="525") 18 | .spacer24 19 | p.color-east-bay.text-regular.text-normal 20 | block 21 | .spacer24 22 | 23 | if isFlipped === true 24 | .col-md-6.hidden-sm 25 | img.section-illustration(src=image, alt=title, width="525") 26 | -------------------------------------------------------------------------------- /docs/stylesheets/components/open-doc-menu_icon-32a0f3e0afd42c93ceeb43b91d1b7657.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Combined Shape 5 | Created with Sketch. 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /jekyll-algolia.gemspec: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | require File.join(__dir__, 'lib/jekyll/algolia/version.rb') 4 | 5 | Gem::Specification.new do |gem| 6 | # Required attributes 7 | gem.name = 'jekyll-algolia' 8 | gem.summary = 'Index your Jekyll content into Algolia' 9 | gem.version = Jekyll::Algolia::VERSION 10 | 11 | # Recommended attributes 12 | gem.authors = ['Tim Carry', 'Sylvain Utard'] 13 | gem.description = 'Index all your content into Algolia by '\ 14 | 'running `jekyll algolia`' 15 | gem.email = 'support@algolia.com' 16 | gem.homepage = 'https://github.com/algolia/jekyll-algolia' 17 | gem.licenses = ['MIT'] 18 | 19 | # Supported Ruby versions 20 | gem.required_ruby_version = '>= 2.3.0' 21 | 22 | # Dependencies 23 | gem.add_runtime_dependency 'algolia_html_extractor', '~> 2.6' 24 | gem.add_runtime_dependency 'algoliasearch', '~> 1.26' 25 | gem.add_runtime_dependency 'filesize', '~> 0.1' 26 | gem.add_runtime_dependency 'jekyll', '>= 3.6', '< 5.0' 27 | gem.add_runtime_dependency 'json', '~> 2.0' 28 | gem.add_runtime_dependency 'nokogiri', '~> 1.6' 29 | gem.add_runtime_dependency 'progressbar', '~> 1.9' 30 | gem.add_runtime_dependency 'verbal_expressions', '~> 0.1.5' 31 | 32 | gem.add_development_dependency 'awesome_print', '~> 1.8' 33 | gem.add_development_dependency 'coveralls', '~> 0.8' 34 | gem.add_development_dependency 'flay', '~> 2.6' 35 | gem.add_development_dependency 'flog', '~> 4.3' 36 | gem.add_development_dependency 'guard', '~> 2.14' 37 | gem.add_development_dependency 'guard-rspec', '~> 4.6' 38 | gem.add_development_dependency 'rake', '~> 12.3' 39 | gem.add_development_dependency 'rspec', '~> 3.0' 40 | gem.add_development_dependency 'rubocop', '~> 0.51' 41 | gem.add_development_dependency 'rubocop-rspec-focused', '~> 0.1.0' 42 | gem.add_development_dependency 'simplecov', '~> 0.10' 43 | 44 | # Files 45 | gem.files = Dir[ 46 | 'lib/**/*.rb', 47 | 'lib/errors/*.txt', 48 | 'README.md', 49 | 'CONTRIBUTING.md', 50 | 'LICENSE.txt', 51 | ] 52 | end 53 | -------------------------------------------------------------------------------- /lib/errors/invalid_credentials.txt: -------------------------------------------------------------------------------- 1 | E:[✗ Error] Invalid credentials 2 | E: 3 | E:The jekyll-algolia plugin could not connect to your application ID using the API key your provided. 4 | W: 5 | W:Make sure your API key has access to your {application_id} application. 6 | W:It should also have the rights to push to the following indices: 7 | W:   - {index_name} 8 | W:   - {index_object_ids_name} 9 | I: 10 | I:You can find your API key in your Algolia dashboard here: 11 | I:   https://www.algolia.com/licensing 12 | I: 13 | -------------------------------------------------------------------------------- /lib/errors/invalid_index_name.txt: -------------------------------------------------------------------------------- 1 | E:[✗ Error] Invalid index name 2 | E: 3 | E:The jekyll-algolia plugin could push records to your index as its name contains invalid characters. 4 | W: 5 | W:Some special characters are not allowed in the naming of indices and your index {index_name} contains some of them. 6 | I: 7 | I:Please, check our FAQ for more details: 8 | I:  https://www.algolia.com/doc/faq/index-configuration/what-can-i-name-my-indices/ 9 | I: 10 | -------------------------------------------------------------------------------- /lib/errors/missing_api_key.txt: -------------------------------------------------------------------------------- 1 | E:[✗ Error] Missing API key 2 | E: 3 | E:The jekyll-algolia plugin could not find your API key. 4 | W: 5 | W:Please, define your API key either by: 6 | W: 7 | W:1/ Defining an ENV variable when calling `jekyll algolia` 8 | W:   $ ALGOLIA_API_KEY='your_api_key' jekyll algolia 9 | W: 10 | W:2/ Save your API key in a named `_algolia_api_key` in your source directory. 11 | W:   If you do this, we strongly recommend you to NOT track this file in your versionning system. 12 | I: 13 | I:You can find your API key in your Algolia dashboard here: 14 | I:   https://www.algolia.com/api-keys 15 | I: 16 | -------------------------------------------------------------------------------- /lib/errors/missing_application_id.txt: -------------------------------------------------------------------------------- 1 | E:[✗ Error] No application ID defined 2 | E: 3 | E:The jekyll-algolia plugin could not find your Algolia application ID. 4 | W: 5 | W:Please, define it in your Jekyll _config.yml file like this: 6 | W: 7 | W:  algolia: 8 | W:    application_id: {your_application_id} 9 | I: 10 | I:You can find your application ID along with all your credentials in your Algolia dashboard here: 11 | I:   https://www.algolia.com/api-keys 12 | -------------------------------------------------------------------------------- /lib/errors/missing_index_name.txt: -------------------------------------------------------------------------------- 1 | E:[✗ Error] No index name defined 2 | E: 3 | E:The jekyll-algolia plugin could not find the name of the Algolia index you want to push your records to. 4 | W: 5 | W:Please, define it in your Jekyll _config.yml file like this: 6 | W: 7 | W:  algolia: 8 | W:   index_name: your_index_name 9 | W: 10 | W:Alternatively, you can also define it as an ENV variable, like this: 11 | W: 12 | W:  $ ALGOLIA_INDEX_NAME='{your_index_name}' jekyll algolia 13 | W: 14 | I:You can see all your indices from your Algolia dashboard here: 15 | I:  https://www.algolia.com/explorer 16 | I: 17 | I:Note that you don't have to create an index before pushing records. 18 | I:It will be created automatically if it does not exist yet. 19 | -------------------------------------------------------------------------------- /lib/errors/no_records_found.txt: -------------------------------------------------------------------------------- 1 | E:[✗ Error] No records found 2 | E: 3 | E:The jekyll-algolia plugin could not find any records to index. 4 | W: 5 | W:The plugin tried to extract records from the pages, posts and collections of your site but could not find anything to index. 6 | I: 7 | I:Make sure you did not exclude too many files from indexing using the `files_to_exclude` option. You are currently excluding the following files: 8 | I:    {files_to_exclude} 9 | I: 10 | I:Also double check that your current value for `nodes_to_index` can actually match something in the pages. You are current indexing the following nodes: 11 | I:    {nodes_to_index} 12 | I: 13 | I:Note that all the markup that is defined in the layouts won't be available during extraction. Only the page content can be accessed. So if you defined a layout markup that is used only for one page, you should move it to the page instead. 14 | I: 15 | -------------------------------------------------------------------------------- /lib/errors/record_too_big.txt: -------------------------------------------------------------------------------- 1 | E:[✗ Error] Record is too big 2 | E: 3 | E:The jekyll-algolia plugin detected that one of your records exceeds the {max_record_size} record size limit. 4 | W: 5 | W:title:    {object_title} 6 | W:url:      {object_url} 7 | W:size:     {record_size} 8 | W: 9 | W:Most probable keys causing the issue: 10 | W:   {probable_wrong_keys} 11 | W: 12 | W:Complete log of the record has been extracted to: 13 | W:   {record_log_path} 14 | W: 15 | I:This issue can be caused by malformed HTML preventing the parser to correctly grab the content of the nodes. Double check that the page actually renders correctly with a regular `jekyll build`. 16 | I: 17 | I:You can also exclude the page generating this error from the indexing by editing the `files_to_exclude` key of your config. 18 | I: 19 | I:If you think this is an error and your current Algolia plan should allow you to push records bigger than {max_record_size}, you can change the `max_record_size` config option to increase the limit. Paid plans have a limit set to 20Kb, while free Community plans have it set to 10Kb. 20 | I: 21 | I:The following documentation might help you: 22 | I:   - https://community.algolia.com/jekyll-algolia/options.html#files-to-exclude 23 | I:   - https://community.algolia.com/jekyll-algolia/options.html#nodes-to-index 24 | I:   - https://community.algolia.com/jekyll-algolia/options.html#max-record-size 25 | I: 26 | I:If you're still having trouble solving this issue, feel free to file a bug on GitHub, ideally with a link to a repository where we can reproduce the issue. 27 | I:  https://github.com/algolia/jekyll-algolia/issues 28 | -------------------------------------------------------------------------------- /lib/errors/record_too_big_api.txt: -------------------------------------------------------------------------------- 1 | E:[✗ Error] Record is too big 2 | E: 3 | E:The API rejected one of your records because it is too big ({record_size}). 4 | W: 5 | W:Make sure the value of `max_record_size` (currently set to "{max_record_size}") matches the maximum size allowed by your current Algolia plan. 6 | W: 7 | I:Free Community plans can push records up to 10Kb (`max_record_size: 10000`, this is the default value), while paid plans can go up to 20Kb (`max_record_size: 20000`). 8 | I: 9 | I:If you're still having trouble solving this issue, feel free to file a bug on GitHub, ideally with a link to a repository where we can reproduce the issue. 10 | I:  https://github.com/algolia/jekyll-algolia/issues 11 | -------------------------------------------------------------------------------- /lib/errors/settings_manually_edited.txt: -------------------------------------------------------------------------------- 1 | I: 2 | W:[jekyll-algolia] Configuration mismatch: 3 | W:It seems that your index settings have been edited from outside of the jekyll-algolia plugin. 4 | I: 5 | I:This can happen if you manually edited them from the Algolia dashboard, for example. Don't worry, they will still be honored (for now). 6 | I: 7 | I:Still, we strongly encourage you to save any custom config inside the algolia.settings key of your _config.yml instead. Any value set there will always take precedence over anything you manually set in your dashboard. 8 | I:This is the best way to be sure your settings won't be lost in the future. 9 | I: 10 | W:To keep your current custom config, here is what you should add to your _config.yml file: 11 | W: 12 | W:algolia: 13 | W:  settings: 14 | {settings} 15 | I: 16 | I:If you'd like to revert to the default settings, the easiest way is to delete the {index_name} index from your dashboard and run `jekyll algolia` again. 17 | I: 18 | -------------------------------------------------------------------------------- /lib/errors/too_many_records.txt: -------------------------------------------------------------------------------- 1 | E:[✗ Error] Too many records 2 | E: 3 | E:The jekyll-algolia plugin could not push your records because it exceeds the maximum number of records allowed in your current plan. 4 | W: 5 | W:Community plans can host up to 10k records and Essential plans starts at 50k. 6 | W: 7 | W:Check our pricing page for more details: 8 | W:   https://www.algolia.com/pricing 9 | W: 10 | I:You might want to upgrade your plan or exclude records from indexing using the `files_to_exclude` option: 11 | I:   https://community.algolia.com/jekyll-algolia/options.html#files-to-exclude 12 | I: 13 | I:If you're having trouble solving this issue, feel free to file a bug on GitHub, ideally with a link to a repository where we can reproduce the issue as well as the APPID you're trying to push to. 14 | I:  https://github.com/algolia/jekyll-algolia/issues 15 | -------------------------------------------------------------------------------- /lib/errors/unknown_application_id.txt: -------------------------------------------------------------------------------- 1 | E:[✗ Error] Unreachable server 2 | E: 3 | E:The jekyll-algolia plugin could not contact the server hosting your application. 4 | W: 5 | W:Make sure you correctly typed your application ID. As we are using the application ID as part of the server url, any typo in the application ID will prevent us from reaching your server. 6 | W: 7 | I:Here is the application ID you defined: {application_id} 8 | I: 9 | I:Make sure it's the same as the one displayed in your dashboard: 10 | I:   https://www.algolia.com/api-keys 11 | I: 12 | I:Then, define it in your Jekyll _config.yml file like this: 13 | I: 14 | I:  algolia: 15 | I:    application_id: your_application_id 16 | I: 17 | -------------------------------------------------------------------------------- /lib/errors/unknown_settings.txt: -------------------------------------------------------------------------------- 1 | E:[✗ Error] Unknown setting 2 | E: 3 | E:The jekyll-algolia plugin could not correctly configure your index as some of the settings passed are not recognized. 4 | W: 5 | W:It seems that one of the custom index settings you defined was not recognized by the API and was rejected: 6 | W:  {setting_name}: {setting_value} 7 | I: 8 | I:Make sure the setting name and value are correct. You can find a list of all the available settings with their documentation in our API reference: 9 | I:  https://www.algolia.com/doc/api-reference/api-parameters/ 10 | I:Or specifically for this setting: 11 | I:  https://www.algolia.com/doc/api-reference/api-parameters/{setting_name}/ 12 | I: 13 | -------------------------------------------------------------------------------- /lib/jekyll/algolia/extractor.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | require 'algolia_html_extractor' 4 | 5 | module Jekyll 6 | module Algolia 7 | # Module to extract records from Jekyll files 8 | module Extractor 9 | include Jekyll::Algolia 10 | 11 | # Public: Extract records from the file 12 | # 13 | # file - The Jekyll file to process 14 | def self.run(file) 15 | # Getting all nodes from the HTML input 16 | raw_records = extract_raw_records(file.content) 17 | # Getting file metadata 18 | shared_metadata = FileBrowser.metadata(file) 19 | 20 | # If no content, we still index the metadata 21 | raw_records = [shared_metadata] if raw_records.empty? 22 | 23 | # Building the list of records 24 | records = [] 25 | raw_records.map do |record| 26 | # We do not need to pass the HTML node element to the final record 27 | node = record[:node] 28 | record.delete(:node) 29 | 30 | # Merging each record info with file info 31 | record = Utils.compact_empty(record.merge(shared_metadata)) 32 | 33 | # Apply custom user-defined hooks 34 | # Users can return `nil` from the hook to signal we should not index 35 | # such a record 36 | record = Hooks.apply_each(record, node, Jekyll::Algolia.site) 37 | next if record.nil? 38 | 39 | records << record 40 | end 41 | 42 | records 43 | end 44 | 45 | # Public: Adds a unique :objectID field to the hash, representing the 46 | # current content of the record 47 | def self.add_unique_object_id(record) 48 | record[:objectID] = AlgoliaHTMLExtractor.uuid(record) 49 | record 50 | end 51 | 52 | # Public: Extract raw records from the file, including content for each 53 | # node and its headings 54 | # 55 | # content - The HTML content to parse 56 | def self.extract_raw_records(content) 57 | records = AlgoliaHTMLExtractor.run( 58 | content, 59 | options: { 60 | css_selector: Configurator.algolia('nodes_to_index'), 61 | tags_to_exclude: 'script,style,iframe' 62 | } 63 | ) 64 | # We remove objectIDs, as the will be added at the very end, after all 65 | # the hooks and shrinkage 66 | records.each do |record| 67 | record.delete(:objectID) 68 | end 69 | 70 | records 71 | end 72 | end 73 | end 74 | end 75 | -------------------------------------------------------------------------------- /lib/jekyll/algolia/overwrites/githubpages-configuration.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module GitHubPages 4 | # The github-pages gem will automatically disable every plugin that is not in 5 | # the whitelist of plugins allowed by GitHub. This includes any plugin defined 6 | # in the `_plugins` folder as well. 7 | # 8 | # Users of the jekyll-algolia plugin will use custom plugins in _plugins to 9 | # define custom hooks to modify the indexing. If they happen to have the 10 | # github-pages gem installed at the same time, those hooks will never be 11 | # executed. 12 | # 13 | # The GitHub Pages gem prevent access to custom plugins by doing two things: 14 | # - forcing safe mode 15 | # - loading custom plugins from a random dir 16 | # 17 | # We cancel those by disabling safe mode and forcing back plugins to be read 18 | # from ./_plugins. 19 | # 20 | # This file will only be loaded when running `jekyll algolia`, so it won't 21 | # interfere with the regular usage of `jekyll build` 22 | class Configuration 23 | class << self 24 | def set!(site) 25 | config = effective_config(site.config) 26 | config['safe'] = false 27 | config['plugins_dir'] = '_plugins' 28 | site.config = config 29 | end 30 | end 31 | end 32 | end 33 | -------------------------------------------------------------------------------- /lib/jekyll/algolia/overwrites/jekyll-document.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module Jekyll 4 | # Overwriting the Jekyll::Document class 5 | class Document 6 | # By default, Jekyll will set the current date (time of build) to any 7 | # collection item. This will break our diff algorithm, so we monkey patch 8 | # this call to return nil if no date is defined and the file is not a 9 | # draft instead. 10 | def date 11 | data["date"] ||= (draft? ? source_file_mtime : nil) 12 | end 13 | end 14 | end 15 | -------------------------------------------------------------------------------- /lib/jekyll/algolia/overwrites/jekyll-paginate-pager.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module Jekyll 4 | module Paginate 5 | # Disable pagination from jekyll-paginate 6 | # 7 | # This plugin will create pages that contain a list of all items to 8 | # paginate. Those pages won't contain any interesting data to be indexed 9 | # (as it will be duplicated content of the real pages), but will still 10 | # take time to generate. 11 | # 12 | # By monkey-patching the plugin, we force it to be disabled 13 | # https://github.com/jekyll/jekyll-paginate/blob/master/lib/jekyll-paginate/pager.rb#L22 14 | class Pager 15 | def self.pagination_enabled?(_site) 16 | false 17 | end 18 | end 19 | end 20 | end 21 | -------------------------------------------------------------------------------- /lib/jekyll/algolia/overwrites/jekyll-tags-link.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | # The default `link` tag allow to link to a specific page, using its relative 4 | # path. Because we might not be indexing the destination of the link, we might 5 | # not have the representation of the page in our data. If that happens, the 6 | # `link` tag fails. 7 | # 8 | # To fix that we'll overwrite the default `link` tag to loop over a backup copy 9 | # of the original files (before we clean it for indexing) 10 | # 11 | # https://github.com/algolia/jekyll-algolia/issues/62 12 | class JekyllAlgoliaLink < Jekyll::Tags::Link 13 | def render(context) 14 | original_files = context.registers[:site].original_site_files 15 | 16 | original_files[:pages].each do |page| 17 | return page.url if page.relative_path == @relative_path 18 | end 19 | 20 | original_files[:collections].each_value do |collection| 21 | collection.docs.each do |item| 22 | return item.url if item.relative_path == @relative_path 23 | end 24 | end 25 | 26 | original_files[:static_files].each do |asset| 27 | return asset.url if asset.relative_path == @relative_path 28 | return asset.url if asset.relative_path == "/#{@relative_path}" 29 | end 30 | 31 | '/' 32 | end 33 | end 34 | -------------------------------------------------------------------------------- /lib/jekyll/algolia/progress_bar.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | require 'progressbar' 4 | require 'ostruct' 5 | 6 | module Jekyll 7 | module Algolia 8 | # Module to push records to Algolia and configure the index 9 | module ProgressBar 10 | include Jekyll::Algolia 11 | 12 | def self.should_be_silenced? 13 | Configurator.verbose? 14 | end 15 | 16 | def self.create(options) 17 | if should_be_silenced? 18 | fake_bar = OpenStruct.new 19 | fake_bar.increment = nil 20 | return fake_bar 21 | end 22 | 23 | ::ProgressBar.create(options) 24 | end 25 | end 26 | end 27 | end 28 | -------------------------------------------------------------------------------- /lib/jekyll/algolia/version.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module Jekyll 4 | module Algolia 5 | VERSION = '1.7.1' 6 | end 7 | end 8 | -------------------------------------------------------------------------------- /lib/jekyll/commands/algolia.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module Jekyll 4 | module Commands 5 | # Registering the `jekyll algolia` command 6 | class Algolia < Command 7 | class << self 8 | def init_with_program(prog) 9 | prog.command(:algolia) do |command| 10 | command.syntax 'algolia [options]' 11 | command.description 'Push your content to an Algolia index' 12 | # Document the options that can be passed from the CLI 13 | command.option 'config', 14 | '--config CONFIG_FILE[,CONFIG_FILE2,...]', 15 | Array, 16 | 'Custom configuration file' 17 | command.option 'dry_run', 18 | '--dry-run', 19 | '-n', 20 | 'Do a dry run, do not push records' 21 | command.option 'verbose', 22 | '--verbose', 23 | 'Display more information on what is indexed' 24 | command.option 'force_settings', 25 | '--force-settings', 26 | 'Force updating of the index settings' 27 | command.option 'future', 28 | '--future', 29 | 'Index posts with a future date' 30 | command.option 'show_drafts', 31 | '--drafts', 32 | '-D', 33 | 'Index posts in the _drafts folder' 34 | 35 | command.action do |_, options| 36 | configuration = configuration_from_options(options) 37 | 38 | Jekyll::Algolia.init(configuration).run 39 | end 40 | end 41 | end 42 | end 43 | end 44 | end 45 | end 46 | -------------------------------------------------------------------------------- /scripts/git_hooks/pre-commit: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | set -e 3 | 4 | # Succeed fast if we did not change any ruby file 5 | if ! git status --short | grep -q '\.rb$'; then 6 | exit 0 7 | fi 8 | 9 | rake test 10 | rake lint 11 | -------------------------------------------------------------------------------- /scripts/git_hooks/pre-push: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | set -e 3 | rake test 4 | rake lint 5 | -------------------------------------------------------------------------------- /scripts/test_all_ruby_versions: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Run tests in all supported Ruby versions 3 | set -e 4 | 5 | versions=("ruby-2.4.2" "ruby-2.3.5" "ruby-2.3.0") 6 | installed_version="$(rvm list strings)" 7 | for version in "${versions[@]}"; do 8 | echo "Testing $version" 9 | # Install this ruby version if not yet installed 10 | if [[ "$installed_version" != *"$version"* ]]; then 11 | echo "$version not found, installing it" 12 | rvm install "$version" 13 | fi 14 | 15 | echo "Updating dependencies" 16 | rvm "$version" 'do' gem install bundler 17 | rvm "$version" 'do' bundle install --quiet 18 | echo "✔ Dependencies updated" 19 | 20 | echo "Running tests" 21 | rvm "$version" 'do' bundle exec rake test 22 | done 23 | -------------------------------------------------------------------------------- /scripts/test_ci: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | bundle exec rake test 3 | -------------------------------------------------------------------------------- /scripts/test_integration: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | set -e 3 | 4 | ./scripts/test_integration_prepare 5 | rake test:integration:_run 6 | -------------------------------------------------------------------------------- /scripts/test_integration_prepare: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | set -e 3 | 4 | if [[ -z "$ALGOLIA_APPLICATION_ID" ]]; then 5 | echo "You need to set ALGOLIA_APPLICATION_ID" 6 | exit 1 7 | fi 8 | if [[ -z "$ALGOLIA_API_KEY" ]]; then 9 | echo "You need to set ALGOLIA_API_KEY" 10 | exit 1 11 | fi 12 | if [[ -z "$ALGOLIA_INDEX_NAME" ]]; then 13 | echo "You need to set ALGOLIA_INDEX_NAME" 14 | exit 1 15 | fi 16 | 17 | 18 | cd ./spec/integration/site 19 | bundle install --quiet 20 | 21 | bundle exec jekyll build --trace 22 | 23 | rake test:integration:_delete_indices 24 | bundle exec jekyll algolia --trace 25 | -------------------------------------------------------------------------------- /scripts/test_integration_watch: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | set -e 3 | 4 | ./scripts/test_integration_prepare 5 | rake test:integration:_watch_run 6 | 7 | -------------------------------------------------------------------------------- /spec/integration/main_spec.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | require_relative './spec_helper' 4 | 5 | # rubocop:disable Metrics/BlockLength 6 | describe('pushed index') do 7 | before(:all) do 8 | @index = Algolia::Index.new(ENV['ALGOLIA_INDEX_NAME']) 9 | end 10 | 11 | describe('built website') do 12 | # Files excluded from indexing should still be written on disk 13 | it { should have_file('404.html') } 14 | it { should have_file('index.html') } 15 | it { should have_file('blog/pages/2/index.html') } 16 | end 17 | 18 | # Custom hooks are executed, even if github-pages is added as a gem 19 | describe 'hooks' do 20 | describe 'exclude a file through should_be_excluded?' do 21 | subject { @index.search('iamexcludedthroughhooks')['hits'].length } 22 | it { should eq 0 } 23 | end 24 | describe 'update all records through before_indexing_each' do 25 | subject { @index.search('')['hits'][0]['added_through_each'] } 26 | it { should eq true } 27 | end 28 | describe 'add a new record through before_indexing_all' do 29 | subject { @index.search('iamaddedthroughhooks')['hits'].length } 30 | it { should eq 1 } 31 | end 32 | end 33 | 34 | # https://github.com/algolia/jekyll-algolia/issues/49 35 | describe 'attributesToSnippet' do 36 | subject { @index.get_settings['attributesToSnippet'] } 37 | it { should eq ['content:10'] } 38 | end 39 | 40 | # https://github.com/algolia/jekyll-algolia/issues/45 41 | describe 'UTF-8 search' do 42 | subject { @index.search(keyword)['hits'][0]['title'] } 43 | context '∀' do 44 | let(:keyword) { '∀' } 45 | it { should eq 'Math symbols' } 46 | end 47 | context 'λ' do 48 | let(:keyword) { 'λ' } 49 | it { should eq 'Math symbols' } 50 | end 51 | context '→' do 52 | let(:keyword) { '→' } 53 | it { should eq 'Math symbols' } 54 | end 55 | end 56 | 57 | describe 'nbHits' do 58 | subject { @index.search('', distinct: distinct)['nbHits'] } 59 | 60 | context 'by default' do 61 | let(:distinct) { nil } 62 | it { should eq 7 } 63 | end 64 | context 'with distinct:true' do 65 | let(:distinct) { true } 66 | it { should eq 7 } 67 | end 68 | context 'with distinct:false' do 69 | let(:distinct) { false } 70 | it { should eq 11 } 71 | end 72 | end 73 | end 74 | # rubocop:enable Metrics/BlockLength 75 | -------------------------------------------------------------------------------- /spec/integration/site/404.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: 404 Not Found 3 | --- 4 | 5 | This is a classical error page, as suggested by 6 | [GitHub pages](https://help.github.com/articles/creating-a-custom-404-page-for-your-github-pages-site/). 7 | 8 | It should not be indexed. 9 | 10 | -------------------------------------------------------------------------------- /spec/integration/site/Gemfile: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | source 'https://rubygems.org' 4 | 5 | gem 'jekyll', '~> 3.7.3' 6 | 7 | # Note: jekyll-remote-theme download themes on each run, which makes tests 8 | # really slow. To workaround the issue, I submitted a PR to add a cache duration 9 | # to the download. It hasn't been merged yet, so we're using the PR fork for now 10 | # Once https://github.com/benbalter/jekyll-remote-theme/pull/36 is merged, we'll 11 | # be able to use the official gem 12 | gem 'jekyll-remote-theme', 13 | git: 'https://github.com/pixelastic/jekyll-remote-theme', 14 | branch: 'cache' 15 | 16 | group :jekyll_plugins do 17 | gem 'github-pages', '~> 183' 18 | gem 'jekyll-algolia', path: '../../../' 19 | gem 'jekyll-feed', '~> 0.6' 20 | gem 'jekyll-paginate', '~> 1.1' 21 | gem 'jekyll-tagging', '~> 1.1' 22 | end 23 | 24 | # Windows does not include zoneinfo files, so bundle the tzinfo-data gem 25 | gem 'tzinfo-data', platforms: %i[mingw mswin x64_mingw jruby] 26 | -------------------------------------------------------------------------------- /spec/integration/site/_config.yml: -------------------------------------------------------------------------------- 1 | collections: 2 | my-collection: 3 | output: true 4 | timezone: Europe/Paris 5 | remote_theme: "mmistakes/minimal-mistakes@4.13.0" 6 | remote_theme_cache: 3600 7 | 8 | algolia: 9 | application_id: APPID 10 | index_name: INDEXNAME 11 | files_to_exclude: 12 | - index.html 13 | - excluded.html 14 | - excluded_dir/*.html 15 | settings: 16 | attributesToSnippet: ['content:10'] 17 | separatorsToIndex: '∀λ→' 18 | 19 | # jekyll-paginate lets you define the path to the pagination pages 20 | paginate: 2 21 | paginate_path: "/blog/pages/:num" 22 | 23 | # jekyll-tagging lets you define where to save the tag files 24 | tag_page_layout: tag 25 | tag_page_dir: tags 26 | -------------------------------------------------------------------------------- /spec/integration/site/_my-collection/sample-item.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Sample item 3 | --- 4 | 5 | This is a sample item 6 | -------------------------------------------------------------------------------- /spec/integration/site/_plugins/hooks.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module Jekyll 4 | module Algolia 5 | # Custom user hooks 6 | module Hooks 7 | def self.should_be_excluded?(filepath) 8 | filepath == 'excluded-from-hook.html' 9 | end 10 | 11 | def self.before_indexing_each(record, _node, _context) 12 | record[:added_through_each] = true 13 | record 14 | end 15 | 16 | def self.before_indexing_all(records, _context) 17 | records << { 18 | content: 'Added through hooks [iamaddedthroughhooks]' 19 | } 20 | records 21 | end 22 | end 23 | end 24 | end 25 | -------------------------------------------------------------------------------- /spec/integration/site/_posts/2015-07-02-test-post.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: "Test post" 3 | tags: 4 | - tag 5 | - another tag 6 | categories: 7 | - foo 8 | - bar 9 | custom: Foo 10 | --- 11 | 12 | Introduction text that also includes [some link](https://www.algolia.com). To 13 | add a bit of fancy, we will also __bold__ and _italicize_ some text. 14 | 15 | # Main title 16 | 17 | We like writing stuff and then indexing it in a very fast engine. Here is why 18 | a fast engine is good for you: 19 | 20 | * fast 21 | * fast 22 | * fast 23 | * and fast 24 | 25 | ## Built with hands 26 | 27 | All this text was typed with my own hands, on my own keyboard. I also did use 28 | a Chair© and a Table™. 29 | 30 | ## Features 31 | 32 | The whole plugin is composed of parts of `code`, and sometime even 33 | <code>. 34 | 35 | Code is __✔ checked__ and errors are __✘ deleted__. 36 | -------------------------------------------------------------------------------- /spec/integration/site/_posts/2018-05-13-post1.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Post 1 3 | --- 4 | 5 | This is just another dummy post to force some pagination 6 | -------------------------------------------------------------------------------- /spec/integration/site/_posts/2018-05-14-post2.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Post 2 3 | --- 4 | 5 | This is just a dummy post to force some pagination 6 | -------------------------------------------------------------------------------- /spec/integration/site/excluded-from-hook.html: -------------------------------------------------------------------------------- 1 | --- 2 | title: Excluded file 3 | --- 4 | 5 |

This should not be indexed because it is specifically excluded with a user hook

6 | 7 |

iamexcludedhroughhooks

8 | -------------------------------------------------------------------------------- /spec/integration/site/index.html: -------------------------------------------------------------------------------- 1 | --- 2 | layout: default 3 | title: Home 4 | --- 5 | 6 | This default index page is usually used to display the list of posts, or briefly explain the product. 7 | 8 | I feel that it should not be indexed. 9 | 10 | {% for post in paginator.posts %} 11 |

12 | 13 | {{ post.title }} 14 | 15 |

16 |

{{ post.content }}

17 | {% endfor %} 18 | 19 | -------------------------------------------------------------------------------- /spec/integration/site/math.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Math symbols 3 | --- 4 | 5 | This is a math text, with symbols like ∀, λ, → 6 | -------------------------------------------------------------------------------- /spec/integration/site/page-with-include-from-theme.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: I have a remote theme include 3 | --- 4 | 5 | This page should use a include from a remote theme 6 | 7 | {% include gallery id="gallery" caption="This is a gallery" %} 8 | -------------------------------------------------------------------------------- /spec/integration/spec_helper.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | require 'algoliasearch' 4 | require 'jekyll' 5 | require 'jekyll-algolia' 6 | 7 | Algolia.init( 8 | application_id: ENV['ALGOLIA_APPLICATION_ID'], 9 | api_key: ENV['ALGOLIA_API_KEY'] 10 | ) 11 | 12 | RSpec.configure do |config| 13 | config.filter_run(focus: true) 14 | config.fail_fast = true 15 | config.run_all_when_everything_filtered = true 16 | end 17 | 18 | SITE_PATH = File.expand_path('./spec/integration/site/_site') 19 | RSpec::Matchers.define :have_file do |expected| 20 | match do 21 | File.exist?(File.join(SITE_PATH, expected)) 22 | end 23 | end 24 | -------------------------------------------------------------------------------- /spec/jekyll/algolia/overwrites_spec.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | require 'spec_helper' 4 | 5 | describe 'overwrites' do 6 | let(:site) { init_new_jekyll_site } 7 | before do 8 | allow(Jekyll.logger).to receive(:info) 9 | allow(Jekyll.logger).to receive(:warn) 10 | end 11 | 12 | describe('Jekyll::Document') do 13 | let(:current) { site.__find_file('collection-item.md') } 14 | 15 | subject { current.date } 16 | 17 | before do 18 | allow(current).to receive(:data).and_return(data) 19 | end 20 | 21 | describe 'return the date if we have it' do 22 | let(:data) { { 'date' => 'my_date' } } 23 | it { should eq 'my_date' } 24 | end 25 | 26 | describe 'return nil if no date defined' do 27 | let(:data) { {} } 28 | it { should eq nil } 29 | end 30 | end 31 | 32 | describe('JekyllAlgoliaLink') do 33 | let(:current) { site.__find_file('links.md') } 34 | 35 | subject { current.content } 36 | 37 | describe 'should link to a page' do 38 | it { should include('page: /about.html') } 39 | end 40 | 41 | describe 'should link to a page in a subdir' do 42 | it { should include('page in subdir: /subdir/subpage.html') } 43 | end 44 | 45 | describe 'should link to file excluded from indexing' do 46 | it { should include('excluded page: /excluded.html') } 47 | end 48 | 49 | describe 'should link to an asset' do 50 | it { should include('asset: /assets/ring.png') } 51 | end 52 | 53 | describe 'should link to a blog post' do 54 | it { should include('blog post: /foo/bar/2015/07/02/test-post.html') } 55 | end 56 | 57 | describe 'should link to collection item' do 58 | it do 59 | should include('collection item: /my-collection/collection-item.html') 60 | end 61 | end 62 | end 63 | end 64 | -------------------------------------------------------------------------------- /spec/jekyll/algolia/progress_bar_spec.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | require 'spec_helper' 4 | describe(Jekyll::Algolia::ProgressBar) do 5 | let(:current) { Jekyll::Algolia::ProgressBar } 6 | let(:configurator) { Jekyll::Algolia::Configurator } 7 | 8 | describe '.should_be_silenced?' do 9 | before do 10 | allow(configurator).to receive(:verbose?).and_return(verbose) 11 | end 12 | 13 | subject { current.should_be_silenced? } 14 | 15 | describe do 16 | let(:verbose) { true } 17 | it { should eq true } 18 | end 19 | describe do 20 | let(:verbose) { false } 21 | it { should eq false } 22 | end 23 | end 24 | 25 | describe '.create' do 26 | let(:progress_bar_instance) { nil } 27 | let(:open_struct_instance) { double('OpenStruct', :increment= => nil) } 28 | let(:options) { 'options' } 29 | 30 | subject { current.create(options) } 31 | 32 | before do 33 | allow(current).to receive(:should_be_silenced?).and_return(silenced) 34 | allow(::ProgressBar).to receive(:create).and_return(progress_bar_instance) 35 | allow(::OpenStruct).to receive(:new).and_return(open_struct_instance) 36 | end 37 | 38 | describe 'when not silenced' do 39 | let(:silenced) { false } 40 | 41 | before do 42 | expect(::ProgressBar) 43 | .to receive(:create) 44 | .with(options) 45 | end 46 | 47 | it 'should return a real progress bar' do 48 | should eq progress_bar_instance 49 | end 50 | end 51 | 52 | describe 'when silenced' do 53 | let(:silenced) { true } 54 | 55 | before do 56 | expect(::OpenStruct) 57 | .to receive(:new) 58 | end 59 | 60 | it 'should return a fake progress bar' do 61 | should eq open_struct_instance 62 | end 63 | end 64 | end 65 | end 66 | -------------------------------------------------------------------------------- /spec/site/404.html: -------------------------------------------------------------------------------- 1 | --- 2 | title: 404 Not Found 3 | --- 4 | 5 | This is a 404.html error page. [GitHub pages](https://help.github.com/articles/creating-a-custom-404-page-for-your-github-pages-site/) 6 | suggested that it should be a `.md` file, but the Hyde theme uses a `.html`, so we handle it as well. 7 | 8 | It should not be indexed. 9 | -------------------------------------------------------------------------------- /spec/site/404.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: 404 Not Found 3 | --- 4 | 5 | This is a classical error page, as suggested by 6 | [GitHub pages](https://help.github.com/articles/creating-a-custom-404-page-for-your-github-pages-site/). 7 | 8 | It should not be indexed. 9 | 10 | -------------------------------------------------------------------------------- /spec/site/Gemfile: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | source 'https://rubygems.org' 4 | 5 | gem 'jekyll', '~> 3.7.3' 6 | 7 | gem 'minima', '~> 2.0' 8 | 9 | group :jekyll_plugins do 10 | gem 'github-pages', '~> 183' 11 | gem 'jekyll-algolia', path: '../../' 12 | gem 'jekyll-feed', '~> 0.6' 13 | gem 'jekyll-paginate', '~> 1.1' 14 | gem 'jekyll-tagging', '~> 1.1' 15 | end 16 | 17 | # Windows does not include zoneinfo files, so bundle the tzinfo-data gem 18 | gem 'tzinfo-data', platforms: %i[mingw mswin x64_mingw jruby] 19 | -------------------------------------------------------------------------------- /spec/site/MIXed-CaSe.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Mixed case 3 | --- 4 | 5 | This is the first paragraph. 6 | 7 | This is the second one. 8 | -------------------------------------------------------------------------------- /spec/site/_algolia_api_key: -------------------------------------------------------------------------------- 1 | APIKEY_FROM_FILE 2 | -------------------------------------------------------------------------------- /spec/site/_config.yml: -------------------------------------------------------------------------------- 1 | collections: 2 | my-collection: 3 | output: true 4 | timezone: Europe/Paris 5 | 6 | algolia: 7 | application_id: APPID 8 | index_name: INDEXNAME 9 | files_to_exclude: 10 | - index.html 11 | - excluded.html 12 | - excluded_dir/*.html 13 | settings: 14 | attributesToSnippet: ['content:10'] 15 | separatorsToIndex: '∀λ→' 16 | 17 | # jekyll-paginate lets you define the path to the pagination pages 18 | paginate: 5 19 | paginate_path: "/blog/pages/:num" 20 | 21 | # jekyll-tagging lets you define where to save the tag files 22 | tag_page_layout: tag 23 | tag_page_dir: tags 24 | -------------------------------------------------------------------------------- /spec/site/_layouts/default.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | {{ content }} 5 | 6 | 7 | -------------------------------------------------------------------------------- /spec/site/_layouts/tag.html: -------------------------------------------------------------------------------- 1 | --- 2 | layout: default 3 | --- 4 | 5 | 6 |
7 | {% for post in page.posts %} 8 | {{ post.title }} 9 | {% endfor %} 10 |
11 | -------------------------------------------------------------------------------- /spec/site/_my-collection/collection-item-with-categories.html: -------------------------------------------------------------------------------- 1 | --- 2 | title: Collection Item 3 | date: 04-05-1984 4 | categories: 5 | - category1 6 | - category2 7 | --- 8 | 9 |

Just to test that we can read the categories

10 | 11 | -------------------------------------------------------------------------------- /spec/site/_my-collection/collection-item-with-excerpt.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Collection Item 3 | --- 4 | 5 | This is the first paragraph. It is especially long because we want it to wrap on 6 | two lines. 7 | 8 | This is the second one. 9 | 10 | -------------------------------------------------------------------------------- /spec/site/_my-collection/collection-item-with-tags.html: -------------------------------------------------------------------------------- 1 | --- 2 | title: Collection Item 3 | date: 04-05-1984 4 | tags: 5 | - tag1 6 | - tag2 7 | --- 8 | 9 |

Just to test that we can read the tags

10 | -------------------------------------------------------------------------------- /spec/site/_my-collection/collection-item.html: -------------------------------------------------------------------------------- 1 | --- 2 | title: Collection Item 3 | date: 04-05-1984 4 | --- 5 | 6 |

The grandest of omelettes. Those that feast on dragon eggs often find that there 7 | is very little they would not dare to do.

8 | -------------------------------------------------------------------------------- /spec/site/_my-collection/collection-item.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Collection Item 3 | date: 04-05-1984 4 | categories: 5 | - foo 6 | - bar 7 | tags: 8 | - foo 9 | - bar 10 | --- 11 | 12 | The grandest of omelettes. Those that feast on dragon eggs often find that there 13 | is very little they would not dare to do. 14 | -------------------------------------------------------------------------------- /spec/site/_my-collection/sample-item.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Sample item 3 | --- 4 | 5 | This collection item has no defined date. 6 | -------------------------------------------------------------------------------- /spec/site/_plugins/algolia.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module Jekyll 4 | module Algolia 5 | # Custom user hooks 6 | module Hooks 7 | def self.should_be_excluded?(filepath) 8 | filepath == 'excluded-from-hook.html' 9 | end 10 | 11 | def self.before_indexing_each(record, _node, _context) 12 | record[:added_through_each] = true 13 | record 14 | end 15 | 16 | def self.before_indexing_all(records, _context) 17 | records << { 18 | name: 'Last one' 19 | } 20 | records 21 | end 22 | end 23 | end 24 | end 25 | -------------------------------------------------------------------------------- /spec/site/_posts/2015-07-02-test-post.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: "Test post" 3 | tags: 4 | - tag 5 | - another tag 6 | categories: 7 | - foo 8 | - bar 9 | custom: Foo 10 | --- 11 | 12 | Introduction text that also includes [some link](https://www.algolia.com). To 13 | add a bit of fancy, we will also __bold__ and _italicize_ some text. 14 | 15 | # Main title 16 | 17 | We like writing stuff and then indexing it in a very fast engine. Here is why 18 | a fast engine is good for you: 19 | 20 | * fast 21 | * fast 22 | * fast 23 | * and fast 24 | 25 | ## Built with hands 26 | 27 | All this text was typed with my own hands, on my own keyboard. I also did use 28 | a Chair© and a Table™. 29 | 30 | ## Features 31 | 32 | The whole plugin is composed of parts of `code`, and sometime even 33 | <code>. 34 | 35 | Code is __✔ checked__ and errors are __✘ deleted__. 36 | -------------------------------------------------------------------------------- /spec/site/_posts/2015-07-03-test-post-again.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: "Test post again" 3 | --- 4 | 5 | The goal of this post is simply to trigger pagination, and see that we do not 6 | index the pagination results. 7 | 8 | Note that we added `categories` and `tags` in the front-matter but those won't 9 | be taken into account. Might be a Jekyll bug/feature, but tags and categories 10 | for regular collection items are always empty. Posts work correctly, though. 11 | 12 | -------------------------------------------------------------------------------- /spec/site/_posts/2017-11-10-post-with-custom-excerpt.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: "Post with a custom excerpt" 3 | --- 4 | 5 | foo 6 | 7 | bar 8 | 9 | 10 | 11 |
baz
12 | -------------------------------------------------------------------------------- /spec/site/_posts/2017-11-10-post-with-default-excerpt.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: "Post with a default excerpt" 3 | --- 4 | 5 | foo 6 | 7 | bar 8 | 9 |
baz
10 | -------------------------------------------------------------------------------- /spec/site/_posts/2018-03-13-post-with-categories.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Post with categories 3 | categories: 4 | - category1 5 | - category2 6 | --- 7 | 8 | This post is here to check that we can extract its categories. 9 | 10 | 11 | -------------------------------------------------------------------------------- /spec/site/_posts/2018-03-13-post-with-tags.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Post with tags 3 | tags: 4 | - tag1 5 | - tag2 6 | --- 7 | 8 | This post is here to check that we can extract its tags. 9 | 10 | -------------------------------------------------------------------------------- /spec/site/_posts/2018-03-13-post-without-categories.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Post without categories 3 | --- 4 | 5 | This post is here to check that we can have a default empty array for categories 6 | 7 | -------------------------------------------------------------------------------- /spec/site/_posts/2018-03-13-post-without-tags.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Post without tags 3 | --- 4 | 5 | This post is here to check that we can have an empty array for tags 6 | 7 | -------------------------------------------------------------------------------- /spec/site/_posts/2018-03-20-post-with-date.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: "Post with date" 3 | date: 2018-03-19 4 | --- 5 | 6 | This post has a date set in the front matter different than the date set in the 7 | filename. 8 | -------------------------------------------------------------------------------- /spec/site/about.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: About 3 | author: Myself 4 | custom1: foo 5 | custom2: bar 6 | customList: 7 | - foo 8 | - bar 9 | --- 10 | 11 | # Heading 1 12 | 13 | Text 1 14 | 15 | ## Heading 2 16 | 17 | Text 2 18 | 19 | ### Heading 3 20 | 21 | Text 3 22 | 23 | - item 1 24 | - item 2 25 | - item 3 26 | 27 | ### Another Heading 3 28 | 29 |

Another text 4

30 | 31 |

Another Heading 2

32 | 33 | Another `` 5 34 | 35 | ### Last Heading 3 36 | 37 |
Just a div
38 | 39 |

Last text 6

40 | -------------------------------------------------------------------------------- /spec/site/assets/ring.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algolia/jekyll-algolia/ad7db782551dd5f9bfcb2f1c2a13b5504fa5b5a8/spec/site/assets/ring.png -------------------------------------------------------------------------------- /spec/site/authors.html: -------------------------------------------------------------------------------- 1 | --- 2 | title: Authors 3 | --- 4 | 5 |

This is an HTML page

6 | -------------------------------------------------------------------------------- /spec/site/blog/pages/2/index.html: -------------------------------------------------------------------------------- 1 |
2 | In a real jekyll build, this page would have been generated by jekyll. 3 | 4 | It would have been a pagination page of all the blog posts, as defined in `paginate_path`. 5 | 6 | It should be excluded from the search results 7 |
8 | -------------------------------------------------------------------------------- /spec/site/custom_extension.dhtml: -------------------------------------------------------------------------------- 1 | --- 2 | title: DHTML Page 3 | --- 4 | 5 |

This is an (D)HTML page. It uses a custom extension to test that it can be 6 | excluded correctly.

7 | 8 | -------------------------------------------------------------------------------- /spec/site/default-excerpt.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Page with a default excerpt 3 | --- 4 | 5 | foo 6 | 7 | bar 8 | 9 |
baz
10 | -------------------------------------------------------------------------------- /spec/site/dhtml.dhtml: -------------------------------------------------------------------------------- 1 | --- 2 | title: DHTML Page 3 | --- 4 | 5 |

This is an (D)HTML page.

6 | 7 | -------------------------------------------------------------------------------- /spec/site/excluded-from-hook.html: -------------------------------------------------------------------------------- 1 | --- 2 | title: Excluded file 3 | --- 4 | 5 |

This should not be indexed because it is specifically excluded with a user hook

6 | -------------------------------------------------------------------------------- /spec/site/excluded.html: -------------------------------------------------------------------------------- 1 | --- 2 | title: Excluded file 3 | --- 4 | 5 |

This should not be indexed because it is set in `files_to_exclude`

6 | -------------------------------------------------------------------------------- /spec/site/excluded_dir/file.html: -------------------------------------------------------------------------------- 1 | --- 2 | title: Excluded file 3 | --- 4 | 5 |

This should not be indexed because it is set in a directory excluded by `files_to_exclude`

6 | -------------------------------------------------------------------------------- /spec/site/excluded_dir/file.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Not excluded file 3 | --- 4 | 5 | It should not be excluded because it should not match the glob defined 6 | -------------------------------------------------------------------------------- /spec/site/front_matter.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Front-matter test 3 | author: John Doe 4 | custom: foo 5 | slug: front_matter_test 6 | date: 2018-03-20 7 | tags: foo 8 | url: http://www.foo.com/ 9 | type: foo 10 | --- 11 | 12 | # Title 13 | 14 | Paragraph content 15 | 16 | -------------------------------------------------------------------------------- /spec/site/hierarchy.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Heading test 3 | --- 4 | 5 | # H1 6 | 7 | TEXT1-H1 8 | 9 | ## H2A 10 | 11 | TEXT2-H2A-H1 12 | 13 | TEXT3-H2A-H1 14 | 15 | ## H2B 16 | 17 | TEXT4-H2B-H1 18 | 19 | ### H3A 20 | 21 | TEXT5-H3-H2B-H1 22 | 23 |
24 |

H4

25 |

TEXT7-H4-H3-H2B-H1

26 |
27 | 28 | ## H2C 29 | 30 | TEXT8-H2C-H1 31 | 32 | ### H3B `` 33 | 34 | TEXT9-H3B-H2C-H1 35 | 36 | -------------------------------------------------------------------------------- /spec/site/html.html: -------------------------------------------------------------------------------- 1 | --- 2 | title: HTML 3 | --- 4 | 5 |

This is an HTML page

6 | -------------------------------------------------------------------------------- /spec/site/index.html: -------------------------------------------------------------------------------- 1 | --- 2 | layout: default 3 | title: Home 4 | --- 5 | 6 | This default index page is usually used to display the list of posts, or briefly explain the product. 7 | 8 | I feel that it should not be indexed. 9 | 10 | {% for post in paginator.posts %} 11 | 12 | {{ post.title }} 13 | 14 | {{ post.content }} 15 | {% endfor %} 16 | 17 | -------------------------------------------------------------------------------- /spec/site/links.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: A page with links to other pages 3 | --- 4 | 5 | page: {% link about.md %} 6 | 7 | page in subdir: {% link subdir/subpage.md %} 8 | 9 | excluded page: {% link excluded.html %} 10 | 11 | asset: {% link assets/ring.png %} 12 | 13 | blog post: {% link _posts/2015-07-02-test-post.md %} 14 | 15 | collection item: {% link _my-collection/collection-item.md %} 16 | 17 | -------------------------------------------------------------------------------- /spec/site/markdown.markdown: -------------------------------------------------------------------------------- 1 | --- 2 | title: Markdown file 3 | --- 4 | 5 | # Markdown 6 | 7 | This is a sample markdown file 8 | -------------------------------------------------------------------------------- /spec/site/math.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Math symbols 3 | --- 4 | 5 | This is a math text, with symbols like ∀, λ, → 6 | -------------------------------------------------------------------------------- /spec/site/md.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Markdown file 3 | --- 4 | 5 | # Markdown 6 | 7 | This is a sample markdown file 8 | -------------------------------------------------------------------------------- /spec/site/mkd.mkd: -------------------------------------------------------------------------------- 1 | --- 2 | title: Markdown file 3 | --- 4 | 5 | # Markdown 6 | 7 | This is a sample markdown file 8 | -------------------------------------------------------------------------------- /spec/site/mkdn.mkdn: -------------------------------------------------------------------------------- 1 | --- 2 | title: Markdown file 3 | --- 4 | 5 | # Markdown 6 | 7 | This is a sample markdown file 8 | -------------------------------------------------------------------------------- /spec/site/mkdown.mkdown: -------------------------------------------------------------------------------- 1 | --- 2 | title: Markdown file 3 | --- 4 | 5 | # Markdown 6 | 7 | This is a sample markdown file 8 | -------------------------------------------------------------------------------- /spec/site/only-divs.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Only divs 3 | --- 4 | 5 |
This is the first paragraph
6 | 7 |
This is the second paragraph
8 | 9 |
This is the third paragraph
10 | 11 |
This is the fourth paragraph
12 | 13 |
This is the fifth paragraph
14 | 15 |
This is the last paragraph
16 | -------------------------------------------------------------------------------- /spec/site/only-paragraphs.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Only paragraphs 3 | --- 4 | 5 | This is the first paragraph 6 | 7 | This is the second paragraph 8 | 9 | This is the third paragraph 10 | 11 | This is the fourth paragraph 12 | 13 | This is the fifth paragraph 14 | 15 | This is the last paragraph 16 | -------------------------------------------------------------------------------- /spec/site/page-with-categories.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: I have categories 3 | categories: 4 | - category1 5 | - category2 6 | --- 7 | 8 | Just to test we can read categories 9 | -------------------------------------------------------------------------------- /spec/site/page-with-tags.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: I have tags 3 | tags: 4 | - tag1 5 | - tag2 6 | --- 7 | 8 | Just to test we can read tags 9 | -------------------------------------------------------------------------------- /spec/site/png.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algolia/jekyll-algolia/ad7db782551dd5f9bfcb2f1c2a13b5504fa5b5a8/spec/site/png.png -------------------------------------------------------------------------------- /spec/site/subdir/subpage.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: This is a page in a subdirectory 3 | --- 4 | 5 | This page is in a subdirectory. 6 | -------------------------------------------------------------------------------- /spec/site/weight.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Weight test 3 | --- 4 | 5 | # AAA BBB CCC DDD 6 | 7 | aaa xxx aaa xxx aaa 8 | 9 | ## AAA BBB 10 | 11 | aaa bbb 12 | 13 | ## CCC DDD 14 | 15 | ccc ddd 16 | 17 | ### DDD 18 | 19 | aaa bbb ccc dddd 20 | -------------------------------------------------------------------------------- /spec/spec_helper.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | # Generate coverage when run locally with rake coverage 4 | require_relative './spec_helper_simplecov.rb' if ENV['COVERAGE'] 5 | # Load coverage when run through Travis 6 | if ENV['TRAVIS'] 7 | require 'coveralls' 8 | Coveralls.wear! 9 | end 10 | 11 | require 'jekyll' 12 | require 'jekyll-algolia' 13 | require 'ostruct' 14 | 15 | RSpec.configure do |config| 16 | config.filter_run(focus: true) 17 | config.fail_fast = true 18 | config.run_all_when_everything_filtered = true 19 | config.before do 20 | Jekyll::Algolia::Configurator.init 21 | end 22 | end 23 | 24 | # We will run our tests with a real Jekyll instance, to make sure it works 25 | # with the real beast. 26 | def init_new_jekyll_site(user_config = {}) 27 | # We start a new Jekyll site, using our ./spec/site directory as its starting 28 | # point 29 | config = Jekyll.configuration( 30 | user_config.merge( 31 | source: File.expand_path('./spec/site') 32 | ) 33 | ) 34 | algolia_command = Jekyll::Algolia.init(config) 35 | 36 | # Silence the progress bars. We couldn't use a double here as it would leak 37 | # across tests and this is not allowed by rspec. 38 | fake_progress_bar = OpenStruct.new 39 | fake_progress_bar.increment = nil 40 | allow(ProgressBar) 41 | .to receive(:create) 42 | .and_return(fake_progress_bar) 43 | 44 | site = algolia_command.site 45 | 46 | # We monkey patch it to add a new method that will allow us to more easily 47 | # access the files that are processed by Jekyll, and return an actual instance 48 | # of Jekyll::File 49 | def site.__find_file(needle) 50 | each_site_file do |file| 51 | return file if file.path =~ /#{needle}$/ 52 | end 53 | nil 54 | end 55 | 56 | def site.__all_files 57 | each_site_file do |file| 58 | puts file.path 59 | end 60 | end 61 | 62 | # We have to run the command to actually initialize the Jekyll site so 63 | # it populates its list of internal files 64 | allow(site).to receive(:push) 65 | algolia_command.run 66 | 67 | site 68 | end 69 | -------------------------------------------------------------------------------- /spec/spec_helper_simplecov.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | require 'simplecov' 4 | 5 | SimpleCov.configure do 6 | load_profile 'test_frameworks' 7 | end 8 | 9 | SimpleCov.start do 10 | add_filter '/.rvm/' 11 | end 12 | --------------------------------------------------------------------------------