From 77e9103b8ee78e01306ab97703548c0b9f58f37b Mon Sep 17 00:00:00 2001 From: Robert McGovern Date: Sun, 22 Jan 2023 23:20:15 +0000 Subject: [PATCH] added minimal mistakes files --- src/_data/ui-text.yml | 1969 ++++++++++ src/_includes/analytics-providers/custom.html | 3 + .../analytics-providers/google-gtag.html | 9 + .../analytics-providers/google-universal.html | 7 + src/_includes/analytics-providers/google.html | 14 + src/_includes/analytics.html | 14 + src/_includes/archive-single.html | 30 + src/_includes/archive-taxonomy.html | 29 + src/_includes/archive.html | 26 + .../author-profile-custom-links.html | 7 + src/_includes/author-profile.html | 252 ++ src/_includes/breadcrumbs.html | 39 + src/_includes/browser-upgrade.html | 3 + src/_includes/categories.html | 43 + src/_includes/category-list.html | 19 + src/_includes/category.html | 10 + src/_includes/collection.html | 10 + src/_includes/comment.html | 22 + src/_includes/comments-providers/custom.html | 3 + .../comments-providers/custom_scripts.html | 3 + .../comments-providers/discourse.html | 13 + src/_includes/comments-providers/disqus.html | 15 + .../comments-providers/facebook.html | 8 + src/_includes/comments-providers/giscus.html | 24 + src/_includes/comments-providers/scripts.html | 20 + .../comments-providers/staticman.html | 40 + .../comments-providers/staticman_v2.html | 40 + .../comments-providers/utterances.html | 20 + src/_includes/comments.html | 162 + src/_includes/compress.html | 10 + src/_includes/default.html | 42 + src/_includes/documents-collection.html | 15 + src/_includes/feature_row | 41 + src/_includes/figure | 9 + src/_includes/footer.html | 21 + src/_includes/gallery | 35 + src/_includes/group-by-array | 47 + src/_includes/head.html | 25 + src/_includes/home.html | 22 + src/_includes/masthead.html | 35 + src/_includes/nav_list | 26 + src/_includes/page__date.html | 6 + src/_includes/page__hero.html | 55 + src/_includes/page__hero_video.html | 2 + src/_includes/page__meta.html | 31 + src/_includes/page__taxonomy.html | 7 + src/_includes/paginator.html | 69 + src/_includes/post_pagination.html | 14 + src/_includes/posts-category.html | 5 + src/_includes/posts-tag.html | 5 + src/_includes/posts.html | 30 + src/_includes/scripts.html | 28 + src/_includes/search.html | 42 + .../search/algolia-search-scripts.html | 61 + .../search/google-search-scripts.html | 30 + src/_includes/search/lunr-search-scripts.html | 10 + src/_includes/search/search_form.html | 26 + src/_includes/seo.html | 158 + src/_includes/sidebar.html | 19 + src/_includes/single.html | 89 + src/_includes/skip-links.html | 7 + src/_includes/social-share.html | 11 + src/_includes/splash.html | 22 + src/_includes/tag-list.html | 19 + src/_includes/tag.html | 10 + src/_includes/tags.html | 43 + src/_includes/toc | 7 + src/_includes/toc.html | 182 + src/_includes/video | 24 + src/_sass/minimal-mistakes.scss | 40 + src/_sass/minimal-mistakes/_animations.scss | 21 + src/_sass/minimal-mistakes/_archive.scss | 463 +++ src/_sass/minimal-mistakes/_base.scss | 357 ++ src/_sass/minimal-mistakes/_buttons.scss | 97 + src/_sass/minimal-mistakes/_footer.scss | 85 + src/_sass/minimal-mistakes/_forms.scss | 359 ++ src/_sass/minimal-mistakes/_masthead.scss | 93 + src/_sass/minimal-mistakes/_mixins.scss | 92 + src/_sass/minimal-mistakes/_navigation.scss | 573 +++ src/_sass/minimal-mistakes/_notices.scss | 105 + src/_sass/minimal-mistakes/_page.scss | 559 +++ src/_sass/minimal-mistakes/_print.scss | 252 ++ src/_sass/minimal-mistakes/_reset.scss | 187 + src/_sass/minimal-mistakes/_search.scss | 132 + src/_sass/minimal-mistakes/_sidebar.scss | 346 ++ src/_sass/minimal-mistakes/_syntax.scss | 324 ++ src/_sass/minimal-mistakes/_tables.scss | 39 + src/_sass/minimal-mistakes/_utilities.scss | 593 +++ src/_sass/minimal-mistakes/_variables.scss | 173 + src/_sass/minimal-mistakes/skins/_air.scss | 23 + src/_sass/minimal-mistakes/skins/_aqua.scss | 34 + .../minimal-mistakes/skins/_contrast.scss | 52 + src/_sass/minimal-mistakes/skins/_dark.scss | 30 + .../minimal-mistakes/skins/_default.scss | 5 + src/_sass/minimal-mistakes/skins/_dirt.scss | 33 + src/_sass/minimal-mistakes/skins/_mint.scss | 24 + src/_sass/minimal-mistakes/skins/_neon.scss | 63 + src/_sass/minimal-mistakes/skins/_plum.scss | 70 + .../minimal-mistakes/skins/_sunrise.scss | 49 + src/assets/css/orig-main.scss | 8 + src/assets/js/_main.js | 136 + src/assets/js/lunr/lunr-en.js | 73 + src/assets/js/lunr/lunr-gr.js | 526 +++ src/assets/js/lunr/lunr-store.js | 49 + src/assets/js/lunr/lunr.js | 3475 +++++++++++++++++ src/assets/js/lunr/lunr.min.js | 6 + src/assets/js/main.min.js | 6 + src/assets/js/plugins/gumshoe.js | 484 +++ .../js/plugins/jquery.ba-throttle-debounce.js | 252 ++ src/assets/js/plugins/jquery.fitvids.js | 82 + .../js/plugins/jquery.greedy-navigation.js | 127 + .../js/plugins/jquery.magnific-popup.js | 1860 +++++++++ src/assets/js/plugins/smooth-scroll.js | 650 +++ src/banner.js | 19 + 114 files changed, 17220 insertions(+) create mode 100644 src/_data/ui-text.yml create mode 100644 src/_includes/analytics-providers/custom.html create mode 100644 src/_includes/analytics-providers/google-gtag.html create mode 100644 src/_includes/analytics-providers/google-universal.html create mode 100644 src/_includes/analytics-providers/google.html create mode 100644 src/_includes/analytics.html create mode 100644 src/_includes/archive-single.html create mode 100644 src/_includes/archive-taxonomy.html create mode 100644 src/_includes/archive.html create mode 100644 src/_includes/author-profile-custom-links.html create mode 100644 src/_includes/author-profile.html create mode 100644 src/_includes/breadcrumbs.html create mode 100644 src/_includes/browser-upgrade.html create mode 100644 src/_includes/categories.html create mode 100644 src/_includes/category-list.html create mode 100644 src/_includes/category.html create mode 100644 src/_includes/collection.html create mode 100644 src/_includes/comment.html create mode 100644 src/_includes/comments-providers/custom.html create mode 100644 src/_includes/comments-providers/custom_scripts.html create mode 100644 src/_includes/comments-providers/discourse.html create mode 100644 src/_includes/comments-providers/disqus.html create mode 100644 src/_includes/comments-providers/facebook.html create mode 100644 src/_includes/comments-providers/giscus.html create mode 100644 src/_includes/comments-providers/scripts.html create mode 100644 src/_includes/comments-providers/staticman.html create mode 100644 src/_includes/comments-providers/staticman_v2.html create mode 100644 src/_includes/comments-providers/utterances.html create mode 100644 src/_includes/comments.html create mode 100644 src/_includes/compress.html create mode 100644 src/_includes/default.html create mode 100644 src/_includes/documents-collection.html create mode 100644 src/_includes/feature_row create mode 100644 src/_includes/figure create mode 100644 src/_includes/footer.html create mode 100644 src/_includes/gallery create mode 100644 src/_includes/group-by-array create mode 100644 src/_includes/head.html create mode 100644 src/_includes/home.html create mode 100644 src/_includes/masthead.html create mode 100644 src/_includes/nav_list create mode 100644 src/_includes/page__date.html create mode 100644 src/_includes/page__hero.html create mode 100644 src/_includes/page__hero_video.html create mode 100644 src/_includes/page__meta.html create mode 100644 src/_includes/page__taxonomy.html create mode 100644 src/_includes/paginator.html create mode 100644 src/_includes/post_pagination.html create mode 100644 src/_includes/posts-category.html create mode 100644 src/_includes/posts-tag.html create mode 100644 src/_includes/posts.html create mode 100644 src/_includes/scripts.html create mode 100644 src/_includes/search.html create mode 100644 src/_includes/search/algolia-search-scripts.html create mode 100644 src/_includes/search/google-search-scripts.html create mode 100644 src/_includes/search/lunr-search-scripts.html create mode 100644 src/_includes/search/search_form.html create mode 100644 src/_includes/seo.html create mode 100644 src/_includes/sidebar.html create mode 100644 src/_includes/single.html create mode 100644 src/_includes/skip-links.html create mode 100644 src/_includes/social-share.html create mode 100644 src/_includes/splash.html create mode 100644 src/_includes/tag-list.html create mode 100644 src/_includes/tag.html create mode 100644 src/_includes/tags.html create mode 100644 src/_includes/toc create mode 100644 src/_includes/toc.html create mode 100644 src/_includes/video create mode 100644 src/_sass/minimal-mistakes.scss create mode 100644 src/_sass/minimal-mistakes/_animations.scss create mode 100644 src/_sass/minimal-mistakes/_archive.scss create mode 100644 src/_sass/minimal-mistakes/_base.scss create mode 100644 src/_sass/minimal-mistakes/_buttons.scss create mode 100644 src/_sass/minimal-mistakes/_footer.scss create mode 100644 src/_sass/minimal-mistakes/_forms.scss create mode 100644 src/_sass/minimal-mistakes/_masthead.scss create mode 100644 src/_sass/minimal-mistakes/_mixins.scss create mode 100644 src/_sass/minimal-mistakes/_navigation.scss create mode 100644 src/_sass/minimal-mistakes/_notices.scss create mode 100644 src/_sass/minimal-mistakes/_page.scss create mode 100644 src/_sass/minimal-mistakes/_print.scss create mode 100644 src/_sass/minimal-mistakes/_reset.scss create mode 100644 src/_sass/minimal-mistakes/_search.scss create mode 100644 src/_sass/minimal-mistakes/_sidebar.scss create mode 100644 src/_sass/minimal-mistakes/_syntax.scss create mode 100644 src/_sass/minimal-mistakes/_tables.scss create mode 100644 src/_sass/minimal-mistakes/_utilities.scss create mode 100644 src/_sass/minimal-mistakes/_variables.scss create mode 100644 src/_sass/minimal-mistakes/skins/_air.scss create mode 100644 src/_sass/minimal-mistakes/skins/_aqua.scss create mode 100644 src/_sass/minimal-mistakes/skins/_contrast.scss create mode 100644 src/_sass/minimal-mistakes/skins/_dark.scss create mode 100644 src/_sass/minimal-mistakes/skins/_default.scss create mode 100644 src/_sass/minimal-mistakes/skins/_dirt.scss create mode 100644 src/_sass/minimal-mistakes/skins/_mint.scss create mode 100644 src/_sass/minimal-mistakes/skins/_neon.scss create mode 100644 src/_sass/minimal-mistakes/skins/_plum.scss create mode 100644 src/_sass/minimal-mistakes/skins/_sunrise.scss create mode 100644 src/assets/css/orig-main.scss create mode 100644 src/assets/js/_main.js create mode 100644 src/assets/js/lunr/lunr-en.js create mode 100644 src/assets/js/lunr/lunr-gr.js create mode 100644 src/assets/js/lunr/lunr-store.js create mode 100644 src/assets/js/lunr/lunr.js create mode 100644 src/assets/js/lunr/lunr.min.js create mode 100644 src/assets/js/main.min.js create mode 100644 src/assets/js/plugins/gumshoe.js create mode 100644 src/assets/js/plugins/jquery.ba-throttle-debounce.js create mode 100644 src/assets/js/plugins/jquery.fitvids.js create mode 100644 src/assets/js/plugins/jquery.greedy-navigation.js create mode 100644 src/assets/js/plugins/jquery.magnific-popup.js create mode 100644 src/assets/js/plugins/smooth-scroll.js create mode 100644 src/banner.js diff --git a/src/_data/ui-text.yml b/src/_data/ui-text.yml new file mode 100644 index 0000000..de5098c --- /dev/null +++ b/src/_data/ui-text.yml @@ -0,0 +1,1969 @@ +# User interface text and labels + +# English (default) +# ----------------- +en: &DEFAULT_EN + skip_links : "Skip links" + skip_primary_nav : "Skip to primary navigation" + skip_content : "Skip to content" + skip_footer : "Skip to footer" + page : "Page" + pagination_previous : "Previous" + pagination_next : "Next" + breadcrumb_home_label : "Home" + breadcrumb_separator : "/" + menu_label : "Toggle menu" + search_label : "Toggle search" + toc_label : "On this page" + ext_link_label : "Direct link" + less_than : "less than" + minute_read : "minute read" + share_on_label : "Share on" + meta_label : + tags_label : "Tags:" + categories_label : "Categories:" + date_label : "Updated:" + comments_label : "Leave a comment" + comments_title : "Comments" + more_label : "Learn more" + related_label : "You may also enjoy" + follow_label : "Follow:" + feed_label : "Feed" + powered_by : "Powered by" + website_label : "Website" + email_label : "Email" + recent_posts : "Recent posts" + undefined_wpm : "Undefined parameter words_per_minute at _config.yml" + comment_form_info : "Your email address will not be published. Required fields are marked" + comment_form_comment_label : "Comment" + comment_form_md_info : "Markdown is supported." + comment_form_name_label : "Name" + comment_form_email_label : "Email address" + comment_form_website_label : "Website (optional)" + comment_btn_submit : "Submit comment" + comment_btn_submitted : "Submitted" + comment_success_msg : "Thanks for your comment! It will show on the site once it has been approved." + comment_error_msg : "Sorry, there was an error with your submission. Please make sure all required fields have been completed and try again." + loading_label : "Loading..." + search_label_text : "Enter your search term..." + search_placeholder_text : "Enter your search term..." + search_algolia_no_results : "No results" + results_found : "Result(s) found" + back_to_top : "Back to top" +en-US: + <<: *DEFAULT_EN +en-CA: + <<: *DEFAULT_EN +en-GB: + <<: *DEFAULT_EN +en-AU: + <<: *DEFAULT_EN + +# Spanish +# ------- +es: &DEFAULT_ES + skip_links : "Saltar enlaces" + skip_primary_nav : "Saltar a navegación principal" + skip_content : "Saltar a contenido" + skip_footer : "Saltar a pie" + page : "Página" + pagination_previous : "Anterior" + pagination_next : "Siguiente" + breadcrumb_home_label : "Inicio" + breadcrumb_separator : "/" + menu_label : "Alternar menú" + search_label : "Alternar búsqueda" + toc_label : "En esta página" + ext_link_label : "Enlace directo" + less_than : "menos de" + minute_read : "minuto(s) de lectura" + share_on_label : "Compartir en" + meta_label : + tags_label : "Etiquetas:" + categories_label : "Categorías:" + date_label : "Actualizado:" + comments_label : "Deja un comentario" + comments_title : "Comentarios" + more_label : "Ver más" + related_label : "Puede que también te interese" + follow_label : "Seguir:" + feed_label : "Feed" + powered_by : "Funciona con" + website_label : "Sitio web" + email_label : "Correo electrónico" + recent_posts : "Entradas recientes" + undefined_wpm : "El parámetro words_per_minute (palabras por minuto) no está definido en _config.yml" + comment_form_info : "Tu dirección de correo electrónico no se publicará. Los campos obligatorios están marcados" + comment_form_comment_label : "Comentario" + comment_form_md_info : "Puedes utilizar Markdown" + comment_form_name_label : "Nombre" + comment_form_email_label : "Dirección de correo electrónico" + comment_form_website_label : "Sitio web (opcional)" + comment_btn_submit : "Enviar comentario" + comment_btn_submitted : "Enviado" + comment_success_msg : "¡Gracias por tu comentario! Se publicará una vez sea aprobado." + comment_error_msg : "Ha ocurrido un error al enviar el comentario. Asegúrate de completar todos los campos obligatorios e inténtalo de nuevo." + loading_label : "Cargando..." + search_label_text : "Términos de búsqueda..." + search_placeholder_text : "Términos de búsqueda..." + search_algolia_no_results : + results_found : "resultado(s) encontrado(s)" + back_to_top : "Volver arriba" +es-ES: + <<: *DEFAULT_ES +es-CO: + <<: *DEFAULT_ES + +# French +# ------ +fr: &DEFAULT_FR + skip_links : + skip_primary_nav : + skip_content : + skip_footer : + page : "Page" + pagination_previous : "Précédent" + pagination_next : "Suivant" + breadcrumb_home_label : "Accueil" + breadcrumb_separator : "/" + menu_label : "Menu" + search_label : + toc_label : "Sur cette page" + ext_link_label : "Lien direct" + less_than : "moins de" + minute_read : "minute(s) de lecture" + share_on_label : "Partager sur" + meta_label : + tags_label : "Tags :" + categories_label : "Catégories :" + date_label : "Mis à jour :" + comments_label : "Laisser un commentaire" + comments_title : "Commentaires" + more_label : "Lire plus" + related_label : "Vous pourriez aimer aussi" + follow_label : "Contact" + feed_label : "Flux" + powered_by : "Propulsé par" + website_label : "Site" + email_label : "Email" + recent_posts : "Posts récents" + undefined_wpm : "Le paramètre words_per_minute n'est pas défini dans _config.yml" + comment_form_info : "Votre adresse email ne sera pas visible. Les champs obligatoires sont marqués" + comment_form_comment_label : "Commentaire" + comment_form_md_info : "Markdown est supporté." + comment_form_name_label : "Nom" + comment_form_email_label : "Adresse mail" + comment_form_website_label : "Site web (optionnel)" + comment_btn_submit : "Envoyer" + comment_btn_submitted : "Envoyé" + comment_success_msg : "Merci pour votre commentaire, il sera visible sur le site une fois approuvé." + comment_error_msg : "Désolé, une erreur est survenue lors de la soumission. Vérifiez que les champs obligatoires ont été remplis et réessayez." + loading_label : "Chargement..." + search_label_text : + search_placeholder_text : "Entrez votre recherche..." + search_algolia_no_results : + results_found : "Résultat(s) trouvé(s)" + back_to_top : "Retour en haut" +fr-FR: + <<: *DEFAULT_FR +fr-BE: + <<: *DEFAULT_FR +fr-CH: + <<: *DEFAULT_FR + +# Turkish +# ------- +tr: &DEFAULT_TR + skip_links : + skip_primary_nav : + skip_content : + skip_footer : + page : "Sayfa" + pagination_previous : "Önceki" + pagination_next : "Sonraki" + breadcrumb_home_label : "Ana Sayfa" + breadcrumb_separator : "/" + menu_label : + search_label : + toc_label : "İçindekiler" + ext_link_label : "Doğrudan Bağlantı" + less_than : "Şu süreden az: " + minute_read : "dakika tahmini okuma süresi" + share_on_label : "Paylaş" + meta_label : + tags_label : "Etiketler:" + categories_label : "Kategoriler:" + date_label : "Güncelleme tarihi:" + comments_label : "Yorum yapın" + comments_title : "Yorumlar" + more_label : "Daha fazlasını öğrenin" + related_label : "Bunlar ilginizi çekebilir:" + follow_label : "Takip et:" + feed_label : "RSS" + powered_by : "Emeği geçenler: " + website_label : "Web sayfası" + email_label : "E-posta" + recent_posts : "Son yazılar" + undefined_wpm : "_config.yml dosyasında tanımlanmamış words_per_minute parametresi" + comment_form_info : "Email adresiniz gösterilmeyecektir. Zorunlu alanlar işaretlenmiştir" + comment_form_comment_label : "Yorumunuz" + comment_form_md_info : "Markdown desteklenmektedir." + comment_form_name_label : "Adınız" + comment_form_email_label : "Email adresiniz" + comment_form_website_label : "Websiteniz (opsiyonel)" + comment_btn_submit : "Yorum Yap" + comment_btn_submitted : "Gönderildi" + comment_success_msg : "Yorumunuz için teşekkürler! Yorumunuz onaylandıktan sonra sitede gösterilecektir." + comment_error_msg : "Maalesef bir hata oluştu. Lütfen zorunlu olan tüm alanları doldurduğunuzdan emin olun ve sonrasında tekrar deneyin." + loading_label : "Yükleniyor..." + search_label_text : + search_algolia_no_results : +tr-TR: + <<: *DEFAULT_TR + +# Portuguese +# ---------- +pt: &DEFAULT_PT + skip_links : + skip_primary_nav : + skip_content : + skip_footer : + page : "Página" + pagination_previous : "Anterior" + pagination_next : "Seguinte" + breadcrumb_home_label : "Início" + breadcrumb_separator : "/" + menu_label : + search_label : + toc_label : "Nesta Página" + ext_link_label : "Link Direto" + less_than : "menos de" + minute_read : "minutos de leitura" + share_on_label : "Partilhar no" + meta_label : + tags_label : "Etiquetas:" + categories_label : "Categorias:" + date_label : "Atualizado:" + comments_label : "Deixe um Comentário" + comments_title : "Comentários" + more_label : "Saber mais" + related_label : "Também pode gostar de" + follow_label : "Siga:" + feed_label : "Feed" + powered_by : "Feito com" + website_label : "Site" + email_label : "Email" + recent_posts : "Artigos Recentes" + undefined_wpm : "Parâmetro words_per_minute não definido em _config.yml" + comment_form_info : "O seu endereço email não será publicado. Os campos obrigatórios estão assinalados" + comment_form_comment_label : "Comentário" + comment_form_md_info : "Markdown é suportado." + comment_form_name_label : "Nome" + comment_form_email_label : "Endereço Email" + comment_form_website_label : "Site (opcional)" + comment_btn_submit : "Sumbeter Comentário" + comment_btn_submitted : "Submetido" + comment_success_msg : "Obrigado pelo seu comentário! Será visível no site logo que aprovado." + comment_error_msg : "Lamento, ocorreu um erro na sua submissão. Por favor verifique se todos os campos obrigatórios estão corretamente preenchidos e tente novamente." + loading_label : "A carregar..." + search_label_text : + search_algolia_no_results : +pt-PT: + <<: *DEFAULT_PT +# Brazilian Portuguese +pt-BR: + skip_links : + skip_primary_nav : + skip_content : + skip_footer : + page : "Página" + pagination_previous : "Anterior" + pagination_next : "Próxima" + breadcrumb_home_label : "Home" + breadcrumb_separator : "/" + menu_label : + search_label : "Buscar" + toc_label : "Nesta página" + ext_link_label : "Link direto" + less_than : "menos que" + minute_read : "minuto(s) de leitura" + share_on_label : "Compartilhe" + meta_label : + tags_label : "Tags:" + categories_label : "Categorias:" + date_label : "Atualizado em:" + comments_label : "Deixe um comentário" + comments_title : "Comentários" + more_label : "Saiba mais" + related_label : "Talvez você também goste" + follow_label : "Acompanhe no" + feed_label : "Feed" + powered_by : "Desenvolvido com" + website_label : "Site" + email_label : "E-mail" + recent_posts : "Publicações recentes" + undefined_wpm : "Parâmetro words_per_minute indefinido no _config.yml" + comment_form_info : "Seu e-mail não será publicado. Os campos obrigatórios estão marcados" + comment_form_comment_label : "Comentário" + comment_form_md_info : "Você pode usar Markdown." + comment_form_name_label : "Nome" + comment_form_email_label : "E-mail" + comment_form_website_label : "Site (opcional)" + comment_btn_submit : "Enviar comentário" + comment_btn_submitted : "Enviado" + comment_success_msg : "Obrigado pelo seu comentário! Ele aparecerá no site assim que for aprovado." + comment_error_msg : "Desculpe, ocorreu um erro no envio. Verifique se todos os campos obrigatórios foram preenchidos e tente novamente." + loading_label : "Carregando..." + search_label_text : + search_placeholder_text : "Pesquisar..." + search_algolia_no_results : + results_found : "Resultado(s) encontrado(s)" + back_to_top : "Voltar para o topo" + +# Italian +# ------- +it: &DEFAULT_IT + skip_links : + skip_primary_nav : + skip_content : + skip_footer : + page : "Pagina" + pagination_previous : "Precedente" + pagination_next : "Prossima" + breadcrumb_home_label : "Home" + breadcrumb_separator : "/" + menu_label : + search_label : + toc_label : "Indice della pagina" + ext_link_label : "Link" + less_than : "meno di" + minute_read : "minuto/i di lettura" + share_on_label : "Condividi" + meta_label : + tags_label : "Tags:" + categories_label : "Categorie:" + date_label : "Aggiornato:" + comments_label : "Scrivi un commento" + comments_title : + more_label : "Scopri di più" + related_label : "Potrebbe Piacerti Anche" + follow_label : "Segui:" + feed_label : "Feed" + powered_by : "Powered by" + website_label : "Website" + email_label : "Email" + recent_posts : "Articoli Recenti" + undefined_wpm : "Parametro words_per_minute non definito in _config.yml" + comment_form_info : "Il tuo indirizzo email non sarà pubblicato. Sono segnati i campi obbligatori" + comment_form_comment_label : "Commenta" + comment_form_md_info : "Il linguaggio Markdown è supportato" + comment_form_name_label : "Nome" + comment_form_email_label : "Indirizzo email" + comment_form_website_label : "Sito Web (opzionale)" + comment_btn_submit : "Invia commento" + comment_btn_submitted : "Inviato" + comment_success_msg : "Grazie per il tuo commento! Verrà visualizzato nel sito una volta che sarà approvato." + comment_error_msg : "C'è stato un errore con il tuo invio. Assicurati che tutti i campi richiesti siano stati completati e riprova." + loading_label : "Caricamento..." + search_label_text : + search_placeholder_text : "Inserisci termini di ricerca..." + search_algolia_no_results : + results_found : "Risultati" + back_to_top : "Vai su" +it-IT: + <<: *DEFAULT_IT + +# Chinese (zh-CN Chinese - China) +# -------------------------------- +zh: &DEFAULT_ZH_HANS + skip_links : "跳转链接" + skip_primary_nav : "转到主导航栏" + skip_content : "转到内容" + skip_footer : "转到底部" + page : "页面" + pagination_previous : "上一页" + pagination_next : "下一页" + breadcrumb_home_label : "首页" + breadcrumb_separator : "/" + menu_label : "切换菜单" + search_label : "切换搜索" + toc_label : "目录" + ext_link_label : "直接链接" + less_than : "少于" + minute_read : "分钟阅读" + share_on_label : "分享" + meta_label : + tags_label : "标签:" + categories_label : "分类:" + date_label : "更新时间:" + comments_label : "留下评论" + comments_title : "评论" + more_label : "了解更多" + related_label : "猜您还喜欢" + follow_label : "关注:" + feed_label : "Feed" + powered_by : "技术来自于" + website_label : "网站" + email_label : "电子邮箱" + recent_posts : "最新文章" + undefined_wpm : "_config.yml 配置中 words_per_minute 字段未定义" + comment_form_info : "您的电子邮箱地址并不会被展示。请填写标记为必须的字段。" + comment_form_comment_label : "评论" + comment_form_md_info : "支持 Markdown 语法。" + comment_form_name_label : "姓名" + comment_form_email_label : "电子邮箱" + comment_form_website_label : "网站(可选)" + comment_btn_submit : "提交评论" + comment_btn_submitted : "已提交" + comment_success_msg : "感谢您的评论!被批准后它会立即在此站点展示。" + comment_error_msg : "很抱歉,您的提交存在错误。请确保所有必填字段都已填写正确,然后再试一次。" + loading_label : "正在加载..." + search_label_text : "输入您要搜索的关键词..." + search_placeholder_text : "输入您要搜索的关键词..." + search_algolia_no_results : "无结果" + results_found : "条记录匹配" + back_to_top : "返回顶部" +zh-CN: + <<: *DEFAULT_ZH_HANS +zh-SG: + <<: *DEFAULT_ZH_HANS +# Taiwan (Traditional Chinese) +zh-TW: &DEFAULT_ZH_HANT + skip_links : + skip_primary_nav : "轉至主導航欄" + skip_content : "轉至内容" + skip_footer : "轉至頁脚" + page : "頁面" + pagination_previous : "前一頁" + pagination_next : "後一頁" + breadcrumb_home_label : "首頁" + breadcrumb_separator : "/" + menu_label : "切換選單" + search_label : "切換搜索" + toc_label : "本頁" + ext_link_label : "外部連結" + less_than : "少於" + minute_read : "分鐘閱讀" + share_on_label : "分享到" + meta_label : + tags_label : "標籤:" + categories_label : "分類:" + date_label : "更新時間:" + comments_label : "留言" + comments_title : "留言內容" + more_label : "了解更多" + related_label : "猜您有與趣" + follow_label : "追蹤:" + feed_label : "RSS Feed" + powered_by : "Powered by" + website_label : "網站" + email_label : "電子信箱" + recent_posts : "最新文章" + undefined_wpm : "_config.yml 中未定義 words_per_minute" + comment_form_info : "您的電子信箱不會被公開. 必填部份已標記" + comment_form_comment_label : "留言內容" + comment_form_md_info : "支援 Markdown 語法。" + comment_form_name_label : "名字" + comment_form_email_label : "電子信箱帳號" + comment_form_website_label : "網頁 (可選填)" + comment_btn_submit : "送出留言" + comment_btn_submitted : "已送出" + comment_success_msg : "感謝您的留言! 審核後將會顯示在站上。" + comment_error_msg : "抱歉,部份資料輸入有問題。請確認資料填寫正確後再試一次。" + loading_label : "載入中..." + search_label_text : "輸入您要搜索的關鍵詞..." + search_placeholder_text : "輸入您要搜索的關鍵詞..." + search_algolia_no_results : "沒有結果" + results_found : "條匹配的記錄" + back_to_top : "回到頂部" +zh-HK: + <<: *DEFAULT_ZH_HANT + +# German / Deutsch +# ---------------- +de: &DEFAULT_DE + skip_links : + skip_primary_nav : + skip_content : + skip_footer : + page : "Seite" + pagination_previous : "Vorherige" + pagination_next : "Nächste" + breadcrumb_home_label : "Start" + breadcrumb_separator : "/" + menu_label : "Menü ein-/ausschalten" + search_label : + toc_label : "Auf dieser Seite" + ext_link_label : "Direkter Link" + less_than : "weniger als" + minute_read : "Minuten zum lesen" + share_on_label : "Teilen auf" + meta_label : + tags_label : "Tags:" + categories_label : "Kategorien:" + date_label : "Aktualisiert:" + comments_label : "Hinterlassen Sie einen Kommentar" + comments_title : "Kommentare" + more_label : "Mehr anzeigen" + related_label : "Ihnen gefällt vielleicht auch" + follow_label : "Folgen:" + feed_label : "Feed" + powered_by : "Möglich durch" + website_label : "Webseite" + email_label : "E-Mail" + recent_posts : "Aktuelle Beiträge" + undefined_wpm : "Undefinierter Parameter words_per_minute in _config.yml" + comment_form_info : "Ihre E-Mail Adresse wird nicht veröffentlicht. Benötigte Felder sind markiert" + comment_form_comment_label : "Kommentar" + comment_form_md_info : "Markdown wird unterstützt." + comment_form_name_label : "Name" + comment_form_email_label : "E-Mail-Addresse" + comment_form_website_label : "Webseite (optional)" + comment_btn_submit : "Kommentar absenden" + comment_btn_submitted : "Versendet" + comment_success_msg : "Danke für Ihren Kommentar! Er wird auf der Seite angezeigt, nachdem er geprüft wurde." + comment_error_msg : "Entschuldigung, es gab einen Fehler. Bitte füllen Sie alle benötigten Felder aus und versuchen Sie es erneut." + loading_label : "Lade..." + search_label_text : + search_placeholder_text : "Suchbegriff eingeben..." + search_algolia_no_results : + results_found : "Ergebnis(se) gefunden" +de-DE: + <<: *DEFAULT_DE +de-AT: + <<: *DEFAULT_DE +de-CH: + <<: *DEFAULT_DE +de-BE: + <<: *DEFAULT_DE +de-LI: + <<: *DEFAULT_DE +de-LU: + <<: *DEFAULT_DE + +# Nepali (Nepal) +# -------------- +ne: &DEFAULT_NE + skip_links : + skip_primary_nav : + skip_content : + skip_footer : + page : "पृष्‍ठ" + pagination_previous : "अघिल्लो" + pagination_next : "अर्को" + breadcrumb_home_label : "गृह" + breadcrumb_separator : "/" + menu_label : "टगल मेनु" + search_label : + toc_label : "यो पृष्‍ठमा" + ext_link_label : "सिधा सम्पर्क" + less_than : "कम्तिमा" + minute_read : "मिनेट पढ्नुहोस्" + share_on_label : "शेयर गर्नुहोस्" + meta_label : + tags_label : "ट्यागहरू:" + categories_label : "वर्गहरु:" + date_label : "अद्यावधिक:" + comments_label : "टिप्पणी दिनुहोस्" + comments_title : "टिप्पणीहरू" + more_label : "अझै सिक्नुहोस्" + related_label : "तपाईं रुचाउन सक्नुहुन्छ " + follow_label : "पछ्याउनुहोस्:" + feed_label : "फिड" + powered_by : "Powered by" + website_label : "वेबसाइट" + email_label : "इमेल" + recent_posts : "ताजा लेखहरु" + undefined_wpm : "अपरिभाषित प्यारामिटर शब्दहरू_प्रति_मिनेट at _config.yml" + comment_form_info : "तपाइँको इमेल ठेगाना प्रकाशित गरिने छैन।आवश्यक जानकारीहरुमा चिन्ह लगाइको छ" + comment_form_comment_label : "टिप्पणी" + comment_form_md_info : "मार्कडाउन समर्थित छ।" + comment_form_name_label : "नाम" + comment_form_email_label : "इमेल ठेगाना" + comment_form_website_label : "वेबसाइट (वैकल्पिक)" + comment_btn_submit : "टिप्पणी दिनुहोस् " + comment_btn_submitted : "टिप्पणी भयो" + comment_success_msg : "तपाईंको टिप्पणीको लागि धन्यवाद! एक पटक यो अनुमोदन गरेपछी यो साइटमा देखाउनेछ।" + comment_error_msg : "माफ गर्नुहोस्, तपाईंको टिप्पणी त्रुटि थियो।सबै आवश्यक जानकारीहरु पूरा गरिएको छ भने निश्चित गर्नुहोस् र फेरि प्रयास गर्नुहोस्।" + loading_label : "लोड हुँदैछ ..." + search_label_text : + search_algolia_no_results : +ne-NP: + <<: *DEFAULT_NE + +# Korean +# ------ +ko: &DEFAULT_KO + skip_links : + skip_primary_nav : + skip_content : + skip_footer : + page : "페이지" + pagination_previous : "이전" + pagination_next : "다음" + breadcrumb_home_label : "Home" + breadcrumb_separator : "/" + menu_label : "토글 메뉴" + search_label : + toc_label : "On This Page" + ext_link_label : "직접 링크" + less_than : "최대" + minute_read : "분 소요" + share_on_label : "공유하기" + meta_label : + tags_label : "태그:" + categories_label : "카테고리:" + date_label : "업데이트:" + comments_label : "댓글남기기" + comments_title : "댓글" + more_label : "더 보기" + related_label : "참고" + follow_label : "팔로우:" + feed_label : "피드" + powered_by : "Powered by" + website_label : "웹사이트" + email_label : "이메일" + recent_posts : "최근 포스트" + undefined_wpm : "Undefined parameter words_per_minute at _config.yml" + comment_form_info : "이메일은 공개되지 않습니다. 작성 필요 필드:" + comment_form_comment_label : "댓글" + comment_form_md_info : "마크다운을 지원합니다." + comment_form_name_label : "이름" + comment_form_email_label : "이메일" + comment_form_website_label : "웹사이트(선택사항)" + comment_btn_submit : "댓글 등록" + comment_btn_submitted : "등록됨" + comment_success_msg : "감사합니다! 댓글이 머지된 후 확인하실 수 있습니다." + comment_error_msg : "댓글 등록에 문제가 있습니다. 필요 필드를 작성했는지 확인하고 다시 시도하세요." + loading_label : "로딩중..." + search_label_text : + search_placeholder_text : "검색어를 입력하세요..." + search_algolia_no_results : + results_found : "개 결과 발견" + back_to_top : "맨 위로 이동" +ko-KR: + <<: *DEFAULT_KO + +# Russian / Русский +# ----------------- +ru: &DEFAULT_RU + skip_links : + skip_primary_nav : + skip_content : + skip_footer : + page : "Страница" + pagination_previous : "Предыдущая" + pagination_next : "Следующая" + breadcrumb_home_label : "Главная" + breadcrumb_separator : "/" + menu_label : "Выпадающее меню" + search_label : + toc_label : "Содержание" + ext_link_label : "Прямая ссылка" + less_than : "менее" + minute_read : "мин на чтение" + share_on_label : "Поделиться" + meta_label : + tags_label : "Метки:" + categories_label : "Разделы:" + date_label : "Дата изменения:" + comments_label : "Оставить комментарий" + comments_title : "Комментарии" + more_label : "Читать далее" + related_label : "Вам также может понравиться" + follow_label : "Связаться со мной:" + feed_label : "RSS-лента" + powered_by : "Сайт работает на" + website_label : "Сайт" + email_label : "Электронная почта" + recent_posts : "Свежие записи" + undefined_wpm : "Не определён параметр words_per_minute в _config.yml" + comment_form_info : "Ваш адрес электронной почты не будет опубликован. Обязательные поля помечены" + comment_form_comment_label : "Комментарий" + comment_form_md_info : "Поддерживается синтаксис Markdown." + comment_form_name_label : "Имя" + comment_form_email_label : "Электронная почта" + comment_form_website_label : "Ссылка на сайт (необязательно)" + comment_btn_submit : "Оставить комментарий" + comment_btn_submitted : "Отправлено" + comment_success_msg : "Спасибо за Ваш комментарий! Он будет опубликован на сайте после проверки." + comment_error_msg : "К сожалению, произошла ошибка с отправкой комментария. Пожалуйста, убедитесь, что все обязательные поля заполнены и попытайтесь снова." + loading_label : "Отправка..." + search_label_text : + search_placeholder_text : "Введите поисковый запрос..." + search_algolia_no_results : + results_found : "Найдено" +ru-RU: + <<: *DEFAULT_RU + +# Lithuanian / Lietuviškai +# ------------------------ +lt: &DEFAULT_LT + skip_links : + skip_primary_nav : + skip_content : + skip_footer : + page : "Puslapis" + pagination_previous : "Ankstesnis" + pagination_next : "Sekantis" + breadcrumb_home_label : "Pagrindinis" + breadcrumb_separator : "/" + menu_label : "Meniu rodymas" + search_label : + toc_label : "Turinys" + ext_link_label : "Tiesioginė nuoroda" + less_than : "mažiau nei" + minute_read : "min. skaitymo" + share_on_label : "Pasidalinti" + meta_label : + tags_label : "Žymės:" + categories_label : "Kategorijos:" + date_label : "Atnaujinta:" + comments_label : "Palikti komentarą" + comments_title : "Komentaras" + more_label : "Skaityti daugiau" + related_label : "Taip pat turėtų patikti" + follow_label : "Sekti:" + feed_label : "Šaltinis" + powered_by : "Sukurta su" + website_label : "Tinklapis" + email_label : "El. paštas" + recent_posts : "Naujausi įrašai" + undefined_wpm : "Nedeklaruotas parametras words_per_minute faile _config.yml" + comment_form_info : "El. pašto adresas nebus viešinamas. Būtini laukai pažymėti" + comment_form_comment_label : "Komentaras" + comment_form_md_info : "Markdown palaikomas." + comment_form_name_label : "Vardas" + comment_form_email_label : "El. paštas" + comment_form_website_label : "Tinklapis (nebūtina)" + comment_btn_submit : "Komentuoti" + comment_btn_submitted : "Įrašytas" + comment_success_msg : "Ačiū už komentarą! Jis bus parodytas kai bus patvirtintas." + comment_error_msg : "Atleiskite, įvyko netikėta klaida įrašant komentarą. Pasitikrinkite ar užpildėte visus būtinus laukus ir pamėginkite dar kartą." + loading_label : "Kraunama..." + search_label_text : + search_algolia_no_results : +lt-LT: + <<: *DEFAULT_LT + +# Greek +# ----- +gr: &DEFAULT_GR + skip_links : + skip_primary_nav : + skip_content : + skip_footer : + page : "Σελίδα" + pagination_previous : "Προηγούμενo" + pagination_next : "Επόμενo" + breadcrumb_home_label : "Αρχική" + breadcrumb_separator : "/" + menu_label : "Μενού" + search_label : + toc_label : "Περιεχόμενα" + ext_link_label : "Εξωτερικός Σύνδεσμος" + less_than : "Λιγότερο από" + minute_read : "λεπτά ανάγνωσης" + share_on_label : "Μοιραστείτε το" + meta_label : + tags_label : "Ετικέτες:" + categories_label : "Κατηγορίες:" + date_label : "Ενημερώθηκε:" + comments_label : "Αφήστε ένα σχόλιο" + comments_title : "Σχόλια" + more_label : "Διάβαστε περισσότερα" + related_label : "Σχετικές αναρτήσεις" + follow_label : "Ακολουθήστε:" + feed_label : "RSS Feed" + powered_by : "Δημιουργήθηκε με" + website_label : "Ιστοσελίδα" + email_label : "Email" + recent_posts : "Τελευταίες αναρτήσεις" + undefined_wpm : "Δεν έχει οριστεί η παράμετρος words_per_minute στο αρχείο _config.yml" + comment_form_info : "Η διεύθυνση email σας δεν θα δημοσιευθεί. Τα απαιτούμενα πεδία εμφανίζονται με αστερίσκο" + comment_form_comment_label : "Σχόλιο" + comment_form_md_info : "Το πεδίο υποστηρίζει Markdown." + comment_form_name_label : "Όνομα" + comment_form_email_label : "Διεύθυνση email" + comment_form_website_label : "Ιστοσελίδα (προαιρετικό)" + comment_btn_submit : "Υπόβαλε ένα σχόλιο" + comment_btn_submitted : "Έχει υποβληθεί" + comment_success_msg : "Ευχαριστούμε για το σχόλιό σας! Θα εμφανιστεί στην ιστοσελίδα αφού εγκριθεί." + comment_error_msg : "Λυπούμαστε, παρουσιάστηκε σφάλμα με την υποβολή σας. Παρακαλούμε βεβαιωθείτε ότι έχετε όλα τα απαιτούμενα πεδία συμπληρωμένα και δοκιμάστε ξανά." + loading_label : "Φόρτωση..." + search_label_text : + search_placeholder_text : "Εισάγετε όρο αναζήτησης..." + search_algolia_no_results : + results_found : "Αποτελέσματα" +gr-GR: + <<: *DEFAULT_GR + +# Swedish +# ------- +sv: &DEFAULT_SV + skip_links : + skip_primary_nav : + skip_content : + skip_footer : + page : "Sidan" + pagination_previous : "Föregående" + pagination_next : "Nästa" + breadcrumb_home_label : "Hem" + breadcrumb_separator : "/" + menu_label : "Växla menyläge" + search_label : "Växla sökläge" + toc_label : "På denna sida" + ext_link_label : "Direkt länk" + less_than : "mindre än" + minute_read : "minut läsning" + share_on_label : "Dela på" + meta_label : + tags_label : "Taggar:" + categories_label : "Kategorier:" + date_label : "Uppdaterades:" + comments_label : "Lämna en kommentar" + comments_title : "Kommentarer" + more_label : "Lär dig mer" + related_label : "Du kanske vill även läsa:" + follow_label : "Följ:" + feed_label : "Flöde" + powered_by : "Framställd med" + website_label : "Webbsida" + email_label : "E-post" + recent_posts : "Senaste inlägg" + undefined_wpm : "Odefinerade parametrar words_per_minute i _config.yml" + comment_form_info : "Din e-post adress kommer inte att publiceras. Obligatoriska fält är markerade" + comment_form_comment_label : "Kommentar" + comment_form_md_info : "Stöd för Markdown finns." + comment_form_name_label : "Namn" + comment_form_email_label : "E-post adress" + comment_form_website_label : "Webdsida (valfritt)" + comment_btn_submit : "Skicka en kommentar" + comment_btn_submitted : "Kommentaren har tagits emot" + comment_success_msg : "Tack för din kommentar! Den kommer att visas på sidan så fort den har godkännts." + comment_error_msg : "Tyvärr det har blivit något fel i ett av fälten, se till att du fyllt i alla obligatoriska fält och försök igen." + loading_label : "Laddar..." + search_label_text : + search_placeholder_text : "Fyll i sökterm..." + search_algolia_no_results : + results_found : "Resultat funna" + back_to_top : "Tillbaka till toppen" +sv-SE: + <<: *DEFAULT_SV +sv-FI: + <<: *DEFAULT_SV + +# Dutch +# ----- +nl: &DEFAULT_NL + skip_links : + skip_primary_nav : + skip_content : + skip_footer : + page : "Pagina" + pagination_previous : "Vorige" + pagination_next : "Volgende" + breadcrumb_home_label : "Home" + breadcrumb_separator : "/" + menu_label : "Wissel Menu" + search_label : + toc_label : "Op deze pagina" + ext_link_label : "Directe Link" + less_than : "minder dan" + minute_read : "minuut gelezen" + share_on_label : "Deel op" + meta_label : + tags_label : "Labels:" + categories_label : "Categorieën:" + date_label : "Bijgewerkt:" + comments_label : "Laat een reactie achter" + comments_title : "Commentaren" + more_label : "Meer informatie" + related_label : "Bekijk ook eens" + follow_label : "Volg:" + feed_label : "Feed" + powered_by : "Aangedreven door" + website_label : "Website" + email_label : "Email" + recent_posts : "Recente berichten" + undefined_wpm : "Niet gedefinieerde parameter words_per_minute bij _config.yml" + comment_form_info : "Uw e-mailadres wordt niet gepubliceerd. Verplichte velden zijn gemarkeerd" + comment_form_comment_label : "Commentaar" + comment_form_md_info : "Markdown wordt ondersteund." + comment_form_name_label : "Naam" + comment_form_email_label : "E-mailadres" + comment_form_website_label : "Website (optioneel)" + comment_btn_submit : "Commentaar toevoegen" + comment_btn_submitted : "Toegevoegd" + comment_success_msg : "Bedankt voor uw reactie! Het zal op de site worden weergegeven zodra het is goedgekeurd." + comment_error_msg : "Sorry, er is een fout opgetreden bij uw inzending. Zorg ervoor dat alle vereiste velden zijn voltooid en probeer het opnieuw." + loading_label : "Laden..." + search_label_text : "Geef uw zoekterm in..." + search_placeholder_text : "Geef uw zoekterm in..." + search_algolia_no_results : + results_found : "Resultaat gevonden" + back_to_top : "Terug naar boven" +nl-BE: + <<: *DEFAULT_NL +nl-NL: + <<: *DEFAULT_NL + +# Indonesian +# ---------- +id: &DEFAULT_ID + skip_links : + skip_primary_nav : "Loncat ke navigasi" + skip_content : "Loncat ke konten" + skip_footer : "Loncat ke footer" + page : "Halaman" + pagination_previous : "Sebelumnya" + pagination_next : "Selanjutnya" + breadcrumb_home_label : "Beranda" + breadcrumb_separator : "/" + menu_label : "Menu" + search_label : "Pencarian" + toc_label : "Pada Halaman Ini" + ext_link_label : "Link langsung" + less_than : "Kurang dari" + minute_read : "menit baca" + share_on_label : "Bagikan di" + meta_label : + tags_label : "Label:" + categories_label : "Kategori:" + date_label : "Diupdate:" + comments_label : "Tinggalkan komentar" + comments_title : "Komentar" + more_label : "Pelajari lagi" + related_label : "Anda mungkin suka" + follow_label : "Ikuti:" + feed_label : "Feed" + powered_by : "Didukung oleh" + website_label : "Website" + email_label : "Email" + recent_posts : "Post terbaru" + undefined_wpm : "Parameter terdeskripsi words_per_minute di _config.yml" + comment_form_info : "Email Anda tidak akan dipublish. Kolom yang diperlukan ditandai dengan tanda " + comment_form_comment_label : "Komentar" + comment_form_md_info : "Markdown didukung." + comment_form_name_label : "Nama" + comment_form_email_label : "Alamat email" + comment_form_website_label : "Website (opsional)" + comment_btn_submit : "Kirim Komentar" + comment_btn_submitted : "Telah dikirim" + comment_success_msg : "Terimakasih atas komentar Anda! Komentar akan tampil setelah disetujui." + comment_error_msg : "Maaf, ada kesalahan pada komentar Anda. Pastikan seluruh kolom sudah dilengkapi dan coba kembali." + loading_label : "Sedang memuat..." + search_label_text : "Masukkan kata kunci pencarian..." + search_placeholder_text : "Masukkan kata kunci pencarian..." + search_algolia_no_results : "Tidak ada hasil" + results_found : "Hasil pencarian ditemukan" + back_to_top : "Kembali ke awal" +id-ID: + <<: *DEFAULT_ID + +# Vietnamese +# ---------- +vi: &DEFAULT_VI + skip_links : "Đường dẫn tắt" + skip_primary_nav : "Nhảy tới thanh điều hướng" + skip_content : "Nhảy tới nội dung" + skip_footer : "Nhảy tới chân trang" + page : "Trang" + pagination_previous : "Trước" + pagination_next : "Kế tiếp" + breadcrumb_home_label : "Trang chủ" + breadcrumb_separator : "/" + menu_label : "Menu" + search_label : "Tìm kiếm" + toc_label : "Mục lục" + ext_link_label : "Đường dẫn trực tiếp" + less_than : "chỉ cần" + minute_read : "phút để đọc" + share_on_label : "Chia sẻ tại" + meta_label : + tags_label : "Thẻ:" + categories_label : "Danh mục:" + date_label : "Ngày cập nhật:" + comments_label : "Để lại bình luận" + comments_title : "Bình luận" + more_label : "Mở rộng" + related_label : "Có thể bạn cũng thích" + follow_label : "Theo dõi:" + feed_label : "Feed" + powered_by : "Xây dựng trên nền tảng" + website_label : "Website" + email_label : "Email" + recent_posts : "Bài viết mới" + undefined_wpm : "Chưa định nghĩa thông số words_per_minute tại _config.yml" + comment_form_info : "Email của bạn sẽ được giữ bí mật. Các phần bắt buộc được đánh dấu" + comment_form_comment_label : "Bình luận" + comment_form_md_info : "Hỗ trợ Markdown." + comment_form_name_label : "Tên" + comment_form_email_label : "Địa chỉ email" + comment_form_website_label : "Website (không bắt buộc)" + comment_btn_submit : "Gửi bình luận" + comment_btn_submitted : "Đã được gửi" + comment_success_msg : "Cảm ơn bạn đã bình luận! Bình luận sẽ xuất hiện sau khi được duyệt." + comment_error_msg : "Rất tiếc, có lỗi trong việc gửi bình luận. Hãy đảm bảo toàn bộ các phần bắt buộc đã được điền đầy đủ và thử lại." + loading_label : "Đang tải..." + search_label_text : "Nhập từ khóa cần tìm..." + search_placeholder_text : "Nhập từ khóa cần tìm..." + search_algolia_no_results : "Không tìm thấy kết quả nào" + results_found : "Kết quả tìm được" + back_to_top : "Lên đầu trang" +vi-VN: + <<: *DEFAULT_VI + +# Danish +# ------ +da: &DEFAULT_DA + skip_links : + skip_primary_nav : + skip_content : + skip_footer : + page : "Side" + pagination_previous : "Forrige" + pagination_next : "Næste" + breadcrumb_home_label : "Home" + breadcrumb_separator : "/" + menu_label : "Vis/skjul menu" + search_label : + toc_label : "På denne side" + ext_link_label : "Direkte link" + less_than : "mindre end" + minute_read : "minutters læsning" + share_on_label : "Del på" + meta_label : + tags_label : "Nøgleord:" + categories_label : "Kategorier:" + date_label : "Opdateret:" + comments_label : "Skriv en kommentar" + comments_title : "Kommentarer" + more_label : "Lær mere" + related_label : "Måske kan du også lide" + follow_label : "Følg:" + feed_label : "Feed" + powered_by : "Drives af" + website_label : "Website" + email_label : "E-mail" + recent_posts : "Seneste indlæg" + undefined_wpm : "Parameteren words_per_minute er ikke defineret i _config.yml" + comment_form_info : "Din e-mail bliver ikke offentliggjort. Obligatoriske felter er markeret" + comment_form_comment_label : "Kommentar" + comment_form_md_info : "Markdown er understøttet." + comment_form_name_label : "Navn" + comment_form_email_label : "E-mail" + comment_form_website_label : "Website (frivillig)" + comment_btn_submit : "Send kommentar" + comment_btn_submitted : "Sendt" + comment_success_msg : "Tak for din kommentar! Den bliver vist på siden, så snart den er godkendt." + comment_error_msg : "Desværre skete der en fejl. Prøv igen, mens du sørger for at alle obligatoriske felter er udfyldt." + loading_label : "Indlæser..." + search_label_text : + search_placeholder_text : "Hvad leder du efter..." + search_algolia_no_results : + results_found : "Resultat(er) fundet" + back_to_top : "Tilbage til toppen" +da-DK: + <<: *DEFAULT_DA + +# Polish +# ------ +pl: &DEFAULT_PL + skip_links : + skip_primary_nav : + skip_content : + skip_footer : + page : "Strona" + pagination_previous : "Poprzednia" + pagination_next : "Następna" + breadcrumb_home_label : "Strona główna" + breadcrumb_separator : "/" + menu_label : "Przełącz menu" + search_label : + toc_label : "Spis treści" + ext_link_label : "Link bezpośredni" + less_than : "mniej niż" + minute_read : "minut(y)" + share_on_label : "Udostępnij" + meta_label : + tags_label : "Tagi:" + categories_label : "Kategorie:" + date_label : "Ostatnia aktualizacja:" + comments_label : "Zostaw komentarz" + comments_title : "Komentarze" + more_label : "Dowiedz się więcej" + related_label : "Także może Ci się spodobać" + follow_label : "Śledź:" + feed_label : "Feed" + powered_by : "Powstało dzięki" + website_label : "Strona" + email_label : "Email" + recent_posts : "Najnowsze wpisy" + undefined_wpm : "Parametr words_per_minute nie został zdefiniowany w _config.yml." + comment_form_info : "Twój adres email nie będzie udostępiony. Wymagane pola są oznaczone" + comment_form_comment_label : "Skomentuj" + comment_form_md_info : "Markdown jest wspierany" + comment_form_name_label : "Imię" + comment_form_email_label : "Adres email" + comment_form_website_label : "Strona www (opcjonalna)" + comment_btn_submit : "Skomentuj" + comment_btn_submitted : "Komentarz dodany" + comment_success_msg : "Dziękuję za Twój komentarz! Zostanie dodany po akceptacji." + comment_error_msg : "Niestety wystąpił błąd. Proszę upewnij się, że wszystkie wymagane pola zostały wypełnione i spróbuj ponownie." + loading_label : "Trwa ładowanie strony..." + search_label_text : + search_algolia_no_results : "Brak wyników" +pl-PL: + <<: *DEFAULT_PL + +# Japanese +# -------- +ja: &DEFAULT_JA + skip_links : + skip_primary_nav : + skip_content : + skip_footer : + page : "ページ" + pagination_previous : "前へ" + pagination_next : "次へ" + breadcrumb_home_label : "ホーム" + breadcrumb_separator : "/" + menu_label : "メニュー" + search_label : + toc_label : "目次" + ext_link_label : "リンク" + less_than : + minute_read : + share_on_label : "共有" + meta_label : + tags_label : "タグ:" + categories_label : "カテゴリー:" + date_label : "更新日時:" + comments_label : "コメントする" + comments_title : "コメント" + more_label : "さらに詳しく" + related_label : "関連記事" + follow_label : "フォロー" + feed_label : + powered_by : + website_label : + email_label : + recent_posts : "最近の投稿" + undefined_wpm : "パラメータ words_per_minute が _config.yml で定義されていません" + comment_form_info : "メールアドレスが公開されることはありません。次の印のある項目は必ず入力してください:" + comment_form_comment_label : "コメント" + comment_form_md_info : "Markdown を使用できます" + comment_form_name_label : "名前" + comment_form_email_label : "メールアドレス" + comment_form_website_label : "URL (任意)" + comment_btn_submit : "コメントを送信する" + comment_btn_submitted : "送信しました" + comment_success_msg : "コメントありがとうございます! コメントは承認されるとページに表示されます。" + comment_error_msg : "送信エラーです。必須項目がすべて入力されていることを確認して再送信してください。" + loading_label : "読み込み中..." + search_label_text : + search_placeholder_text : "検索キーワードを入力してください..." + search_algolia_no_results : + results_found : "件" +ja-JP: + <<: *DEFAULT_JA + +# Slovak +# ----------------- +sk: &DEFAULT_SK + skip_links : + skip_primary_nav : + skip_content : + skip_footer : + page : "Stránka" + pagination_previous : "Predošlá" + pagination_next : "Ďalšia" + breadcrumb_home_label : "Domov" + breadcrumb_separator : "/" + menu_label : "Menu" + search_label : + toc_label : "Obsah" + ext_link_label : "Priamy odkaz" + less_than : "menej ako" + minute_read : "minút" + share_on_label : "Zdieľaj na" + meta_label : + tags_label : "Tagy:" + categories_label : "Kategórie:" + date_label : "Aktualizované:" + comments_label : "Zanechaj odkaz" + comments_title : "Komentáre" + more_label : "Dozvedieť sa viac" + related_label : "Podobné články" + follow_label : "Sleduj:" + feed_label : "Zoznam" + powered_by : "Stránka vytvorená pomocou" + website_label : "Web stránka" + email_label : "Email" + recent_posts : "Najnovšie príspevky" + undefined_wpm : "Nedefinovaný parameter words_per_minute v _config.yml" + comment_form_info : "Tvoja emailová adresa nebude publikovaná. Požadované polia sú označené" + comment_form_comment_label : "Komentár" + comment_form_md_info : "Markdown je podporovaný." + comment_form_name_label : "Meno" + comment_form_email_label : "Emailová adresa" + comment_form_website_label : "Webstránka (voliteľné)" + comment_btn_submit : "Vlož komentár" + comment_btn_submitted : "Vložený" + comment_success_msg : "Ďakujem za tvoj komentár! Po schválení bude zobrazený na stránke." + comment_error_msg : "Prepáč, pri ukladaní nastala chyba. Ubezpeč sa prosím, že si vyplnil všetky požadované polia a skús znova." + loading_label : "Načítava sa..." + search_label_text : + search_placeholder_text : "Zadaj hľadaný výraz..." + search_algolia_no_results : + results_found : "Nájdených výsledkov" + back_to_top : "Na začiatok stránky" +sk-SK: + <<: *DEFAULT_SK + +# Hungarian +# ----------------- +hu: &DEFAULT_HU + skip_links : + skip_primary_nav : + skip_content : + skip_footer : + page : "Oldal" + pagination_previous : "Előző" + pagination_next : "Következő" + breadcrumb_home_label : "Kezdőlap" + breadcrumb_separator : "/" + menu_label : "Menü nyit/zár" + search_label : + toc_label : "Ezen az oldalon" + ext_link_label : "Közvetlen Link" + less_than : "kevesebb mint" + minute_read : "eltöltött percek" + share_on_label : "Megosztás" + meta_label : + tags_label : "Tagek:" + categories_label : "Kategóriák:" + date_label : "Frissítve:" + comments_label : "Szólj hozzá!" + comments_title : "Hozzászólások" + more_label : "Tovább" + related_label : "Ajánlások" + follow_label : "Követés:" + feed_label : "Folyam" + powered_by : "Powered by" + website_label : "Honlap" + email_label : "Email" + recent_posts : "Friss cikkek" + undefined_wpm : "Ismeretlen paraméter words_per_minute : _config.yml" + comment_form_info : "Az e-mail címed nem lesz publikus. A csillagozott mezők kitöltése kötelező" + comment_form_comment_label : "Hozzászólás" + comment_form_md_info : "Támogatott formázási mód: Markdown" + comment_form_name_label : "Név" + comment_form_email_label : "Email cím" + comment_form_website_label : "Honlap (nem kötelező):" + comment_btn_submit : "Hozzászólás elküldése" + comment_btn_submitted : "Hozzászólás elküldve" + comment_success_msg : "Köszönjük a Hozzászólást! A Hozzászólások csak előzetes moderáció után lesznek publikusak." + comment_error_msg : "Hoppá, hiba történt a beküldés közben. Kérlek ellenőrizd hogy minden kötelező mező ki van-e töltve." + loading_label : "Betöltés..." + search_label_text : + search_placeholder_text : "Keresendő szöveg..." + search_algolia_no_results : + results_found : "Találatok:" + back_to_top : "Oldal tetejére" +hu-HU: + <<: *DEFAULT_HU + +# Romanian +# ----------------- +ro: &DEFAULT_RO + skip_links : + skip_primary_nav : + skip_content : + skip_footer : + page : "Pagina" + pagination_previous : "Anterior" + pagination_next : "Următor" + breadcrumb_home_label : "Acasă" + breadcrumb_separator : "/" + menu_label : "Comută meniul" + search_label : + toc_label : "Pe această pagină" + ext_link_label : "Link direct" + less_than : "mai puțin de" + minute_read : "minute de citit" + share_on_label : "Distribuie pe" + meta_label : + tags_label : "Etichete:" + categories_label : "Categorii:" + date_label : "Actualizat:" + comments_label : "Lasă un comentariu" + comments_title : "Comentarii" + more_label : "Citește mai departe" + related_label : "S-ar putea să-ți placă" + follow_label : "Urmărește:" + feed_label : "Feed RSS" + powered_by : "Cu sprijinul" + website_label : "Site" + email_label : "Email" + recent_posts : "Articole recente" + undefined_wpm : "Parametru words_per_minute nedefinit în _config.yml" + comment_form_info : "Adresa ta de email nu va fi făcută publică. Câmpurile marcate sunt obligatorii" + comment_form_comment_label : "Comentariu" + comment_form_md_info : "Markdown este suportat." + comment_form_name_label : "Nume" + comment_form_email_label : "Adresă de email" + comment_form_website_label : "Site (opțional)" + comment_btn_submit : "Trimite comentariul" + comment_btn_submitted : "Trimis" + comment_success_msg : "Mulțumesc pentru comentariu! Va apărea pe site în momentul în care va fi aprobat." + comment_error_msg : "Scuze, este o problemă cu comentariul tău. Asigură-te că toate câmpurile obligatorii au fost completate și încearcă din nou." + loading_label : "Se încarcă..." + search_label_text : + search_placeholder_text : "Caută ceva..." + search_algolia_no_results : + results_found : "Rezultate găsite" + back_to_top : "Înapoi în susul paginii" +ro-RO: + <<: *DEFAULT_RO + +# Punjabi +# ----------------- +pa: &DEFAULT_PA + skip_links : "ਲਿੰਕ ਛੱਡੋ" + skip_primary_nav : "ਮੂਲ ਮਾਰਗ ਛੱਡੋ" + skip_content : "ਸਮੱਗਰੀ ਛੱਡੋ" + skip_footer : "ਅੰਤ ਵਿਚ ਲਿਖਿਆ ਛੱਡੋ" + page : "ਸਫ਼ਾ" + pagination_previous : "ਪਿਛਲਾ" + pagination_next : "ਅਗਲਾ " + breadcrumb_home_label : "ਘਰ" + breadcrumb_separator : "/" + menu_label : "ਟੌਗਲ ਮੀਨੂ" + search_label : "ਖੋਜ" + toc_label : "ਇਸ ਸਫ਼ੇ 'ਤੇ" + ext_link_label : "ਸਿੱਧਾ ਸੰਪਰਕ" + less_than : "ਤੋਂ ਘੱਟ" + minute_read : "ਮਿੰਟ ਵਿੱਚ ਪੜਿਆ ਜਾ ਸਕਦਾ ਹੈ" + share_on_label : "ਸਾਂਝਾ ਕਰੋ" + meta_label : "ਸਵੈ-ਸੰਦਰਭ ਜਾਣਕਾਰੀ" + tags_label : "ਟੈਗ" + categories_label : "ਵਰਗ" + date_label : "ਅਪਡੇਟ ਕੀਤਾ:" + comments_label : "ਇੱਕ ਟਿੱਪਣੀ ਛੱਡੋ" + comments_title : "ਟਿੱਪਣੀਆਂ" + more_label : "ਹੋਰ ਜਾਣੋ" + related_label : "ਤੁਸੀਂ ਇਸਦਾ ਆਨੰਦ ਵੀ ਲੈ ਸਕਦੇ ਹੋ" + follow_label : "ਫਾਲੋ ਅੱਪ ਕਰੋ:" + feed_label : "ਫੀਡ" + powered_by : "ਦੁਆਰਾ ਸੰਚਾਲਿਤ" + website_label : "ਵੈੱਬਸਾਇਟ" + email_label : "ਈਮੇਲ" + recent_posts : "ਹਾਲ ਹੀ ਦੇ ਪੋਸਟ" + undefined_wpm : "_config.yml ਤੇ ਅਣ-ਪ੍ਰਭਾਸ਼ਿਤ ਪੈਰਾਮੀਟਰ words_per_minute" + comment_form_info : "ਤੁਹਾਡਾ ਈਮੇਲ ਪਤਾ ਪ੍ਰਕਾਸ਼ਿਤ ਨਹੀਂ ਕੀਤਾ ਜਾਵੇਗਾ। ਅਨੁਮਾਨਿਤ ਸਥਾਨਾਂ ਨੂੰ ਅੰਡਰਲਾਈਨ ਕੀਤਾ ਗਿਆ ਹੈ" + comment_form_comment_label : "ਟਿੱਪਣੀ" + comment_form_md_info : "ਮਾਰਕਡਾਊਨ ਵਰਤ ਸਕਦੇ ਹੋ।" + comment_form_name_label : "ਨਾਮ" + comment_form_email_label : "ਈਮੇਲ ਪਤਾ" + comment_form_website_label : "ਵੈਬਸਾਈਟ (ਵਿਕਲਪਿਕ)" + comment_btn_submit : "ਕੋਈ ਟਿੱਪਣੀ ਭੇਜੋ" + comment_btn_submitted : "ਪੇਸ਼ ਕੀਤਾ" + comment_success_msg : "ਤੁਹਾਡੀਆਂ ਟਿੱਪਣੀਆਂ ਲਈ ਧੰਨਵਾਦ! ਇਹ ਮਨਜ਼ੂਰੀ ਮਿਲਣ ਦੇ ਬਾਅਦ ਸਾਈਟ 'ਤੇ ਦਿਖਾਇਆ ਜਾਵੇਗਾ।" + comment_error_msg : "ਮੁਆਫ ਕਰਨਾ, ਤੁਹਾਡੀ ਅਧੀਨਗੀ ਵਿੱਚ ਕੋਈ ਗਲਤੀ ਹੋਈ ਸੀ ਕਿਰਪਾ ਕਰਕੇ ਯਕੀਨੀ ਬਣਾਓ ਕਿ ਸਾਰੇ ਲੋੜੀਂਦੇ ਖੇਤਰ ਪੂਰੇ ਹੋ ਗਏ ਹਨ ਅਤੇ ਦੁਬਾਰਾ ਕੋਸ਼ਿਸ਼ ਕਰੋ।" + loading_label : "ਲੋਡ ਹੋ ਰਿਹਾ ਹੈ..." + search_label_text : "ਖੋਜ" + search_placeholder_text : "ਆਪਣੀ ਖੋਜ ਦੇ ਸ਼ਬਦ ਨੂੰ ਦਰਜ ਕਰੋ..." + search_algolia_no_results : + results_found : "ਨਤੀਜਾ ਮਿਲਿਆ/ਮਿਲੇ" + back_to_top : "ਵਾਪਸ ਚੋਟੀ 'ਤੇ ਜਾਓ" +pa-IN: + <<: *DEFAULT_PA + +# Persian (Farsi) +# -------------- +fa: &DEFAULT_FA + skip_links : + skip_primary_nav : + skip_content : + skip_footer : + page : "صفحه" + pagination_previous : "قبلی" + pagination_next : "بعدی" + breadcrumb_home_label : "صفحه اصلی" + breadcrumb_separator : "/" + menu_label : "فهرست" + toc_label : "در این صفحه" + ext_link_label : "لینک مستقیم" + less_than : " " + minute_read : "(طول مطالعه (دقیقه" + share_on_label : "اشتراک گذاری در" + meta_label : + tags_label : "تگ ها: " + categories_label : "دسته بندی ها: " + date_label : "به روز شده در: " + comments_label : "ارسال نظر" + comments_title : "نظرات" + more_label : "ادامه مطلب" + related_label : "ممکن است از این مطالب نیز لذت ببرید" + follow_label : "دنبال کنید: " + feed_label : "خوراک" + powered_by : "طراحی شده توسط" + website_label : "سایت اینترنتی" + email_label : "پست الکترونیک" + recent_posts : "آخرین مطالب" + undefined_wpm : ".(words_per_minute) _config.yml متغیر اشتباه در" + comment_form_info : ".آدرس ایمیل شما منتشر نخواهد شد. فیلدهای اجباری مشخص شده اند" + comment_form_comment_label : "دیدگاه" + comment_form_md_info : ".پشتیبانی می شود Markdown" + comment_form_name_label : "نام" + comment_form_email_label : "پست الکترونیک" + comment_form_website_label : "سایت اینترنتی (اختیاری)" + comment_btn_submit : "ارسال نظر" + comment_btn_submitted : "ارسال شد" + comment_success_msg : ".باتشکر از ارسال دیدگاه! پس از تأیید، این دیدگاه در سایت نشان داده خواهد شد" + comment_error_msg : ".متاسفانه در ارسال شما خطایی بود. لطفا مطمئن شوید تمام فیلدهای مورد نیاز تکمیل شده و دوباره امتحان کنید" + loading_label : "...بارگذاری" + search_label_text : + search_placeholder_text : "...عبارت جستجوی خود را وارد کنید" + search_algolia_no_results : + results_found : "نتایج" + back_to_top : "بازگشت به بالا" +fa-IR: + <<: *DEFAULT_FA + + +# Malayalam +# ----------------- +ml: &DEFAULT_ML + skip_links : + skip_primary_nav : + skip_content : + skip_footer : + page : "പേജ്" + pagination_previous : "തിരികെ" + pagination_next : "മുന്നോട്ട്" + breadcrumb_home_label : "ഹോം" + breadcrumb_separator : "/" + menu_label : "ടോഗിൾ മെനു" + search_label : "ടോഗിൾ സെർച്ച്" + toc_label : "ഈ പേജിൽ" + ext_link_label : "ലിങ്കിലേക് പോകാൻ" + less_than : "ഏതാണ്ട്" + minute_read : "മിനിറ്റ് ദൈർഖ്യം" + share_on_label : "ഷെയർ ചെയ്യുവാൻ " + meta_label : + tags_label : "ടാഗുകൾ:" + categories_label : "വിഭാഗങ്ങൾ:" + date_label : "അവസാന മാറ്റം:" + comments_label : "അഭിപ്രായം രേഖപ്പെടുത്തുക" + comments_title : "അഭിപ്രായങ്ങൾ" + more_label : "കൂടുതൽ അറിയുവാൻ" + related_label : "നിങ്ങൾക് ഇതും ഇഷ്ടപ്പെട്ടേക്കാം" + follow_label : "പിന്തുടരുക:" + feed_label : "ഫീഡ്" + powered_by : "പവേർഡ് ബൈ" + website_label : "വെബ്സൈറ്റ്" + email_label : "ഇ-മെയിൽ" + recent_posts : "സമീപകാല പോസ്റ്റുകൾ" + undefined_wpm : "Config.yml ലെ words_per_minute പരാമീറ്റർ നിർവചിച്ചിട്ടില്ല." + comment_form_info : "നിങ്ങളുടെ ഇമെയിൽ വിലാസം പ്രസിദ്ധീകരിക്കില്ല. ആവശ്യമായ ഫീൽഡുകൾ അടയാളപ്പെടുത്തി." + comment_form_comment_label : "കമന്റ്" + comment_form_md_info : "Markdown സപ്പോർട്ട് ചെയ്യുന്നതാണ്." + comment_form_name_label : "പേര്" + comment_form_email_label : "ഇ-മെയിൽ" + comment_form_website_label : "വെബ്സൈറ് (ഓപ്ഷണൽ)" + comment_btn_submit : "അഭിപ്രായം രേഖപ്പെടുത്തുക" + comment_btn_submitted : "രേഖപ്പെടുത്തി" + comment_success_msg : "നിങ്ങളുടെ അഭിപ്രായത്തിന് നന്ദി! ഇത് അംഗീകരിച്ചുകഴിഞ്ഞാൽ ഇത് സൈറ്റിൽ പ്രദർശിപ്പിക്കും." + comment_error_msg : "ക്ഷമിക്കണം, നിങ്ങളുടെ സമർപ്പണവുമായി ബന്ധപ്പെട്ട് ഒരു പിശകുണ്ടായിരുന്നു. ആവശ്യമായ എല്ലാ ഫീൽഡുകളും പൂർത്തിയായിട്ടുണ്ടെന്ന് ഉറപ്പുവരുത്തുക, വീണ്ടും ശ്രമിക്കുക." + loading_label : "ലോഡിംഗ്..." + search_label_text : + search_placeholder_text : "നിങ്ങളുടെ തിരയൽ പദം നൽകുക..." + search_algolia_no_results : + results_found : "ഫലം (കൾ) കണ്ടെത്തി" + back_to_top : "മുകളിലേയ്ക്ക്" +ml-IN: + <<: *DEFAULT_ML + +# Thailand +# -------------- +th: &DEFAULT_TH + skip_links : + skip_primary_nav : + skip_content : + skip_footer : + page : "หน้า" + pagination_previous : "ก่อนหน้า" + pagination_next : "ถัดไป" + breadcrumb_home_label : "หน้าแรก" + breadcrumb_separator : "/" + menu_label : "พับเมนู" + search_label : "พับการค้นหา" + toc_label : "บนหน้านี้" + ext_link_label : "ลิงก์โดยตรง" + less_than : "น้อยกว่า" + minute_read : "นาที ในการอ่าน" + share_on_label : "แชร์ไปที่" + meta_label : + tags_label : "แท็ก:" + categories_label : "หมวดหมู่:" + date_label : "อัพเดตล่าสุด:" + comments_label : "แสดงความคิดเห็น" + comments_title : "ความคิดเห็น" + more_label : "อ่านต่อ" + related_label : "คุณอาจจะชอบสิ่งนี้" + follow_label : "ติดตาม:" + feed_label : "ฟืดข่าว" + powered_by : "ขับเคลื่อนโดย" + website_label : "เว็บไซต์" + email_label : "อีเมล" + recent_posts : "โพสล่าสุด" + undefined_wpm : "ไม่สามารถระบุพารามิเตอร์ words_per_minute ได้ใน _config.yml" + comment_form_info : "อีเมลของคุณไม่สามารถโพสสาธารณะได้ กรุณากรอกช่องที่ระบุด้วยเครื่องหมายดอกจันไว้" + comment_form_comment_label : "แสดงความคิดเห็น" + comment_form_md_info : "มาร์กดาวน์ได้รับการสนับสนุน" + comment_form_name_label : "ชื่อ" + comment_form_email_label : "ที่อยู่อีเมล" + comment_form_website_label : "เว็บไซต์ (ตัวเลือก)" + comment_btn_submit : "ส่งความคิดเห็น" + comment_btn_submitted : "ส่งเรียบร้อยแล้ว" + comment_success_msg : "ขอบคุณสำหรับการแสดงความคิดเห็น! ความคิดเห็นจะได้รับการแสดงหลังจากได้รับการยืนยัน" + comment_error_msg : "ขออภัย, มีบางอย่างผิดพลาดจากการส่งแบบฟอร์ม กรุณาตรวจทานทุกช่อง และลองส่งใหม่อีกครั้ง" + loading_label : "กำลังโหลด..." + search_label_text : + search_placeholder_text : "ใส่คำค้นหาของคุณ..." + search_algolia_no_results : + results_found : "ผลการค้นหา พบ" + back_to_top : "กลับด้านบน" +th-TH: + <<: *DEFAULT_TH + +# Hindi +# ----------------- +hi: &DEFAULT_HI + skip_links : "लिंक छोड़ें" + skip_primary_nav : "प्राथमिक पथ-प्रदर्शन छोड़ें" + skip_content : "सामग्री छोड़ें" + skip_footer : "अंत-में लिखा छोड़ें" + page : "पृष्ठ" + pagination_previous : "पिछला" + pagination_next : "अगला" + breadcrumb_home_label : "घर" + breadcrumb_separator : "/" + menu_label : "टॉगल मेनू" + toc_label : "इस पृष्ठ पर" + ext_link_label : "सीधा संपर्क" + less_than : "से कम" + minute_read : "मिनट में पढ़ सकते हैं" + share_on_label : "साझा करें" + meta_label : "स्व-संदर्भात्मक जानकारी" + tags_label : "अंकितक:" + categories_label : "श्रेणियाँ:" + date_label : "अपडेट किया गया:" + comments_label : "एक टिप्पणी छोड़ें" + comments_title : "टिप्पणियाँ" + more_label : "और अधिक जानें" + related_label : "आप इसका भी आनंद ले सकते हैं" + follow_label : "अनुसरण करे:" + feed_label : "फ़ीड" + powered_by : "द्वारा संचालित" + website_label : "वेबसाइट" + email_label : "ईमेल" + recent_posts : "हाल के पोस्ट" + undefined_wpm : "_config.yml पर अपरिभाषित पैरामीटर words_per_minute" + comment_form_info : "आपका ईमेल पता प्रकाशित नहीं किया जाएगा। अपेक्षित स्थानों को रेखांकित कर दिया गया है" + comment_form_comment_label : "टिप्पणी" + comment_form_md_info : "मार्कडाउन की अनुमति है।" + comment_form_name_label : "नाम" + comment_form_email_label : "ईमेल पता" + comment_form_website_label : "वेबसाइट (ऐच्छिक)" + comment_btn_submit : "टिप्पणी भेजें" + comment_btn_submitted : "प्रस्तुत" + comment_success_msg : "आपके कमेंट के लिए धन्यवाद! इसे स्वीकृति मिलने के बाद साइट पर दिखाया जाएगा।" + comment_error_msg : "क्षमा करें, आपके सबमिशन के साथ एक त्रुटि हुई थी। कृपया सुनिश्चित करें कि सभी आवश्यक फ़ील्ड पूरा हो गए हैं और पुनः प्रयास करें।" + loading_label : "लोड हो रहा है..." + search_label_text : "खोज" + search_placeholder_text : "अपना खोज शब्द दर्ज करें..." + search_algolia_no_results : + results_found : "परिणाम मिला/मिले" + back_to_top : "शीर्ष पर वापस" +hi-IN: + <<: *DEFAULT_HI + +# Catalan +# -------------- +ca: &DEFAULT_CA + skip_links : "Salta els enllaços" + skip_primary_nav : "Salta a la navegació primària" + skip_content : "Salta al contingut" + skip_footer : "Salta al peu" + page : "Pàgina" + pagination_previous : "Anterior" + pagination_next : "Següent" + breadcrumb_home_label : "Inici" + breadcrumb_separator : "/" + menu_label : "Mostra/amaga el menú" + search_label : "Mostra/amaga la cerca" + toc_label : "En aquesta pàgina" + ext_link_label : "Enllaç directe" + less_than : "es llegeix en menys de" + minute_read : "minut(s)" + share_on_label : "Comparteix a" + meta_label : + tags_label : "Etiquetes:" + categories_label : "Categories:" + date_label : "Actualitzat:" + comments_label : "Deixa un comentari" + comments_title : "Comentaris" + more_label : "Llegeix més" + related_label : "També et pot agradar" + follow_label : "Segueix-me:" + feed_label : "Feed" + powered_by : "Funciona amb" + website_label : "Pàgina web" + email_label : "Correu electrònic" + recent_posts : "Entrades recents" + undefined_wpm : "El paràmetre words_per_minute no està definit a _config.yml" + comment_form_info : "No es mostrarà el teu correu electrònic. Els camps obligatoris estan marcats" + comment_form_comment_label : "Comentari" + comment_form_md_info : "Admet Markdown." + comment_form_name_label : "Nom" + comment_form_email_label : "Correu electrònic" + comment_form_website_label : "Pàgina web (opcional)" + comment_btn_submit : "Envia" + comment_btn_submitted : "Enviat" + comment_success_msg : "Gràcies pel teu comentari! Apareixerà un cop sigui aprovat." + comment_error_msg : "Hi ha hagut un error enviat el comentari. Comprova que els camps obligatirs estiguin omplerts i torna-ho a provar." + loading_label : "Carregant..." + search_label_text : "Introdueix termes per cercar..." + search_placeholder_text : "Introdueix termes per cercar..." + search_algolia_no_results : + results_found : "resultat(s)" + back_to_top : "Torna a dalt" +ca-ES: + <<: *DEFAULT_CA + +# Irish (Gaeilge) +# -------------- +ga: &DEFAULT_GA + skip_links : "Léim naisc" + skip_primary_nav : "Léim chuig príomh naiscleanúint" + skip_content : "Léim chuig inneachar" + skip_footer : "Léim chuig buntásc" + page : "Leathanach" + pagination_previous : "Leathanach roimhe sin" + pagination_next : "Céad leathanach eile" + breadcrumb_home_label : "Baile" + breadcrumb_separator : "/" + menu_label : "Scorán roghchlár" + search_label : "Scorán cuardach" + toc_label : "Ar an leathanach seo" + ext_link_label : "Nasc díreach" + less_than : "níos lú na" + minute_read : "a léamh" + share_on_label : "Roinn ar" + meta_label : + tags_label : "Clibeanna:" + categories_label : "Catagoírí:" + date_label : "Nuashonraíodh:" + comments_label : "Fág trácht" + comments_title : "Tráchtanna" + more_label : "Foghlaim níos mó" + follow_label : "Lean:" + feed_label : "Feed" + powered_by : "Ag fáil cumhacht as" + website_label : "Suíomh gréasáin" + email_label : "R-phost" + recent_posts : "Postálacha le deanaí" + comment_form_comment_label : "Trácht" + comment_form_name_label : "Ainm" + comment_form_email_label : "Ríomhsheoladh" + comment_form_website_label : "Suíomh gréasáin (roghnach)" + comment_btn_submit : "Cuir isteach trácht" + comment_btn_submitted : "Curtha isteach" + loading_label : "Lódáil..." + search_label_text : "Cuir do chuardach isteach..." + search_placeholder_text : "Cuir do chuardach isteach..." + search_algolia_no_results : + results_found : "Torthaí aimsithe" + back_to_top : "Ar ais go barr" +ga-IE: + <<: *DEFAULT_GA + + +# Finnish / Suomi +# ----------------- +fi: &DEFAULT_FI + skip_links : "Ohita linkit" + skip_primary_nav : "Hyppää pää navigaatioon" + skip_content : "Hyppää sisältöön" + skip_footer : "Hyppää alareunaan" + page : "Sivu" + pagination_previous : "Edellinen" + pagination_next : "Seuraava" + breadcrumb_home_label : "Etusivu" + breadcrumb_separator : "/" + menu_label : "Avaa valikko" + search_label : "Avaa haku" + toc_label : "Tällä sivulla" + ext_link_label : "Suora linkki" + less_than : "vähemmän kuin" + minute_read : "lukuaika" + share_on_label : "Jaa" + meta_label : + tags_label : "Tagit:" + categories_label : "Kategoriat:" + date_label : "Päivitetty:" + comments_label : "Jätä kommentti" + comments_title : "Kommentit" + more_label : "Lisää" + related_label : "Voit olla kiinnostunut myös" + follow_label : "Seuraa:" + feed_label : "Syöte" + powered_by : "Voimanlähteenä" + website_label : "Websivu" + email_label : "Email" + recent_posts : "Viimeisimmät postaukset" + undefined_wpm : "words_per_minute asetusta ei ole määritelty _config.yml tiedostossa" + comment_form_info : "Your email address will not be published. Required fields are marked" + comment_form_comment_label : "Kommentti" + comment_form_md_info : "Tukee markdown muotoilua." + comment_form_name_label : "Nimi" + comment_form_email_label : "Email osoite" + comment_form_website_label : "Webbisivu (vapaaehtoinen)" + comment_btn_submit : "Lähetä" + comment_btn_submitted : "Lähetetty" + comment_success_msg : "Kiitos kommentista, se julkaistaan tällä sivulla moderoinnin jälkeen." + comment_error_msg : "Tarkista että olet täyttänyt kaikki kentät ja yritä uudelleen." + loading_label : "Ladataan..." + search_label_text : "Hakusana..." + search_placeholder_text : "Hakusana..." + search_algolia_no_results : + results_found : "Tulosta" + back_to_top : "Ylös" + +# Myanmar (Burmese) +# ----------------- +my: &DEFAULT_MY + skip_links : "လင့်များကို​ကျော်ပါ။" + skip_primary_nav : "မူလအညွှန်းသို့​ကျော်ပါ။" + skip_content : "အကြောင်းအရာသို့ကျော်ပါ။" + skip_footer : "အောက်ခြေသို့ကျော်ပါ။" + page : "စာမျက်နှာ" + pagination_previous : "ရှေ့တစ်ခု" + pagination_next : "နောက်တစ်ခု" + breadcrumb_home_label : "ပင်မစာမျက်နှာ" + breadcrumb_separator : "/" + menu_label : "မီနူး ဖွင့်၊ပိတ်" + search_label : "ရှာ​ဖွေရန် ဖွင့်၊ပိတ်" + toc_label : "ဒီစာမျက်နှာတွင်" + ext_link_label : "တိုက်ရိုက်လင့်" + less_than : "ဖတ်ရန်ကြာချိန်" + minute_read : "မိနစ်" + share_on_label : "မျှဝေပါ။" + meta_label : + tags_label : "အမှတ်အသားများ -" + categories_label : "အမျိုးအစားများ -" + date_label : "ပြင်ဆင်ပြီး -" + comments_label : "မှတ်ချက်တစ်ခုချန်ထားပါ။" + comments_title : "မှတ်ချက်များ" + more_label : "ပိုမိုသိရှိရန်" + related_label : "သင်နှစ်သက်နိုင်​သော" + follow_label : "သတင်းလိုက်ယူရန် -" + feed_label : "Feed ယူရန် -" + powered_by : "ပံ့ပိုးသည်" + website_label : "ဝဘ်ဆိုက်" + email_label : "အီးမေးလ်" + recent_posts : "လတ်တလောရေးသားချက်များ" + undefined_wpm : "_config.yml မှာ words_per_minute ကိုမသတ်မှတ်ထားပါ။" + comment_form_info : "သင့်အီးမေးလ်လိပ်စာကို​ဖော်ပြသွားမည်မဟုတ်ပါ။ လိုအပ်သောဖြည့်စွက်ရန်​နေရာများကို အမှတ်အသားပြထားပါသည်။" + comment_form_comment_label : "မှတ်ချက်" + comment_form_md_info : "Markdown ကိုထောက်ပံ့သည်။" + comment_form_name_label : "နာမည်" + comment_form_email_label : "အီးမေးလိပ်စာ" + comment_form_website_label : "ဝဘ်ဆိုက် (မဖြည့်စွက်လည်းရသည်)" + comment_btn_submit : "မှတ်ချက်တင်ပါ" + comment_btn_submitted : "တင်သွင်းလိုက်သည်" + comment_success_msg : "မှတ်ချက်ပေးတဲ့အတွက်ကျေးဇူးတင်ပါတယ်။ ၎င်းကိုအတည်ပြုပြီးသည့်အခါ ဝဘ်ဆိုက်ပေါ်တွင်ပြလိမ့်မည်။" + comment_error_msg : "တောင်းပန်ပါတယ်။ သင့်တင်သွင်းမှုတွင်အမှားတစ်ခုရှိခဲ့သည်။ ကျေးဇူးပြုပြီးလိုအပ်သောဖြည့်စွက်ရန်​နေရာအားလုံးဖြည့်ပြီးပါကထပ်မံကြိုးစားပါ။" + loading_label : "တင်နေသည်..." + search_label_text : "သင့်ရှာဖွေရေးဝေါဟာရကိုရိုက်ထည့်ပါ..." + search_placeholder_text : "သင့်ရှာဖွေရေးဝေါဟာရကိုရိုက်ထည့်ပါ..." + search_algolia_no_results : + results_found : "ရလဒ်(များ)ကိုတွေ့ရှိခဲ့သည်" + back_to_top : "အပေါ်သို့ပြန်သွား" +my-MM: + <<: *DEFAULT_MY + +# Norwegian +# ------- +no: &DEFAULT_NO + skip_links : "Hopp over lenker" + skip_primary_nav : "Gå til primærnavigasjon" + skip_content : "Gå til innhold" + skip_footer : "Gå til fotnote" + page : "Side" + pagination_previous : "Forrige" + pagination_next : "Neste" + breadcrumb_home_label : "Hjem" + breadcrumb_separator : "/" + menu_label : "Vis/skjul meny" + search_label : "Vis/skjul søk" + toc_label : "På denne siden" + ext_link_label : "Direkte lenke" + less_than : "mindre enn" + minute_read : "minutters lesing" + share_on_label : "Del på" + meta_label : + tags_label : "Nøkkelord:" + categories_label : "Kategorier:" + date_label : "Oppdatert:" + comments_label : "Skriv en kommentar" + comments_title : "Kommentarer" + more_label : "Lær mer" + related_label : "Du vil kanskje også lese:" + follow_label : "Følg:" + feed_label : "Feed" + powered_by : "Lagd med" + website_label : "Nettside" + email_label : "E-post" + recent_posts : "Nyeste innlegg" + undefined_wpm : "Parameteret words_per_minute er ikke definert i _config.yml" + comment_form_info : "Din e-postadresse vil ikke bli publisert. Obligatoriske felt er markert" + comment_form_comment_label : "Kommentar" + comment_form_md_info : "Markdown er støttet" + comment_form_name_label : "Navn" + comment_form_email_label : "E-postadresse" + comment_form_website_label : "Nettside (frivillig)" + comment_btn_submit : "Send kommentar" + comment_btn_submitted : "Sendt" + comment_success_msg : "Takk for din kommentar! Den blir vist på siden så fort den er godkjent" + comment_error_msg : "Beklager, noe gikk galt. Sjekk at alle obligatoriska felt er utfylt og prøv igjen" + loading_label : "Laster..." + search_label_text : "Skriv inn søkeord" + search_placeholder_text : "Skriv inn søkeord" + search_algolia_no_results : "Ingen treff" + results_found : "Treff funnet" + back_to_top : "Tillbake til toppen" +no-NB: + <<: *DEFAULT_NO +no-NN: + <<: *DEFAULT_NO + +# Hebrew +# ------- +he: &DEFAULT_HE + skip_links : "דלגו על קישור" + skip_primary_nav : "דלגו לראשי" + skip_content : "דלגו לתוכן" + skip_footer : "דלגו לתחתית" + page : "דף" + pagination_previous : "קודם" + pagination_next : "הבא" + breadcrumb_home_label : "בית" + breadcrumb_separator : "/" + menu_label : "סגירה/פתיחה של תפריט" + search_label : "סגירה/פתיחה של חיפוש" + toc_label : "בדף זה" + ext_link_label : "קישור ישיר" + less_than : "פחות מ" + minute_read : "דקת קריאה" + share_on_label : "שתפו ב" + meta_label : + tags_label : "תגיות:" + categories_label : "קטגוריות:" + date_label : "מעודכן:" + comments_label : "השאירו הערה" + comments_title : "הערות" + more_label : "קראו עוד" + related_label : "אולי יעניין אותך גם" + follow_label : "עקבו אחרי" + feed_label : "פיד" + powered_by : "Powered by" + website_label : "אתר" + email_label : "אימייל" + recent_posts : "פוסטים אחרונים" + undefined_wpm : "Undefined parameter words_per_minute at _config.yml" + comment_form_info : "האימייל שלך נשמר חסוי. שדות חובה מסומנים" + comment_form_comment_label : "הערה" + comment_form_md_info : "Markdown is supported." + comment_form_name_label : "שם" + comment_form_email_label : "כתובת אימייל" + comment_form_website_label : "אתר (אפשרות)" + comment_btn_submit : "שלחו הערה" + comment_btn_submitted : "נשלח" + comment_success_msg : "תודה על ההערה שלך! היא תופיע באתר ברגע שתאושר." + comment_error_msg : "סליחה, קרתה תקלה בשליחה. אנא וודאו שכל השדות מלאים ונסו שנית." + loading_label : "טוען..." + search_label_text : "מילות חיפוש..." + search_placeholder_text : "מילות חיפוש..." + search_algolia_no_results : "אין תוצאות" + results_found : "תוצאות נמצאו" + back_to_top : "חזרה להתחלה" +he-IL: + <<: *DEFAULT_HE + +# Arabic (عربي) +# -------------- +ar: &DEFAULT_AR + skip_links : "تخطي الروابط" + skip_primary_nav : "تخطى الى شريط التنقل" + skip_content : "الانتقال الى المحتوى" + skip_footer : "الانتقال الى ذيل الصفحة" + page : "صفحه" + pagination_previous : "قبل" + pagination_next : "بعد" + breadcrumb_home_label : "الرئيس" + breadcrumb_separator : "/" + menu_label : "الخيارات" + search_label : "البحث" + toc_label : "على هذه الصفحة" + ext_link_label : "رابط مباشر" + less_than : "اقل من" + minute_read : "دقيقة قرائية" + share_on_label : "مشاركة" + meta_label : + tags_label : "العلامات الوصفية:" + categories_label : "الفئات:" + date_label : "تم التحديث:" + comments_label : "اترك تعليق" + comments_title : "التعليقات" + more_label : "اقرأ المزيد" + related_label : "قد يعجبك أيضا" + follow_label : "تابع:" + feed_label : "الاخبار - RSS" + powered_by : "تم تطوير بواسطة" + website_label : "موقع" + email_label : "ايميل" + recent_posts : "المشاركات الأخيرة" + undefined_wpm : "معامل غير معرف في words_per_minute (كلمة في الدقيقة) في ملف _config.yml" + comment_form_info : "لن يتم نشر عنوان بريدك الإلكتروني. الحقول المطلوبة إلزامية" + comment_form_comment_label : "تعليق" + comment_form_md_info : "لغة ال Markdown مدعومة." + comment_form_name_label : "الاسم" + comment_form_email_label : "البريد الالكتروني" + comment_form_website_label : "الموقع (اختياري)" + comment_btn_submit : "أضف تعليق" + comment_btn_submitted : "تم الإرسال" + comment_success_msg : "شكراً على التعليق! سيتم اظهاره عندما يتم موافقة عليه." + comment_error_msg : "للأسف, هناك خطأ في المحاولة. الرجاء الحرص على تعبئة جميع الخانات و محاولة مجدداً." + loading_label : "جاري التحميل..." + search_label_text : "اكتب مصطلح للبحث..." + search_placeholder_text : "اكتب مصطلح للبحث..." + search_algolia_no_results : "لا توجد نتائج" + results_found : "تم إيجاد نتيجة" + back_to_top : "الانتقال الى الأعلى" +ar-SD: + <<: *DEFAULT_AR +ar-SA: + <<: *DEFAULT_AR +ar-AE: + <<: *DEFAULT_AR +ar-EG: + <<: *DEFAULT_AR + +# Another locale +# -------------- +# diff --git a/src/_includes/analytics-providers/custom.html b/src/_includes/analytics-providers/custom.html new file mode 100644 index 0000000..c34b97a --- /dev/null +++ b/src/_includes/analytics-providers/custom.html @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/src/_includes/analytics-providers/google-gtag.html b/src/_includes/analytics-providers/google-gtag.html new file mode 100644 index 0000000..16d0cf1 --- /dev/null +++ b/src/_includes/analytics-providers/google-gtag.html @@ -0,0 +1,9 @@ + + + diff --git a/src/_includes/analytics-providers/google-universal.html b/src/_includes/analytics-providers/google-universal.html new file mode 100644 index 0000000..68c2674 --- /dev/null +++ b/src/_includes/analytics-providers/google-universal.html @@ -0,0 +1,7 @@ + + diff --git a/src/_includes/analytics-providers/google.html b/src/_includes/analytics-providers/google.html new file mode 100644 index 0000000..c5742b9 --- /dev/null +++ b/src/_includes/analytics-providers/google.html @@ -0,0 +1,14 @@ + diff --git a/src/_includes/analytics.html b/src/_includes/analytics.html new file mode 100644 index 0000000..371469f --- /dev/null +++ b/src/_includes/analytics.html @@ -0,0 +1,14 @@ +{% if jekyll.environment == 'production' and site.analytics.provider and page.analytics != false %} + +{% case site.analytics.provider %} +{% when "google" %} + {% include /analytics-providers/google.html %} +{% when "google-universal" %} + {% include /analytics-providers/google-universal.html %} +{% when "google-gtag" %} + {% include /analytics-providers/google-gtag.html %} +{% when "custom" %} + {% include /analytics-providers/custom.html %} +{% endcase %} + +{% endif %} \ No newline at end of file diff --git a/src/_includes/archive-single.html b/src/_includes/archive-single.html new file mode 100644 index 0000000..6817480 --- /dev/null +++ b/src/_includes/archive-single.html @@ -0,0 +1,30 @@ +{% if post.header.teaser %} + {% capture teaser %}{{ post.header.teaser }}{% endcapture %} +{% else %} + {% assign teaser = site.teaser %} +{% endif %} + +{% if post.id %} + {% assign title = post.title | markdownify | remove: "

" | remove: "

" %} +{% else %} + {% assign title = post.title %} +{% endif %} + +
+
+ {% if include.type == "grid" and teaser %} +
+ +
+ {% endif %} +

+ {% if post.link %} + {{ title }} Permalink + {% else %} + {{ title }} + {% endif %} +

+ {% include page__meta.html type=include.type %} + {% if post.excerpt %}

{{ post.excerpt | markdownify | strip_html | truncate: 160 }}

{% endif %} +
+
diff --git a/src/_includes/archive-taxonomy.html b/src/_includes/archive-taxonomy.html new file mode 100644 index 0000000..eb62a87 --- /dev/null +++ b/src/_includes/archive-taxonomy.html @@ -0,0 +1,29 @@ +--- +layout: default +author_profile: false +--- + +{% if page.header.overlay_color or page.header.overlay_image or page.header.image %} + {% include page__hero.html %} +{% elsif page.header.video.id and page.header.video.provider %} + {% include page__hero_video.html %} +{% endif %} + +{% if page.url != "/" and site.breadcrumbs %} + {% unless paginator %} + {% include breadcrumbs.html %} + {% endunless %} +{% endif %} + +
+ {% include sidebar.html %} + +
+ {% unless page.header.overlay_color or page.header.overlay_image %} +

{{ page.title }}

+ {% endunless %} + {% for post in page.posts %} + {% include archive-single.html %} + {% endfor %} +
+
diff --git a/src/_includes/archive.html b/src/_includes/archive.html new file mode 100644 index 0000000..08beb89 --- /dev/null +++ b/src/_includes/archive.html @@ -0,0 +1,26 @@ +--- +layout: default +--- + +{% if page.header.overlay_color or page.header.overlay_image or page.header.image %} + {% include page__hero.html %} +{% elsif page.header.video.id and page.header.video.provider %} + {% include page__hero_video.html %} +{% endif %} + +{% if page.url != "/" and site.breadcrumbs %} + {% unless paginator %} + {% include breadcrumbs.html %} + {% endunless %} +{% endif %} + +
+ {% include sidebar.html %} + +
+ {% unless page.header.overlay_color or page.header.overlay_image %} +

{{ page.title }}

+ {% endunless %} + {{ content }} +
+
\ No newline at end of file diff --git a/src/_includes/author-profile-custom-links.html b/src/_includes/author-profile-custom-links.html new file mode 100644 index 0000000..b89ffcb --- /dev/null +++ b/src/_includes/author-profile-custom-links.html @@ -0,0 +1,7 @@ + \ No newline at end of file diff --git a/src/_includes/author-profile.html b/src/_includes/author-profile.html new file mode 100644 index 0000000..d384ee7 --- /dev/null +++ b/src/_includes/author-profile.html @@ -0,0 +1,252 @@ +{% assign author = page.author | default: page.authors[0] | default: site.author %} +{% assign author = site.data.authors[author] | default: author %} + +
+ + {% if author.avatar %} +
+ {% if author.home %} + + {{ author.name }} + + {% else %} + {{ author.name }} + {% endif %} +
+ {% endif %} + +
+ {% if author.home %} +

{{ author.name }}

+ {% else %} +

{{ author.name }}

+ {% endif %} + {% if author.bio %} +
+ {{ author.bio | markdownify }} +
+ {% endif %} +
+ +
+ + +
+
diff --git a/src/_includes/breadcrumbs.html b/src/_includes/breadcrumbs.html new file mode 100644 index 0000000..cba3d41 --- /dev/null +++ b/src/_includes/breadcrumbs.html @@ -0,0 +1,39 @@ +{% case site.category_archive.type %} + {% when "liquid" %} + {% assign path_type = "#" %} + {% when "jekyll-archives" %} + {% assign path_type = nil %} +{% endcase %} + +{% if page.collection != 'posts' %} + {% assign path_type = nil %} + {% assign crumb_path = '/' %} +{% else %} + {% assign crumb_path = site.category_archive.path %} +{% endif %} + + diff --git a/src/_includes/browser-upgrade.html b/src/_includes/browser-upgrade.html new file mode 100644 index 0000000..ec6ad0a --- /dev/null +++ b/src/_includes/browser-upgrade.html @@ -0,0 +1,3 @@ + diff --git a/src/_includes/categories.html b/src/_includes/categories.html new file mode 100644 index 0000000..f5448a2 --- /dev/null +++ b/src/_includes/categories.html @@ -0,0 +1,43 @@ +--- +layout: archive +--- + +{{ content }} + +{% assign categories_max = 0 %} +{% for category in site.categories %} + {% if category[1].size > categories_max %} + {% assign categories_max = category[1].size %} + {% endif %} +{% endfor %} + + + +{% assign entries_layout = page.entries_layout | default: 'list' %} +{% for i in (1..categories_max) reversed %} + {% for category in site.categories %} + {% if category[1].size == i %} +
+

{{ category[0] }}

+
+ {% for post in category.last %} + {% include archive-single.html type=entries_layout %} + {% endfor %} +
+ {{ site.data.ui-text[site.locale].back_to_top | default: 'Back to Top' }} ↑ +
+ {% endif %} + {% endfor %} +{% endfor %} diff --git a/src/_includes/category-list.html b/src/_includes/category-list.html new file mode 100644 index 0000000..1439f14 --- /dev/null +++ b/src/_includes/category-list.html @@ -0,0 +1,19 @@ +{% case site.category_archive.type %} + {% when "liquid" %} + {% assign path_type = "#" %} + {% when "jekyll-archives" %} + {% assign path_type = nil %} +{% endcase %} + +{% if site.category_archive.path %} + {% assign categories_sorted = page.categories | sort_natural %} + +

+ {{ site.data.ui-text[site.locale].categories_label | default: "Categories:" }} + + {% for category_word in categories_sorted %} + {% unless forloop.last %}, {% endunless %} + {% endfor %} + +

+{% endif %} \ No newline at end of file diff --git a/src/_includes/category.html b/src/_includes/category.html new file mode 100644 index 0000000..b281c85 --- /dev/null +++ b/src/_includes/category.html @@ -0,0 +1,10 @@ +--- +layout: archive +--- + +{{ content }} + +{% assign entries_layout = page.entries_layout | default: 'list' %} +
+ {% include posts-category.html taxonomy=page.taxonomy type=entries_layout %} +
diff --git a/src/_includes/collection.html b/src/_includes/collection.html new file mode 100644 index 0000000..d23d0c7 --- /dev/null +++ b/src/_includes/collection.html @@ -0,0 +1,10 @@ +--- +layout: archive +--- + +{{ content }} + +{% assign entries_layout = page.entries_layout | default: 'list' %} +
+ {% include documents-collection.html collection=page.collection sort_by=page.sort_by sort_order=page.sort_order type=entries_layout %} +
diff --git a/src/_includes/comment.html b/src/_includes/comment.html new file mode 100644 index 0000000..2e3013e --- /dev/null +++ b/src/_includes/comment.html @@ -0,0 +1,22 @@ +
+
+ {{ include.name }} +
+
+ +

+ {% if include.date %} + {% if include.index %}{% endif %} + {% endif %} +

+
{{ include.message | markdownify }}
+
+
diff --git a/src/_includes/comments-providers/custom.html b/src/_includes/comments-providers/custom.html new file mode 100644 index 0000000..9099369 --- /dev/null +++ b/src/_includes/comments-providers/custom.html @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/src/_includes/comments-providers/custom_scripts.html b/src/_includes/comments-providers/custom_scripts.html new file mode 100644 index 0000000..6947946 --- /dev/null +++ b/src/_includes/comments-providers/custom_scripts.html @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/src/_includes/comments-providers/discourse.html b/src/_includes/comments-providers/discourse.html new file mode 100644 index 0000000..aca62cc --- /dev/null +++ b/src/_includes/comments-providers/discourse.html @@ -0,0 +1,13 @@ +{% if site.comments.discourse.server %} +{% capture canonical %}{% if site.permalink contains '.html' %}{{ page.url | absolute_url }}{% else %}{{ page.url | absolute_url | remove:'index.html' | strip_slash }}{% endif %}{% endcapture %} + + +{% endif %} diff --git a/src/_includes/comments-providers/disqus.html b/src/_includes/comments-providers/disqus.html new file mode 100644 index 0000000..16a6027 --- /dev/null +++ b/src/_includes/comments-providers/disqus.html @@ -0,0 +1,15 @@ +{% if site.comments.disqus.shortname %} + + +{% endif %} diff --git a/src/_includes/comments-providers/facebook.html b/src/_includes/comments-providers/facebook.html new file mode 100644 index 0000000..009dc1c --- /dev/null +++ b/src/_includes/comments-providers/facebook.html @@ -0,0 +1,8 @@ +
+ \ No newline at end of file diff --git a/src/_includes/comments-providers/giscus.html b/src/_includes/comments-providers/giscus.html new file mode 100644 index 0000000..e89d41c --- /dev/null +++ b/src/_includes/comments-providers/giscus.html @@ -0,0 +1,24 @@ + \ No newline at end of file diff --git a/src/_includes/comments-providers/scripts.html b/src/_includes/comments-providers/scripts.html new file mode 100644 index 0000000..e87bada --- /dev/null +++ b/src/_includes/comments-providers/scripts.html @@ -0,0 +1,20 @@ +{% if site.comments.provider and page.comments %} +{% case site.comments.provider %} + {% when "disqus" %} + {% include /comments-providers/disqus.html %} + {% when "discourse" %} + {% include /comments-providers/discourse.html %} + {% when "facebook" %} + {% include /comments-providers/facebook.html %} + {% when "staticman" %} + {% include /comments-providers/staticman.html %} + {% when "staticman_v2" %} + {% include /comments-providers/staticman_v2.html %} + {% when "utterances" %} + {% include /comments-providers/utterances.html %} + {% when "giscus" %} + {% include /comments-providers/giscus.html %} + {% when "custom" %} + {% include /comments-providers/custom_scripts.html %} +{% endcase %} +{% endif %} \ No newline at end of file diff --git a/src/_includes/comments-providers/staticman.html b/src/_includes/comments-providers/staticman.html new file mode 100644 index 0000000..ae3991d --- /dev/null +++ b/src/_includes/comments-providers/staticman.html @@ -0,0 +1,40 @@ +{% if site.repository and site.staticman.branch %} + +{% endif %} diff --git a/src/_includes/comments-providers/staticman_v2.html b/src/_includes/comments-providers/staticman_v2.html new file mode 100644 index 0000000..3d8ba11 --- /dev/null +++ b/src/_includes/comments-providers/staticman_v2.html @@ -0,0 +1,40 @@ +{% if site.repository and site.comments.staticman.branch %} + +{% endif %} diff --git a/src/_includes/comments-providers/utterances.html b/src/_includes/comments-providers/utterances.html new file mode 100644 index 0000000..129ab77 --- /dev/null +++ b/src/_includes/comments-providers/utterances.html @@ -0,0 +1,20 @@ + diff --git a/src/_includes/comments.html b/src/_includes/comments.html new file mode 100644 index 0000000..4ff59e2 --- /dev/null +++ b/src/_includes/comments.html @@ -0,0 +1,162 @@ +
+ {% capture comments_label %}{{ site.data.ui-text[site.locale].comments_label | default: "Comments" }}{% endcapture %} + {% case site.comments.provider %} + {% when "discourse" %} +

{{ comments_label }}

+
+ {% when "disqus" %} +

{{ comments_label }}

+
+ {% when "facebook" %} +

{{ comments_label }}

+
+ {% when "staticman_v2" %} +
+ {% if site.repository and site.comments.staticman.branch %} + +
+ {% if site.data.comments[page.slug] %} +

{{ site.data.ui-text[site.locale].comments_title | default: "Comments" }}

+ {% assign comments = site.data.comments[page.slug] | sort %} + + {% for comment in comments %} + {% assign email = comment[1].email %} + {% assign name = comment[1].name %} + {% assign url = comment[1].url %} + {% assign date = comment[1].date %} + {% assign message = comment[1].message %} + {% include comment.html index=forloop.index email=email name=name url=url date=date message=message %} + {% endfor %} + {% endif %} +
+ + + +
+

{{ site.data.ui-text[site.locale].comments_label | default: "Leave a Comment" }}

+

{{ site.data.ui-text[site.locale].comment_form_info | default: "Your email address will not be published. Required fields are marked" }} *

+
+
+ + {{ site.data.ui-text[site.locale].loading_label | default: "Loading..." }} +
+ +
+ + + +
+
+ + +
+
+ + +
+
+ + +
+ + + + + {% if site.reCaptcha.siteKey %} +
+
+
+ {% endif %} +
+ +
+
+
+ + {% if site.reCaptcha.siteKey %}{% endif %} + {% endif %} +
+ {% when "staticman" %} +
+ {% if site.repository and site.staticman.branch %} + +
+ {% if site.data.comments[page.slug] %} +

{{ site.data.ui-text[site.locale].comments_title | default: "Comments" }}

+ {% assign comments = site.data.comments[page.slug] | sort %} + + {% for comment in comments %} + {% assign email = comment[1].email %} + {% assign name = comment[1].name %} + {% assign url = comment[1].url %} + {% assign date = comment[1].date %} + {% assign message = comment[1].message %} + {% include comment.html index=forloop.index email=email name=name url=url date=date message=message %} + {% endfor %} + {% endif %} +
+ + + +
+

{{ site.data.ui-text[site.locale].comments_label | default: "Leave a Comment" }}

+

{{ site.data.ui-text[site.locale].comment_form_info | default: "Your email address will not be published. Required fields are marked" }} *

+
+
+ + {{ site.data.ui-text[site.locale].loading_label | default: "Loading..." }} +
+ +
+ + + +
+
+ + +
+
+ + +
+
+ + +
+ + + + +
+ +
+
+
+ + {% endif %} +
+ {% when "utterances" %} +

{{ comments_label }}

+
+ {% when "giscus" %} +

{{ comments_label }}

+
+ {% when "custom" %} + {% include /comments-providers/custom.html %} + {% endcase %} +
diff --git a/src/_includes/compress.html b/src/_includes/compress.html new file mode 100644 index 0000000..bb34487 --- /dev/null +++ b/src/_includes/compress.html @@ -0,0 +1,10 @@ +--- +# Jekyll layout that compresses HTML +# v3.1.0 +# http://jch.penibelst.de/ +# © 2014–2015 Anatol Broder +# MIT License +--- + +{% capture _LINE_FEED %} +{% endcapture %}{% if site.compress_html.ignore.envs contains jekyll.environment or site.compress_html.ignore.envs == "all" %}{{ content }}{% else %}{% capture _content %}{{ content }}{% endcapture %}{% assign _profile = site.compress_html.profile %}{% if site.compress_html.endings == "all" %}{% assign _endings = "html head body li dt dd optgroup option colgroup caption thead tbody tfoot tr td th" | split: " " %}{% else %}{% assign _endings = site.compress_html.endings %}{% endif %}{% for _element in _endings %}{% capture _end %}{% endcapture %}{% assign _content = _content | remove: _end %}{% endfor %}{% if _profile and _endings %}{% assign _profile_endings = _content | size | plus: 1 %}{% endif %}{% for _element in site.compress_html.startings %}{% capture _start %}<{{ _element }}>{% endcapture %}{% assign _content = _content | remove: _start %}{% endfor %}{% if _profile and site.compress_html.startings %}{% assign _profile_startings = _content | size | plus: 1 %}{% endif %}{% if site.compress_html.comments == "all" %}{% assign _comments = "" | split: " " %}{% else %}{% assign _comments = site.compress_html.comments %}{% endif %}{% if _comments.size == 2 %}{% capture _comment_befores %}.{{ _content }}{% endcapture %}{% assign _comment_befores = _comment_befores | split: _comments.first %}{% for _comment_before in _comment_befores %}{% if forloop.first %}{% continue %}{% endif %}{% capture _comment_outside %}{% if _carry %}{{ _comments.first }}{% endif %}{{ _comment_before }}{% endcapture %}{% capture _comment %}{% unless _carry %}{{ _comments.first }}{% endunless %}{{ _comment_outside | split: _comments.last | first }}{% if _comment_outside contains _comments.last %}{{ _comments.last }}{% assign _carry = false %}{% else %}{% assign _carry = true %}{% endif %}{% endcapture %}{% assign _content = _content | remove_first: _comment %}{% endfor %}{% if _profile %}{% assign _profile_comments = _content | size | plus: 1 %}{% endif %}{% endif %}{% assign _pre_befores = _content | split: "" %}{% assign _pres_after = "" %}{% if _pres.size != 0 %}{% if site.compress_html.blanklines %}{% assign _lines = _pres.last | split: _LINE_FEED %}{% capture _pres_after %}{% for _line in _lines %}{% assign _trimmed = _line | split: " " | join: " " %}{% if _trimmed != empty or forloop.last %}{% unless forloop.first %}{{ _LINE_FEED }}{% endunless %}{{ _line }}{% endif %}{% endfor %}{% endcapture %}{% else %}{% assign _pres_after = _pres.last | split: " " | join: " " %}{% endif %}{% endif %}{% capture _content %}{{ _content }}{% if _pre_before contains "" %}{% endif %}{% unless _pre_before contains "" and _pres.size == 1 %}{{ _pres_after }}{% endunless %}{% endcapture %}{% endfor %}{% if _profile %}{% assign _profile_collapse = _content | size | plus: 1 %}{% endif %}{% if site.compress_html.clippings == "all" %}{% assign _clippings = "html head title base link meta style body article section nav aside h1 h2 h3 h4 h5 h6 hgroup header footer address p hr blockquote ol ul li dl dt dd figure figcaption main div table caption colgroup col tbody thead tfoot tr td th" | split: " " %}{% else %}{% assign _clippings = site.compress_html.clippings %}{% endif %}{% for _element in _clippings %}{% assign _edges = " ;; ;" | replace: "e", _element | split: ";" %}{% assign _content = _content | replace: _edges[0], _edges[1] | replace: _edges[2], _edges[3] | replace: _edges[4], _edges[5] %}{% endfor %}{% if _profile and _clippings %}{% assign _profile_clippings = _content | size | plus: 1 %}{% endif %}{{ _content }}{% if _profile %}
Step Bytes
raw {{ content | size }}{% if _profile_endings %}
endings {{ _profile_endings }}{% endif %}{% if _profile_startings %}
startings {{ _profile_startings }}{% endif %}{% if _profile_comments %}
comments {{ _profile_comments }}{% endif %}{% if _profile_collapse %}
collapse {{ _profile_collapse }}{% endif %}{% if _profile_clippings %}
clippings {{ _profile_clippings }}{% endif %}
{% endif %}{% endif %} diff --git a/src/_includes/default.html b/src/_includes/default.html new file mode 100644 index 0000000..5abd964 --- /dev/null +++ b/src/_includes/default.html @@ -0,0 +1,42 @@ +--- +--- + + + + + + {% include head.html %} + {% include head/custom.html %} + + + + {% include_cached skip-links.html %} + {% include_cached browser-upgrade.html %} + {% include_cached masthead.html %} + +
+ {{ content }} +
+ + {% if site.search == true %} +
+ {% include_cached search/search_form.html %} +
+ {% endif %} + + + + {% include scripts.html %} + + + diff --git a/src/_includes/documents-collection.html b/src/_includes/documents-collection.html new file mode 100644 index 0000000..e88d8c4 --- /dev/null +++ b/src/_includes/documents-collection.html @@ -0,0 +1,15 @@ +{% assign entries = site[include.collection] %} + +{% if include.sort_by %} + {% assign entries = entries | sort: include.sort_by %} +{% endif %} + +{% if include.sort_order == 'reverse' %} + {% assign entries = entries | reverse %} +{% endif %} + +{%- for post in entries -%} + {%- unless post.hidden -%} + {% include archive-single.html %} + {%- endunless -%} +{%- endfor -%} diff --git a/src/_includes/feature_row b/src/_includes/feature_row new file mode 100644 index 0000000..03f09c1 --- /dev/null +++ b/src/_includes/feature_row @@ -0,0 +1,41 @@ +{% if include.id %} + {% assign feature_row = page[include.id] %} +{% else %} + {% assign feature_row = page.feature_row %} +{% endif %} + +
+ + {% for f in feature_row %} +
+
+ {% if f.image_path %} +
+ {% if f.alt %}{{ f.alt }}{% endif %} + {% if f.image_caption %} + {{ f.image_caption | markdownify | remove: "

" | remove: "

" }}
+ {% endif %} +
+ {% endif %} + +
+ {% if f.title %} +

{{ f.title }}

+ {% endif %} + + {% if f.excerpt %} +
+ {{ f.excerpt | markdownify }} +
+ {% endif %} + + {% if f.url %} +

{{ f.btn_label | default: site.data.ui-text[site.locale].more_label | default: "Learn More" }}

+ {% endif %} +
+
+
+ {% endfor %} + +
diff --git a/src/_includes/figure b/src/_includes/figure new file mode 100644 index 0000000..dacc668 --- /dev/null +++ b/src/_includes/figure @@ -0,0 +1,9 @@ +
+ {% if include.alt %}{{ include.alt }}{% endif %} + {%- if include.caption -%} +
+ {{ include.caption | markdownify | remove: "

" | remove: "

" }} +
+ {%- endif -%} +
diff --git a/src/_includes/footer.html b/src/_includes/footer.html new file mode 100644 index 0000000..2b53a25 --- /dev/null +++ b/src/_includes/footer.html @@ -0,0 +1,21 @@ + + + diff --git a/src/_includes/gallery b/src/_includes/gallery new file mode 100644 index 0000000..71a9e1e --- /dev/null +++ b/src/_includes/gallery @@ -0,0 +1,35 @@ +{% if include.id %} + {% assign gallery = page[include.id] %} +{% else %} + {% assign gallery = page.gallery %} +{% endif %} + +{% if include.layout %} + {% assign gallery_layout = include.layout %} +{% else %} + {% if gallery.size == 2 %} + {% assign gallery_layout = 'half' %} + {% elsif gallery.size >= 3 %} + {% assign gallery_layout = 'third' %} + {% else %} + {% assign gallery_layout = '' %} + {% endif %} +{% endif %} + + diff --git a/src/_includes/group-by-array b/src/_includes/group-by-array new file mode 100644 index 0000000..708de41 --- /dev/null +++ b/src/_includes/group-by-array @@ -0,0 +1,47 @@ + + + +{% assign __empty_array = '' | split: ',' %} +{% assign group_names = __empty_array %} +{% assign group_items = __empty_array %} + + +{% assign __names = include.collection | map: include.field %} + + +{% assign __names = __names | join: ',' | join: ',' | split: ',' %} + + +{% assign __names = __names | sort %} +{% for name in __names %} + + +{% unless name == previous %} + + +{% assign group_names = group_names | push: name %} +{% endunless %} + +{% assign previous = name %} +{% endfor %} + + + +{% for name in group_names %} + + +{% assign __item = __empty_array %} +{% for __element in include.collection %} +{% if __element[include.field] contains name %} +{% assign __item = __item | push: __element %} +{% endif %} +{% endfor %} + + +{% assign group_items = group_items | push: __item %} +{% endfor %} \ No newline at end of file diff --git a/src/_includes/head.html b/src/_includes/head.html new file mode 100644 index 0000000..73e5637 --- /dev/null +++ b/src/_includes/head.html @@ -0,0 +1,25 @@ + + +{% include seo.html %} + +{% unless site.atom_feed.hide %} + +{% endunless %} + + + + + + + + + + + +{% if site.head_scripts %} + {% for script in site.head_scripts %} + + {% endfor %} +{% endif %} diff --git a/src/_includes/home.html b/src/_includes/home.html new file mode 100644 index 0000000..02e96eb --- /dev/null +++ b/src/_includes/home.html @@ -0,0 +1,22 @@ +--- +layout: archive +--- + +{{ content }} + +

{{ site.data.ui-text[site.locale].recent_posts | default: "Recent Posts" }}

+ +{% if paginator %} + {% assign posts = paginator.posts %} +{% else %} + {% assign posts = site.posts %} +{% endif %} + +{% assign entries_layout = page.entries_layout | default: 'list' %} +
+ {% for post in posts %} + {% include archive-single.html type=entries_layout %} + {% endfor %} +
+ +{% include paginator.html %} diff --git a/src/_includes/masthead.html b/src/_includes/masthead.html new file mode 100644 index 0000000..0c66aa6 --- /dev/null +++ b/src/_includes/masthead.html @@ -0,0 +1,35 @@ +{% capture logo_path %}{{ site.logo }}{% endcapture %} + +
+
+
+ +
+
+
diff --git a/src/_includes/nav_list b/src/_includes/nav_list new file mode 100644 index 0000000..a035a5b --- /dev/null +++ b/src/_includes/nav_list @@ -0,0 +1,26 @@ +{% assign navigation = site.data.navigation[include.nav] %} + + diff --git a/src/_includes/page__date.html b/src/_includes/page__date.html new file mode 100644 index 0000000..4f995ed --- /dev/null +++ b/src/_includes/page__date.html @@ -0,0 +1,6 @@ +{% assign date_format = site.date_format | default: "%B %-d, %Y" %} +{% if page.last_modified_at %} +

{{ site.data.ui-text[site.locale].date_label | default: "Updated:" }}

+{% elsif page.date %} +

{{ site.data.ui-text[site.locale].date_label | default: "Updated:" }}

+{% endif %} diff --git a/src/_includes/page__hero.html b/src/_includes/page__hero.html new file mode 100644 index 0000000..dd1c26f --- /dev/null +++ b/src/_includes/page__hero.html @@ -0,0 +1,55 @@ +{% capture overlay_img_path %}{{ page.header.overlay_image | relative_url }}{% endcapture %} + +{% if page.header.overlay_filter contains "gradient" %} + {% capture overlay_filter %}{{ page.header.overlay_filter }}{% endcapture %} +{% elsif page.header.overlay_filter contains "rgba" %} + {% capture overlay_filter %}{{ page.header.overlay_filter }}{% endcapture %} + {% capture overlay_filter %}linear-gradient({{ overlay_filter }}, {{ overlay_filter }}){% endcapture %} +{% elsif page.header.overlay_filter %} + {% capture overlay_filter %}rgba(0, 0, 0, {{ page.header.overlay_filter }}){% endcapture %} + {% capture overlay_filter %}linear-gradient({{ overlay_filter }}, {{ overlay_filter }}){% endcapture %} +{% endif %} + +{% if page.header.image_description %} + {% assign image_description = page.header.image_description %} +{% else %} + {% assign image_description = page.title %} +{% endif %} + +{% assign image_description = image_description | markdownify | strip_html | strip_newlines | escape_once %} + +
+ {% if page.header.overlay_color or page.header.overlay_image %} +
+

+ {% if paginator and site.paginate_show_page_num %} + {{ site.title }}{% unless paginator.page == 1 %} {{ site.data.ui-text[site.locale].page | default: "Page" }} {{ paginator.page }}{% endunless %} + {% else %} + {{ page.title | default: site.title | markdownify | remove: "

" | remove: "

" }} + {% endif %} +

+ {% if page.tagline %} +

{{ page.tagline | markdownify | remove: "

" | remove: "

" }}

+ {% elsif page.header.show_overlay_excerpt != false and page.excerpt %} +

{{ page.excerpt | markdownify | remove: "

" | remove: "

" }}

+ {% endif %} + {% include page__meta.html %} + {% if page.header.cta_url %} +

{{ page.header.cta_label | default: site.data.ui-text[site.locale].more_label | default: "Learn More" }}

+ {% endif %} + {% if page.header.actions %} +

+ {% for action in page.header.actions %} + {{ action.label | default: site.data.ui-text[site.locale].more_label | default: "Learn More" }} + {% endfor %} + {% endif %} +

+ {% else %} + {{ image_description }} + {% endif %} + {% if page.header.caption %} + {{ page.header.caption | markdownify | remove: "

" | remove: "

" }}
+ {% endif %} +
diff --git a/src/_includes/page__hero_video.html b/src/_includes/page__hero_video.html new file mode 100644 index 0000000..a313a23 --- /dev/null +++ b/src/_includes/page__hero_video.html @@ -0,0 +1,2 @@ +{% assign video = page.header.video %} +{% include video id=video.id provider=video.provider danmaku=video.danmaku %} diff --git a/src/_includes/page__meta.html b/src/_includes/page__meta.html new file mode 100644 index 0000000..3d228c9 --- /dev/null +++ b/src/_includes/page__meta.html @@ -0,0 +1,31 @@ +{% assign document = post | default: page %} +{% if document.read_time or document.show_date %} +

+ {% if document.show_date and document.date %} + {% assign date = document.date %} + + + {% assign date_format = site.date_format | default: "%B %-d, %Y" %} + + + {% endif %} + + {% if document.read_time and document.show_date %}{% endif %} + + {% if document.read_time %} + {% assign words_per_minute = document.words_per_minute | default: site.words_per_minute | default: 200 %} + {% assign words = document.content | strip_html | number_of_words %} + + + + {% if words < words_per_minute %} + {{ site.data.ui-text[site.locale].less_than | default: "less than" }} 1 {{ site.data.ui-text[site.locale].minute_read | default: "minute read" }} + {% elsif words == words_per_minute %} + 1 {{ site.data.ui-text[site.locale].minute_read | default: "minute read" }} + {% else %} + {{ words | divided_by: words_per_minute }} {{ site.data.ui-text[site.locale].minute_read | default: "minute read" }} + {% endif %} + + {% endif %} +

+{% endif %} diff --git a/src/_includes/page__taxonomy.html b/src/_includes/page__taxonomy.html new file mode 100644 index 0000000..75c76c8 --- /dev/null +++ b/src/_includes/page__taxonomy.html @@ -0,0 +1,7 @@ +{% if site.tag_archive.type and page.tags[0] %} + {% include tag-list.html %} +{% endif %} + +{% if site.category_archive.type and page.categories[0] %} + {% include category-list.html %} +{% endif %} \ No newline at end of file diff --git a/src/_includes/paginator.html b/src/_includes/paginator.html new file mode 100644 index 0000000..bffa079 --- /dev/null +++ b/src/_includes/paginator.html @@ -0,0 +1,69 @@ +{% if paginator.total_pages > 1 %} + +{% endif %} diff --git a/src/_includes/post_pagination.html b/src/_includes/post_pagination.html new file mode 100644 index 0000000..a93c627 --- /dev/null +++ b/src/_includes/post_pagination.html @@ -0,0 +1,14 @@ +{% if page.previous or page.next %} + +{% endif %} \ No newline at end of file diff --git a/src/_includes/posts-category.html b/src/_includes/posts-category.html new file mode 100644 index 0000000..b364f30 --- /dev/null +++ b/src/_includes/posts-category.html @@ -0,0 +1,5 @@ +{%- for post in site.categories[include.taxonomy] -%} + {%- unless post.hidden -%} + {% include archive-single.html %} + {%- endunless -%} +{%- endfor -%} diff --git a/src/_includes/posts-tag.html b/src/_includes/posts-tag.html new file mode 100644 index 0000000..46fade0 --- /dev/null +++ b/src/_includes/posts-tag.html @@ -0,0 +1,5 @@ +{%- for post in site.tags[include.taxonomy] -%} + {%- unless post.hidden -%} + {% include archive-single.html %} + {%- endunless -%} +{%- endfor -%} diff --git a/src/_includes/posts.html b/src/_includes/posts.html new file mode 100644 index 0000000..13fc707 --- /dev/null +++ b/src/_includes/posts.html @@ -0,0 +1,30 @@ +--- +layout: archive +--- + +{{ content }} + +
    + {% assign postsInYear = site.posts | where_exp: "item", "item.hidden != true" | group_by_exp: 'post', 'post.date | date: "%Y"' %} + {% for year in postsInYear %} +
  • + + {{ year.name }} {{ year.items | size }} + +
  • + {% endfor %} +
+ +{% assign entries_layout = page.entries_layout | default: 'list' %} +{% assign postsByYear = site.posts | where_exp: "item", "item.hidden != true" | group_by_exp: 'post', 'post.date | date: "%Y"' %} +{% for year in postsByYear %} +
+

{{ year.name }}

+
+ {% for post in year.items %} + {% include archive-single.html type=entries_layout %} + {% endfor %} +
+ {{ site.data.ui-text[site.locale].back_to_top | default: 'Back to Top' }} ↑ +
+{% endfor %} diff --git a/src/_includes/scripts.html b/src/_includes/scripts.html new file mode 100644 index 0000000..bbdaddf --- /dev/null +++ b/src/_includes/scripts.html @@ -0,0 +1,28 @@ +{% if site.footer_scripts %} + {% for script in site.footer_scripts %} + + {% endfor %} +{% else %} + +{% endif %} + +{% if site.search == true or page.layout == "search" %} + {%- assign search_provider = site.search_provider | default: "lunr" -%} + {%- case search_provider -%} + {%- when "lunr" -%} + {% include_cached search/lunr-search-scripts.html %} + {%- when "google" -%} + {% include_cached search/google-search-scripts.html %} + {%- when "algolia" -%} + {% include_cached search/algolia-search-scripts.html %} + {%- endcase -%} +{% endif %} + +{% include analytics.html %} +{% include /comments-providers/scripts.html %} + +{% if site.after_footer_scripts %} + {% for script in site.after_footer_scripts %} + + {% endfor %} +{% endif %} diff --git a/src/_includes/search.html b/src/_includes/search.html new file mode 100644 index 0000000..9e661a3 --- /dev/null +++ b/src/_includes/search.html @@ -0,0 +1,42 @@ +--- +layout: default +--- + +{% if page.header.overlay_color or page.header.overlay_image or page.header.image %} + {% include page__hero.html %} +{% endif %} + +{% if page.url != "/" and site.breadcrumbs %} + {% unless paginator %} + {% include breadcrumbs.html %} + {% endunless %} +{% endif %} + +
+ {% include sidebar.html %} + +
+ {% unless page.header.overlay_color or page.header.overlay_image %} +

{{ page.title }}

+ {% endunless %} + + {{ content }} + + {%- assign search_provider = site.search_provider | default: "lunr" -%} + {%- case search_provider -%} + {%- when "lunr" -%} + +
+ {%- when "google" -%} +
+ +
+
+ +
+ {%- when "algolia" -%} + +
+ {%- endcase -%} +
+
diff --git a/src/_includes/search/algolia-search-scripts.html b/src/_includes/search/algolia-search-scripts.html new file mode 100644 index 0000000..2728d29 --- /dev/null +++ b/src/_includes/search/algolia-search-scripts.html @@ -0,0 +1,61 @@ + + + + + + diff --git a/src/_includes/search/google-search-scripts.html b/src/_includes/search/google-search-scripts.html new file mode 100644 index 0000000..4af7423 --- /dev/null +++ b/src/_includes/search/google-search-scripts.html @@ -0,0 +1,30 @@ + \ No newline at end of file diff --git a/src/_includes/search/lunr-search-scripts.html b/src/_includes/search/lunr-search-scripts.html new file mode 100644 index 0000000..574c390 --- /dev/null +++ b/src/_includes/search/lunr-search-scripts.html @@ -0,0 +1,10 @@ +{% assign lang = site.locale | slice: 0,2 | default: "en" %} +{% case lang %} +{% when "gr" %} + {% assign lang = "gr" %} +{% else %} + {% assign lang = "en" %} +{% endcase %} + + + \ No newline at end of file diff --git a/src/_includes/search/search_form.html b/src/_includes/search/search_form.html new file mode 100644 index 0000000..c346379 --- /dev/null +++ b/src/_includes/search/search_form.html @@ -0,0 +1,26 @@ +
+ {%- assign search_provider = site.search_provider | default: "lunr" -%} + {%- case search_provider -%} + {%- when "lunr" -%} +
+ + +
+
+ {%- when "google" -%} +
+ + +
+
+ +
+ {%- when "algolia" -%} + +
+ {%- endcase -%} +
diff --git a/src/_includes/seo.html b/src/_includes/seo.html new file mode 100644 index 0000000..c9d01e9 --- /dev/null +++ b/src/_includes/seo.html @@ -0,0 +1,158 @@ + +{%- if site.url -%} + {%- assign seo_url = site.url | append: site.baseurl -%} +{%- endif -%} +{%- assign seo_url = seo_url | default: site.github.url -%} + +{% assign title_separator = site.title_separator | default: '-' | replace: '|', '|' %} + +{%- if page.title -%} + {%- assign seo_title = page.title | append: " " | append: title_separator | append: " " | append: site.title -%} +{%- endif -%} + +{%- if seo_title -%} + {%- assign seo_title = seo_title | markdownify | strip_html | strip_newlines | escape_once -%} +{%- endif -%} + +{% if page.canonical_url %} + {%- assign canonical_url = page.canonical_url %} +{% else %} + {%- assign canonical_url = page.url | replace: "index.html", "" | absolute_url %} +{% endif %} + +{%- assign seo_description = page.description | default: page.excerpt | default: site.description -%} +{%- if seo_description -%} + {%- assign seo_description = seo_description | markdownify | strip_html | newline_to_br | strip_newlines | replace: '
', ' ' | escape_once | strip -%} +{%- endif -%} + +{%- assign author = page.author | default: page.authors[0] | default: site.author -%} +{%- assign author = site.data.authors[author] | default: author -%} + +{%- if author.twitter -%} + {%- assign author_twitter = author.twitter | replace: "@", "" -%} +{%- endif -%} + +{%- assign page_large_image = page.header.og_image | default: page.header.overlay_image | default: page.header.image | absolute_url -%} +{%- assign page_large_image = page_large_image | escape -%} + +{%- assign page_teaser_image = page.header.teaser | default: site.og_image | absolute_url -%} +{%- assign page_teaser_image = page_teaser_image | escape -%} + +{%- assign site_og_image = site.og_image | absolute_url -%} +{%- assign site_og_image = site_og_image | escape -%} + +{%- if page.date -%} + {%- assign og_type = "article" -%} +{%- else -%} + {%- assign og_type = "website" -%} +{%- endif -%} + +{{ seo_title | default: site.title }}{% if paginator %}{% unless paginator.page == 1 %} {{ title_separator }} {{ site.data.ui-text[site.locale].page | default: "Page" }} {{ paginator.page }}{% endunless %}{% endif %} + + +{% if author.name %} + + {% if og_type == "article" %} + + {% endif %} +{% endif %} + + + + + + + +{% if seo_description %} + +{% endif %} + +{% if page_large_image %} + +{% elsif page_teaser_image %} + +{% endif %} + +{% if site.twitter.username %} + + + + + + {% if page_large_image %} + + + {% else %} + + {% if page_teaser_image %} + + {% endif %} + {% endif %} + + {% if author_twitter %} + + {% endif %} +{% endif %} + +{% if page.date %} + +{% endif %} + +{% if og_type == "article" and page.last_modified_at %} + +{% endif %} + +{% if site.facebook %} + {% if site.facebook.publisher %} + + {% endif %} + + {% if site.facebook.app_id %} + + {% endif %} +{% endif %} + + + +{% if paginator.previous_page %} + +{% endif %} +{% if paginator.next_page %} + +{% endif %} + + + +{% if site.google_site_verification %} + +{% endif %} +{% if site.bing_site_verification %} + +{% endif %} +{% if site.alexa_site_verification %} + +{% endif %} +{% if site.yandex_site_verification %} + +{% endif %} +{% if site.naver_site_verification %} + +{% endif %} +{% if site.baidu_site_verification %} + +{% endif %} + diff --git a/src/_includes/sidebar.html b/src/_includes/sidebar.html new file mode 100644 index 0000000..a4ca1ca --- /dev/null +++ b/src/_includes/sidebar.html @@ -0,0 +1,19 @@ +{% if page.author_profile or layout.author_profile or page.sidebar %} + +{% endif %} diff --git a/src/_includes/single.html b/src/_includes/single.html new file mode 100644 index 0000000..d74002b --- /dev/null +++ b/src/_includes/single.html @@ -0,0 +1,89 @@ +--- +layout: default +--- + +{% if page.header.overlay_color or page.header.overlay_image or page.header.image %} + {% include page__hero.html %} +{% elsif page.header.video.id and page.header.video.provider %} + {% include page__hero_video.html %} +{% endif %} + +{% if page.url != "/" and site.breadcrumbs %} + {% unless paginator %} + {% include breadcrumbs.html %} + {% endunless %} +{% endif %} + +
+ {% include sidebar.html %} + +
+ {% if page.title %}{% endif %} + {% if page.excerpt %}{% endif %} + {% if page.date %}{% endif %} + {% if page.last_modified_at %}{% endif %} + +
+ {% unless page.header.overlay_color or page.header.overlay_image %} +
+ {% if page.title %}

{{ page.title | markdownify | remove: "

" | remove: "

" }}

{% endif %} + {% include page__meta.html %} +
+ {% endunless %} + +
+ {% if page.toc %} + + {% endif %} + {{ content }} + {% if page.link %}{% endif %} +
+ +
+ {% if site.data.ui-text[site.locale].meta_label %} +

{{ site.data.ui-text[site.locale].meta_label }}

+ {% endif %} + {% include page__taxonomy.html %} + {% include page__date.html %} +
+ + {% if page.share %}{% include social-share.html %}{% endif %} + + {% include post_pagination.html %} +
+ + {% if jekyll.environment == 'production' and site.comments.provider and page.comments %} + {% include comments.html %} + {% endif %} +
+ + {% comment %}{% endcomment %} + {% if page.id and page.related and site.related_posts.size > 0 %} + + {% comment %}{% endcomment %} + {% elsif page.id and page.related %} + + {% endif %} +
diff --git a/src/_includes/skip-links.html b/src/_includes/skip-links.html new file mode 100644 index 0000000..c2d5223 --- /dev/null +++ b/src/_includes/skip-links.html @@ -0,0 +1,7 @@ + diff --git a/src/_includes/social-share.html b/src/_includes/social-share.html new file mode 100644 index 0000000..0b37798 --- /dev/null +++ b/src/_includes/social-share.html @@ -0,0 +1,11 @@ + diff --git a/src/_includes/splash.html b/src/_includes/splash.html new file mode 100644 index 0000000..2116502 --- /dev/null +++ b/src/_includes/splash.html @@ -0,0 +1,22 @@ +--- +layout: default +--- + +{% if page.header.overlay_color or page.header.overlay_image or page.header.image %} + {% include page__hero.html %} +{% elsif page.header.video.id and page.header.video.provider %} + {% include page__hero_video.html %} +{% endif %} + +
+
+ {% if page.title %}{% endif %} + {% if page.excerpt %}{% endif %} + {% if page.date %}{% endif %} + {% if page.last_modified_at %}{% endif %} + +
+ {{ content }} +
+
+
diff --git a/src/_includes/tag-list.html b/src/_includes/tag-list.html new file mode 100644 index 0000000..b16eca2 --- /dev/null +++ b/src/_includes/tag-list.html @@ -0,0 +1,19 @@ +{% case site.tag_archive.type %} + {% when "liquid" %} + {% assign path_type = "#" %} + {% when "jekyll-archives" %} + {% assign path_type = nil %} +{% endcase %} + +{% if site.tag_archive.path %} + {% assign tags_sorted = page.tags | sort_natural %} + +

+ {{ site.data.ui-text[site.locale].tags_label | default: "Tags:" }} + + {% for tag_word in tags_sorted %} + {% unless forloop.last %}, {% endunless %} + {% endfor %} + +

+{% endif %} \ No newline at end of file diff --git a/src/_includes/tag.html b/src/_includes/tag.html new file mode 100644 index 0000000..8b1c188 --- /dev/null +++ b/src/_includes/tag.html @@ -0,0 +1,10 @@ +--- +layout: archive +--- + +{{ content }} + +{% assign entries_layout = page.entries_layout | default: 'list' %} +
+ {% include posts-tag.html taxonomy=page.taxonomy type=entries_layout %} +
diff --git a/src/_includes/tags.html b/src/_includes/tags.html new file mode 100644 index 0000000..daa1182 --- /dev/null +++ b/src/_includes/tags.html @@ -0,0 +1,43 @@ +--- +layout: archive +--- + +{{ content }} + +{% assign tags_max = 0 %} +{% for tag in site.tags %} + {% if tag[1].size > tags_max %} + {% assign tags_max = tag[1].size %} + {% endif %} +{% endfor %} + +
    + {% for i in (1..tags_max) reversed %} + {% for tag in site.tags %} + {% if tag[1].size == i %} +
  • + + {{ tag[0] }} {{ i }} + +
  • + {% endif %} + {% endfor %} + {% endfor %} +
+ +{% assign entries_layout = page.entries_layout | default: 'list' %} +{% for i in (1..tags_max) reversed %} + {% for tag in site.tags %} + {% if tag[1].size == i %} +
+

{{ tag[0] }}

+
+ {% for post in tag.last %} + {% include archive-single.html type=entries_layout %} + {% endfor %} +
+ {{ site.data.ui-text[site.locale].back_to_top | default: 'Back to Top' }} ↑ +
+ {% endif %} + {% endfor %} +{% endfor %} diff --git a/src/_includes/toc b/src/_includes/toc new file mode 100644 index 0000000..6423ccd --- /dev/null +++ b/src/_includes/toc @@ -0,0 +1,7 @@ + \ No newline at end of file diff --git a/src/_includes/toc.html b/src/_includes/toc.html new file mode 100644 index 0000000..8c71007 --- /dev/null +++ b/src/_includes/toc.html @@ -0,0 +1,182 @@ +{% capture tocWorkspace %} + {% comment %} + Copyright (c) 2017 Vladimir "allejo" Jimenez + + Permission is hereby granted, free of charge, to any person + obtaining a copy of this software and associated documentation + files (the "Software"), to deal in the Software without + restriction, including without limitation the rights to use, + copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the + Software is furnished to do so, subject to the following + conditions: + + The above copyright notice and this permission notice shall be + included in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + OTHER DEALINGS IN THE SOFTWARE. + {% endcomment %} + {% comment %} + Version 1.1.0 + https://github.com/allejo/jekyll-toc + + "...like all things liquid - where there's a will, and ~36 hours to spare, there's usually a/some way" ~jaybe + + Usage: + {% include toc.html html=content sanitize=true class="inline_toc" id="my_toc" h_min=2 h_max=3 %} + + Parameters: + * html (string) - the HTML of compiled markdown generated by kramdown in Jekyll + + Optional Parameters: + * sanitize (bool) : false - when set to true, the headers will be stripped of any HTML in the TOC + * class (string) : '' - a CSS class assigned to the TOC + * id (string) : '' - an ID to assigned to the TOC + * h_min (int) : 1 - the minimum TOC header level to use; any header lower than this value will be ignored + * h_max (int) : 6 - the maximum TOC header level to use; any header greater than this value will be ignored + * ordered (bool) : false - when set to true, an ordered list will be outputted instead of an unordered list + * item_class (string) : '' - add custom class(es) for each list item; has support for '%level%' placeholder, which is the current heading level + * submenu_class (string) : '' - add custom class(es) for each child group of headings; has support for '%level%' placeholder which is the current "submenu" heading level + * base_url (string) : '' - add a base url to the TOC links for when your TOC is on another page than the actual content + * anchor_class (string) : '' - add custom class(es) for each anchor element + * skip_no_ids (bool) : false - skip headers that do not have an `id` attribute + + Output: + An ordered or unordered list representing the table of contents of a markdown block. This snippet will only + generate the table of contents and will NOT output the markdown given to it + {% endcomment %} + + {% capture newline %} + {% endcapture %} + {% assign newline = newline | rstrip %} + + {% capture deprecation_warnings %}{% endcapture %} + + {% if include.baseurl %} + {% capture deprecation_warnings %}{{ deprecation_warnings }}{{ newline }}{% endcapture %} + {% endif %} + + {% if include.skipNoIDs %} + {% capture deprecation_warnings %}{{ deprecation_warnings }}{{ newline }}{% endcapture %} + {% endif %} + + {% capture jekyll_toc %}{% endcapture %} + {% assign orderedList = include.ordered | default: false %} + {% assign baseURL = include.base_url | default: include.baseurl | default: '' %} + {% assign skipNoIDs = include.skip_no_ids | default: include.skipNoIDs | default: false %} + {% assign minHeader = include.h_min | default: 1 %} + {% assign maxHeader = include.h_max | default: 6 %} + {% assign nodes = include.html | strip | split: ' maxHeader %} + {% continue %} + {% endif %} + + {% assign _workspace = node | split: '' | first }}>{% endcapture %} + {% assign header = _workspace[0] | replace: _hAttrToStrip, '' %} + + {% if include.item_class and include.item_class != blank %} + {% capture listItemClass %} class="{{ include.item_class | replace: '%level%', currLevel | split: '.' | join: ' ' }}"{% endcapture %} + {% endif %} + + {% if include.submenu_class and include.submenu_class != blank %} + {% assign subMenuLevel = currLevel | minus: 1 %} + {% capture subMenuClass %} class="{{ include.submenu_class | replace: '%level%', subMenuLevel | split: '.' | join: ' ' }}"{% endcapture %} + {% endif %} + + {% capture anchorBody %}{% if include.sanitize %}{{ header | strip_html }}{% else %}{{ header }}{% endif %}{% endcapture %} + + {% if htmlID %} + {% capture anchorAttributes %} href="{% if baseURL %}{{ baseURL }}{% endif %}#{{ htmlID }}"{% endcapture %} + + {% if include.anchor_class %} + {% capture anchorAttributes %}{{ anchorAttributes }} class="{{ include.anchor_class | split: '.' | join: ' ' }}"{% endcapture %} + {% endif %} + + {% capture listItem %}{{ anchorBody }}{% endcapture %} + {% elsif skipNoIDs == true %} + {% continue %} + {% else %} + {% capture listItem %}{{ anchorBody }}{% endcapture %} + {% endif %} + + {% if currLevel > lastLevel %} + {% capture jekyll_toc %}{{ jekyll_toc }}<{{ listModifier }}{{ subMenuClass }}>{% endcapture %} + {% elsif currLevel < lastLevel %} + {% assign repeatCount = lastLevel | minus: currLevel %} + + {% for i in (1..repeatCount) %} + {% capture jekyll_toc %}{{ jekyll_toc }}{% endcapture %} + {% endfor %} + + {% capture jekyll_toc %}{{ jekyll_toc }}{% endcapture %} + {% else %} + {% capture jekyll_toc %}{{ jekyll_toc }}{% endcapture %} + {% endif %} + + {% capture jekyll_toc %}{{ jekyll_toc }}{{ listItem }}{% endcapture %} + + {% assign lastLevel = currLevel %} + {% assign firstHeader = false %} + {% endfor %} + + {% assign repeatCount = minHeader | minus: 1 %} + {% assign repeatCount = lastLevel | minus: repeatCount %} + {% for i in (1..repeatCount) %} + {% capture jekyll_toc %}{{ jekyll_toc }}{% endcapture %} + {% endfor %} + + {% if jekyll_toc != '' %} + {% assign rootAttributes = '' %} + {% if include.class and include.class != blank %} + {% capture rootAttributes %} class="{{ include.class | split: '.' | join: ' ' }}"{% endcapture %} + {% endif %} + + {% if include.id and include.id != blank %} + {% capture rootAttributes %}{{ rootAttributes }} id="{{ include.id }}"{% endcapture %} + {% endif %} + + {% if rootAttributes %} + {% assign nodes = jekyll_toc | split: '>' %} + {% capture jekyll_toc %}<{{ listModifier }}{{ rootAttributes }}>{{ nodes | shift | join: '>' }}>{% endcapture %} + {% endif %} + {% endif %} +{% endcapture %}{% assign tocWorkspace = '' %}{{ deprecation_warnings }}{{ jekyll_toc }} diff --git a/src/_includes/video b/src/_includes/video new file mode 100644 index 0000000..d653fd6 --- /dev/null +++ b/src/_includes/video @@ -0,0 +1,24 @@ +{% capture video_id %}{{ include.id }}{% endcapture %} +{% capture video_provider %}{{ include.provider }}{% endcapture %} +{% capture video_danmaku %}{{ include.danmaku | default: 0 }}{% endcapture %} + +{% capture video_src %} + {% case video_provider %} + {% when "vimeo" %} + https://player.vimeo.com/video/{{ video_id }}?dnt=true + {% when "youtube" %} + https://www.youtube-nocookie.com/embed/{{ video_id }} + {% when "google-drive" %} + https://drive.google.com/file/d/{{ video_id }}/preview + {% when "bilibili" %} + https://player.bilibili.com/player.html?bvid={{ video_id }}&page=1&as_wide=1&high_quality=1&danmaku={{ video_danmaku }} + {% endcase %} +{% endcapture %} +{% assign video_src = video_src | strip %} + + +{% unless video_src == "" %} +
+ +
+{% endunless %} diff --git a/src/_sass/minimal-mistakes.scss b/src/_sass/minimal-mistakes.scss new file mode 100644 index 0000000..3b252e5 --- /dev/null +++ b/src/_sass/minimal-mistakes.scss @@ -0,0 +1,40 @@ +/*! + * Minimal Mistakes Jekyll Theme 4.24.0 by Michael Rose + * Copyright 2013-2020 Michael Rose - mademistakes.com | @mmistakes + * Licensed under MIT (https://github.com/mmistakes/minimal-mistakes/blob/master/LICENSE) +*/ + +/* Variables */ +@import "minimal-mistakes/variables"; + +/* Mixins and functions */ +@import "minimal-mistakes/vendor/breakpoint/breakpoint"; +@include breakpoint-set("to ems", true); +@import "minimal-mistakes/vendor/magnific-popup/magnific-popup"; // Magnific Popup +@import "minimal-mistakes/vendor/susy/susy"; +@import "minimal-mistakes/mixins"; + +/* Core CSS */ +@import "minimal-mistakes/reset"; +@import "minimal-mistakes/base"; +@import "minimal-mistakes/forms"; +@import "minimal-mistakes/tables"; +@import "minimal-mistakes/animations"; + +/* Components */ +@import "minimal-mistakes/buttons"; +@import "minimal-mistakes/notices"; +@import "minimal-mistakes/masthead"; +@import "minimal-mistakes/navigation"; +@import "minimal-mistakes/footer"; +@import "minimal-mistakes/search"; +@import "minimal-mistakes/syntax"; + +/* Utility classes */ +@import "minimal-mistakes/utilities"; + +/* Layout specific */ +@import "minimal-mistakes/page"; +@import "minimal-mistakes/archive"; +@import "minimal-mistakes/sidebar"; +@import "minimal-mistakes/print"; diff --git a/src/_sass/minimal-mistakes/_animations.scss b/src/_sass/minimal-mistakes/_animations.scss new file mode 100644 index 0000000..25ef77f --- /dev/null +++ b/src/_sass/minimal-mistakes/_animations.scss @@ -0,0 +1,21 @@ +/* ========================================================================== + ANIMATIONS + ========================================================================== */ + +@-webkit-keyframes intro { + 0% { + opacity: 0; + } + 100% { + opacity: 1; + } +} + +@keyframes intro { + 0% { + opacity: 0; + } + 100% { + opacity: 1; + } +} \ No newline at end of file diff --git a/src/_sass/minimal-mistakes/_archive.scss b/src/_sass/minimal-mistakes/_archive.scss new file mode 100644 index 0000000..9f57632 --- /dev/null +++ b/src/_sass/minimal-mistakes/_archive.scss @@ -0,0 +1,463 @@ +/* ========================================================================== + ARCHIVE + ========================================================================== */ + +.archive { + margin-top: 1em; + margin-bottom: 2em; + + @include breakpoint($large) { + float: right; + width: calc(100% - #{$right-sidebar-width-narrow}); + padding-right: $right-sidebar-width-narrow; + } + + @include breakpoint($x-large) { + width: calc(100% - #{$right-sidebar-width}); + padding-right: $right-sidebar-width; + } +} + +.archive__item { + position: relative; + + a { + position: relative; + z-index: 10; + } + + a[rel="permalink"] { + position: static; + } +} + +.archive__subtitle { + margin: 1.414em 0 0.5em; + padding-bottom: 0.5em; + font-size: $type-size-5; + color: $muted-text-color; + border-bottom: 1px solid $border-color; + + + .list__item .archive__item-title { + margin-top: 0.5em; + } +} + +.archive__item-title { + margin-bottom: 0.25em; + font-family: $sans-serif-narrow; + line-height: initial; + overflow: hidden; + text-overflow: ellipsis; + + a[rel="permalink"]::before { + content: ''; + position: absolute; + left: 0; + top: 0; + right: 0; + bottom: 0; + } + + a + a { + opacity: 0.5; + } +} + +/* remove border*/ +.page__content { + .archive__item-title { + margin-top: 1em; + border-bottom: none; + } +} + +.archive__item-excerpt { + margin-top: 0; + font-size: $type-size-6; + + & + p { + text-indent: 0; + } + + a { + position: relative; + } +} + +.archive__item-teaser { + position: relative; + border-radius: $border-radius; + overflow: hidden; + + img { + width: 100%; + } +} + +.archive__item-caption { + position: absolute; + bottom: 0; + right: 0; + margin: 0 auto; + padding: 2px 5px; + color: #fff; + font-family: $caption-font-family; + font-size: $type-size-8; + background: #000; + text-align: right; + z-index: 5; + opacity: 0.5; + border-radius: $border-radius 0 0 0; + + @include breakpoint($large) { + padding: 5px 10px; + } + + a { + color: #fff; + text-decoration: none; + } +} + +/* + List view + ========================================================================== */ + +.list__item { + .page__meta { + margin: 0 0 4px; + font-size: 0.6em; + } +} + +/* + Grid view + ========================================================================== */ + +.archive { + .grid__wrapper { + /* extend grid elements to the right */ + + @include breakpoint($large) { + margin-right: -1 * $right-sidebar-width-narrow; + } + + @include breakpoint($x-large) { + margin-right: -1 * $right-sidebar-width; + } + } +} + +.grid__item { + margin-bottom: 2em; + + @include breakpoint($small) { + float: left; + width: span(5 of 10); + + &:nth-child(2n + 1) { + clear: both; + margin-left: 0; + } + + &:nth-child(2n + 2) { + clear: none; + margin-left: gutter(of 10); + } + } + + @include breakpoint($medium) { + margin-left: 0; /* override margin*/ + margin-right: 0; /* override margin*/ + width: span(3 of 12); + + &:nth-child(2n + 1) { + clear: none; + } + + &:nth-child(4n + 1) { + clear: both; + } + + &:nth-child(4n + 2) { + clear: none; + margin-left: gutter(1 of 12); + } + + &:nth-child(4n + 3) { + clear: none; + margin-left: gutter(1 of 12); + } + + &:nth-child(4n + 4) { + clear: none; + margin-left: gutter(1 of 12); + } + } + + .page__meta { + margin: 0 0 4px; + font-size: 0.6em; + } + + .page__meta-sep { + display: block; + + &::before { + display: none; + } + } + + .archive__item-title { + margin-top: 0.5em; + font-size: $type-size-5; + } + + .archive__item-excerpt { + display: none; + + @include breakpoint($medium) { + display: block; + font-size: $type-size-6; + } + } + + .archive__item-teaser { + @include breakpoint($small) { + max-height: 200px; + } + + @include breakpoint($medium) { + max-height: 120px; + } + } +} + +/* + Features + ========================================================================== */ + +.feature__wrapper { + @include clearfix(); + margin-bottom: 2em; + border-bottom: 1px solid $border-color; + + .archive__item-title { + margin-bottom: 0; + } +} + +.feature__item { + position: relative; + margin-bottom: 2em; + font-size: 1.125em; + + @include breakpoint($small) { + float: left; + margin-bottom: 0; + width: span(4 of 12); + + &:nth-child(3n + 1) { + clear: both; + margin-left: 0; + } + + &:nth-child(3n + 2) { + clear: none; + margin-left: gutter(of 12); + } + + &:nth-child(3n + 3) { + clear: none; + margin-left: gutter(of 12); + } + + .feature__item-teaser { + max-height: 200px; + overflow: hidden; + } + } + + .archive__item-body { + padding-left: gutter(1 of 12); + padding-right: gutter(1 of 12); + } + + a.btn::before { + content: ''; + position: absolute; + left: 0; + top: 0; + right: 0; + bottom: 0; + } + + &--left { + position: relative; + float: left; + margin-left: 0; + margin-right: 0; + width: 100%; + clear: both; + font-size: 1.125em; + + .archive__item { + float: left; + } + + .archive__item-teaser { + margin-bottom: 2em; + } + + a.btn::before { + content: ''; + position: absolute; + left: 0; + top: 0; + right: 0; + bottom: 0; + } + + @include breakpoint($small) { + .archive__item-teaser { + float: left; + width: span(5 of 12); + } + + .archive__item-body { + float: right; + padding-left: gutter(0.5 of 12); + padding-right: gutter(1 of 12); + width: span(7 of 12); + } + } + } + + &--right { + position: relative; + float: left; + margin-left: 0; + margin-right: 0; + width: 100%; + clear: both; + font-size: 1.125em; + + .archive__item { + float: left; + } + + .archive__item-teaser { + margin-bottom: 2em; + } + + a.btn::before { + content: ''; + position: absolute; + left: 0; + top: 0; + right: 0; + bottom: 0; + } + + @include breakpoint($small) { + text-align: right; + + .archive__item-teaser { + float: right; + width: span(5 of 12); + } + + .archive__item-body { + float: left; + width: span(7 of 12); + padding-left: gutter(0.5 of 12); + padding-right: gutter(1 of 12); + } + } + } + + &--center { + position: relative; + float: left; + margin-left: 0; + margin-right: 0; + width: 100%; + clear: both; + font-size: 1.125em; + + .archive__item { + float: left; + width: 100%; + } + + .archive__item-teaser { + margin-bottom: 2em; + } + + a.btn::before { + content: ''; + position: absolute; + left: 0; + top: 0; + right: 0; + bottom: 0; + } + + @include breakpoint($small) { + text-align: center; + + .archive__item-teaser { + margin: 0 auto; + width: span(5 of 12); + } + + .archive__item-body { + margin: 0 auto; + width: span(7 of 12); + } + } + } +} + +/* Place inside an archive layout */ + +.archive { + .feature__wrapper { + .archive__item-title { + margin-top: 0.25em; + font-size: 1em; + } + } + + .feature__item, + .feature__item--left, + .feature__item--center, + .feature__item--right { + font-size: 1em; + } +} + +/* + Wide Pages + ========================================================================== */ + + .wide { + .archive { + @include breakpoint($large) { + padding-right: 0; + } + + @include breakpoint($x-large) { + padding-right: 0; + } + } +} + +/* Place inside a single layout */ + +.layout--single { + .feature__wrapper { + display: inline-block; + } +} diff --git a/src/_sass/minimal-mistakes/_base.scss b/src/_sass/minimal-mistakes/_base.scss new file mode 100644 index 0000000..3796eb6 --- /dev/null +++ b/src/_sass/minimal-mistakes/_base.scss @@ -0,0 +1,357 @@ +/* ========================================================================== + BASE ELEMENTS + ========================================================================== */ + +html { + /* sticky footer fix */ + position: relative; + min-height: 100%; +} + +body { + margin: 0; + padding: 0; + color: $text-color; + font-family: $global-font-family; + line-height: 1.5; + + &.overflow--hidden { + /* when primary navigation is visible, the content in the background won't scroll */ + overflow: hidden; + } +} + +h1, +h2, +h3, +h4, +h5, +h6 { + margin: 2em 0 0.5em; + line-height: 1.2; + font-family: $header-font-family; + font-weight: bold; +} + +h1 { + margin-top: 0; + font-size: $h-size-1; +} + +h2 { + font-size: $h-size-2; +} + +h3 { + font-size: $h-size-3; +} + +h4 { + font-size: $h-size-4; +} + +h5 { + font-size: $h-size-5; +} + +h6 { + font-size: $h-size-6; +} + +small, +.small { + font-size: $type-size-6; +} + +p { + margin-bottom: 1.3em; +} + +u, +ins { + text-decoration: none; + border-bottom: 1px solid $text-color; + a { + color: inherit; + } +} + +del a { + color: inherit; +} + +/* reduce orphans and widows when printing */ + +p, +pre, +blockquote, +ul, +ol, +dl, +figure, +table, +fieldset { + orphans: 3; + widows: 3; +} + +/* abbreviations */ + +abbr[title], +abbr[data-original-title] { + text-decoration: none; + cursor: help; + border-bottom: 1px dotted $text-color; +} + +/* blockquotes */ + +blockquote { + margin: 2em 1em 2em 0; + padding-left: 1em; + padding-right: 1em; + font-style: italic; + border-left: 0.25em solid $primary-color; + + cite { + font-style: italic; + + &:before { + content: "\2014"; + padding-right: 5px; + } + } +} + +/* links */ + +a { + &:focus { + @extend %tab-focus; + } + + &:visited { + color: $link-color-visited; + } + + &:hover { + color: $link-color-hover; + outline: 0; + } +} + +/* buttons */ + +button:focus { + @extend %tab-focus; +} + +/* code */ + +tt, +code, +kbd, +samp, +pre { + font-family: $monospace; +} + +pre { + overflow-x: auto; /* add scrollbars to wide code blocks*/ +} + +p > code, +a > code, +li > code, +figcaption > code, +td > code { + padding-top: 0.1rem; + padding-bottom: 0.1rem; + font-size: 0.8em; + background: $code-background-color; + border-radius: $border-radius; + + &:before, + &:after { + letter-spacing: -0.2em; + content: "\00a0"; /* non-breaking space*/ + } +} + +/* horizontal rule */ + +hr { + display: block; + margin: 1em 0; + border: 0; + border-top: 1px solid $border-color; +} + +/* lists */ + +ul li, +ol li { + margin-bottom: 0.5em; +} + +li ul, +li ol { + margin-top: 0.5em; +} + +/* + Media and embeds + ========================================================================== */ + +/* Figures and images */ + +figure { + display: -webkit-box; + display: flex; + -webkit-box-pack: justify; + justify-content: space-between; + -webkit-box-align: start; + align-items: flex-start; + flex-wrap: wrap; + margin: 2em 0; + + img, + iframe, + .fluid-width-video-wrapper { + margin-bottom: 1em; + } + + img { + width: 100%; + border-radius: $border-radius; + -webkit-transition: $global-transition; + transition: $global-transition; + } + + > a { + display: block; + } + + &.half { + > a, + > img { + @include breakpoint($small) { + width: calc(50% - 0.5em); + } + } + + figcaption { + width: 100%; + } + } + + &.third { + > a, + > img { + @include breakpoint($small) { + width: calc(33.3333% - 0.5em); + } + } + + figcaption { + width: 100%; + } + } +} + +/* Figure captions */ + +figcaption { + margin-bottom: 0.5em; + color: $muted-text-color; + font-family: $caption-font-family; + font-size: $type-size-6; + + a { + -webkit-transition: $global-transition; + transition: $global-transition; + + &:hover { + color: $link-color-hover; + } + } +} + +/* Fix IE9 SVG bug */ + +svg:not(:root) { + overflow: hidden; +} + +/* + Navigation lists + ========================================================================== */ + +/** + * Removes margins, padding, and bullet points from navigation lists + * + * Example usage: + * + */ + +nav { + ul { + margin: 0; + padding: 0; + } + + li { + list-style: none; + } + + a { + text-decoration: none; + } + + /* override white-space for nested lists */ + ul li, + ol li { + margin-bottom: 0; + } + + li ul, + li ol { + margin-top: 0; + } +} + +/* + Global animation transition + ========================================================================== */ + +b, +i, +strong, +em, +blockquote, +p, +q, +span, +figure, +img, +h1, +h2, +header, +input, +a, +tr, +td, +form button, +input[type="submit"], +.btn, +.highlight, +.archive__item-teaser { + -webkit-transition: $global-transition; + transition: $global-transition; +} diff --git a/src/_sass/minimal-mistakes/_buttons.scss b/src/_sass/minimal-mistakes/_buttons.scss new file mode 100644 index 0000000..9ef60a8 --- /dev/null +++ b/src/_sass/minimal-mistakes/_buttons.scss @@ -0,0 +1,97 @@ +/* ========================================================================== + BUTTONS + ========================================================================== */ + +/* + Default button + ========================================================================== */ + +.btn { + /* default */ + display: inline-block; + margin-bottom: 0.25em; + padding: 0.5em 1em; + font-family: $sans-serif; + font-size: $type-size-6; + font-weight: bold; + text-align: center; + text-decoration: none; + border-width: 0; + border-radius: $border-radius; + cursor: pointer; + + .icon { + margin-right: 0.5em; + } + + .icon + .hidden { + margin-left: -0.5em; /* override for hidden text*/ + } + + /* button colors */ + $buttoncolors: + (primary, $primary-color), + (inverse, #fff), + (light-outline, transparent), + (success, $success-color), + (warning, $warning-color), + (danger, $danger-color), + (info, $info-color), + (facebook, $facebook-color), + (twitter, $twitter-color), + (linkedin, $linkedin-color); + + @each $buttoncolor, $color in $buttoncolors { + &--#{$buttoncolor} { + @include yiq-contrasted($color); + @if ($buttoncolor == inverse) { + border: 1px solid $border-color; + } + @if ($buttoncolor == light-outline) { + border: 1px solid #fff; + } + + &:visited { + @include yiq-contrasted($color); + } + + &:hover { + @include yiq-contrasted(mix(#000, $color, 20%)); + } + } + } + + /* fills width of parent container */ + &--block { + display: block; + width: 100%; + + + .btn--block { + margin-top: 0.25em; + } + } + + /* disabled */ + &--disabled { + pointer-events: none; + cursor: not-allowed; + filter: alpha(opacity=65); + box-shadow: none; + opacity: 0.65; + } + + /* extra large button */ + &--x-large { + font-size: $type-size-4; + } + + /* large button */ + &--large { + font-size: $type-size-5; + } + + /* small button */ + &--small { + font-size: $type-size-7; + } +} \ No newline at end of file diff --git a/src/_sass/minimal-mistakes/_footer.scss b/src/_sass/minimal-mistakes/_footer.scss new file mode 100644 index 0000000..c0b0625 --- /dev/null +++ b/src/_sass/minimal-mistakes/_footer.scss @@ -0,0 +1,85 @@ +/* ========================================================================== + FOOTER + ========================================================================== */ + +.page__footer { + @include clearfix; + float: left; + margin-left: 0; + margin-right: 0; + width: 100%; + margin-top: 3em; + color: $muted-text-color; + -webkit-animation: $intro-transition; + animation: $intro-transition; + -webkit-animation-delay: 0.45s; + animation-delay: 0.45s; + background-color: $footer-background-color; + + footer { + @include clearfix; + margin-left: auto; + margin-right: auto; + margin-top: 2em; + max-width: 100%; + padding: 0 1em 2em; + + @include breakpoint($x-large) { + max-width: $x-large; + } + } + + a { + color: inherit; + text-decoration: none; + + &:hover { + text-decoration: underline; + } + } + + .fas, + .fab, + .far, + .fal { + color: $muted-text-color; + } +} + +.page__footer-copyright { + font-family: $global-font-family; + font-size: $type-size-7; +} + +.page__footer-follow { + ul { + margin: 0; + padding: 0; + list-style-type: none; + } + + li { + display: inline-block; + padding-top: 5px; + padding-bottom: 5px; + font-family: $sans-serif-narrow; + font-size: $type-size-6; + text-transform: uppercase; + } + + li + li:before { + content: ""; + padding-right: 5px; + } + + a { + padding-right: 10px; + font-weight: bold; + } + + .social-icons { + a { + white-space: nowrap; + } + } +} diff --git a/src/_sass/minimal-mistakes/_forms.scss b/src/_sass/minimal-mistakes/_forms.scss new file mode 100644 index 0000000..0dd9b48 --- /dev/null +++ b/src/_sass/minimal-mistakes/_forms.scss @@ -0,0 +1,359 @@ +/* ========================================================================== + Forms + ========================================================================== */ + +form { + margin: 0 0 5px 0; + padding: 1em; + background-color: $form-background-color; + + fieldset { + margin-bottom: 5px; + padding: 0; + border-width: 0; + } + + legend { + display: block; + width: 100%; + margin-bottom: 5px * 2; + *margin-left: -7px; + padding: 0; + color: $text-color; + border: 0; + white-space: normal; + } + + p { + margin-bottom: (5px / 2); + } + + ul { + list-style-type: none; + margin: 0 0 5px 0; + padding: 0; + } + + br { + display: none; + } +} + +label, +input, +button, +select, +textarea { + vertical-align: baseline; + *vertical-align: middle; +} + +input, +button, +select, +textarea { + box-sizing: border-box; + font-family: $sans-serif; +} + +label { + display: block; + margin-bottom: 0.25em; + color: $text-color; + cursor: pointer; + + small { + font-size: $type-size-6; + } + + input, + textarea, + select { + display: block; + } +} + +input, +textarea, +select { + display: inline-block; + width: 100%; + padding: 0.25em; + margin-bottom: 0.5em; + color: $text-color; + background-color: $background-color; + border: $border-color; + border-radius: $border-radius; + box-shadow: $box-shadow; +} + +.input-mini { + width: 60px; +} + +.input-small { + width: 90px; +} + +input[type="image"], +input[type="checkbox"], +input[type="radio"] { + width: auto; + height: auto; + padding: 0; + margin: 3px 0; + *margin-top: 0; + line-height: normal; + cursor: pointer; + border-radius: 0; + border: 0 \9; + box-shadow: none; +} + +input[type="checkbox"], +input[type="radio"] { + box-sizing: border-box; + padding: 0; + *width: 13px; + *height: 13px; +} + +input[type="image"] { + border: 0; +} + +input[type="file"] { + width: auto; + padding: initial; + line-height: initial; + border: initial; + background-color: transparent; + background-color: initial; + box-shadow: none; +} + +input[type="button"], +input[type="reset"], +input[type="submit"] { + width: auto; + height: auto; + cursor: pointer; + *overflow: visible; +} + +select, +input[type="file"] { + *margin-top: 4px; +} + +select { + width: auto; + background-color: #fff; +} + +select[multiple], +select[size] { + height: auto; +} + +textarea { + resize: vertical; + height: auto; + overflow: auto; + vertical-align: top; +} + +input[type="hidden"] { + display: none; +} + +.form { + position: relative; +} + +.radio, +.checkbox { + padding-left: 18px; + font-weight: normal; +} + +.radio input[type="radio"], +.checkbox input[type="checkbox"] { + float: left; + margin-left: -18px; +} + +.radio.inline, +.checkbox.inline { + display: inline-block; + padding-top: 5px; + margin-bottom: 0; + vertical-align: middle; +} + +.radio.inline + .radio.inline, +.checkbox.inline + .checkbox.inline { + margin-left: 10px; +} + +/* + Disabled state + ========================================================================== */ + +input[disabled], +select[disabled], +textarea[disabled], +input[readonly], +select[readonly], +textarea[readonly] { + opacity: 0.5; + cursor: not-allowed; +} + +/* + Focus & active state + ========================================================================== */ + +input:focus, +textarea:focus { + border-color: $primary-color; + outline: 0; + outline: thin dotted \9; + box-shadow: inset 0 1px 3px rgba($text-color, 0.06), + 0 0 5px rgba($primary-color, 0.7); +} + +input[type="file"]:focus, +input[type="radio"]:focus, +input[type="checkbox"]:focus, +select:focus { + box-shadow: none; +} + +/* + Help text + ========================================================================== */ + +.help-block, +.help-inline { + color: $muted-text-color; +} + +.help-block { + display: block; + margin-bottom: 1em; + line-height: 1em; +} + +.help-inline { + display: inline-block; + vertical-align: middle; + padding-left: 5px; +} + +/* + .form-group + ========================================================================== */ + +.form-group { + margin-bottom: 5px; + padding: 0; + border-width: 0; +} + +/* + .form-inline + ========================================================================== */ + +.form-inline input, +.form-inline textarea, +.form-inline select { + display: inline-block; + margin-bottom: 0; +} + +.form-inline label { + display: inline-block; +} + +.form-inline .radio, +.form-inline .checkbox, +.form-inline .radio { + padding-left: 0; + margin-bottom: 0; + vertical-align: middle; +} + +.form-inline .radio input[type="radio"], +.form-inline .checkbox input[type="checkbox"] { + float: left; + margin-left: 0; + margin-right: 3px; +} + +/* + .form-search + ========================================================================== */ + +.form-search input, +.form-search textarea, +.form-search select { + display: inline-block; + margin-bottom: 0; +} + +.form-search .search-query { + padding-left: 14px; + padding-right: 14px; + margin-bottom: 0; + border-radius: 14px; +} + +.form-search label { + display: inline-block; +} + +.form-search .radio, +.form-search .checkbox, +.form-inline .radio { + padding-left: 0; + margin-bottom: 0; + vertical-align: middle; +} + +.form-search .radio input[type="radio"], +.form-search .checkbox input[type="checkbox"] { + float: left; + margin-left: 0; + margin-right: 3px; +} + +/* + .form--loading + ========================================================================== */ + +.form--loading:before { + content: ""; +} + +.form--loading .form__spinner { + display: block; +} + +.form:before { + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; + background-color: rgba(255, 255, 255, 0.7); + z-index: 10; +} + +.form__spinner { + display: none; + position: absolute; + top: 50%; + left: 50%; + z-index: 11; +} diff --git a/src/_sass/minimal-mistakes/_masthead.scss b/src/_sass/minimal-mistakes/_masthead.scss new file mode 100644 index 0000000..2dfefcc --- /dev/null +++ b/src/_sass/minimal-mistakes/_masthead.scss @@ -0,0 +1,93 @@ +/* ========================================================================== + MASTHEAD + ========================================================================== */ + +.masthead { + position: relative; + border-bottom: 1px solid $border-color; + -webkit-animation: $intro-transition; + animation: $intro-transition; + -webkit-animation-delay: 0.15s; + animation-delay: 0.15s; + z-index: 20; + + &__inner-wrap { + @include clearfix; + margin-left: auto; + margin-right: auto; + padding: 1em; + max-width: 100%; + display: -webkit-box; + display: -ms-flexbox; + display: flex; + -webkit-box-pack: justify; + -ms-flex-pack: justify; + justify-content: space-between; + font-family: $sans-serif-narrow; + + @include breakpoint($x-large) { + max-width: $max-width; + } + + nav { + z-index: 10; + } + + a { + text-decoration: none; + } + } +} + +.site-logo img { + max-height: 2rem; +} + +.site-title { + display: -webkit-box; + display: -ms-flexbox; + display: flex; + -ms-flex-item-align: center; + align-self: center; + font-weight: bold; + // z-index: 20; +} + +.site-subtitle { + display: block; + font-size: $type-size-8; +} + +.masthead__menu { + float: left; + margin-left: 0; + margin-right: 0; + width: 100%; + clear: both; + + .site-nav { + margin-left: 0; + + @include breakpoint($small) { + float: right; + } + } + + ul { + margin: 0; + padding: 0; + clear: both; + list-style-type: none; + } +} + +.masthead__menu-item { + display: block; + list-style-type: none; + white-space: nowrap; + + &--lg { + padding-right: 2em; + font-weight: 700; + } +} diff --git a/src/_sass/minimal-mistakes/_mixins.scss b/src/_sass/minimal-mistakes/_mixins.scss new file mode 100644 index 0000000..4aa9eb0 --- /dev/null +++ b/src/_sass/minimal-mistakes/_mixins.scss @@ -0,0 +1,92 @@ +/* ========================================================================== + MIXINS + ========================================================================== */ + +%tab-focus { + /* Default*/ + outline: thin dotted $focus-color; + /* Webkit*/ + outline: 5px auto $focus-color; + outline-offset: -2px; +} + +/* + em function + ========================================================================== */ + +@function em($target, $context: $doc-font-size) { + @return ($target / $context) * 1em; +} + + +/* + Bourbon clearfix + ========================================================================== */ + +/* + * Provides an easy way to include a clearfix for containing floats. + * link http://cssmojo.com/latest_new_clearfix_so_far/ + * + * example scss - Usage + * + * .element { + * @include clearfix; + * } + * + * example css - CSS Output + * + * .element::after { + * clear: both; + * content: ""; + * display: table; + * } +*/ + +@mixin clearfix { + clear: both; + + &::after { + clear: both; + content: ""; + display: table; + } +} + +/* + Compass YIQ Color Contrast + https://github.com/easy-designs/yiq-color-contrast + ========================================================================== */ + +@function yiq-is-light( + $color, + $threshold: $yiq-contrasted-threshold +) { + $red: red($color); + $green: green($color); + $blue: blue($color); + + $yiq: (($red*299)+($green*587)+($blue*114))/1000; + + @if $yiq-debug { @debug $yiq, $threshold; } + + @return if($yiq >= $threshold, true, false); +} + +@function yiq-contrast-color( + $color, + $dark: $yiq-contrasted-dark-default, + $light: $yiq-contrasted-light-default, + $threshold: $yiq-contrasted-threshold +) { + @return if(yiq-is-light($color, $threshold), $yiq-contrasted-dark-default, $yiq-contrasted-light-default); +} + +@mixin yiq-contrasted( + $background-color, + $dark: $yiq-contrasted-dark-default, + $light: $yiq-contrasted-light-default, + $threshold: $yiq-contrasted-threshold +) { + background-color: $background-color; + color: yiq-contrast-color($background-color, $dark, $light, $threshold); +} \ No newline at end of file diff --git a/src/_sass/minimal-mistakes/_navigation.scss b/src/_sass/minimal-mistakes/_navigation.scss new file mode 100644 index 0000000..4909c2d --- /dev/null +++ b/src/_sass/minimal-mistakes/_navigation.scss @@ -0,0 +1,573 @@ +/* ========================================================================== + NAVIGATION + ========================================================================== */ + +/* + Breadcrumb navigation links + ========================================================================== */ + +.breadcrumbs { + @include clearfix; + margin: 0 auto; + max-width: 100%; + padding-left: 1em; + padding-right: 1em; + font-family: $sans-serif; + -webkit-animation: $intro-transition; + animation: $intro-transition; + -webkit-animation-delay: 0.3s; + animation-delay: 0.3s; + + @include breakpoint($x-large) { + max-width: $x-large; + } + + ol { + padding: 0; + list-style: none; + font-size: $type-size-6; + + @include breakpoint($large) { + float: right; + width: calc(100% - #{$right-sidebar-width-narrow}); + } + + @include breakpoint($x-large) { + width: calc(100% - #{$right-sidebar-width}); + } + } + + li { + display: inline; + } + + .current { + font-weight: bold; + } +} + +/* + Post pagination navigation links + ========================================================================== */ + +.pagination { + @include clearfix(); + float: left; + margin-top: 1em; + padding-top: 1em; + width: 100%; + + ul { + margin: 0; + padding: 0; + list-style-type: none; + font-family: $sans-serif; + } + + li { + display: block; + float: left; + margin-left: -1px; + + a { + display: block; + margin-bottom: 0.25em; + padding: 0.5em 1em; + font-family: $sans-serif; + font-size: 14px; + font-weight: bold; + line-height: 1.5; + text-align: center; + text-decoration: none; + color: $muted-text-color; + border: 1px solid mix(#000, $border-color, 25%); + border-radius: 0; + + &:hover { + color: $link-color-hover; + } + + &.current, + &.current.disabled { + color: #fff; + background: $primary-color; + } + + &.disabled { + color: rgba($muted-text-color, 0.5); + pointer-events: none; + cursor: not-allowed; + } + } + + &:first-child { + margin-left: 0; + + a { + border-top-left-radius: $border-radius; + border-bottom-left-radius: $border-radius; + } + } + + &:last-child { + a { + border-top-right-radius: $border-radius; + border-bottom-right-radius: $border-radius; + } + } + } + + /* next/previous buttons */ + &--pager { + display: block; + padding: 1em 2em; + float: left; + width: 50%; + font-family: $sans-serif; + font-size: $type-size-5; + font-weight: bold; + text-align: center; + text-decoration: none; + color: $muted-text-color; + border: 1px solid mix(#000, $border-color, 25%); + border-radius: $border-radius; + + &:hover { + @include yiq-contrasted($muted-text-color); + } + + &:first-child { + border-top-right-radius: 0; + border-bottom-right-radius: 0; + } + + &:last-child { + margin-left: -1px; + border-top-left-radius: 0; + border-bottom-left-radius: 0; + } + + &.disabled { + color: rgba($muted-text-color, 0.5); + pointer-events: none; + cursor: not-allowed; + } + } +} + +.page__content + .pagination, +.page__meta + .pagination, +.page__share + .pagination, +.page__comments + .pagination { + margin-top: 2em; + padding-top: 2em; + border-top: 1px solid $border-color; +} + +/* + Priority plus navigation + ========================================================================== */ + +.greedy-nav { + position: relative; + display: -webkit-box; + display: -ms-flexbox; + display: flex; + -webkit-box-align: center; + -ms-flex-align: center; + align-items: center; + min-height: $nav-height; + background: $background-color; + + a { + display: block; + margin: 0 1rem; + color: $masthead-link-color; + text-decoration: none; + -webkit-transition: none; + transition: none; + + &:hover { + color: $masthead-link-color-hover; + } + + &.site-logo { + margin-left: 0; + margin-right: 0.5rem; + } + + &.site-title { + margin-left: 0; + } + } + + img{ + -webkit-transition: none; + transition: none; + } + + &__toggle { + -ms-flex-item-align: center; + align-self: center; + height: $nav-toggle-height; + border: 0; + outline: none; + background-color: transparent; + cursor: pointer; + } + + .visible-links { + display: -webkit-box; + display: -ms-flexbox; + display: flex; + -webkit-box-pack: end; + -ms-flex-pack: end; + justify-content: flex-end; + -webkit-box-flex: 1; + -ms-flex: 1; + flex: 1; + overflow: hidden; + + li { + -webkit-box-flex: 0; + -ms-flex: none; + flex: none; + } + + a { + position: relative; + + &:before { + content: ""; + position: absolute; + left: 0; + bottom: 0; + height: 4px; + background: $primary-color; + width: 100%; + -webkit-transition: $global-transition; + transition: $global-transition; + -webkit-transform: scaleX(0) translate3d(0, 0, 0); + transform: scaleX(0) translate3d(0, 0, 0); // hide + } + + &:hover:before { + -webkit-transform: scaleX(1); + -ms-transform: scaleX(1); + transform: scaleX(1); // reveal + } + } + } + + .hidden-links { + position: absolute; + top: 100%; + right: 0; + margin-top: 15px; + padding: 5px; + border: 1px solid $border-color; + border-radius: $border-radius; + background: $background-color; + -webkit-box-shadow: 0 2px 4px 0 rgba(#000, 0.16), + 0 2px 10px 0 rgba(#000, 0.12); + box-shadow: 0 2px 4px 0 rgba(#000, 0.16), 0 2px 10px 0 rgba(#000, 0.12); + + &.hidden { + display: none; + } + + a { + margin: 0; + padding: 10px 20px; + font-size: $type-size-5; + + &:hover { + color: $masthead-link-color-hover; + background: $navicon-link-color-hover; + } + } + + &:before { + content: ""; + position: absolute; + top: -11px; + right: 10px; + width: 0; + border-style: solid; + border-width: 0 10px 10px; + border-color: $border-color transparent; + display: block; + z-index: 0; + } + + &:after { + content: ""; + position: absolute; + top: -10px; + right: 10px; + width: 0; + border-style: solid; + border-width: 0 10px 10px; + border-color: $background-color transparent; + display: block; + z-index: 1; + } + + li { + display: block; + border-bottom: 1px solid $border-color; + + &:last-child { + border-bottom: none; + } + } + } +} + +.no-js { + .greedy-nav { + .visible-links { + -ms-flex-wrap: wrap; + flex-wrap: wrap; + overflow: visible; + } + } +} + +/* + Navigation list + ========================================================================== */ + +.nav__list { + margin-bottom: 1.5em; + + input[type="checkbox"], + label { + display: none; + } + + @include breakpoint(max-width $large - 1px) { + label { + position: relative; + display: inline-block; + padding: 0.5em 2.5em 0.5em 1em; + color: $gray; + font-size: $type-size-6; + font-weight: bold; + border: 1px solid $light-gray; + border-radius: $border-radius; + z-index: 20; + -webkit-transition: 0.2s ease-out; + transition: 0.2s ease-out; + cursor: pointer; + + &:before, + &:after { + content: ""; + position: absolute; + right: 1em; + top: 1.25em; + width: 0.75em; + height: 0.125em; + line-height: 1; + background-color: $gray; + -webkit-transition: 0.2s ease-out; + transition: 0.2s ease-out; + } + + &:after { + -webkit-transform: rotate(90deg); + -ms-transform: rotate(90deg); + transform: rotate(90deg); + } + + &:hover { + color: #fff; + border-color: $gray; + background-color: mix(white, #000, 20%); + + &:before, + &:after { + background-color: #fff; + } + } + } + + /* selected*/ + input:checked + label { + color: white; + background-color: mix(white, #000, 20%); + + &:before, + &:after { + background-color: #fff; + } + } + + /* on hover show expand*/ + label:hover:after { + -webkit-transform: rotate(90deg); + -ms-transform: rotate(90deg); + transform: rotate(90deg); + } + + input:checked + label:hover:after { + -webkit-transform: rotate(0); + -ms-transform: rotate(0); + transform: rotate(0); + } + + ul { + margin-bottom: 1em; + } + + a { + display: block; + padding: 0.25em 0; + + @include breakpoint($large) { + padding-top: 0.125em; + padding-bottom: 0.125em; + } + + &:hover { + text-decoration: underline; + } + } + } +} + +.nav__list .nav__items { + margin: 0; + font-size: 1.25rem; + + a { + color: inherit; + } + + .active { + margin-left: -0.5em; + padding-left: 0.5em; + padding-right: 0.5em; + font-weight: bold; + } + + @include breakpoint(max-width $large - 1px) { + position: relative; + max-height: 0; + opacity: 0%; + overflow: hidden; + z-index: 10; + -webkit-transition: 0.3s ease-in-out; + transition: 0.3s ease-in-out; + -webkit-transform: translate(0, 10%); + -ms-transform: translate(0, 10%); + transform: translate(0, 10%); + } +} + +@include breakpoint(max-width $large - 1px) { + .nav__list input:checked ~ .nav__items { + -webkit-transition: 0.5s ease-in-out; + transition: 0.5s ease-in-out; + max-height: 9999px; /* exaggerate max-height to accommodate tall lists*/ + overflow: visible; + opacity: 1; + margin-top: 1em; + -webkit-transform: translate(0, 0); + -ms-transform: translate(0, 0); + transform: translate(0, 0); + } +} + +.nav__title { + margin: 0; + padding: 0.5rem 0.75rem; + font-family: $sans-serif-narrow; + font-size: $type-size-5; + font-weight: bold; +} + +.nav__sub-title { + display: block; + margin: 0.5rem 0; + padding: 0.25rem 0; + font-family: $sans-serif-narrow; + font-size: $type-size-6; + font-weight: bold; + text-transform: uppercase; + border-bottom: 1px solid $border-color; +} + +/* + Table of contents navigation + ========================================================================== */ + +.toc { + font-family: $sans-serif-narrow; + color: $gray; + background-color: $background-color; + border: 1px solid $border-color; + border-radius: $border-radius; + -webkit-box-shadow: $box-shadow; + box-shadow: $box-shadow; + + .nav__title { + color: #fff; + font-size: $type-size-6; + background: $primary-color; + border-top-left-radius: $border-radius; + border-top-right-radius: $border-radius; + } + + // Scrollspy marks toc items as .active when they are in focus + .active a { + @include yiq-contrasted($active-color); + } +} + +.toc__menu { + margin: 0; + padding: 0; + width: 100%; + list-style: none; + font-size: $type-size-6; + + @include breakpoint($large) { + font-size: $type-size-7; + } + + a { + display: block; + padding: 0.25rem 0.75rem; + color: $muted-text-color; + font-weight: bold; + line-height: 1.5; + border-bottom: 1px solid $border-color; + + &:hover { + color: $text-color; + } + } + + li ul > li a { + padding-left: 1.25rem; + font-weight: normal; + } + + li ul li ul > li a { + padding-left: 1.75rem; + } + + li ul li ul li ul > li a { + padding-left: 2.25rem; + } + + li ul li ul li ul li ul > li a { + padding-left: 2.75rem; + } + + li ul li ul li ul li ul li ul > li a { + padding-left: 3.25rem + } +} diff --git a/src/_sass/minimal-mistakes/_notices.scss b/src/_sass/minimal-mistakes/_notices.scss new file mode 100644 index 0000000..3a9b5e6 --- /dev/null +++ b/src/_sass/minimal-mistakes/_notices.scss @@ -0,0 +1,105 @@ +/* ========================================================================== + NOTICE TEXT BLOCKS + ========================================================================== */ + +/** + * Default Kramdown usage (no indents!): + *
+ * #### Headline for the Notice + * Text for the notice + *
+ */ + +@mixin notice($notice-color) { + margin: 2em 0 !important; /* override*/ + padding: 1em; + color: $text-color; + font-family: $global-font-family; + font-size: $type-size-6 !important; + text-indent: initial; /* override*/ + background-color: mix($background-color, $notice-color, $notice-background-mix); + border-radius: $border-radius; + box-shadow: 0 1px 1px rgba($notice-color, 0.25); + + h4 { + margin-top: 0 !important; /* override*/ + margin-bottom: 0.75em; + line-height: inherit; + } + + @at-root .page__content #{&} h4 { + /* using at-root to override .page-content h4 font size*/ + margin-bottom: 0; + font-size: 1em; + } + + p { + &:last-child { + margin-bottom: 0 !important; /* override*/ + } + } + + h4 + p { + /* remove space above paragraphs that appear directly after notice headline*/ + margin-top: 0; + padding-top: 0; + } + + a { + color: mix(#000, $notice-color, 10%); + + &:hover { + color: mix(#000, $notice-color, 50%); + } + } + + code { + background-color: mix($background-color, $notice-color, $code-notice-background-mix) + } + + pre code { + background-color: inherit; + } + + ul { + &:last-child { + margin-bottom: 0; /* override*/ + } + } +} + +/* Default notice */ + +.notice { + @include notice($light-gray); +} + +/* Primary notice */ + +.notice--primary { + @include notice($primary-color); +} + +/* Info notice */ + +.notice--info { + @include notice($info-color); +} + +/* Warning notice */ + +.notice--warning { + @include notice($warning-color); +} + +/* Success notice */ + +.notice--success { + @include notice($success-color); +} + +/* Danger notice */ + +.notice--danger { + @include notice($danger-color); +} diff --git a/src/_sass/minimal-mistakes/_page.scss b/src/_sass/minimal-mistakes/_page.scss new file mode 100644 index 0000000..f25f75f --- /dev/null +++ b/src/_sass/minimal-mistakes/_page.scss @@ -0,0 +1,559 @@ +/* ========================================================================== + SINGLE PAGE/POST + ========================================================================== */ + +#main { + @include clearfix; + margin-left: auto; + margin-right: auto; + padding-left: 1em; + padding-right: 1em; + -webkit-animation: $intro-transition; + animation: $intro-transition; + max-width: 100%; + -webkit-animation-delay: 0.15s; + animation-delay: 0.15s; + + @include breakpoint($x-large) { + max-width: $max-width; + } +} + +body { + display: -webkit-box; + display: -ms-flexbox; + display: flex; + min-height: 100vh; + -webkit-box-orient: vertical; + -webkit-box-direction: normal; + -ms-flex-direction: column; + flex-direction: column; +} + +.initial-content, +.search-content { + flex: 1 0 auto; +} + +.page { + @include breakpoint($large) { + float: right; + width: calc(100% - #{$right-sidebar-width-narrow}); + padding-right: $right-sidebar-width-narrow; + } + + @include breakpoint($x-large) { + width: calc(100% - #{$right-sidebar-width}); + padding-right: $right-sidebar-width; + } + + .page__inner-wrap { + float: left; + margin-top: 1em; + margin-left: 0; + margin-right: 0; + width: 100%; + clear: both; + + .page__content, + .page__meta, + .page__share { + position: relative; + float: left; + margin-left: 0; + margin-right: 0; + width: 100%; + clear: both; + } + } +} + +.page__title { + margin-top: 0; + line-height: 1; + + & + .page__meta { + margin-top: -0.5em; + } +} + +.page__lead { + font-family: $global-font-family; + font-size: $type-size-4; +} + +.page__content { + h2 { + padding-bottom: 0.5em; + border-bottom: 1px solid $border-color; + } + + h1, h2, h3, h4, h5, h6 { + .header-link { + position: relative; + left: 0.5em; + opacity: 0; + font-size: 0.8em; + -webkit-transition: opacity 0.2s ease-in-out 0.1s; + -moz-transition: opacity 0.2s ease-in-out 0.1s; + -o-transition: opacity 0.2s ease-in-out 0.1s; + transition: opacity 0.2s ease-in-out 0.1s; + } + + &:hover .header-link { + opacity: 1; + } + } + + p, + li, + dl { + font-size: 1em; + } + + /* paragraph indents */ + p { + margin: 0 0 $indent-var; + + /* sibling indentation*/ + @if $paragraph-indent == true { + & + p { + text-indent: $indent-var; + margin-top: -($indent-var); + } + } + } + + a:not(.btn) { + &:hover { + text-decoration: underline; + + img { + box-shadow: 0 0 10px rgba(#000, 0.25); + } + } + } + + dt { + margin-top: 1em; + font-family: $sans-serif; + font-weight: bold; + } + + dd { + margin-left: 1em; + font-family: $sans-serif; + font-size: $type-size-6; + } + + .small { + font-size: $type-size-6; + } + + /* blockquote citations */ + blockquote + .small { + margin-top: -1.5em; + padding-left: 1.25rem; + } +} + +.page__hero { + position: relative; + margin-bottom: 2em; + @include clearfix; + -webkit-animation: $intro-transition; + animation: $intro-transition; + -webkit-animation-delay: 0.25s; + animation-delay: 0.25s; + + &--overlay { + position: relative; + margin-bottom: 2em; + padding: 3em 0; + @include clearfix; + background-size: cover; + background-repeat: no-repeat; + background-position: center; + -webkit-animation: $intro-transition; + animation: $intro-transition; + -webkit-animation-delay: 0.25s; + animation-delay: 0.25s; + + a { + color: #fff; + } + + .wrapper { + padding-left: 1em; + padding-right: 1em; + + @include breakpoint($x-large) { + max-width: $x-large; + } + } + + .page__title, + .page__meta, + .page__lead, + .btn { + color: #fff; + text-shadow: 1px 1px 4px rgba(#000, 0.5); + } + + .page__lead { + max-width: $medium; + } + + .page__title { + font-size: $type-size-2; + + @include breakpoint($small) { + font-size: $type-size-1; + } + } + } +} + +.page__hero-image { + width: 100%; + height: auto; + -ms-interpolation-mode: bicubic; +} + +.page__hero-caption { + position: absolute; + bottom: 0; + right: 0; + margin: 0 auto; + padding: 2px 5px; + color: #fff; + font-family: $caption-font-family; + font-size: $type-size-7; + background: #000; + text-align: right; + z-index: 5; + opacity: 0.5; + border-radius: $border-radius 0 0 0; + + @include breakpoint($large) { + padding: 5px 10px; + } + + a { + color: #fff; + text-decoration: none; + } +} + +/* + Social sharing + ========================================================================== */ + +.page__share { + margin-top: 2em; + padding-top: 1em; + border-top: 1px solid $border-color; + + @include breakpoint(max-width $small) { + .btn span { + border: 0; + clip: rect(0 0 0 0); + height: 1px; + margin: -1px; + overflow: hidden; + padding: 0; + position: absolute; + width: 1px; + } + } +} + +.page__share-title { + margin-bottom: 10px; + font-size: $type-size-6; + text-transform: uppercase; +} + +/* + Page meta + ========================================================================== */ + +.page__meta { + margin-top: 2em; + color: $muted-text-color; + font-family: $sans-serif; + font-size: $type-size-6; + + p { + margin: 0; + } + + a { + color: inherit; + } +} + +.page__meta-title { + margin-bottom: 10px; + font-size: $type-size-6; + text-transform: uppercase; +} + +.page__meta-sep::before { + content: "\2022"; + padding-left: 0.5em; + padding-right: 0.5em; +} + +/* + Page taxonomy + ========================================================================== */ + +.page__taxonomy { + .sep { + display: none; + } + + strong { + margin-right: 10px; + } +} + +.page__taxonomy-item { + display: inline-block; + margin-right: 5px; + margin-bottom: 8px; + padding: 5px 10px; + text-decoration: none; + border: 1px solid mix(#000, $border-color, 25%); + border-radius: $border-radius; + + &:hover { + text-decoration: none; + color: $link-color-hover; + } +} + +.taxonomy__section { + margin-bottom: 2em; + padding-bottom: 1em; + + &:not(:last-child) { + border-bottom: solid 1px $border-color; + } + + .archive__item-title { + margin-top: 0; + } + + .archive__subtitle { + clear: both; + border: 0; + } + + + .taxonomy__section { + margin-top: 2em; + } +} + +.taxonomy__title { + margin-bottom: 0.5em; + color: $muted-text-color; +} + +.taxonomy__count { + color: $muted-text-color; +} + +.taxonomy__index { + display: grid; + grid-column-gap: 2em; + grid-template-columns: repeat(2, 1fr); + margin: 1.414em 0; + padding: 0; + font-size: 0.75em; + list-style: none; + + @include breakpoint($large) { + grid-template-columns: repeat(3, 1fr); + } + + a { + display: -webkit-box; + display: -ms-flexbox; + display: flex; + padding: 0.25em 0; + -webkit-box-pack: justify; + -ms-flex-pack: justify; + justify-content: space-between; + color: inherit; + text-decoration: none; + border-bottom: 1px solid $border-color; + } +} + +.back-to-top { + display: block; + clear: both; + color: $muted-text-color; + font-size: 0.6em; + text-transform: uppercase; + text-align: right; + text-decoration: none; +} + +/* + Comments + ========================================================================== */ + +.page__comments { + float: left; + margin-left: 0; + margin-right: 0; + width: 100%; + clear: both; +} + +.page__comments-title { + margin-top: 2rem; + margin-bottom: 10px; + padding-top: 2rem; + font-size: $type-size-6; + border-top: 1px solid $border-color; + text-transform: uppercase; +} + +.page__comments-form { + -webkit-transition: $global-transition; + transition: $global-transition; + + &.disabled { + input, + button, + textarea, + label { + pointer-events: none; + cursor: not-allowed; + filter: alpha(opacity=65); + box-shadow: none; + opacity: 0.65; + } + } +} + +.comment { + @include clearfix(); + margin: 1em 0; + + &:not(:last-child) { + border-bottom: 1px solid $border-color; + } +} + +.comment__avatar-wrapper { + float: left; + width: 60px; + height: 60px; + + @include breakpoint($large) { + width: 100px; + height: 100px; + } +} + +.comment__avatar { + width: 40px; + height: 40px; + border-radius: 50%; + + @include breakpoint($large) { + width: 80px; + height: 80px; + padding: 5px; + border: 1px solid $border-color; + } +} + +.comment__content-wrapper { + float: right; + width: calc(100% - 60px); + + @include breakpoint($large) { + width: calc(100% - 100px); + } +} + +.comment__author { + margin: 0; + + a { + text-decoration: none; + } +} + +.comment__date { + @extend .page__meta; + margin: 0; + + a { + text-decoration: none; + } +} + +/* + Related + ========================================================================== */ + +.page__related { + @include clearfix(); + float: left; + margin-top: 2em; + padding-top: 1em; + border-top: 1px solid $border-color; + + @include breakpoint($large) { + float: right; + width: calc(100% - #{$right-sidebar-width-narrow}); + } + + @include breakpoint($x-large) { + width: calc(100% - #{$right-sidebar-width}); + } + + a { + color: inherit; + text-decoration: none; + } +} + +.page__related-title { + margin-bottom: 10px; + font-size: $type-size-6; + text-transform: uppercase; +} + +/* + Wide Pages + ========================================================================== */ + +.wide { + .page { + @include breakpoint($large) { + padding-right: 0; + } + + @include breakpoint($x-large) { + padding-right: 0; + } + } + + .page__related { + @include breakpoint($large) { + padding-right: 0; + } + + @include breakpoint($x-large) { + padding-right: 0; + } + } +} diff --git a/src/_sass/minimal-mistakes/_print.scss b/src/_sass/minimal-mistakes/_print.scss new file mode 100644 index 0000000..b93f1d4 --- /dev/null +++ b/src/_sass/minimal-mistakes/_print.scss @@ -0,0 +1,252 @@ +/* ========================================================================== + PRINT STYLES + ========================================================================== */ + +@media print { + + [hidden] { + display: none; + } + + * { + -moz-box-sizing: border-box; + -webkit-box-sizing: border-box; + box-sizing: border-box; + } + + html { + margin: 0; + padding: 0; + min-height: auto !important; + font-size: 16px; + } + + body { + margin: 0 auto; + background: #fff !important; + color: #000 !important; + font-size: 1rem; + line-height: 1.5; + -moz-osx-font-smoothing: grayscale; + -webkit-font-smoothing: antialiased; + text-rendering: optimizeLegibility; + } + + h1, + h2, + h3, + h4, + h5, + h6 { + color: #000; + line-height: 1.2; + margin-bottom: 0.75rem; + margin-top: 0; + } + + h1 { + font-size: 2.5rem; + } + + h2 { + font-size: 2rem; + } + + h3 { + font-size: 1.75rem; + } + + h4 { + font-size: 1.5rem; + } + + h5 { + font-size: 1.25rem; + } + + h6 { + font-size: 1rem; + } + + a, + a:visited { + color: #000; + text-decoration: underline; + word-wrap: break-word; + } + + table { + border-collapse: collapse; + } + + thead { + display: table-header-group; + } + + table, + th, + td { + border-bottom: 1px solid #000; + } + + td, + th { + padding: 8px 16px; + } + + img { + border: 0; + display: block; + max-width: 100% !important; + vertical-align: middle; + } + + hr { + border: 0; + border-bottom: 2px solid #bbb; + height: 0; + margin: 2.25rem 0; + padding: 0; + } + + dt { + font-weight: bold; + } + + dd { + margin: 0; + margin-bottom: 0.75rem; + } + + abbr[title], + acronym[title] { + border: 0; + text-decoration: none; + } + + table, + blockquote, + pre, + code, + figure, + li, + hr, + ul, + ol, + a, + tr { + page-break-inside: avoid; + } + + h2, + h3, + h4, + p, + a { + orphans: 3; + widows: 3; + } + + h1, + h2, + h3, + h4, + h5, + h6 { + page-break-after: avoid; + page-break-inside: avoid; + } + + h1 + p, + h2 + p, + h3 + p { + page-break-before: avoid; + } + + img { + page-break-after: auto; + page-break-before: auto; + page-break-inside: avoid; + } + + pre { + white-space: pre-wrap !important; + word-wrap: break-word; + } + + a[href^='http://']:after, + a[href^='https://']:after, + a[href^='ftp://']:after { + content: " (" attr(href) ")"; + font-size: 80%; + } + + abbr[title]:after, + acronym[title]:after { + content: " (" attr(title) ")"; + } + + #main { + max-width: 100%; + } + + .page { + margin: 0; + padding: 0; + width: 100%; + } + + .page-break, + .page-break-before { + page-break-before: always; + } + + .page-break-after { + page-break-after: always; + } + + .no-print { + display: none; + } + + a.no-reformat:after { + content: ''; + } + + abbr[title].no-reformat:after, + acronym[title].no-reformat:after { + content: ''; + } + + .page__hero-caption { + color: #000 !important; + background: #fff !important; + opacity: 1; + + a { + color: #000 !important; + } + } + +/* + Hide the following elements on print + ========================================================================== */ + + .masthead, + .toc, + .page__share, + .page__related, + .pagination, + .ads, + .page__footer, + .page__comments-form, + .author__avatar, + .author__content, + .author__urls-wrapper, + .nav__list, + .sidebar, + .adsbygoogle { + display: none !important; + height: 1px !important; + } +} \ No newline at end of file diff --git a/src/_sass/minimal-mistakes/_reset.scss b/src/_sass/minimal-mistakes/_reset.scss new file mode 100644 index 0000000..2259fd0 --- /dev/null +++ b/src/_sass/minimal-mistakes/_reset.scss @@ -0,0 +1,187 @@ +/* ========================================================================== + STYLE RESETS + ========================================================================== */ + +* { box-sizing: border-box; } + +html { + /* apply a natural box layout model to all elements */ + box-sizing: border-box; + background-color: $background-color; + font-size: 16px; + + @include breakpoint($medium) { + font-size: 18px; + } + + @include breakpoint($large) { + font-size: 20px; + } + + @include breakpoint($x-large) { + font-size: 22px; + } + + -webkit-text-size-adjust: 100%; + -ms-text-size-adjust: 100%; +} + +/* Remove margin */ + +body { margin: 0; } + +/* Selected elements */ + +::-moz-selection { + color: #fff; + background: #000; +} + +::selection { + color: #fff; + background: #000; +} + +/* Display HTML5 elements in IE6-9 and FF3 */ + +article, +aside, +details, +figcaption, +figure, +footer, +header, +hgroup, +main, +nav, +section { + display: block; +} + +/* Display block in IE6-9 and FF3 */ + +audio, +canvas, +video { + display: inline-block; + *display: inline; + *zoom: 1; +} + +/* Prevents modern browsers from displaying 'audio' without controls */ + +audio:not([controls]) { + display: none; +} + +a { + color: $link-color; +} + +/* Apply focus state */ + +a:focus { + @extend %tab-focus; +} + +/* Remove outline from links */ + +a:hover, +a:active { + outline: 0; +} + +/* Prevent sub and sup affecting line-height in all browsers */ + +sub, +sup { + position: relative; + font-size: 75%; + line-height: 0; + vertical-align: baseline; +} + +sup { + top: -0.5em; +} + +sub { + bottom: -0.25em; +} + +/* img border in anchor's and image quality */ + +img { + /* Responsive images (ensure images don't scale beyond their parents) */ + max-width: 100%; /* part 1: Set a maximum relative to the parent*/ + width: auto\9; /* IE7-8 need help adjusting responsive images*/ + height: auto; /* part 2: Scale the height according to the width, otherwise you get stretching*/ + + vertical-align: middle; + border: 0; + -ms-interpolation-mode: bicubic; +} + +/* Prevent max-width from affecting Google Maps */ + +#map_canvas img, +.google-maps img { + max-width: none; +} + +/* Consistent form font size in all browsers, margin changes, misc */ + +button, +input, +select, +textarea { + margin: 0; + font-size: 100%; + vertical-align: middle; +} + +button, +input { + *overflow: visible; /* inner spacing ie IE6/7*/ + line-height: normal; /* FF3/4 have !important on line-height in UA stylesheet*/ +} + +button::-moz-focus-inner, +input::-moz-focus-inner { /* inner padding and border oddities in FF3/4*/ + padding: 0; + border: 0; +} + +button, +html input[type="button"], // avoid the WebKit bug in Android 4.0.* where (2) destroys native `audio` and `video` controls +input[type="reset"], +input[type="submit"] { + -webkit-appearance: button; /* corrects inability to style clickable `input` types in iOS*/ + cursor: pointer; /* improves usability and consistency of cursor style between image-type `input` and others*/ +} + +label, +select, +button, +input[type="button"], +input[type="reset"], +input[type="submit"], +input[type="radio"], +input[type="checkbox"] { + cursor: pointer; /* improves usability and consistency of cursor style between image-type `input` and others*/ +} + +input[type="search"] { /* Appearance in Safari/Chrome*/ + box-sizing: border-box; + -webkit-appearance: textfield; +} + +input[type="search"]::-webkit-search-decoration, +input[type="search"]::-webkit-search-cancel-button { + -webkit-appearance: none; /* inner-padding issues in Chrome OSX, Safari 5*/ +} + +textarea { + overflow: auto; /* remove vertical scrollbar in IE6-9*/ + vertical-align: top; /* readability and alignment cross-browser*/ +} \ No newline at end of file diff --git a/src/_sass/minimal-mistakes/_search.scss b/src/_sass/minimal-mistakes/_search.scss new file mode 100644 index 0000000..fa7ee83 --- /dev/null +++ b/src/_sass/minimal-mistakes/_search.scss @@ -0,0 +1,132 @@ +/* ========================================================================== + SEARCH + ========================================================================== */ + +.layout--search { + .archive__item-teaser { + margin-bottom: 0.25em; + } +} + +.search__toggle { + margin-left: 1rem; + margin-right: 1rem; + height: $nav-toggle-height; + border: 0; + outline: none; + color: $primary-color; + background-color: transparent; + cursor: pointer; + -webkit-transition: 0.2s; + transition: 0.2s; + + &:hover { + color: mix(#000, $primary-color, 25%); + } +} + +.search-icon { + width: 100%; + height: 100%; +} + +.search-content { + display: none; + visibility: hidden; + padding-top: 1em; + padding-bottom: 1em; + + &__inner-wrap { + width: 100%; + margin-left: auto; + margin-right: auto; + padding-left: 1em; + padding-right: 1em; + -webkit-animation: $intro-transition; + animation: $intro-transition; + -webkit-animation-delay: 0.15s; + animation-delay: 0.15s; + + @include breakpoint($x-large) { + max-width: $max-width; + } + + } + + &__form { + background-color: transparent; + } + + .search-input { + display: block; + margin-bottom: 0; + padding: 0; + border: none; + outline: none; + box-shadow: none; + background-color: transparent; + font-size: $type-size-3; + + @include breakpoint($large) { + font-size: $type-size-2; + } + + @include breakpoint($x-large) { + font-size: $type-size-1; + } + } + + &.is--visible { + display: block; + visibility: visible; + + &::after { + content: ""; + display: block; + } + } + + .results__found { + margin-top: 0.5em; + font-size: $type-size-6; + } + + .archive__item { + margin-bottom: 2em; + + @include breakpoint($large) { + width: 75%; + } + + @include breakpoint($x-large) { + width: 50%; + } + } + + .archive__item-title { + margin-top: 0; + } + + .archive__item-excerpt { + margin-bottom: 0; + } +} + +/* Algolia search */ + +.ais-search-box { + max-width: 100% !important; + margin-bottom: 2em; +} + +.archive__item-title .ais-Highlight { + color: $primary-color; + font-style: normal; + text-decoration: underline; +} + +.archive__item-excerpt .ais-Highlight { + color: $primary-color; + font-style: normal; + font-weight: bold; +} diff --git a/src/_sass/minimal-mistakes/_sidebar.scss b/src/_sass/minimal-mistakes/_sidebar.scss new file mode 100644 index 0000000..b1f5ca9 --- /dev/null +++ b/src/_sass/minimal-mistakes/_sidebar.scss @@ -0,0 +1,346 @@ +/* ========================================================================== + SIDEBAR + ========================================================================== */ + +/* + Default + ========================================================================== */ + +.sidebar { + @include clearfix(); + // @include breakpoint(max-width $large) { + // /* fix z-index order of follow links */ + // position: relative; + // z-index: 10; + // -webkit-transform: translate3d(0, 0, 0); + // transform: translate3d(0, 0, 0); + // } + + @include breakpoint($large) { + float: left; + width: calc(#{$right-sidebar-width-narrow} - 1em); + opacity: 0.75; + -webkit-transition: opacity 0.2s ease-in-out; + transition: opacity 0.2s ease-in-out; + + &:hover { + opacity: 1; + } + + &.sticky { + overflow-y: auto; + /* calculate height of nav list + viewport height - nav height - masthead x-padding + */ + max-height: calc(100vh - #{$nav-height} - 2em); + } + } + + @include breakpoint($x-large) { + width: calc(#{$right-sidebar-width} - 1em); + } + + > * { + margin-top: 1em; + margin-bottom: 1em; + } + + h2, + h3, + h4, + h5, + h6 { + margin-bottom: 0; + font-family: $sans-serif-narrow; + } + + p, + li { + font-family: $sans-serif; + font-size: $type-size-6; + line-height: 1.5; + } + + img { + width: 100%; + + &.emoji { + width: 20px; + height: 20px; + } + } +} + +.sidebar__right { + margin-bottom: 1em; + + @include breakpoint($large) { + position: absolute; + top: 0; + right: 0; + width: $right-sidebar-width-narrow; + margin-right: -1 * $right-sidebar-width-narrow; + padding-left: 1em; + z-index: 10; + + &.sticky { + @include clearfix(); + position: -webkit-sticky; + position: sticky; + top: 2em; + float: right; + } + } + + @include breakpoint($x-large) { + width: $right-sidebar-width; + margin-right: -1 * $right-sidebar-width; + } +} + +.splash .sidebar__right { + @include breakpoint($large) { + position: relative; + float: right; + margin-right: 0; + } + + @include breakpoint($x-large) { + margin-right: 0; + } +} + +/* + Author profile and links + ========================================================================== */ + +.author__avatar { + display: table-cell; + vertical-align: top; + width: 36px; + height: 36px; + + @include breakpoint($large) { + display: block; + width: auto; + height: auto; + } + + img { + max-width: 110px; + border-radius: 50%; + + @include breakpoint($large) { + padding: 5px; + border: 1px solid $border-color; + } + } +} + +.author__content { + display: table-cell; + vertical-align: top; + padding-left: 15px; + padding-right: 25px; + line-height: 1; + + @include breakpoint($large) { + display: block; + width: 100%; + padding-left: 0; + padding-right: 0; + } + + a { + color: inherit; + text-decoration: none; + } +} + +.author__name { + margin: 0; + + @include breakpoint($large) { + margin-top: 10px; + margin-bottom: 10px; + } +} +.sidebar .author__name { + font-family: $sans-serif; + font-size: $type-size-5; +} + +.author__bio { + margin: 0; + + @include breakpoint($large) { + margin-top: 10px; + margin-bottom: 20px; + } +} + +.author__urls-wrapper { + position: relative; + display: table-cell; + vertical-align: middle; + font-family: $sans-serif; + z-index: 20; + cursor: pointer; + + li:last-child { + a { + margin-bottom: 0; + } + } + + .author__urls { + span.label { + padding-left: 5px; + } + } + + @include breakpoint($large) { + display: block; + } + + button { + position: relative; + margin-bottom: 0; + + &:before { + @supports (pointer-events: none) { + content: ''; + position: fixed; + top: 0; + left: 0; + width: 100%; + height: 100%; + pointer-events: none; + } + } + + &.open { + &:before { + pointer-events: auto; + } + } + + @include breakpoint($large) { + display: none; + } + } +} + +.author__urls { + display: none; + position: absolute; + right: 0; + margin-top: 15px; + padding: 10px; + list-style-type: none; + border: 1px solid $border-color; + border-radius: $border-radius; + background: $background-color; + box-shadow: 0 2px 4px 0 rgba(#000, 0.16), 0 2px 10px 0 rgba(#000, 0.12); + cursor: default; + + &.is--visible { + display: block; + } + + @include breakpoint($large) { + display: block; + position: relative; + margin: 0; + padding: 0; + border: 0; + background: transparent; + box-shadow: none; + } + + &:before { + display: block; + content: ""; + position: absolute; + top: -11px; + left: calc(50% - 10px); + width: 0; + border-style: solid; + border-width: 0 10px 10px; + border-color: $border-color transparent; + z-index: 0; + + @include breakpoint($large) { + display: none; + } + } + + &:after { + display: block; + content: ""; + position: absolute; + top: -10px; + left: calc(50% - 10px); + width: 0; + border-style: solid; + border-width: 0 10px 10px; + border-color: $background-color transparent; + z-index: 1; + + @include breakpoint($large) { + display: none; + } + } + + ul { + padding: 10px; + list-style-type: none; + } + + li { + white-space: nowrap; + } + + a { + display: block; + margin-bottom: 5px; + padding-right: 5px; + padding-top: 2px; + padding-bottom: 2px; + color: inherit; + font-size: $type-size-5; + text-decoration: none; + + &:hover { + text-decoration: underline; + } + } +} + +/* + Wide Pages + ========================================================================== */ + +.wide .sidebar__right { + margin-bottom: 1em; + + @include breakpoint($large) { + position: initial; + top: initial; + right: initial; + width: initial; + margin-right: initial; + padding-left: initial; + z-index: initial; + + &.sticky { + float: none; + } + } + + @include breakpoint($x-large) { + width: initial; + margin-right: initial; + } +} + diff --git a/src/_sass/minimal-mistakes/_syntax.scss b/src/_sass/minimal-mistakes/_syntax.scss new file mode 100644 index 0000000..7265202 --- /dev/null +++ b/src/_sass/minimal-mistakes/_syntax.scss @@ -0,0 +1,324 @@ +/* ========================================================================== + Syntax highlighting + ========================================================================== */ + +div.highlighter-rouge, +figure.highlight { + position: relative; + margin-bottom: 1em; + background: $base00; + color: $base05; + font-family: $monospace; + font-size: $type-size-6; + line-height: 1.8; + border-radius: $border-radius; + + > pre, + pre.highlight { + margin: 0; + padding: 1em; + } +} + +.highlight table { + margin-bottom: 0; + font-size: 1em; + border: 0; + + td { + padding: 0; + width: calc(100% - 1em); + border: 0; + + /* line numbers*/ + &.gutter, + &.rouge-gutter { + padding-right: 1em; + width: 1em; + color: $base04; + border-right: 1px solid $base04; + text-align: right; + } + + /* code */ + &.code, + &.rouge-code { + padding-left: 1em; + } + } + + pre { + margin: 0; + } +} + +.highlight pre { + width: 100%; +} + +.highlight .hll { + background-color: $base06; +} +.highlight { + .c { + /* Comment */ + color: $base04; + } + .err { + /* Error */ + color: $base08; + } + .k { + /* Keyword */ + color: $base0e; + } + .l { + /* Literal */ + color: $base09; + } + .n { + /* Name */ + color: $base05; + } + .o { + /* Operator */ + color: $base0c; + } + .p { + /* Punctuation */ + color: $base05; + } + .cm { + /* Comment.Multiline */ + color: $base04; + } + .cp { + /* Comment.Preproc */ + color: $base04; + } + .c1 { + /* Comment.Single */ + color: $base04; + } + .cs { + /* Comment.Special */ + color: $base04; + } + .gd { + /* Generic.Deleted */ + color: $base08; + } + .ge { + /* Generic.Emph */ + font-style: italic; + } + .gh { + /* Generic.Heading */ + color: $base05; + font-weight: bold; + } + .gi { + /* Generic.Inserted */ + color: $base0b; + } + .gp { + /* Generic.Prompt */ + color: $base04; + font-weight: bold; + } + .gs { + /* Generic.Strong */ + font-weight: bold; + } + .gu { + /* Generic.Subheading */ + color: $base0c; + font-weight: bold; + } + .kc { + /* Keyword.Constant */ + color: $base0e; + } + .kd { + /* Keyword.Declaration */ + color: $base0e; + } + .kn { + /* Keyword.Namespace */ + color: $base0c; + } + .kp { + /* Keyword.Pseudo */ + color: $base0e; + } + .kr { + /* Keyword.Reserved */ + color: $base0e; + } + .kt { + /* Keyword.Type */ + color: $base0a; + } + .ld { + /* Literal.Date */ + color: $base0b; + } + .m { + /* Literal.Number */ + color: $base09; + } + .s { + /* Literal.String */ + color: $base0b; + } + .na { + /* Name.Attribute */ + color: $base0d; + } + .nb { + /* Name.Builtin */ + color: $base05; + } + .nc { + /* Name.Class */ + color: $base0a; + } + .no { + /* Name.Constant */ + color: $base08; + } + .nd { + /* Name.Decorator */ + color: $base0c; + } + .ni { + /* Name.Entity */ + color: $base05; + } + .ne { + /* Name.Exception */ + color: $base08; + } + .nf { + /* Name.Function */ + color: $base0d; + } + .nl { + /* Name.Label */ + color: $base05; + } + .nn { + /* Name.Namespace */ + color: $base0a; + } + .nx { + /* Name.Other */ + color: $base0d; + } + .py { + /* Name.Property */ + color: $base05; + } + .nt { + /* Name.Tag */ + color: $base0c; + } + .nv { + /* Name.Variable */ + color: $base08; + } + .ow { + /* Operator.Word */ + color: $base0c; + } + .w { + /* Text.Whitespace */ + color: $base05; + } + .mf { + /* Literal.Number.Float */ + color: $base09; + } + .mh { + /* Literal.Number.Hex */ + color: $base09; + } + .mi { + /* Literal.Number.Integer */ + color: $base09; + } + .mo { + /* Literal.Number.Oct */ + color: $base09; + } + .sb { + /* Literal.String.Backtick */ + color: $base0b; + } + .sc { + /* Literal.String.Char */ + color: $base05; + } + .sd { + /* Literal.String.Doc */ + color: $base04; + } + .s2 { + /* Literal.String.Double */ + color: $base0b; + } + .se { + /* Literal.String.Escape */ + color: $base09; + } + .sh { + /* Literal.String.Heredoc */ + color: $base0b; + } + .si { + /* Literal.String.Interpol */ + color: $base09; + } + .sx { + /* Literal.String.Other */ + color: $base0b; + } + .sr { + /* Literal.String.Regex */ + color: $base0b; + } + .s1 { + /* Literal.String.Single */ + color: $base0b; + } + .ss { + /* Literal.String.Symbol */ + color: $base0b; + } + .bp { + /* Name.Builtin.Pseudo */ + color: $base05; + } + .vc { + /* Name.Variable.Class */ + color: $base08; + } + .vg { + /* Name.Variable.Global */ + color: $base08; + } + .vi { + /* Name.Variable.Instance */ + color: $base08; + } + .il { + /* Literal.Number.Integer.Long */ + color: $base09; + } +} + +.gist { + th, td { + border-bottom: 0; + } +} \ No newline at end of file diff --git a/src/_sass/minimal-mistakes/_tables.scss b/src/_sass/minimal-mistakes/_tables.scss new file mode 100644 index 0000000..c270a77 --- /dev/null +++ b/src/_sass/minimal-mistakes/_tables.scss @@ -0,0 +1,39 @@ +/* ========================================================================== + TABLES + ========================================================================== */ + +table { + display: block; + margin-bottom: 1em; + width: 100%; + font-family: $global-font-family; + font-size: $type-size-6; + border-collapse: collapse; + overflow-x: auto; + + & + table { + margin-top: 1em; + } +} + +thead { + background-color: $border-color; + border-bottom: 2px solid mix(#000, $border-color, 25%); +} + +th { + padding: 0.5em; + font-weight: bold; + text-align: left; +} + +td { + padding: 0.5em; + border-bottom: 1px solid mix(#000, $border-color, 25%); +} + +tr, +td, +th { + vertical-align: middle; +} \ No newline at end of file diff --git a/src/_sass/minimal-mistakes/_utilities.scss b/src/_sass/minimal-mistakes/_utilities.scss new file mode 100644 index 0000000..1c127d3 --- /dev/null +++ b/src/_sass/minimal-mistakes/_utilities.scss @@ -0,0 +1,593 @@ +/* ========================================================================== + UTILITY CLASSES + ========================================================================== */ + +/* + Visibility + ========================================================================== */ + +/* http://www.456bereastreet.com/archive/200711/screen_readers_sometimes_ignore_displaynone/ */ + +.hidden, +.is--hidden { + display: none; + visibility: hidden; +} + +/* for preloading images */ + +.load { + display: none; +} + +.transparent { + opacity: 0; +} + +/* https://developer.yahoo.com/blogs/ydn/clip-hidden-content-better-accessibility-53456.html */ + +.visually-hidden, +.screen-reader-text, +.screen-reader-text span, +.screen-reader-shortcut { + position: absolute !important; + clip: rect(1px, 1px, 1px, 1px); + height: 1px !important; + width: 1px !important; + border: 0 !important; + overflow: hidden; +} + +body:hover .visually-hidden a, +body:hover .visually-hidden input, +body:hover .visually-hidden button { + display: none !important; +} + +/* screen readers */ + +.screen-reader-text:focus, +.screen-reader-shortcut:focus { + clip: auto !important; + height: auto !important; + width: auto !important; + display: block; + font-size: 1em; + font-weight: bold; + padding: 15px 23px 14px; + background: #fff; + z-index: 100000; + text-decoration: none; + box-shadow: 0 0 2px 2px rgba(0, 0, 0, 0.6); +} + +/* + Skip links + ========================================================================== */ + +.skip-link { + position: fixed; + z-index: 20; + margin: 0; + font-family: $sans-serif; + white-space: nowrap; +} + +.skip-link li { + height: 0; + width: 0; + list-style: none; +} + +/* + Type + ========================================================================== */ + +.text-left { + text-align: left; +} + +.text-center { + text-align: center; +} + +.text-right { + text-align: right; +} + +.text-justify { + text-align: justify; +} + +.text-nowrap { + white-space: nowrap; +} + +/* + Task lists + ========================================================================== */ + +.task-list { + padding:0; + + li { + list-style-type: none; + } + + .task-list-item-checkbox { + margin-right: 0.5em; + opacity: 1; + } +} + +.task-list .task-list { + margin-left: 1em; +} + +/* + Alignment + ========================================================================== */ + +/* clearfix */ + +.cf { + clear: both; +} + +.wrapper { + margin-left: auto; + margin-right: auto; + width: 100%; +} + +/* + Images + ========================================================================== */ + +/* image align left */ + +.align-left { + display: block; + margin-left: auto; + margin-right: auto; + + @include breakpoint($small) { + float: left; + margin-right: 1em; + } +} + +/* image align right */ + +.align-right { + display: block; + margin-left: auto; + margin-right: auto; + + @include breakpoint($small) { + float: right; + margin-left: 1em; + } +} + +/* image align center */ + +.align-center { + display: block; + margin-left: auto; + margin-right: auto; +} + +/* file page content container */ + +.full { + @include breakpoint($large) { + margin-right: -1 * span(2.5 of 12) !important; + } +} + +/* + Icons + ========================================================================== */ + +.icon { + display: inline-block; + fill: currentColor; + width: 1em; + height: 1.1em; + line-height: 1; + position: relative; + top: -0.1em; + vertical-align: middle; +} + +/* social icons*/ + +.social-icons { + .fas, + .fab, + .far, + .fal { + color: $text-color; + } + + .fa-behance, + .fa-behance-square { + color: $behance-color; + } + + .fa-bitbucket { + color: $bitbucket-color; + } + + .fa-dribbble, + .fa-dribble-square { + color: $dribbble-color; + } + + .fa-facebook, + .fa-facebook-square, + .fa-facebook-f { + color: $facebook-color; + } + + .fa-flickr { + color: $flickr-color; + } + + .fa-foursquare { + color: $foursquare-color; + } + + .fa-github, + .fa-github-alt, + .fa-github-square { + color: $github-color; + } + + .fa-gitlab { + color: $gitlab-color; + } + + .fa-instagram { + color: $instagram-color; + } + + .fa-keybase { + color: $keybase-color; + } + + .fa-lastfm, + .fa-lastfm-square { + color: $lastfm-color; + } + + .fa-linkedin, + .fa-linkedin-in { + color: $linkedin-color; + } + + .fa-mastodon, + .fa-mastodon-square { + color: $mastodon-color; + } + + .fa-pinterest, + .fa-pinterest-p, + .fa-pinterest-square { + color: $pinterest-color; + } + + .fa-reddit { + color: $reddit-color; + } + + .fa-rss, + .fa-rss-square { + color: $rss-color; + } + + .fa-soundcloud { + color: $soundcloud-color; + } + + .fa-stack-exchange, + .fa-stack-overflow { + color: $stackoverflow-color; + } + + .fa-tumblr, + .fa-tumblr-square { + color: $tumblr-color; + } + + .fa-twitter, + .fa-twitter-square { + color: $twitter-color; + } + + .fa-vimeo, + .fa-vimeo-square, + .fa-vimeo-v { + color: $vimeo-color; + } + + .fa-vine { + color: $vine-color; + } + + .fa-youtube { + color: $youtube-color; + } + + .fa-xing, + .fa-xing-square { + color: $xing-color; + } +} + +/* + Navicons + ========================================================================== */ + +.navicon { + position: relative; + width: $navicon-width; + height: $navicon-height; + background: $primary-color; + margin: auto; + -webkit-transition: 0.3s; + transition: 0.3s; + + &:before, + &:after { + content: ""; + position: absolute; + left: 0; + width: $navicon-width; + height: $navicon-height; + background: $primary-color; + -webkit-transition: 0.3s; + transition: 0.3s; + } + + &:before { + top: (-2 * $navicon-height); + } + + &:after { + bottom: (-2 * $navicon-height); + } +} + +.close .navicon { + /* hide the middle line*/ + background: transparent; + + /* overlay the lines by setting both their top values to 0*/ + &:before, + &:after { + -webkit-transform-origin: 50% 50%; + -ms-transform-origin: 50% 50%; + transform-origin: 50% 50%; + top: 0; + width: $navicon-width; + } + + /* rotate the lines to form the x shape*/ + &:before { + -webkit-transform: rotate3d(0, 0, 1, 45deg); + transform: rotate3d(0, 0, 1, 45deg); + } + &:after { + -webkit-transform: rotate3d(0, 0, 1, -45deg); + transform: rotate3d(0, 0, 1, -45deg); + } +} + +.greedy-nav__toggle { + &:before { + @supports (pointer-events: none) { + content: ''; + position: fixed; + top: 0; + left: 0; + width: 100%; + height: 100%; + opacity: 0; + background-color: $background-color; + -webkit-transition: $global-transition; + transition: $global-transition; + pointer-events: none; + } + } + + &.close { + &:before { + opacity: 0.9; + -webkit-transition: $global-transition; + transition: $global-transition; + pointer-events: auto; + } + } +} + +.greedy-nav__toggle:hover { + .navicon, + .navicon:before, + .navicon:after { + background: mix(#000, $primary-color, 25%); + } + + &.close { + .navicon { + background: transparent; + } + } +} + +/* + Sticky, fixed to top content + ========================================================================== */ + +.sticky { + @include breakpoint($large) { + @include clearfix(); + position: -webkit-sticky; + position: sticky; + top: 2em; + + > * { + display: block; + } + } +} + +/* + Wells + ========================================================================== */ + +.well { + min-height: 20px; + padding: 19px; + margin-bottom: 20px; + background-color: #f5f5f5; + border: 1px solid #e3e3e3; + border-radius: $border-radius; + box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05); +} + +/* + Modals + ========================================================================== */ + +.show-modal { + overflow: hidden; + position: relative; + + &:before { + position: absolute; + content: ""; + top: 0; + left: 0; + width: 100%; + height: 100%; + z-index: 999; + background-color: rgba(255, 255, 255, 0.85); + } + + .modal { + display: block; + } +} + +.modal { + display: none; + position: fixed; + width: 300px; + top: 50%; + left: 50%; + margin-left: -150px; + margin-top: -150px; + min-height: 0; + z-index: 9999; + background: #fff; + border: 1px solid $border-color; + border-radius: $border-radius; + box-shadow: $box-shadow; + + &__title { + margin: 0; + padding: 0.5em 1em; + } + + &__supporting-text { + padding: 0 1em 0.5em 1em; + } + + &__actions { + padding: 0.5em 1em; + border-top: 1px solid $border-color; + } +} + +/* + Footnotes + ========================================================================== */ + +.footnote { + color: mix(#fff, $gray, 25%); + text-decoration: none; +} + +.footnotes { + color: mix(#fff, $gray, 25%); + + ol, + li, + p { + margin-bottom: 0; + font-size: $type-size-6; + } +} + +a.reversefootnote { + color: $gray; + text-decoration: none; + + &:hover { + text-decoration: underline; + } +} + +/* + Required + ========================================================================== */ + +.required { + color: $danger-color; + font-weight: bold; +} + +/* + Google Custom Search Engine + ========================================================================== */ + +.gsc-control-cse { + table, + tr, + td { + border: 0; /* remove table borders widget */ + } +} + +/* + Responsive Video Embed + ========================================================================== */ + +.responsive-video-container { + position: relative; + margin-bottom: 1em; + padding-bottom: 56.25%; + height: 0; + overflow: hidden; + max-width: 100%; + + iframe, + object, + embed { + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; + } +} + +// full screen video fixes +:-webkit-full-screen-ancestor { + .masthead, + .page__footer { + position: static; + } +} diff --git a/src/_sass/minimal-mistakes/_variables.scss b/src/_sass/minimal-mistakes/_variables.scss new file mode 100644 index 0000000..81a3acf --- /dev/null +++ b/src/_sass/minimal-mistakes/_variables.scss @@ -0,0 +1,173 @@ +/* ========================================================================== + Variables + ========================================================================== */ + +/* + Typography + ========================================================================== */ + +$doc-font-size: 16 !default; + +/* paragraph indention */ +$paragraph-indent: false !default; // true, false (default) +$indent-var: 1.3em !default; + +/* system typefaces */ +$serif: Georgia, Times, serif !default; +$sans-serif: -apple-system, BlinkMacSystemFont, "Roboto", "Segoe UI", + "Helvetica Neue", "Lucida Grande", Arial, sans-serif !default; +$monospace: Monaco, Consolas, "Lucida Console", monospace !default; + +/* sans serif typefaces */ +$sans-serif-narrow: $sans-serif !default; +$helvetica: Helvetica, "Helvetica Neue", Arial, sans-serif !default; + +/* serif typefaces */ +$georgia: Georgia, serif !default; +$times: Times, serif !default; +$bodoni: "Bodoni MT", serif !default; +$calisto: "Calisto MT", serif !default; +$garamond: Garamond, serif !default; + +$global-font-family: $sans-serif !default; +$header-font-family: $sans-serif !default; +$caption-font-family: $serif !default; + +/* type scale */ +$type-size-1: 2.441em !default; // ~39.056px +$type-size-2: 1.953em !default; // ~31.248px +$type-size-3: 1.563em !default; // ~25.008px +$type-size-4: 1.25em !default; // ~20px +$type-size-5: 1em !default; // ~16px +$type-size-6: 0.75em !default; // ~12px +$type-size-7: 0.6875em !default; // ~11px +$type-size-8: 0.625em !default; // ~10px + +/* headline scale */ +$h-size-1: 1.563em !default; // ~25.008px +$h-size-2: 1.25em !default; // ~20px +$h-size-3: 1.125em !default; // ~18px +$h-size-4: 1.0625em !default; // ~17px +$h-size-5: 1.03125em !default; // ~16.5px +$h-size-6: 1em !default; // ~16px + +/* + Colors + ========================================================================== */ + +$gray: #7a8288 !default; +$dark-gray: mix(#000, $gray, 50%) !default; +$darker-gray: mix(#000, $gray, 60%) !default; +$light-gray: mix(#fff, $gray, 50%) !default; +$lighter-gray: mix(#fff, $gray, 90%) !default; + +$background-color: #fff !default; +$code-background-color: #fafafa !default; +$code-background-color-dark: $light-gray !default; +$text-color: $dark-gray !default; +$muted-text-color: mix(#fff, $text-color, 20%) !default; +$border-color: $lighter-gray !default; +$form-background-color: $lighter-gray !default; +$footer-background-color: $lighter-gray !default; + +$primary-color: #6f777d !default; +$success-color: #3fa63f !default; +$warning-color: #d67f05 !default; +$danger-color: #ee5f5b !default; +$info-color: #3b9cba !default; +$focus-color: $primary-color !default; +$active-color: mix(#fff, $primary-color, 80%) !default; + +/* YIQ color contrast */ +$yiq-contrasted-dark-default: $dark-gray !default; +$yiq-contrasted-light-default: #fff !default; +$yiq-contrasted-threshold: 175 !default; +$yiq-debug: false !default; + +/* brands */ +$behance-color: #1769ff !default; +$bitbucket-color: #205081 !default; +$dribbble-color: #ea4c89 !default; +$facebook-color: #3b5998 !default; +$flickr-color: #ff0084 !default; +$foursquare-color: #0072b1 !default; +$github-color: #171516 !default; +$gitlab-color: #e24329 !default; +$instagram-color: #517fa4 !default; +$keybase-color: #ef7639 !default; +$lastfm-color: #d51007 !default; +$linkedin-color: #007bb6 !default; +$mastodon-color: #2b90d9 !default; +$pinterest-color: #cb2027 !default; +$reddit-color: #ff4500 !default; +$rss-color: #fa9b39 !default; +$soundcloud-color: #ff3300 !default; +$stackoverflow-color: #fe7a15 !default; +$tumblr-color: #32506d !default; +$twitter-color: #55acee !default; +$vimeo-color: #1ab7ea !default; +$vine-color: #00bf8f !default; +$youtube-color: #bb0000 !default; +$xing-color: #006567 !default; + +/* links */ +$link-color: mix(#000, $info-color, 20%) !default; +$link-color-hover: mix(#000, $link-color, 25%) !default; +$link-color-visited: mix(#fff, $link-color, 15%) !default; +$masthead-link-color: $primary-color !default; +$masthead-link-color-hover: mix(#000, $primary-color, 25%) !default; +$navicon-link-color-hover: mix(#fff, $primary-color, 75%) !default; + +/* notices */ +$notice-background-mix: 80% !default; +$code-notice-background-mix: 90% !default; + +/* syntax highlighting (base16) */ +$base00: #263238 !default; +$base01: #2e3c43 !default; +$base02: #314549 !default; +$base03: #546e7a !default; +$base04: #b2ccd6 !default; +$base05: #eeffff !default; +$base06: #eeffff !default; +$base07: #ffffff !default; +$base08: #f07178 !default; +$base09: #f78c6c !default; +$base0a: #ffcb6b !default; +$base0b: #c3e88d !default; +$base0c: #89ddff !default; +$base0d: #82aaff !default; +$base0e: #c792ea !default; +$base0f: #ff5370 !default; + +/* + Breakpoints + ========================================================================== */ + +$small: 600px !default; +$medium: 768px !default; +$medium-wide: 900px !default; +$large: 1024px !default; +$x-large: 1280px !default; +$max-width: $x-large !default; + +/* + Grid + ========================================================================== */ + +$right-sidebar-width-narrow: 200px !default; +$right-sidebar-width: 300px !default; +$right-sidebar-width-wide: 400px !default; + +/* + Other + ========================================================================== */ + +$border-radius: 4px !default; +$box-shadow: 0 1px 1px rgba(0, 0, 0, 0.125) !default; +$nav-height: 2em !default; +$nav-toggle-height: 2rem !default; +$navicon-width: 1.5rem !default; +$navicon-height: 0.25rem !default; +$global-transition: all 0.2s ease-in-out !default; +$intro-transition: intro 0.3s both !default; diff --git a/src/_sass/minimal-mistakes/skins/_air.scss b/src/_sass/minimal-mistakes/skins/_air.scss new file mode 100644 index 0000000..0e5360c --- /dev/null +++ b/src/_sass/minimal-mistakes/skins/_air.scss @@ -0,0 +1,23 @@ +/* ========================================================================== + Air skin + ========================================================================== */ + +/* Colors */ +$background-color: #eeeeee !default; +$text-color: #222831 !default; +$muted-text-color: #393e46 !default; +$primary-color: #0092ca !default; +$border-color: mix(#fff, #393e46, 75%) !default; +$footer-background-color: $primary-color !default; +$link-color: #393e46 !default; +$masthead-link-color: $text-color !default; +$masthead-link-color-hover: $text-color !default; +$navicon-link-color-hover: mix(#fff, $text-color, 80%) !default; + +.page__footer { + color: #fff !important; // override +} + +.page__footer-follow .social-icons .svg-inline--fa { + color: inherit; +} diff --git a/src/_sass/minimal-mistakes/skins/_aqua.scss b/src/_sass/minimal-mistakes/skins/_aqua.scss new file mode 100644 index 0000000..7c3944e --- /dev/null +++ b/src/_sass/minimal-mistakes/skins/_aqua.scss @@ -0,0 +1,34 @@ +/* ========================================================================== + Aqua skin + ========================================================================== */ + +/* Colors */ +$gray : #1976d2 !default; +$dark-gray : mix(#000, $gray, 40%) !default; +$darker-gray : mix(#000, $gray, 60%) !default; +$light-gray : mix(#fff, $gray, 50%) !default; +$lighter-gray : mix(#fff, $gray, 90%) !default; + +$body-color : #fff !default; +$background-color : #f0fff0 !default; +$code-background-color : $lighter-gray !default; +$code-background-color-dark : $light-gray !default; +$text-color : $dark-gray !default; +$border-color : $lighter-gray !default; + +$primary-color : $gray !default; +$success-color : #27ae60 !default; +$warning-color : #e67e22 !default; +$danger-color : #c0392b !default; +$info-color : #03a9f4 !default; + +/* links */ +$link-color : $info-color !default; +$link-color-hover : mix(#000, $link-color, 25%) !default; +$link-color-visited : mix(#fff, $link-color, 25%) !default; +$masthead-link-color : $primary-color !default; +$masthead-link-color-hover : mix(#000, $primary-color, 25%) !default; + +/* notices */ +$notice-background-mix: 90% !default; +$code-notice-background-mix: 95% !default; diff --git a/src/_sass/minimal-mistakes/skins/_contrast.scss b/src/_sass/minimal-mistakes/skins/_contrast.scss new file mode 100644 index 0000000..38283b8 --- /dev/null +++ b/src/_sass/minimal-mistakes/skins/_contrast.scss @@ -0,0 +1,52 @@ +/* ========================================================================== + Contrast skin + ========================================================================== */ + +/* Colors */ +$text-color: #000 !default; +$muted-text-color: $text-color !default; +$primary-color: #ff0000 !default; +$border-color: mix(#fff, $text-color, 75%) !default; +$footer-background-color: #000 !default; +$link-color: #0000ff !default; +$masthead-link-color: $text-color !default; +$masthead-link-color-hover: $text-color !default; +$navicon-link-color-hover: mix(#fff, $text-color, 80%) !default; + +/* contrast syntax highlighting (base16) */ +$base00: #000000 !default; +$base01: #242422 !default; +$base02: #484844 !default; +$base03: #6c6c66 !default; +$base04: #918f88 !default; +$base05: #b5b3aa !default; +$base06: #d9d7cc !default; +$base07: #fdfbee !default; +$base08: #ff6c60 !default; +$base09: #e9c062 !default; +$base0a: #ffffb6 !default; +$base0b: #a8ff60 !default; +$base0c: #c6c5fe !default; +$base0d: #96cbfe !default; +$base0e: #ff73fd !default; +$base0f: #b18a3d !default; + +.page__content { + .notice, + .notice--primary, + .notice--info, + .notice--warning, + .notice--success, + .notice--danger { + color: $text-color; + } +} + +.page__footer { + color: #fff !important; // override +} + +.page__footer-follow .social-icons i, +.page__footer-follow .social-icons .svg-inline--fa { + color: inherit; +} diff --git a/src/_sass/minimal-mistakes/skins/_dark.scss b/src/_sass/minimal-mistakes/skins/_dark.scss new file mode 100644 index 0000000..3805349 --- /dev/null +++ b/src/_sass/minimal-mistakes/skins/_dark.scss @@ -0,0 +1,30 @@ +/* ========================================================================== + Dark skin + ========================================================================== */ + +/* Colors */ +$background-color: #252a34 !default; +$text-color: #eaeaea !default; +$primary-color: #00adb5 !default; +$border-color: mix(#fff, $background-color, 20%) !default; +$code-background-color: mix(#000, $background-color, 15%) !default; +$code-background-color-dark: mix(#000, $background-color, 20%) !default; +$form-background-color: mix(#000, $background-color, 15%) !default; +$footer-background-color: mix(#000, $background-color, 30%) !default; +$link-color: mix($primary-color, $text-color, 40%) !default; +$link-color-hover: mix(#fff, $link-color, 25%) !default; +$link-color-visited: mix(#000, $link-color, 25%) !default; +$masthead-link-color: $text-color !default; +$masthead-link-color-hover: mix(#000, $text-color, 20%) !default; +$navicon-link-color-hover: mix(#000, $background-color, 30%) !default; + +.author__urls.social-icons i, +.author__urls.social-icons .svg-inline--fa, +.page__footer-follow .social-icons i, +.page__footer-follow .social-icons .svg-inline--fa { + color: inherit; +} + +.ais-search-box .ais-search-box--input { + background-color: $form-background-color; +} diff --git a/src/_sass/minimal-mistakes/skins/_default.scss b/src/_sass/minimal-mistakes/skins/_default.scss new file mode 100644 index 0000000..7489b58 --- /dev/null +++ b/src/_sass/minimal-mistakes/skins/_default.scss @@ -0,0 +1,5 @@ +/* ========================================================================== + Default skin + ========================================================================== */ + +// Intentionally left blank diff --git a/src/_sass/minimal-mistakes/skins/_dirt.scss b/src/_sass/minimal-mistakes/skins/_dirt.scss new file mode 100644 index 0000000..5090f55 --- /dev/null +++ b/src/_sass/minimal-mistakes/skins/_dirt.scss @@ -0,0 +1,33 @@ +/* ========================================================================== + Dirt skin + ========================================================================== */ + +/* Colors */ +$background-color: #f3f3f3 !default; +$text-color: #343434 !default; +$muted-text-color: #8e8b82 !default; +$primary-color: #343434 !default; +$border-color: #e9dcbe !default; +$footer-background-color: #e9dcbe !default; +$link-color: #343434 !default; +$masthead-link-color: $text-color !default; +$masthead-link-color-hover: $text-color !default; +$navicon-link-color-hover: mix(#fff, $text-color, 80%) !default; + +/* dirt syntax highlighting (base16) */ +$base00: #231e18 !default; +$base01: #302b25 !default; +$base02: #48413a !default; +$base03: #9d8b70 !default; +$base04: #b4a490 !default; +$base05: #cabcb1 !default; +$base06: #d7c8bc !default; +$base07: #e4d4c8 !default; +$base08: #d35c5c !default; +$base09: #ca7f32 !default; +$base0a: #e0ac16 !default; +$base0b: #b7ba53 !default; +$base0c: #6eb958 !default; +$base0d: #88a4d3 !default; +$base0e: #bb90e2 !default; +$base0f: #b49368 !default; diff --git a/src/_sass/minimal-mistakes/skins/_mint.scss b/src/_sass/minimal-mistakes/skins/_mint.scss new file mode 100644 index 0000000..28557a3 --- /dev/null +++ b/src/_sass/minimal-mistakes/skins/_mint.scss @@ -0,0 +1,24 @@ +/* ========================================================================== + Mint skin + ========================================================================== */ + +/* Colors */ +$background-color: #f3f6f6 !default; +$text-color: #40514e !default; +$muted-text-color: #40514e !default; +$primary-color: #11999e !default; +$border-color: mix(#fff, #40514e, 75%) !default; +$footer-background-color: #30e3ca !default; +$link-color: #11999e !default; +$masthead-link-color: $text-color !default; +$masthead-link-color-hover: $text-color !default; +$navicon-link-color-hover: mix(#fff, $text-color, 80%) !default; + +.page__footer { + color: #fff !important; // override +} + +.page__footer-follow .social-icons i, +.page__footer-follow .social-icons .svg-inline--fa { + color: inherit; +} diff --git a/src/_sass/minimal-mistakes/skins/_neon.scss b/src/_sass/minimal-mistakes/skins/_neon.scss new file mode 100644 index 0000000..a4f2ef5 --- /dev/null +++ b/src/_sass/minimal-mistakes/skins/_neon.scss @@ -0,0 +1,63 @@ +/* ========================================================================== + Neon skin + ========================================================================== */ + +/* Colors */ +$background-color: #141010 !default; +$text-color: #fff6fb !default; +$primary-color: #f21368 !default; +$border-color: mix(#fff, $background-color, 20%) !default; +$code-background-color: mix(#000, $background-color, 15%) !default; +$code-background-color-dark: mix(#000, $background-color, 20%) !default; +$form-background-color: mix(#000, $background-color, 15%) !default; +$footer-background-color: mix($primary-color, #000, 10%) !default; +$link-color: $primary-color !default; +$link-color-hover: mix(#fff, $link-color, 25%) !default; +$link-color-visited: mix(#000, $link-color, 25%) !default; +$masthead-link-color: $text-color !default; +$masthead-link-color-hover: mix(#000, $text-color, 20%) !default; +$navicon-link-color-hover: mix(#000, $background-color, 30%) !default; + +/* notices */ +$notice-background-mix: 90% !default; +$code-notice-background-mix: 95% !default; + +/* neon syntax highlighting (base16) */ +$base00: #ffffff !default; +$base01: #e0e0e0 !default; +$base02: #d0d0d0 !default; +$base03: #b0b0b0 !default; +$base04: #000000 !default; +$base05: #101010 !default; +$base06: #151515 !default; +$base07: #202020 !default; +$base08: #ff0086 !default; +$base09: #fd8900 !default; +$base0a: #aba800 !default; +$base0b: #00c918 !default; +$base0c: #1faaaa !default; +$base0d: #3777e6 !default; +$base0e: #ad00a1 !default; +$base0f: #cc6633 !default; + +.author__urls.social-icons i, +.author__urls.social-icons .svg-inline--fa, +.page__footer-follow .social-icons i, +.page__footer-follow .social-icons .svg-inline--fa { + color: inherit; +} + +/* next/previous buttons */ +.pagination--pager { + color: $text-color; + background-color: $primary-color; + border-color: transparent; + + &:visited { + color: $text-color; + } +} + +.ais-search-box .ais-search-box--input { + background-color: $form-background-color; +} \ No newline at end of file diff --git a/src/_sass/minimal-mistakes/skins/_plum.scss b/src/_sass/minimal-mistakes/skins/_plum.scss new file mode 100644 index 0000000..defa69c --- /dev/null +++ b/src/_sass/minimal-mistakes/skins/_plum.scss @@ -0,0 +1,70 @@ +/* ========================================================================== + Plum skin + ========================================================================== */ + +/* Colors */ +$background-color: #521477 !default; +$text-color: #fffd86 !default; +$primary-color: #c327ab !default; +$border-color: mix(#fff, $background-color, 20%) !default; +$code-background-color: mix(#000, $background-color, 15%) !default; +$code-background-color-dark: mix(#000, $background-color, 20%) !default; +$form-background-color: mix(#000, $background-color, 15%) !default; +$footer-background-color: mix(#000, $background-color, 25%) !default; +$link-color: $primary-color !default; +$link-color-hover: mix(#fff, $link-color, 25%) !default; +$link-color-visited: mix(#000, $link-color, 25%) !default; +$masthead-link-color: $text-color !default; +$masthead-link-color-hover: mix(#000, $text-color, 20%) !default; +$navicon-link-color-hover: mix(#000, $background-color, 30%) !default; + +/* notices */ +$notice-background-mix: 70% !default; +$code-notice-background-mix: 80% !default; + +/* plum syntax highlighting (base16) */ +$base00: #ffffff !default; +$base01: #e0e0e0 !default; +$base02: #d0d0d0 !default; +$base03: #b0b0b0 !default; +$base04: #000000 !default; +$base05: #101010 !default; +$base06: #151515 !default; +$base07: #202020 !default; +$base08: #ff0086 !default; +$base09: #fd8900 !default; +$base0a: #aba800 !default; +$base0b: #00c918 !default; +$base0c: #1faaaa !default; +$base0d: #3777e6 !default; +$base0e: #ad00a1 !default; +$base0f: #cc6633 !default; + +.author__urls.social-icons i, +.author__urls.social-icons .svg-inline--fa, +.page__footer-follow .social-icons i, +.page__footer-follow .social-icons .svg-inline--fa { + color: inherit; +} + +.page__content { + a, + a:visited { + color: inherit; + } +} + +/* next/previous buttons */ +.pagination--pager { + color: $text-color; + background-color: $primary-color; + border-color: transparent; + + &:visited { + color: $text-color; + } +} + +.ais-search-box .ais-search-box--input { + background-color: $form-background-color; +} \ No newline at end of file diff --git a/src/_sass/minimal-mistakes/skins/_sunrise.scss b/src/_sass/minimal-mistakes/skins/_sunrise.scss new file mode 100644 index 0000000..bc259f6 --- /dev/null +++ b/src/_sass/minimal-mistakes/skins/_sunrise.scss @@ -0,0 +1,49 @@ +/* ========================================================================== + Sunrise skin + ========================================================================== */ + +/* Colors */ +$dark-gray: #0e2431 !default; +$background-color: #e8d5b7 !default; +$text-color: #000 !default; +$muted-text-color: $dark-gray !default; +$primary-color: #fc3a52 !default; +$border-color: mix(#000, $background-color, 20%) !default; +$code-background-color: mix(#fff, $background-color, 20%) !default; +$code-background-color-dark: mix(#000, $background-color, 10%) !default; +$form-background-color: mix(#fff, $background-color, 15%) !default; +$footer-background-color: #f9b248 !default; +$link-color: mix(#000, $primary-color, 10%) !default; +$link-color-hover: mix(#fff, $link-color, 25%) !default; +$link-color-visited: mix(#000, $link-color, 25%) !default; +$masthead-link-color: $text-color !default; +$masthead-link-color-hover: mix(#000, $text-color, 20%) !default; +$navicon-link-color-hover: mix(#000, $background-color, 30%) !default; + +/* notices */ +$notice-background-mix: 75% !default; + +/* sunrise syntax highlighting (base16) */ +$base00: #1d1f21 !default; +$base01: #282a2e !default; +$base02: #373b41 !default; +$base03: #969896 !default; +$base04: #b4b7b4 !default; +$base05: #c5c8c6 !default; +$base06: #e0e0e0 !default; +$base07: #ffffff !default; +$base08: #cc6666 !default; +$base09: #de935f !default; +$base0a: #f0c674 !default; +$base0b: #b5bd68 !default; +$base0c: #8abeb7 !default; +$base0d: #81a2be !default; +$base0e: #b294bb !default; +$base0f: #a3685a !default; + +.author__urls.social-icons i, +.author__urls.social-icons .svg-inline--fa, +.page__footer-follow .social-icons i, +.page__footer-follow .social-icons .svg-inline--fa { + color: inherit; +} diff --git a/src/assets/css/orig-main.scss b/src/assets/css/orig-main.scss new file mode 100644 index 0000000..23346e7 --- /dev/null +++ b/src/assets/css/orig-main.scss @@ -0,0 +1,8 @@ +--- +# Only the main Sass file needs front matter (the dashes are enough) +--- + +@charset "utf-8"; + +@import "minimal-mistakes/skins/{{ site.minimal_mistakes_skin | default: 'default' }}"; // skin +@import "minimal-mistakes"; // main partials \ No newline at end of file diff --git a/src/assets/js/_main.js b/src/assets/js/_main.js new file mode 100644 index 0000000..0efc970 --- /dev/null +++ b/src/assets/js/_main.js @@ -0,0 +1,136 @@ +/* ========================================================================== + jQuery plugin settings and other scripts + ========================================================================== */ + +$(document).ready(function() { + // FitVids init + $("#main").fitVids(); + + // Sticky sidebar + var stickySideBar = function() { + var show = + $(".author__urls-wrapper button").length === 0 + ? $(window).width() > 1024 // width should match $large Sass variable + : !$(".author__urls-wrapper button").is(":visible"); + if (show) { + // fix + $(".sidebar").addClass("sticky"); + } else { + // unfix + $(".sidebar").removeClass("sticky"); + } + }; + + stickySideBar(); + + $(window).resize(function() { + stickySideBar(); + }); + + // Follow menu drop down + $(".author__urls-wrapper button").on("click", function() { + $(".author__urls").toggleClass("is--visible"); + $(".author__urls-wrapper button").toggleClass("open"); + }); + + // Close search screen with Esc key + $(document).keyup(function(e) { + if (e.keyCode === 27) { + if ($(".initial-content").hasClass("is--hidden")) { + $(".search-content").toggleClass("is--visible"); + $(".initial-content").toggleClass("is--hidden"); + } + } + }); + + // Search toggle + $(".search__toggle").on("click", function() { + $(".search-content").toggleClass("is--visible"); + $(".initial-content").toggleClass("is--hidden"); + // set focus on input + setTimeout(function() { + $(".search-content input").focus(); + }, 400); + }); + + // Smooth scrolling + var scroll = new SmoothScroll('a[href*="#"]', { + offset: 20, + speed: 400, + speedAsDuration: true, + durationMax: 500 + }); + + // Gumshoe scroll spy init + if($("nav.toc").length > 0) { + var spy = new Gumshoe("nav.toc a", { + // Active classes + navClass: "active", // applied to the nav list item + contentClass: "active", // applied to the content + + // Nested navigation + nested: false, // if true, add classes to parents of active link + nestedClass: "active", // applied to the parent items + + // Offset & reflow + offset: 20, // how far from the top of the page to activate a content area + reflow: true, // if true, listen for reflows + + // Event support + events: true // if true, emit custom events + }); + } + + // add lightbox class to all image links + $( + "a[href$='.jpg'],a[href$='.jpeg'],a[href$='.JPG'],a[href$='.png'],a[href$='.gif'],a[href$='.webp']" + ).addClass("image-popup"); + + // Magnific-Popup options + $(".image-popup").magnificPopup({ + // disableOn: function() { + // if( $(window).width() < 500 ) { + // return false; + // } + // return true; + // }, + type: "image", + tLoading: "Loading image #%curr%...", + gallery: { + enabled: true, + navigateByImgClick: true, + preload: [0, 1] // Will preload 0 - before current, and 1 after the current image + }, + image: { + tError: 'Image #%curr% could not be loaded.' + }, + removalDelay: 500, // Delay in milliseconds before popup is removed + // Class that is added to body when popup is open. + // make it unique to apply your CSS animations just to this exact popup + mainClass: "mfp-zoom-in", + callbacks: { + beforeOpen: function() { + // just a hack that adds mfp-anim class to markup + this.st.image.markup = this.st.image.markup.replace( + "mfp-figure", + "mfp-figure mfp-with-anim" + ); + } + }, + closeOnContentClick: true, + midClick: true // allow opening popup on middle mouse click. Always set it to true if you don't provide alternative source. + }); + + // Add anchors for headings + $('.page__content').find('h1, h2, h3, h4, h5, h6').each(function() { + var id = $(this).attr('id'); + if (id) { + var anchor = document.createElement("a"); + anchor.className = 'header-link'; + anchor.href = '#' + id; + anchor.innerHTML = 'Permalink'; + anchor.title = "Permalink"; + $(this).append(anchor); + } + }); +}); diff --git a/src/assets/js/lunr/lunr-en.js b/src/assets/js/lunr/lunr-en.js new file mode 100644 index 0000000..4342930 --- /dev/null +++ b/src/assets/js/lunr/lunr-en.js @@ -0,0 +1,73 @@ +--- +layout: none +--- + +var idx = lunr(function () { + this.field('title') + this.field('excerpt') + this.field('categories') + this.field('tags') + this.ref('id') + + this.pipeline.remove(lunr.trimmer) + + for (var item in store) { + this.add({ + title: store[item].title, + excerpt: store[item].excerpt, + categories: store[item].categories, + tags: store[item].tags, + id: item + }) + } +}); + +$(document).ready(function() { + $('input#search').on('keyup', function () { + var resultdiv = $('#results'); + var query = $(this).val().toLowerCase(); + var result = + idx.query(function (q) { + query.split(lunr.tokenizer.separator).forEach(function (term) { + q.term(term, { boost: 100 }) + if(query.lastIndexOf(" ") != query.length-1){ + q.term(term, { usePipeline: false, wildcard: lunr.Query.wildcard.TRAILING, boost: 10 }) + } + if (term != ""){ + q.term(term, { usePipeline: false, editDistance: 1, boost: 1 }) + } + }) + }); + resultdiv.empty(); + resultdiv.prepend('

'+result.length+' {{ site.data.ui-text[site.locale].results_found | default: "Result(s) found" }}

'); + for (var item in result) { + var ref = result[item].ref; + if(store[ref].teaser){ + var searchitem = + '
'+ + '
'+ + '

'+ + ''+store[ref].title+''+ + '

'+ + '
'+ + ''+ + '
'+ + '

'+store[ref].excerpt.split(" ").splice(0,20).join(" ")+'...

'+ + '
'+ + '
'; + } + else{ + var searchitem = + '
'+ + '
'+ + '

'+ + ''+store[ref].title+''+ + '

'+ + '

'+store[ref].excerpt.split(" ").splice(0,20).join(" ")+'...

'+ + '
'+ + '
'; + } + resultdiv.append(searchitem); + } + }); +}); diff --git a/src/assets/js/lunr/lunr-gr.js b/src/assets/js/lunr/lunr-gr.js new file mode 100644 index 0000000..10eb0e7 --- /dev/null +++ b/src/assets/js/lunr/lunr-gr.js @@ -0,0 +1,526 @@ +--- +layout: none +--- + +step1list = new Array(); +step1list["ΦΑΓΙΑ"] = "ΦΑ"; +step1list["ΦΑΓΙΟΥ"] = "ΦΑ"; +step1list["ΦΑΓΙΩΝ"] = "ΦΑ"; +step1list["ΣΚΑΓΙΑ"] = "ΣΚΑ"; +step1list["ΣΚΑΓΙΟΥ"] = "ΣΚΑ"; +step1list["ΣΚΑΓΙΩΝ"] = "ΣΚΑ"; +step1list["ΟΛΟΓΙΟΥ"] = "ΟΛΟ"; +step1list["ΟΛΟΓΙΑ"] = "ΟΛΟ"; +step1list["ΟΛΟΓΙΩΝ"] = "ΟΛΟ"; +step1list["ΣΟΓΙΟΥ"] = "ΣΟ"; +step1list["ΣΟΓΙΑ"] = "ΣΟ"; +step1list["ΣΟΓΙΩΝ"] = "ΣΟ"; +step1list["ΤΑΤΟΓΙΑ"] = "ΤΑΤΟ"; +step1list["ΤΑΤΟΓΙΟΥ"] = "ΤΑΤΟ"; +step1list["ΤΑΤΟΓΙΩΝ"] = "ΤΑΤΟ"; +step1list["ΚΡΕΑΣ"] = "ΚΡΕ"; +step1list["ΚΡΕΑΤΟΣ"] = "ΚΡΕ"; +step1list["ΚΡΕΑΤΑ"] = "ΚΡΕ"; +step1list["ΚΡΕΑΤΩΝ"] = "ΚΡΕ"; +step1list["ΠΕΡΑΣ"] = "ΠΕΡ"; +step1list["ΠΕΡΑΤΟΣ"] = "ΠΕΡ"; +step1list["ΠΕΡΑΤΑ"] = "ΠΕΡ"; +step1list["ΠΕΡΑΤΩΝ"] = "ΠΕΡ"; +step1list["ΤΕΡΑΣ"] = "ΤΕΡ"; +step1list["ΤΕΡΑΤΟΣ"] = "ΤΕΡ"; +step1list["ΤΕΡΑΤΑ"] = "ΤΕΡ"; +step1list["ΤΕΡΑΤΩΝ"] = "ΤΕΡ"; +step1list["ΦΩΣ"] = "ΦΩ"; +step1list["ΦΩΤΟΣ"] = "ΦΩ"; +step1list["ΦΩΤΑ"] = "ΦΩ"; +step1list["ΦΩΤΩΝ"] = "ΦΩ"; +step1list["ΚΑΘΕΣΤΩΣ"] = "ΚΑΘΕΣΤ"; +step1list["ΚΑΘΕΣΤΩΤΟΣ"] = "ΚΑΘΕΣΤ"; +step1list["ΚΑΘΕΣΤΩΤΑ"] = "ΚΑΘΕΣΤ"; +step1list["ΚΑΘΕΣΤΩΤΩΝ"] = "ΚΑΘΕΣΤ"; +step1list["ΓΕΓΟΝΟΣ"] = "ΓΕΓΟΝ"; +step1list["ΓΕΓΟΝΟΤΟΣ"] = "ΓΕΓΟΝ"; +step1list["ΓΕΓΟΝΟΤΑ"] = "ΓΕΓΟΝ"; +step1list["ΓΕΓΟΝΟΤΩΝ"] = "ΓΕΓΟΝ"; + +v = "[ΑΕΗΙΟΥΩ]"; +v2 = "[ΑΕΗΙΟΩ]" + +function stemWord(w) { + var stem; + var suffix; + var firstch; + var origword = w; + test1 = new Boolean(true); + + if(w.length < 4) { + return w; + } + + var re; + var re2; + var re3; + var re4; + + re = /(.*)(ΦΑΓΙΑ|ΦΑΓΙΟΥ|ΦΑΓΙΩΝ|ΣΚΑΓΙΑ|ΣΚΑΓΙΟΥ|ΣΚΑΓΙΩΝ|ΟΛΟΓΙΟΥ|ΟΛΟΓΙΑ|ΟΛΟΓΙΩΝ|ΣΟΓΙΟΥ|ΣΟΓΙΑ|ΣΟΓΙΩΝ|ΤΑΤΟΓΙΑ|ΤΑΤΟΓΙΟΥ|ΤΑΤΟΓΙΩΝ|ΚΡΕΑΣ|ΚΡΕΑΤΟΣ|ΚΡΕΑΤΑ|ΚΡΕΑΤΩΝ|ΠΕΡΑΣ|ΠΕΡΑΤΟΣ|ΠΕΡΑΤΑ|ΠΕΡΑΤΩΝ|ΤΕΡΑΣ|ΤΕΡΑΤΟΣ|ΤΕΡΑΤΑ|ΤΕΡΑΤΩΝ|ΦΩΣ|ΦΩΤΟΣ|ΦΩΤΑ|ΦΩΤΩΝ|ΚΑΘΕΣΤΩΣ|ΚΑΘΕΣΤΩΤΟΣ|ΚΑΘΕΣΤΩΤΑ|ΚΑΘΕΣΤΩΤΩΝ|ΓΕΓΟΝΟΣ|ΓΕΓΟΝΟΤΟΣ|ΓΕΓΟΝΟΤΑ|ΓΕΓΟΝΟΤΩΝ)$/; + + if(re.test(w)) { + var fp = re.exec(w); + stem = fp[1]; + suffix = fp[2]; + w = stem + step1list[suffix]; + test1 = false; + } + + re = /^(.+?)(ΑΔΕΣ|ΑΔΩΝ)$/; + + if(re.test(w)) { + var fp = re.exec(w); + stem = fp[1]; + w = stem; + + reg1 = /(ΟΚ|ΜΑΜ|ΜΑΝ|ΜΠΑΜΠ|ΠΑΤΕΡ|ΓΙΑΓΙ|ΝΤΑΝΤ|ΚΥΡ|ΘΕΙ|ΠΕΘΕΡ)$/; + + if(!(reg1.test(w))) { + w = w + "ΑΔ"; + } + } + + re2 = /^(.+?)(ΕΔΕΣ|ΕΔΩΝ)$/; + + if(re2.test(w)) { + var fp = re2.exec(w); + stem = fp[1]; + w = stem; + + exept2 = /(ΟΠ|ΙΠ|ΕΜΠ|ΥΠ|ΓΗΠ|ΔΑΠ|ΚΡΑΣΠ|ΜΙΛ)$/; + + if(exept2.test(w)) { + w = w + "ΕΔ"; + } + } + + re3 = /^(.+?)(ΟΥΔΕΣ|ΟΥΔΩΝ)$/; + + if(re3.test(w)) { + var fp = re3.exec(w); + stem = fp[1]; + w = stem; + + exept3 = /(ΑΡΚ|ΚΑΛΙΑΚ|ΠΕΤΑΛ|ΛΙΧ|ΠΛΕΞ|ΣΚ|Σ|ΦΛ|ΦΡ|ΒΕΛ|ΛΟΥΛ|ΧΝ|ΣΠ|ΤΡΑΓ|ΦΕ)$/; + + if(exept3.test(w)) { + w = w + "ΟΥΔ"; + } + } + + re4 = /^(.+?)(ΕΩΣ|ΕΩΝ)$/; + + if(re4.test(w)) { + var fp = re4.exec(w); + stem = fp[1]; + w = stem; + test1 = false; + + exept4 = /^(Θ|Δ|ΕΛ|ΓΑΛ|Ν|Π|ΙΔ|ΠΑΡ)$/; + + if(exept4.test(w)) { + w = w + "Ε"; + } + } + + re = /^(.+?)(ΙΑ|ΙΟΥ|ΙΩΝ)$/; + + if(re.test(w)) { + var fp = re.exec(w); + stem = fp[1]; + w = stem; + re2 = new RegExp(v + "$"); + test1 = false; + + if(re2.test(w)) { + w = stem + "Ι"; + } + } + + re = /^(.+?)(ΙΚΑ|ΙΚΟ|ΙΚΟΥ|ΙΚΩΝ)$/; + + if(re.test(w)) { + var fp = re.exec(w); + stem = fp[1]; + w = stem; + test1 = false; + + re2 = new RegExp(v + "$"); + exept5 = /^(ΑΛ|ΑΔ|ΕΝΔ|ΑΜΑΝ|ΑΜΜΟΧΑΛ|ΗΘ|ΑΝΗΘ|ΑΝΤΙΔ|ΦΥΣ|ΒΡΩΜ|ΓΕΡ|ΕΞΩΔ|ΚΑΛΠ|ΚΑΛΛΙΝ|ΚΑΤΑΔ|ΜΟΥΛ|ΜΠΑΝ|ΜΠΑΓΙΑΤ|ΜΠΟΛ|ΜΠΟΣ|ΝΙΤ|ΞΙΚ|ΣΥΝΟΜΗΛ|ΠΕΤΣ|ΠΙΤΣ|ΠΙΚΑΝΤ|ΠΛΙΑΤΣ|ΠΟΣΤΕΛΝ|ΠΡΩΤΟΔ|ΣΕΡΤ|ΣΥΝΑΔ|ΤΣΑΜ|ΥΠΟΔ|ΦΙΛΟΝ|ΦΥΛΟΔ|ΧΑΣ)$/; + + if((exept5.test(w)) || (re2.test(w))) { + w = w + "ΙΚ"; + } + } + + re = /^(.+?)(ΑΜΕ)$/; + re2 = /^(.+?)(ΑΓΑΜΕ|ΗΣΑΜΕ|ΟΥΣΑΜΕ|ΗΚΑΜΕ|ΗΘΗΚΑΜΕ)$/; + if(w == "ΑΓΑΜΕ") { + w = "ΑΓΑΜ"; + } + + if(re2.test(w)) { + var fp = re2.exec(w); + stem = fp[1]; + w = stem; + test1 = false; + } + + if(re.test(w)) { + var fp = re.exec(w); + stem = fp[1]; + w = stem; + test1 = false; + + exept6 = /^(ΑΝΑΠ|ΑΠΟΘ|ΑΠΟΚ|ΑΠΟΣΤ|ΒΟΥΒ|ΞΕΘ|ΟΥΛ|ΠΕΘ|ΠΙΚΡ|ΠΟΤ|ΣΙΧ|Χ)$/; + + if(exept6.test(w)) { + w = w + "ΑΜ"; + } + } + + re2 = /^(.+?)(ΑΝΕ)$/; + re3 = /^(.+?)(ΑΓΑΝΕ|ΗΣΑΝΕ|ΟΥΣΑΝΕ|ΙΟΝΤΑΝΕ|ΙΟΤΑΝΕ|ΙΟΥΝΤΑΝΕ|ΟΝΤΑΝΕ|ΟΤΑΝΕ|ΟΥΝΤΑΝΕ|ΗΚΑΝΕ|ΗΘΗΚΑΝΕ)$/; + + if(re3.test(w)) { + var fp = re3.exec(w); + stem = fp[1]; + w = stem; + test1 = false; + + re3 = /^(ΤΡ|ΤΣ)$/; + + if(re3.test(w)) { + w = w + "ΑΓΑΝ"; + } + } + + if(re2.test(w)) { + var fp = re2.exec(w); + stem = fp[1]; + w = stem; + test1 = false; + + re2 = new RegExp(v2 + "$"); + exept7 = /^(ΒΕΤΕΡ|ΒΟΥΛΚ|ΒΡΑΧΜ|Γ|ΔΡΑΔΟΥΜ|Θ|ΚΑΛΠΟΥΖ|ΚΑΣΤΕΛ|ΚΟΡΜΟΡ|ΛΑΟΠΛ|ΜΩΑΜΕΘ|Μ|ΜΟΥΣΟΥΛΜ|Ν|ΟΥΛ|Π|ΠΕΛΕΚ|ΠΛ|ΠΟΛΙΣ|ΠΟΡΤΟΛ|ΣΑΡΑΚΑΤΣ|ΣΟΥΛΤ|ΤΣΑΡΛΑΤ|ΟΡΦ|ΤΣΙΓΓ|ΤΣΟΠ|ΦΩΤΟΣΤΕΦ|Χ|ΨΥΧΟΠΛ|ΑΓ|ΟΡΦ|ΓΑΛ|ΓΕΡ|ΔΕΚ|ΔΙΠΛ|ΑΜΕΡΙΚΑΝ|ΟΥΡ|ΠΙΘ|ΠΟΥΡΙΤ|Σ|ΖΩΝΤ|ΙΚ|ΚΑΣΤ|ΚΟΠ|ΛΙΧ|ΛΟΥΘΗΡ|ΜΑΙΝΤ|ΜΕΛ|ΣΙΓ|ΣΠ|ΣΤΕΓ|ΤΡΑΓ|ΤΣΑΓ|Φ|ΕΡ|ΑΔΑΠ|ΑΘΙΓΓ|ΑΜΗΧ|ΑΝΙΚ|ΑΝΟΡΓ|ΑΠΗΓ|ΑΠΙΘ|ΑΤΣΙΓΓ|ΒΑΣ|ΒΑΣΚ|ΒΑΘΥΓΑΛ|ΒΙΟΜΗΧ|ΒΡΑΧΥΚ|ΔΙΑΤ|ΔΙΑΦ|ΕΝΟΡΓ|ΘΥΣ|ΚΑΠΝΟΒΙΟΜΗΧ|ΚΑΤΑΓΑΛ|ΚΛΙΒ|ΚΟΙΛΑΡΦ|ΛΙΒ|ΜΕΓΛΟΒΙΟΜΗΧ|ΜΙΚΡΟΒΙΟΜΗΧ|ΝΤΑΒ|ΞΗΡΟΚΛΙΒ|ΟΛΙΓΟΔΑΜ|ΟΛΟΓΑΛ|ΠΕΝΤΑΡΦ|ΠΕΡΗΦ|ΠΕΡΙΤΡ|ΠΛΑΤ|ΠΟΛΥΔΑΠ|ΠΟΛΥΜΗΧ|ΣΤΕΦ|ΤΑΒ|ΤΕΤ|ΥΠΕΡΗΦ|ΥΠΟΚΟΠ|ΧΑΜΗΛΟΔΑΠ|ΨΗΛΟΤΑΒ)$/; + + if((re2.test(w)) || (exept7.test(w))) { + w = w + "ΑΝ"; + } + } + + re3 = /^(.+?)(ΕΤΕ)$/; + re4 = /^(.+?)(ΗΣΕΤΕ)$/; + + if(re4.test(w)) { + var fp = re4.exec(w); + stem = fp[1]; + w = stem; + test1 = false; + } + + if(re3.test(w)) { + var fp = re3.exec(w); + stem = fp[1]; + w = stem; + test1 = false; + + re3 = new RegExp(v2 + "$"); + exept8 = /(ΟΔ|ΑΙΡ|ΦΟΡ|ΤΑΘ|ΔΙΑΘ|ΣΧ|ΕΝΔ|ΕΥΡ|ΤΙΘ|ΥΠΕΡΘ|ΡΑΘ|ΕΝΘ|ΡΟΘ|ΣΘ|ΠΥΡ|ΑΙΝ|ΣΥΝΔ|ΣΥΝ|ΣΥΝΘ|ΧΩΡ|ΠΟΝ|ΒΡ|ΚΑΘ|ΕΥΘ|ΕΚΘ|ΝΕΤ|ΡΟΝ|ΑΡΚ|ΒΑΡ|ΒΟΛ|ΩΦΕΛ)$/; + exept9 = /^(ΑΒΑΡ|ΒΕΝ|ΕΝΑΡ|ΑΒΡ|ΑΔ|ΑΘ|ΑΝ|ΑΠΛ|ΒΑΡΟΝ|ΝΤΡ|ΣΚ|ΚΟΠ|ΜΠΟΡ|ΝΙΦ|ΠΑΓ|ΠΑΡΑΚΑΛ|ΣΕΡΠ|ΣΚΕΛ|ΣΥΡΦ|ΤΟΚ|Υ|Δ|ΕΜ|ΘΑΡΡ|Θ)$/; + + if((re3.test(w)) || (exept8.test(w)) || (exept9.test(w))) { + w = w + "ΕΤ"; + } + } + + re = /^(.+?)(ΟΝΤΑΣ|ΩΝΤΑΣ)$/; + + if(re.test(w)) { + var fp = re.exec(w); + stem = fp[1]; + w = stem; + test1 = false; + + exept10 = /^(ΑΡΧ)$/; + exept11 = /(ΚΡΕ)$/; + if(exept10.test(w)) { + w = w + "ΟΝΤ"; + } + if(exept11.test(w)) { + w = w + "ΩΝΤ"; + } + } + + re = /^(.+?)(ΟΜΑΣΤΕ|ΙΟΜΑΣΤΕ)$/; + + if(re.test(w)) { + var fp = re.exec(w); + stem = fp[1]; + w = stem; + test1 = false; + + exept11 = /^(ΟΝ)$/; + + if(exept11.test(w)) { + w = w + "ΟΜΑΣΤ"; + } + } + + re = /^(.+?)(ΕΣΤΕ)$/; + re2 = /^(.+?)(ΙΕΣΤΕ)$/; + + if(re2.test(w)) { + var fp = re2.exec(w); + stem = fp[1]; + w = stem; + test1 = false; + + re2 = /^(Π|ΑΠ|ΣΥΜΠ|ΑΣΥΜΠ|ΑΚΑΤΑΠ|ΑΜΕΤΑΜΦ)$/; + + if(re2.test(w)) { + w = w + "ΙΕΣΤ"; + } + } + + if(re.test(w)) { + var fp = re.exec(w); + stem = fp[1]; + w = stem; + test1 = false; + + exept12 = /^(ΑΛ|ΑΡ|ΕΚΤΕΛ|Ζ|Μ|Ξ|ΠΑΡΑΚΑΛ|ΑΡ|ΠΡΟ|ΝΙΣ)$/; + + if(exept12.test(w)) { + w = w + "ΕΣΤ"; + } + } + + re = /^(.+?)(ΗΚΑ|ΗΚΕΣ|ΗΚΕ)$/; + re2 = /^(.+?)(ΗΘΗΚΑ|ΗΘΗΚΕΣ|ΗΘΗΚΕ)$/; + + if(re2.test(w)) { + var fp = re2.exec(w); + stem = fp[1]; + w = stem; + test1 = false; + } + + if(re.test(w)) { + var fp = re.exec(w); + stem = fp[1]; + w = stem; + test1 = false; + + exept13 = /(ΣΚΩΛ|ΣΚΟΥΛ|ΝΑΡΘ|ΣΦ|ΟΘ|ΠΙΘ)$/; + exept14 = /^(ΔΙΑΘ|Θ|ΠΑΡΑΚΑΤΑΘ|ΠΡΟΣΘ|ΣΥΝΘ|)$/; + + if((exept13.test(w)) || (exept14.test(w))) { + w = w + "ΗΚ"; + } + } + + re = /^(.+?)(ΟΥΣΑ|ΟΥΣΕΣ|ΟΥΣΕ)$/; + + if(re.test(w)) { + var fp = re.exec(w); + stem = fp[1]; + w = stem; + test1 = false; + + exept15 = /^(ΦΑΡΜΑΚ|ΧΑΔ|ΑΓΚ|ΑΝΑΡΡ|ΒΡΟΜ|ΕΚΛΙΠ|ΛΑΜΠΙΔ|ΛΕΧ|Μ|ΠΑΤ|Ρ|Λ|ΜΕΔ|ΜΕΣΑΖ|ΥΠΟΤΕΙΝ|ΑΜ|ΑΙΘ|ΑΝΗΚ|ΔΕΣΠΟΖ|ΕΝΔΙΑΦΕΡ|ΔΕ|ΔΕΥΤΕΡΕΥ|ΚΑΘΑΡΕΥ|ΠΛΕ|ΤΣΑ)$/; + exept16 = /(ΠΟΔΑΡ|ΒΛΕΠ|ΠΑΝΤΑΧ|ΦΡΥΔ|ΜΑΝΤΙΛ|ΜΑΛΛ|ΚΥΜΑΤ|ΛΑΧ|ΛΗΓ|ΦΑΓ|ΟΜ|ΠΡΩΤ)$/; + + if((exept15.test(w)) || (exept16.test(w))) { + w = w + "ΟΥΣ"; + } + } + + re = /^(.+?)(ΑΓΑ|ΑΓΕΣ|ΑΓΕ)$/; + + if(re.test(w)) { + var fp = re.exec(w); + stem = fp[1]; + w = stem; + test1 = false; + + exept17 = /^(ΨΟΦ|ΝΑΥΛΟΧ)$/; + exept20 = /(ΚΟΛΛ)$/; + exept18 = /^(ΑΒΑΣΤ|ΠΟΛΥΦ|ΑΔΗΦ|ΠΑΜΦ|Ρ|ΑΣΠ|ΑΦ|ΑΜΑΛ|ΑΜΑΛΛΙ|ΑΝΥΣΤ|ΑΠΕΡ|ΑΣΠΑΡ|ΑΧΑΡ|ΔΕΡΒΕΝ|ΔΡΟΣΟΠ|ΞΕΦ|ΝΕΟΠ|ΝΟΜΟΤ|ΟΛΟΠ|ΟΜΟΤ|ΠΡΟΣΤ|ΠΡΟΣΩΠΟΠ|ΣΥΜΠ|ΣΥΝΤ|Τ|ΥΠΟΤ|ΧΑΡ|ΑΕΙΠ|ΑΙΜΟΣΤ|ΑΝΥΠ|ΑΠΟΤ|ΑΡΤΙΠ|ΔΙΑΤ|ΕΝ|ΕΠΙΤ|ΚΡΟΚΑΛΟΠ|ΣΙΔΗΡΟΠ|Λ|ΝΑΥ|ΟΥΛΑΜ|ΟΥΡ|Π|ΤΡ|Μ)$/; + exept19 = /(ΟΦ|ΠΕΛ|ΧΟΡΤ|ΛΛ|ΣΦ|ΡΠ|ΦΡ|ΠΡ|ΛΟΧ|ΣΜΗΝ)$/; + + if(((exept18.test(w)) || (exept19.test(w))) && !((exept17.test(w)) || (exept20.test(w)))) { + w = w + "ΑΓ"; + } + } + + re = /^(.+?)(ΗΣΕ|ΗΣΟΥ|ΗΣΑ)$/; + + if(re.test(w)) { + var fp = re.exec(w); + stem = fp[1]; + w = stem; + test1 = false; + + exept21 = /^(Ν|ΧΕΡΣΟΝ|ΔΩΔΕΚΑΝ|ΕΡΗΜΟΝ|ΜΕΓΑΛΟΝ|ΕΠΤΑΝ)$/; + + if(exept21.test(w)) { + w = w + "ΗΣ"; + } + } + + re = /^(.+?)(ΗΣΤΕ)$/; + + if(re.test(w)) { + var fp = re.exec(w); + stem = fp[1]; + w = stem; + test1 = false; + + exept22 = /^(ΑΣΒ|ΣΒ|ΑΧΡ|ΧΡ|ΑΠΛ|ΑΕΙΜΝ|ΔΥΣΧΡ|ΕΥΧΡ|ΚΟΙΝΟΧΡ|ΠΑΛΙΜΨ)$/; + + if(exept22.test(w)) { + w = w + "ΗΣΤ"; + } + } + + re = /^(.+?)(ΟΥΝΕ|ΗΣΟΥΝΕ|ΗΘΟΥΝΕ)$/; + + if(re.test(w)) { + var fp = re.exec(w); + stem = fp[1]; + w = stem; + test1 = false; + + exept23 = /^(Ν|Ρ|ΣΠΙ|ΣΤΡΑΒΟΜΟΥΤΣ|ΚΑΚΟΜΟΥΤΣ|ΕΞΩΝ)$/; + + if(exept23.test(w)) { + w = w + "ΟΥΝ"; + } + } + + re = /^(.+?)(ΟΥΜΕ|ΗΣΟΥΜΕ|ΗΘΟΥΜΕ)$/; + + if(re.test(w)) { + var fp = re.exec(w); + stem = fp[1]; + w = stem; + test1 = false; + + exept24 = /^(ΠΑΡΑΣΟΥΣ|Φ|Χ|ΩΡΙΟΠΛ|ΑΖ|ΑΛΛΟΣΟΥΣ|ΑΣΟΥΣ)$/; + + if(exept24.test(w)) { + w = w + "ΟΥΜ"; + } + } + + re = /^(.+?)(ΜΑΤΑ|ΜΑΤΩΝ|ΜΑΤΟΣ)$/; + re2 = /^(.+?)(Α|ΑΓΑΤΕ|ΑΓΑΝ|ΑΕΙ|ΑΜΑΙ|ΑΝ|ΑΣ|ΑΣΑΙ|ΑΤΑΙ|ΑΩ|Ε|ΕΙ|ΕΙΣ|ΕΙΤΕ|ΕΣΑΙ|ΕΣ|ΕΤΑΙ|Ι|ΙΕΜΑΙ|ΙΕΜΑΣΤΕ|ΙΕΤΑΙ|ΙΕΣΑΙ|ΙΕΣΑΣΤΕ|ΙΟΜΑΣΤΑΝ|ΙΟΜΟΥΝ|ΙΟΜΟΥΝΑ|ΙΟΝΤΑΝ|ΙΟΝΤΟΥΣΑΝ|ΙΟΣΑΣΤΑΝ|ΙΟΣΑΣΤΕ|ΙΟΣΟΥΝ|ΙΟΣΟΥΝΑ|ΙΟΤΑΝ|ΙΟΥΜΑ|ΙΟΥΜΑΣΤΕ|ΙΟΥΝΤΑΙ|ΙΟΥΝΤΑΝ|Η|ΗΔΕΣ|ΗΔΩΝ|ΗΘΕΙ|ΗΘΕΙΣ|ΗΘΕΙΤΕ|ΗΘΗΚΑΤΕ|ΗΘΗΚΑΝ|ΗΘΟΥΝ|ΗΘΩ|ΗΚΑΤΕ|ΗΚΑΝ|ΗΣ|ΗΣΑΝ|ΗΣΑΤΕ|ΗΣΕΙ|ΗΣΕΣ|ΗΣΟΥΝ|ΗΣΩ|Ο|ΟΙ|ΟΜΑΙ|ΟΜΑΣΤΑΝ|ΟΜΟΥΝ|ΟΜΟΥΝΑ|ΟΝΤΑΙ|ΟΝΤΑΝ|ΟΝΤΟΥΣΑΝ|ΟΣ|ΟΣΑΣΤΑΝ|ΟΣΑΣΤΕ|ΟΣΟΥΝ|ΟΣΟΥΝΑ|ΟΤΑΝ|ΟΥ|ΟΥΜΑΙ|ΟΥΜΑΣΤΕ|ΟΥΝ|ΟΥΝΤΑΙ|ΟΥΝΤΑΝ|ΟΥΣ|ΟΥΣΑΝ|ΟΥΣΑΤΕ|Υ|ΥΣ|Ω|ΩΝ)$/; + + if(re.test(w)) { + var fp = re.exec(w); + stem = fp[1]; + w = stem + "ΜΑ"; + } + + if((re2.test(w)) && (test1)) { + var fp = re2.exec(w); + stem = fp[1]; + w = stem; + + } + + re = /^(.+?)(ΕΣΤΕΡ|ΕΣΤΑΤ|ΟΤΕΡ|ΟΤΑΤ|ΥΤΕΡ|ΥΤΑΤ|ΩΤΕΡ|ΩΤΑΤ)$/; + + if(re.test(w)) { + var fp = re.exec(w); + stem = fp[1]; + w = stem; + } + + return w; +}; + +var greekStemmer = function (token) { + return token.update(function (word) { + return stemWord(word); + }) +} + +var idx = lunr(function () { + this.field('title') + this.field('excerpt') + this.field('categories') + this.field('tags') + this.ref('id') + + this.pipeline.remove(lunr.trimmer) + this.pipeline.add(greekStemmer) + this.pipeline.remove(lunr.stemmer) + + for (var item in store) { + this.add({ + title: store[item].title, + excerpt: store[item].excerpt, + categories: store[item].categories, + tags: store[item].tags, + id: item + }) + } +}); + +$(document).ready(function() { + $('input#search').on('keyup', function () { + var resultdiv = $('#results'); + var query = $(this).val().toLowerCase(); + var result = + idx.query(function (q) { + query.split(lunr.tokenizer.separator).forEach(function (term) { + q.term(term, { boost: 100 }) + if(query.lastIndexOf(" ") != query.length-1){ + q.term(term, { usePipeline: false, wildcard: lunr.Query.wildcard.TRAILING, boost: 10 }) + } + if (term != ""){ + q.term(term, { usePipeline: false, editDistance: 1, boost: 1 }) + } + }) + }); + resultdiv.empty(); + resultdiv.prepend('

'+result.length+' {{ site.data.ui-text[site.locale].results_found | default: "Result(s) found" }}

'); + for (var item in result) { + var ref = result[item].ref; + if(store[ref].teaser){ + var searchitem = + '
'+ + '
'+ + '

'+ + ''+store[ref].title+''+ + '

'+ + '
'+ + ''+ + '
'+ + '

'+store[ref].excerpt.split(" ").splice(0,20).join(" ")+'...

'+ + '
'+ + '
'; + } + else{ + var searchitem = + '
'+ + '
'+ + '

'+ + ''+store[ref].title+''+ + '

'+ + '

'+store[ref].excerpt.split(" ").splice(0,20).join(" ")+'...

'+ + '
'+ + '
'; + } + resultdiv.append(searchitem); + } + }); +}); diff --git a/src/assets/js/lunr/lunr-store.js b/src/assets/js/lunr/lunr-store.js new file mode 100644 index 0000000..ff5e2e6 --- /dev/null +++ b/src/assets/js/lunr/lunr-store.js @@ -0,0 +1,49 @@ +--- +layout: none +--- + +var store = [ + {%- for c in site.collections -%} + {%- if forloop.last -%} + {%- assign l = true -%} + {%- endif -%} + {%- assign docs = c.docs | where_exp:'doc','doc.search != false' -%} + {%- for doc in docs -%} + {%- if doc.header.teaser -%} + {%- capture teaser -%}{{ doc.header.teaser }}{%- endcapture -%} + {%- else -%} + {%- assign teaser = site.teaser -%} + {%- endif -%} + { + "title": {{ doc.title | jsonify }}, + "excerpt": + {%- if site.search_full_content == true -%} + {{ doc.content | newline_to_br | + replace:"
", " " | + replace:"

", " " | + replace:"", " " | + replace:"", " " | + replace:"", " " | + replace:"", " " | + replace:"", " " | + replace:"", " "| + strip_html | strip_newlines | jsonify }}, + {%- else -%} + {{ doc.content | newline_to_br | + replace:"
", " " | + replace:"

", " " | + replace:"", " " | + replace:"", " " | + replace:"", " " | + replace:"", " " | + replace:"", " " | + replace:"", " "| + strip_html | strip_newlines | truncatewords: 50 | jsonify }}, + {%- endif -%} + "categories": {{ doc.categories | jsonify }}, + "tags": {{ doc.tags | jsonify }}, + "url": {{ doc.url | relative_url | jsonify }}, + "teaser": {{ teaser | relative_url | jsonify }} + }{%- unless forloop.last and l -%},{%- endunless -%} + {%- endfor -%} + {%- endfor -%}] diff --git a/src/assets/js/lunr/lunr.js b/src/assets/js/lunr/lunr.js new file mode 100644 index 0000000..6aa370f --- /dev/null +++ b/src/assets/js/lunr/lunr.js @@ -0,0 +1,3475 @@ +/** + * lunr - http://lunrjs.com - A bit like Solr, but much smaller and not as bright - 2.3.9 + * Copyright (C) 2020 Oliver Nightingale + * @license MIT + */ + +;(function(){ + +/** + * A convenience function for configuring and constructing + * a new lunr Index. + * + * A lunr.Builder instance is created and the pipeline setup + * with a trimmer, stop word filter and stemmer. + * + * This builder object is yielded to the configuration function + * that is passed as a parameter, allowing the list of fields + * and other builder parameters to be customised. + * + * All documents _must_ be added within the passed config function. + * + * @example + * var idx = lunr(function () { + * this.field('title') + * this.field('body') + * this.ref('id') + * + * documents.forEach(function (doc) { + * this.add(doc) + * }, this) + * }) + * + * @see {@link lunr.Builder} + * @see {@link lunr.Pipeline} + * @see {@link lunr.trimmer} + * @see {@link lunr.stopWordFilter} + * @see {@link lunr.stemmer} + * @namespace {function} lunr + */ +var lunr = function (config) { + var builder = new lunr.Builder + + builder.pipeline.add( + lunr.trimmer, + lunr.stopWordFilter, + lunr.stemmer + ) + + builder.searchPipeline.add( + lunr.stemmer + ) + + config.call(builder, builder) + return builder.build() +} + +lunr.version = "2.3.9" +/*! + * lunr.utils + * Copyright (C) 2020 Oliver Nightingale + */ + +/** + * A namespace containing utils for the rest of the lunr library + * @namespace lunr.utils + */ +lunr.utils = {} + +/** + * Print a warning message to the console. + * + * @param {String} message The message to be printed. + * @memberOf lunr.utils + * @function + */ +lunr.utils.warn = (function (global) { + /* eslint-disable no-console */ + return function (message) { + if (global.console && console.warn) { + console.warn(message) + } + } + /* eslint-enable no-console */ +})(this) + +/** + * Convert an object to a string. + * + * In the case of `null` and `undefined` the function returns + * the empty string, in all other cases the result of calling + * `toString` on the passed object is returned. + * + * @param {Any} obj The object to convert to a string. + * @return {String} string representation of the passed object. + * @memberOf lunr.utils + */ +lunr.utils.asString = function (obj) { + if (obj === void 0 || obj === null) { + return "" + } else { + return obj.toString() + } +} + +/** + * Clones an object. + * + * Will create a copy of an existing object such that any mutations + * on the copy cannot affect the original. + * + * Only shallow objects are supported, passing a nested object to this + * function will cause a TypeError. + * + * Objects with primitives, and arrays of primitives are supported. + * + * @param {Object} obj The object to clone. + * @return {Object} a clone of the passed object. + * @throws {TypeError} when a nested object is passed. + * @memberOf Utils + */ +lunr.utils.clone = function (obj) { + if (obj === null || obj === undefined) { + return obj + } + + var clone = Object.create(null), + keys = Object.keys(obj) + + for (var i = 0; i < keys.length; i++) { + var key = keys[i], + val = obj[key] + + if (Array.isArray(val)) { + clone[key] = val.slice() + continue + } + + if (typeof val === 'string' || + typeof val === 'number' || + typeof val === 'boolean') { + clone[key] = val + continue + } + + throw new TypeError("clone is not deep and does not support nested objects") + } + + return clone +} +lunr.FieldRef = function (docRef, fieldName, stringValue) { + this.docRef = docRef + this.fieldName = fieldName + this._stringValue = stringValue +} + +lunr.FieldRef.joiner = "/" + +lunr.FieldRef.fromString = function (s) { + var n = s.indexOf(lunr.FieldRef.joiner) + + if (n === -1) { + throw "malformed field ref string" + } + + var fieldRef = s.slice(0, n), + docRef = s.slice(n + 1) + + return new lunr.FieldRef (docRef, fieldRef, s) +} + +lunr.FieldRef.prototype.toString = function () { + if (this._stringValue == undefined) { + this._stringValue = this.fieldName + lunr.FieldRef.joiner + this.docRef + } + + return this._stringValue +} +/*! + * lunr.Set + * Copyright (C) 2020 Oliver Nightingale + */ + +/** + * A lunr set. + * + * @constructor + */ +lunr.Set = function (elements) { + this.elements = Object.create(null) + + if (elements) { + this.length = elements.length + + for (var i = 0; i < this.length; i++) { + this.elements[elements[i]] = true + } + } else { + this.length = 0 + } +} + +/** + * A complete set that contains all elements. + * + * @static + * @readonly + * @type {lunr.Set} + */ +lunr.Set.complete = { + intersect: function (other) { + return other + }, + + union: function () { + return this + }, + + contains: function () { + return true + } +} + +/** + * An empty set that contains no elements. + * + * @static + * @readonly + * @type {lunr.Set} + */ +lunr.Set.empty = { + intersect: function () { + return this + }, + + union: function (other) { + return other + }, + + contains: function () { + return false + } +} + +/** + * Returns true if this set contains the specified object. + * + * @param {object} object - Object whose presence in this set is to be tested. + * @returns {boolean} - True if this set contains the specified object. + */ +lunr.Set.prototype.contains = function (object) { + return !!this.elements[object] +} + +/** + * Returns a new set containing only the elements that are present in both + * this set and the specified set. + * + * @param {lunr.Set} other - set to intersect with this set. + * @returns {lunr.Set} a new set that is the intersection of this and the specified set. + */ + +lunr.Set.prototype.intersect = function (other) { + var a, b, elements, intersection = [] + + if (other === lunr.Set.complete) { + return this + } + + if (other === lunr.Set.empty) { + return other + } + + if (this.length < other.length) { + a = this + b = other + } else { + a = other + b = this + } + + elements = Object.keys(a.elements) + + for (var i = 0; i < elements.length; i++) { + var element = elements[i] + if (element in b.elements) { + intersection.push(element) + } + } + + return new lunr.Set (intersection) +} + +/** + * Returns a new set combining the elements of this and the specified set. + * + * @param {lunr.Set} other - set to union with this set. + * @return {lunr.Set} a new set that is the union of this and the specified set. + */ + +lunr.Set.prototype.union = function (other) { + if (other === lunr.Set.complete) { + return lunr.Set.complete + } + + if (other === lunr.Set.empty) { + return this + } + + return new lunr.Set(Object.keys(this.elements).concat(Object.keys(other.elements))) +} +/** + * A function to calculate the inverse document frequency for + * a posting. This is shared between the builder and the index + * + * @private + * @param {object} posting - The posting for a given term + * @param {number} documentCount - The total number of documents. + */ +lunr.idf = function (posting, documentCount) { + var documentsWithTerm = 0 + + for (var fieldName in posting) { + if (fieldName == '_index') continue // Ignore the term index, its not a field + documentsWithTerm += Object.keys(posting[fieldName]).length + } + + var x = (documentCount - documentsWithTerm + 0.5) / (documentsWithTerm + 0.5) + + return Math.log(1 + Math.abs(x)) +} + +/** + * A token wraps a string representation of a token + * as it is passed through the text processing pipeline. + * + * @constructor + * @param {string} [str=''] - The string token being wrapped. + * @param {object} [metadata={}] - Metadata associated with this token. + */ +lunr.Token = function (str, metadata) { + this.str = str || "" + this.metadata = metadata || {} +} + +/** + * Returns the token string that is being wrapped by this object. + * + * @returns {string} + */ +lunr.Token.prototype.toString = function () { + return this.str +} + +/** + * A token update function is used when updating or optionally + * when cloning a token. + * + * @callback lunr.Token~updateFunction + * @param {string} str - The string representation of the token. + * @param {Object} metadata - All metadata associated with this token. + */ + +/** + * Applies the given function to the wrapped string token. + * + * @example + * token.update(function (str, metadata) { + * return str.toUpperCase() + * }) + * + * @param {lunr.Token~updateFunction} fn - A function to apply to the token string. + * @returns {lunr.Token} + */ +lunr.Token.prototype.update = function (fn) { + this.str = fn(this.str, this.metadata) + return this +} + +/** + * Creates a clone of this token. Optionally a function can be + * applied to the cloned token. + * + * @param {lunr.Token~updateFunction} [fn] - An optional function to apply to the cloned token. + * @returns {lunr.Token} + */ +lunr.Token.prototype.clone = function (fn) { + fn = fn || function (s) { return s } + return new lunr.Token (fn(this.str, this.metadata), this.metadata) +} +/*! + * lunr.tokenizer + * Copyright (C) 2020 Oliver Nightingale + */ + +/** + * A function for splitting a string into tokens ready to be inserted into + * the search index. Uses `lunr.tokenizer.separator` to split strings, change + * the value of this property to change how strings are split into tokens. + * + * This tokenizer will convert its parameter to a string by calling `toString` and + * then will split this string on the character in `lunr.tokenizer.separator`. + * Arrays will have their elements converted to strings and wrapped in a lunr.Token. + * + * Optional metadata can be passed to the tokenizer, this metadata will be cloned and + * added as metadata to every token that is created from the object to be tokenized. + * + * @static + * @param {?(string|object|object[])} obj - The object to convert into tokens + * @param {?object} metadata - Optional metadata to associate with every token + * @returns {lunr.Token[]} + * @see {@link lunr.Pipeline} + */ +lunr.tokenizer = function (obj, metadata) { + if (obj == null || obj == undefined) { + return [] + } + + if (Array.isArray(obj)) { + return obj.map(function (t) { + return new lunr.Token( + lunr.utils.asString(t).toLowerCase(), + lunr.utils.clone(metadata) + ) + }) + } + + var str = obj.toString().toLowerCase(), + len = str.length, + tokens = [] + + for (var sliceEnd = 0, sliceStart = 0; sliceEnd <= len; sliceEnd++) { + var char = str.charAt(sliceEnd), + sliceLength = sliceEnd - sliceStart + + if ((char.match(lunr.tokenizer.separator) || sliceEnd == len)) { + + if (sliceLength > 0) { + var tokenMetadata = lunr.utils.clone(metadata) || {} + tokenMetadata["position"] = [sliceStart, sliceLength] + tokenMetadata["index"] = tokens.length + + tokens.push( + new lunr.Token ( + str.slice(sliceStart, sliceEnd), + tokenMetadata + ) + ) + } + + sliceStart = sliceEnd + 1 + } + + } + + return tokens +} + +/** + * The separator used to split a string into tokens. Override this property to change the behaviour of + * `lunr.tokenizer` behaviour when tokenizing strings. By default this splits on whitespace and hyphens. + * + * @static + * @see lunr.tokenizer + */ +lunr.tokenizer.separator = /[\s\-]+/ +/*! + * lunr.Pipeline + * Copyright (C) 2020 Oliver Nightingale + */ + +/** + * lunr.Pipelines maintain an ordered list of functions to be applied to all + * tokens in documents entering the search index and queries being ran against + * the index. + * + * An instance of lunr.Index created with the lunr shortcut will contain a + * pipeline with a stop word filter and an English language stemmer. Extra + * functions can be added before or after either of these functions or these + * default functions can be removed. + * + * When run the pipeline will call each function in turn, passing a token, the + * index of that token in the original list of all tokens and finally a list of + * all the original tokens. + * + * The output of functions in the pipeline will be passed to the next function + * in the pipeline. To exclude a token from entering the index the function + * should return undefined, the rest of the pipeline will not be called with + * this token. + * + * For serialisation of pipelines to work, all functions used in an instance of + * a pipeline should be registered with lunr.Pipeline. Registered functions can + * then be loaded. If trying to load a serialised pipeline that uses functions + * that are not registered an error will be thrown. + * + * If not planning on serialising the pipeline then registering pipeline functions + * is not necessary. + * + * @constructor + */ +lunr.Pipeline = function () { + this._stack = [] +} + +lunr.Pipeline.registeredFunctions = Object.create(null) + +/** + * A pipeline function maps lunr.Token to lunr.Token. A lunr.Token contains the token + * string as well as all known metadata. A pipeline function can mutate the token string + * or mutate (or add) metadata for a given token. + * + * A pipeline function can indicate that the passed token should be discarded by returning + * null, undefined or an empty string. This token will not be passed to any downstream pipeline + * functions and will not be added to the index. + * + * Multiple tokens can be returned by returning an array of tokens. Each token will be passed + * to any downstream pipeline functions and all will returned tokens will be added to the index. + * + * Any number of pipeline functions may be chained together using a lunr.Pipeline. + * + * @interface lunr.PipelineFunction + * @param {lunr.Token} token - A token from the document being processed. + * @param {number} i - The index of this token in the complete list of tokens for this document/field. + * @param {lunr.Token[]} tokens - All tokens for this document/field. + * @returns {(?lunr.Token|lunr.Token[])} + */ + +/** + * Register a function with the pipeline. + * + * Functions that are used in the pipeline should be registered if the pipeline + * needs to be serialised, or a serialised pipeline needs to be loaded. + * + * Registering a function does not add it to a pipeline, functions must still be + * added to instances of the pipeline for them to be used when running a pipeline. + * + * @param {lunr.PipelineFunction} fn - The function to check for. + * @param {String} label - The label to register this function with + */ +lunr.Pipeline.registerFunction = function (fn, label) { + if (label in this.registeredFunctions) { + lunr.utils.warn('Overwriting existing registered function: ' + label) + } + + fn.label = label + lunr.Pipeline.registeredFunctions[fn.label] = fn +} + +/** + * Warns if the function is not registered as a Pipeline function. + * + * @param {lunr.PipelineFunction} fn - The function to check for. + * @private + */ +lunr.Pipeline.warnIfFunctionNotRegistered = function (fn) { + var isRegistered = fn.label && (fn.label in this.registeredFunctions) + + if (!isRegistered) { + lunr.utils.warn('Function is not registered with pipeline. This may cause problems when serialising the index.\n', fn) + } +} + +/** + * Loads a previously serialised pipeline. + * + * All functions to be loaded must already be registered with lunr.Pipeline. + * If any function from the serialised data has not been registered then an + * error will be thrown. + * + * @param {Object} serialised - The serialised pipeline to load. + * @returns {lunr.Pipeline} + */ +lunr.Pipeline.load = function (serialised) { + var pipeline = new lunr.Pipeline + + serialised.forEach(function (fnName) { + var fn = lunr.Pipeline.registeredFunctions[fnName] + + if (fn) { + pipeline.add(fn) + } else { + throw new Error('Cannot load unregistered function: ' + fnName) + } + }) + + return pipeline +} + +/** + * Adds new functions to the end of the pipeline. + * + * Logs a warning if the function has not been registered. + * + * @param {lunr.PipelineFunction[]} functions - Any number of functions to add to the pipeline. + */ +lunr.Pipeline.prototype.add = function () { + var fns = Array.prototype.slice.call(arguments) + + fns.forEach(function (fn) { + lunr.Pipeline.warnIfFunctionNotRegistered(fn) + this._stack.push(fn) + }, this) +} + +/** + * Adds a single function after a function that already exists in the + * pipeline. + * + * Logs a warning if the function has not been registered. + * + * @param {lunr.PipelineFunction} existingFn - A function that already exists in the pipeline. + * @param {lunr.PipelineFunction} newFn - The new function to add to the pipeline. + */ +lunr.Pipeline.prototype.after = function (existingFn, newFn) { + lunr.Pipeline.warnIfFunctionNotRegistered(newFn) + + var pos = this._stack.indexOf(existingFn) + if (pos == -1) { + throw new Error('Cannot find existingFn') + } + + pos = pos + 1 + this._stack.splice(pos, 0, newFn) +} + +/** + * Adds a single function before a function that already exists in the + * pipeline. + * + * Logs a warning if the function has not been registered. + * + * @param {lunr.PipelineFunction} existingFn - A function that already exists in the pipeline. + * @param {lunr.PipelineFunction} newFn - The new function to add to the pipeline. + */ +lunr.Pipeline.prototype.before = function (existingFn, newFn) { + lunr.Pipeline.warnIfFunctionNotRegistered(newFn) + + var pos = this._stack.indexOf(existingFn) + if (pos == -1) { + throw new Error('Cannot find existingFn') + } + + this._stack.splice(pos, 0, newFn) +} + +/** + * Removes a function from the pipeline. + * + * @param {lunr.PipelineFunction} fn The function to remove from the pipeline. + */ +lunr.Pipeline.prototype.remove = function (fn) { + var pos = this._stack.indexOf(fn) + if (pos == -1) { + return + } + + this._stack.splice(pos, 1) +} + +/** + * Runs the current list of functions that make up the pipeline against the + * passed tokens. + * + * @param {Array} tokens The tokens to run through the pipeline. + * @returns {Array} + */ +lunr.Pipeline.prototype.run = function (tokens) { + var stackLength = this._stack.length + + for (var i = 0; i < stackLength; i++) { + var fn = this._stack[i] + var memo = [] + + for (var j = 0; j < tokens.length; j++) { + var result = fn(tokens[j], j, tokens) + + if (result === null || result === void 0 || result === '') continue + + if (Array.isArray(result)) { + for (var k = 0; k < result.length; k++) { + memo.push(result[k]) + } + } else { + memo.push(result) + } + } + + tokens = memo + } + + return tokens +} + +/** + * Convenience method for passing a string through a pipeline and getting + * strings out. This method takes care of wrapping the passed string in a + * token and mapping the resulting tokens back to strings. + * + * @param {string} str - The string to pass through the pipeline. + * @param {?object} metadata - Optional metadata to associate with the token + * passed to the pipeline. + * @returns {string[]} + */ +lunr.Pipeline.prototype.runString = function (str, metadata) { + var token = new lunr.Token (str, metadata) + + return this.run([token]).map(function (t) { + return t.toString() + }) +} + +/** + * Resets the pipeline by removing any existing processors. + * + */ +lunr.Pipeline.prototype.reset = function () { + this._stack = [] +} + +/** + * Returns a representation of the pipeline ready for serialisation. + * + * Logs a warning if the function has not been registered. + * + * @returns {Array} + */ +lunr.Pipeline.prototype.toJSON = function () { + return this._stack.map(function (fn) { + lunr.Pipeline.warnIfFunctionNotRegistered(fn) + + return fn.label + }) +} +/*! + * lunr.Vector + * Copyright (C) 2020 Oliver Nightingale + */ + +/** + * A vector is used to construct the vector space of documents and queries. These + * vectors support operations to determine the similarity between two documents or + * a document and a query. + * + * Normally no parameters are required for initializing a vector, but in the case of + * loading a previously dumped vector the raw elements can be provided to the constructor. + * + * For performance reasons vectors are implemented with a flat array, where an elements + * index is immediately followed by its value. E.g. [index, value, index, value]. This + * allows the underlying array to be as sparse as possible and still offer decent + * performance when being used for vector calculations. + * + * @constructor + * @param {Number[]} [elements] - The flat list of element index and element value pairs. + */ +lunr.Vector = function (elements) { + this._magnitude = 0 + this.elements = elements || [] +} + + +/** + * Calculates the position within the vector to insert a given index. + * + * This is used internally by insert and upsert. If there are duplicate indexes then + * the position is returned as if the value for that index were to be updated, but it + * is the callers responsibility to check whether there is a duplicate at that index + * + * @param {Number} insertIdx - The index at which the element should be inserted. + * @returns {Number} + */ +lunr.Vector.prototype.positionForIndex = function (index) { + // For an empty vector the tuple can be inserted at the beginning + if (this.elements.length == 0) { + return 0 + } + + var start = 0, + end = this.elements.length / 2, + sliceLength = end - start, + pivotPoint = Math.floor(sliceLength / 2), + pivotIndex = this.elements[pivotPoint * 2] + + while (sliceLength > 1) { + if (pivotIndex < index) { + start = pivotPoint + } + + if (pivotIndex > index) { + end = pivotPoint + } + + if (pivotIndex == index) { + break + } + + sliceLength = end - start + pivotPoint = start + Math.floor(sliceLength / 2) + pivotIndex = this.elements[pivotPoint * 2] + } + + if (pivotIndex == index) { + return pivotPoint * 2 + } + + if (pivotIndex > index) { + return pivotPoint * 2 + } + + if (pivotIndex < index) { + return (pivotPoint + 1) * 2 + } +} + +/** + * Inserts an element at an index within the vector. + * + * Does not allow duplicates, will throw an error if there is already an entry + * for this index. + * + * @param {Number} insertIdx - The index at which the element should be inserted. + * @param {Number} val - The value to be inserted into the vector. + */ +lunr.Vector.prototype.insert = function (insertIdx, val) { + this.upsert(insertIdx, val, function () { + throw "duplicate index" + }) +} + +/** + * Inserts or updates an existing index within the vector. + * + * @param {Number} insertIdx - The index at which the element should be inserted. + * @param {Number} val - The value to be inserted into the vector. + * @param {function} fn - A function that is called for updates, the existing value and the + * requested value are passed as arguments + */ +lunr.Vector.prototype.upsert = function (insertIdx, val, fn) { + this._magnitude = 0 + var position = this.positionForIndex(insertIdx) + + if (this.elements[position] == insertIdx) { + this.elements[position + 1] = fn(this.elements[position + 1], val) + } else { + this.elements.splice(position, 0, insertIdx, val) + } +} + +/** + * Calculates the magnitude of this vector. + * + * @returns {Number} + */ +lunr.Vector.prototype.magnitude = function () { + if (this._magnitude) return this._magnitude + + var sumOfSquares = 0, + elementsLength = this.elements.length + + for (var i = 1; i < elementsLength; i += 2) { + var val = this.elements[i] + sumOfSquares += val * val + } + + return this._magnitude = Math.sqrt(sumOfSquares) +} + +/** + * Calculates the dot product of this vector and another vector. + * + * @param {lunr.Vector} otherVector - The vector to compute the dot product with. + * @returns {Number} + */ +lunr.Vector.prototype.dot = function (otherVector) { + var dotProduct = 0, + a = this.elements, b = otherVector.elements, + aLen = a.length, bLen = b.length, + aVal = 0, bVal = 0, + i = 0, j = 0 + + while (i < aLen && j < bLen) { + aVal = a[i], bVal = b[j] + if (aVal < bVal) { + i += 2 + } else if (aVal > bVal) { + j += 2 + } else if (aVal == bVal) { + dotProduct += a[i + 1] * b[j + 1] + i += 2 + j += 2 + } + } + + return dotProduct +} + +/** + * Calculates the similarity between this vector and another vector. + * + * @param {lunr.Vector} otherVector - The other vector to calculate the + * similarity with. + * @returns {Number} + */ +lunr.Vector.prototype.similarity = function (otherVector) { + return this.dot(otherVector) / this.magnitude() || 0 +} + +/** + * Converts the vector to an array of the elements within the vector. + * + * @returns {Number[]} + */ +lunr.Vector.prototype.toArray = function () { + var output = new Array (this.elements.length / 2) + + for (var i = 1, j = 0; i < this.elements.length; i += 2, j++) { + output[j] = this.elements[i] + } + + return output +} + +/** + * A JSON serializable representation of the vector. + * + * @returns {Number[]} + */ +lunr.Vector.prototype.toJSON = function () { + return this.elements +} +/* eslint-disable */ +/*! + * lunr.stemmer + * Copyright (C) 2020 Oliver Nightingale + * Includes code from - http://tartarus.org/~martin/PorterStemmer/js.txt + */ + +/** + * lunr.stemmer is an english language stemmer, this is a JavaScript + * implementation of the PorterStemmer taken from http://tartarus.org/~martin + * + * @static + * @implements {lunr.PipelineFunction} + * @param {lunr.Token} token - The string to stem + * @returns {lunr.Token} + * @see {@link lunr.Pipeline} + * @function + */ +lunr.stemmer = (function(){ + var step2list = { + "ational" : "ate", + "tional" : "tion", + "enci" : "ence", + "anci" : "ance", + "izer" : "ize", + "bli" : "ble", + "alli" : "al", + "entli" : "ent", + "eli" : "e", + "ousli" : "ous", + "ization" : "ize", + "ation" : "ate", + "ator" : "ate", + "alism" : "al", + "iveness" : "ive", + "fulness" : "ful", + "ousness" : "ous", + "aliti" : "al", + "iviti" : "ive", + "biliti" : "ble", + "logi" : "log" + }, + + step3list = { + "icate" : "ic", + "ative" : "", + "alize" : "al", + "iciti" : "ic", + "ical" : "ic", + "ful" : "", + "ness" : "" + }, + + c = "[^aeiou]", // consonant + v = "[aeiouy]", // vowel + C = c + "[^aeiouy]*", // consonant sequence + V = v + "[aeiou]*", // vowel sequence + + mgr0 = "^(" + C + ")?" + V + C, // [C]VC... is m>0 + meq1 = "^(" + C + ")?" + V + C + "(" + V + ")?$", // [C]VC[V] is m=1 + mgr1 = "^(" + C + ")?" + V + C + V + C, // [C]VCVC... is m>1 + s_v = "^(" + C + ")?" + v; // vowel in stem + + var re_mgr0 = new RegExp(mgr0); + var re_mgr1 = new RegExp(mgr1); + var re_meq1 = new RegExp(meq1); + var re_s_v = new RegExp(s_v); + + var re_1a = /^(.+?)(ss|i)es$/; + var re2_1a = /^(.+?)([^s])s$/; + var re_1b = /^(.+?)eed$/; + var re2_1b = /^(.+?)(ed|ing)$/; + var re_1b_2 = /.$/; + var re2_1b_2 = /(at|bl|iz)$/; + var re3_1b_2 = new RegExp("([^aeiouylsz])\\1$"); + var re4_1b_2 = new RegExp("^" + C + v + "[^aeiouwxy]$"); + + var re_1c = /^(.+?[^aeiou])y$/; + var re_2 = /^(.+?)(ational|tional|enci|anci|izer|bli|alli|entli|eli|ousli|ization|ation|ator|alism|iveness|fulness|ousness|aliti|iviti|biliti|logi)$/; + + var re_3 = /^(.+?)(icate|ative|alize|iciti|ical|ful|ness)$/; + + var re_4 = /^(.+?)(al|ance|ence|er|ic|able|ible|ant|ement|ment|ent|ou|ism|ate|iti|ous|ive|ize)$/; + var re2_4 = /^(.+?)(s|t)(ion)$/; + + var re_5 = /^(.+?)e$/; + var re_5_1 = /ll$/; + var re3_5 = new RegExp("^" + C + v + "[^aeiouwxy]$"); + + var porterStemmer = function porterStemmer(w) { + var stem, + suffix, + firstch, + re, + re2, + re3, + re4; + + if (w.length < 3) { return w; } + + firstch = w.substr(0,1); + if (firstch == "y") { + w = firstch.toUpperCase() + w.substr(1); + } + + // Step 1a + re = re_1a + re2 = re2_1a; + + if (re.test(w)) { w = w.replace(re,"$1$2"); } + else if (re2.test(w)) { w = w.replace(re2,"$1$2"); } + + // Step 1b + re = re_1b; + re2 = re2_1b; + if (re.test(w)) { + var fp = re.exec(w); + re = re_mgr0; + if (re.test(fp[1])) { + re = re_1b_2; + w = w.replace(re,""); + } + } else if (re2.test(w)) { + var fp = re2.exec(w); + stem = fp[1]; + re2 = re_s_v; + if (re2.test(stem)) { + w = stem; + re2 = re2_1b_2; + re3 = re3_1b_2; + re4 = re4_1b_2; + if (re2.test(w)) { w = w + "e"; } + else if (re3.test(w)) { re = re_1b_2; w = w.replace(re,""); } + else if (re4.test(w)) { w = w + "e"; } + } + } + + // Step 1c - replace suffix y or Y by i if preceded by a non-vowel which is not the first letter of the word (so cry -> cri, by -> by, say -> say) + re = re_1c; + if (re.test(w)) { + var fp = re.exec(w); + stem = fp[1]; + w = stem + "i"; + } + + // Step 2 + re = re_2; + if (re.test(w)) { + var fp = re.exec(w); + stem = fp[1]; + suffix = fp[2]; + re = re_mgr0; + if (re.test(stem)) { + w = stem + step2list[suffix]; + } + } + + // Step 3 + re = re_3; + if (re.test(w)) { + var fp = re.exec(w); + stem = fp[1]; + suffix = fp[2]; + re = re_mgr0; + if (re.test(stem)) { + w = stem + step3list[suffix]; + } + } + + // Step 4 + re = re_4; + re2 = re2_4; + if (re.test(w)) { + var fp = re.exec(w); + stem = fp[1]; + re = re_mgr1; + if (re.test(stem)) { + w = stem; + } + } else if (re2.test(w)) { + var fp = re2.exec(w); + stem = fp[1] + fp[2]; + re2 = re_mgr1; + if (re2.test(stem)) { + w = stem; + } + } + + // Step 5 + re = re_5; + if (re.test(w)) { + var fp = re.exec(w); + stem = fp[1]; + re = re_mgr1; + re2 = re_meq1; + re3 = re3_5; + if (re.test(stem) || (re2.test(stem) && !(re3.test(stem)))) { + w = stem; + } + } + + re = re_5_1; + re2 = re_mgr1; + if (re.test(w) && re2.test(w)) { + re = re_1b_2; + w = w.replace(re,""); + } + + // and turn initial Y back to y + + if (firstch == "y") { + w = firstch.toLowerCase() + w.substr(1); + } + + return w; + }; + + return function (token) { + return token.update(porterStemmer); + } +})(); + +lunr.Pipeline.registerFunction(lunr.stemmer, 'stemmer') +/*! + * lunr.stopWordFilter + * Copyright (C) 2020 Oliver Nightingale + */ + +/** + * lunr.generateStopWordFilter builds a stopWordFilter function from the provided + * list of stop words. + * + * The built in lunr.stopWordFilter is built using this generator and can be used + * to generate custom stopWordFilters for applications or non English languages. + * + * @function + * @param {Array} token The token to pass through the filter + * @returns {lunr.PipelineFunction} + * @see lunr.Pipeline + * @see lunr.stopWordFilter + */ +lunr.generateStopWordFilter = function (stopWords) { + var words = stopWords.reduce(function (memo, stopWord) { + memo[stopWord] = stopWord + return memo + }, {}) + + return function (token) { + if (token && words[token.toString()] !== token.toString()) return token + } +} + +/** + * lunr.stopWordFilter is an English language stop word list filter, any words + * contained in the list will not be passed through the filter. + * + * This is intended to be used in the Pipeline. If the token does not pass the + * filter then undefined will be returned. + * + * @function + * @implements {lunr.PipelineFunction} + * @params {lunr.Token} token - A token to check for being a stop word. + * @returns {lunr.Token} + * @see {@link lunr.Pipeline} + */ +lunr.stopWordFilter = lunr.generateStopWordFilter([ + 'a', + 'able', + 'about', + 'across', + 'after', + 'all', + 'almost', + 'also', + 'am', + 'among', + 'an', + 'and', + 'any', + 'are', + 'as', + 'at', + 'be', + 'because', + 'been', + 'but', + 'by', + 'can', + 'cannot', + 'could', + 'dear', + 'did', + 'do', + 'does', + 'either', + 'else', + 'ever', + 'every', + 'for', + 'from', + 'get', + 'got', + 'had', + 'has', + 'have', + 'he', + 'her', + 'hers', + 'him', + 'his', + 'how', + 'however', + 'i', + 'if', + 'in', + 'into', + 'is', + 'it', + 'its', + 'just', + 'least', + 'let', + 'like', + 'likely', + 'may', + 'me', + 'might', + 'most', + 'must', + 'my', + 'neither', + 'no', + 'nor', + 'not', + 'of', + 'off', + 'often', + 'on', + 'only', + 'or', + 'other', + 'our', + 'own', + 'rather', + 'said', + 'say', + 'says', + 'she', + 'should', + 'since', + 'so', + 'some', + 'than', + 'that', + 'the', + 'their', + 'them', + 'then', + 'there', + 'these', + 'they', + 'this', + 'tis', + 'to', + 'too', + 'twas', + 'us', + 'wants', + 'was', + 'we', + 'were', + 'what', + 'when', + 'where', + 'which', + 'while', + 'who', + 'whom', + 'why', + 'will', + 'with', + 'would', + 'yet', + 'you', + 'your' +]) + +lunr.Pipeline.registerFunction(lunr.stopWordFilter, 'stopWordFilter') +/*! + * lunr.trimmer + * Copyright (C) 2020 Oliver Nightingale + */ + +/** + * lunr.trimmer is a pipeline function for trimming non word + * characters from the beginning and end of tokens before they + * enter the index. + * + * This implementation may not work correctly for non latin + * characters and should either be removed or adapted for use + * with languages with non-latin characters. + * + * @static + * @implements {lunr.PipelineFunction} + * @param {lunr.Token} token The token to pass through the filter + * @returns {lunr.Token} + * @see lunr.Pipeline + */ +lunr.trimmer = function (token) { + return token.update(function (s) { + return s.replace(/^\W+/, '').replace(/\W+$/, '') + }) +} + +lunr.Pipeline.registerFunction(lunr.trimmer, 'trimmer') +/*! + * lunr.TokenSet + * Copyright (C) 2020 Oliver Nightingale + */ + +/** + * A token set is used to store the unique list of all tokens + * within an index. Token sets are also used to represent an + * incoming query to the index, this query token set and index + * token set are then intersected to find which tokens to look + * up in the inverted index. + * + * A token set can hold multiple tokens, as in the case of the + * index token set, or it can hold a single token as in the + * case of a simple query token set. + * + * Additionally token sets are used to perform wildcard matching. + * Leading, contained and trailing wildcards are supported, and + * from this edit distance matching can also be provided. + * + * Token sets are implemented as a minimal finite state automata, + * where both common prefixes and suffixes are shared between tokens. + * This helps to reduce the space used for storing the token set. + * + * @constructor + */ +lunr.TokenSet = function () { + this.final = false + this.edges = {} + this.id = lunr.TokenSet._nextId + lunr.TokenSet._nextId += 1 +} + +/** + * Keeps track of the next, auto increment, identifier to assign + * to a new tokenSet. + * + * TokenSets require a unique identifier to be correctly minimised. + * + * @private + */ +lunr.TokenSet._nextId = 1 + +/** + * Creates a TokenSet instance from the given sorted array of words. + * + * @param {String[]} arr - A sorted array of strings to create the set from. + * @returns {lunr.TokenSet} + * @throws Will throw an error if the input array is not sorted. + */ +lunr.TokenSet.fromArray = function (arr) { + var builder = new lunr.TokenSet.Builder + + for (var i = 0, len = arr.length; i < len; i++) { + builder.insert(arr[i]) + } + + builder.finish() + return builder.root +} + +/** + * Creates a token set from a query clause. + * + * @private + * @param {Object} clause - A single clause from lunr.Query. + * @param {string} clause.term - The query clause term. + * @param {number} [clause.editDistance] - The optional edit distance for the term. + * @returns {lunr.TokenSet} + */ +lunr.TokenSet.fromClause = function (clause) { + if ('editDistance' in clause) { + return lunr.TokenSet.fromFuzzyString(clause.term, clause.editDistance) + } else { + return lunr.TokenSet.fromString(clause.term) + } +} + +/** + * Creates a token set representing a single string with a specified + * edit distance. + * + * Insertions, deletions, substitutions and transpositions are each + * treated as an edit distance of 1. + * + * Increasing the allowed edit distance will have a dramatic impact + * on the performance of both creating and intersecting these TokenSets. + * It is advised to keep the edit distance less than 3. + * + * @param {string} str - The string to create the token set from. + * @param {number} editDistance - The allowed edit distance to match. + * @returns {lunr.Vector} + */ +lunr.TokenSet.fromFuzzyString = function (str, editDistance) { + var root = new lunr.TokenSet + + var stack = [{ + node: root, + editsRemaining: editDistance, + str: str + }] + + while (stack.length) { + var frame = stack.pop() + + // no edit + if (frame.str.length > 0) { + var char = frame.str.charAt(0), + noEditNode + + if (char in frame.node.edges) { + noEditNode = frame.node.edges[char] + } else { + noEditNode = new lunr.TokenSet + frame.node.edges[char] = noEditNode + } + + if (frame.str.length == 1) { + noEditNode.final = true + } + + stack.push({ + node: noEditNode, + editsRemaining: frame.editsRemaining, + str: frame.str.slice(1) + }) + } + + if (frame.editsRemaining == 0) { + continue + } + + // insertion + if ("*" in frame.node.edges) { + var insertionNode = frame.node.edges["*"] + } else { + var insertionNode = new lunr.TokenSet + frame.node.edges["*"] = insertionNode + } + + if (frame.str.length == 0) { + insertionNode.final = true + } + + stack.push({ + node: insertionNode, + editsRemaining: frame.editsRemaining - 1, + str: frame.str + }) + + // deletion + // can only do a deletion if we have enough edits remaining + // and if there are characters left to delete in the string + if (frame.str.length > 1) { + stack.push({ + node: frame.node, + editsRemaining: frame.editsRemaining - 1, + str: frame.str.slice(1) + }) + } + + // deletion + // just removing the last character from the str + if (frame.str.length == 1) { + frame.node.final = true + } + + // substitution + // can only do a substitution if we have enough edits remaining + // and if there are characters left to substitute + if (frame.str.length >= 1) { + if ("*" in frame.node.edges) { + var substitutionNode = frame.node.edges["*"] + } else { + var substitutionNode = new lunr.TokenSet + frame.node.edges["*"] = substitutionNode + } + + if (frame.str.length == 1) { + substitutionNode.final = true + } + + stack.push({ + node: substitutionNode, + editsRemaining: frame.editsRemaining - 1, + str: frame.str.slice(1) + }) + } + + // transposition + // can only do a transposition if there are edits remaining + // and there are enough characters to transpose + if (frame.str.length > 1) { + var charA = frame.str.charAt(0), + charB = frame.str.charAt(1), + transposeNode + + if (charB in frame.node.edges) { + transposeNode = frame.node.edges[charB] + } else { + transposeNode = new lunr.TokenSet + frame.node.edges[charB] = transposeNode + } + + if (frame.str.length == 1) { + transposeNode.final = true + } + + stack.push({ + node: transposeNode, + editsRemaining: frame.editsRemaining - 1, + str: charA + frame.str.slice(2) + }) + } + } + + return root +} + +/** + * Creates a TokenSet from a string. + * + * The string may contain one or more wildcard characters (*) + * that will allow wildcard matching when intersecting with + * another TokenSet. + * + * @param {string} str - The string to create a TokenSet from. + * @returns {lunr.TokenSet} + */ +lunr.TokenSet.fromString = function (str) { + var node = new lunr.TokenSet, + root = node + + /* + * Iterates through all characters within the passed string + * appending a node for each character. + * + * When a wildcard character is found then a self + * referencing edge is introduced to continually match + * any number of any characters. + */ + for (var i = 0, len = str.length; i < len; i++) { + var char = str[i], + final = (i == len - 1) + + if (char == "*") { + node.edges[char] = node + node.final = final + + } else { + var next = new lunr.TokenSet + next.final = final + + node.edges[char] = next + node = next + } + } + + return root +} + +/** + * Converts this TokenSet into an array of strings + * contained within the TokenSet. + * + * This is not intended to be used on a TokenSet that + * contains wildcards, in these cases the results are + * undefined and are likely to cause an infinite loop. + * + * @returns {string[]} + */ +lunr.TokenSet.prototype.toArray = function () { + var words = [] + + var stack = [{ + prefix: "", + node: this + }] + + while (stack.length) { + var frame = stack.pop(), + edges = Object.keys(frame.node.edges), + len = edges.length + + if (frame.node.final) { + /* In Safari, at this point the prefix is sometimes corrupted, see: + * https://github.com/olivernn/lunr.js/issues/279 Calling any + * String.prototype method forces Safari to "cast" this string to what + * it's supposed to be, fixing the bug. */ + frame.prefix.charAt(0) + words.push(frame.prefix) + } + + for (var i = 0; i < len; i++) { + var edge = edges[i] + + stack.push({ + prefix: frame.prefix.concat(edge), + node: frame.node.edges[edge] + }) + } + } + + return words +} + +/** + * Generates a string representation of a TokenSet. + * + * This is intended to allow TokenSets to be used as keys + * in objects, largely to aid the construction and minimisation + * of a TokenSet. As such it is not designed to be a human + * friendly representation of the TokenSet. + * + * @returns {string} + */ +lunr.TokenSet.prototype.toString = function () { + // NOTE: Using Object.keys here as this.edges is very likely + // to enter 'hash-mode' with many keys being added + // + // avoiding a for-in loop here as it leads to the function + // being de-optimised (at least in V8). From some simple + // benchmarks the performance is comparable, but allowing + // V8 to optimize may mean easy performance wins in the future. + + if (this._str) { + return this._str + } + + var str = this.final ? '1' : '0', + labels = Object.keys(this.edges).sort(), + len = labels.length + + for (var i = 0; i < len; i++) { + var label = labels[i], + node = this.edges[label] + + str = str + label + node.id + } + + return str +} + +/** + * Returns a new TokenSet that is the intersection of + * this TokenSet and the passed TokenSet. + * + * This intersection will take into account any wildcards + * contained within the TokenSet. + * + * @param {lunr.TokenSet} b - An other TokenSet to intersect with. + * @returns {lunr.TokenSet} + */ +lunr.TokenSet.prototype.intersect = function (b) { + var output = new lunr.TokenSet, + frame = undefined + + var stack = [{ + qNode: b, + output: output, + node: this + }] + + while (stack.length) { + frame = stack.pop() + + // NOTE: As with the #toString method, we are using + // Object.keys and a for loop instead of a for-in loop + // as both of these objects enter 'hash' mode, causing + // the function to be de-optimised in V8 + var qEdges = Object.keys(frame.qNode.edges), + qLen = qEdges.length, + nEdges = Object.keys(frame.node.edges), + nLen = nEdges.length + + for (var q = 0; q < qLen; q++) { + var qEdge = qEdges[q] + + for (var n = 0; n < nLen; n++) { + var nEdge = nEdges[n] + + if (nEdge == qEdge || qEdge == '*') { + var node = frame.node.edges[nEdge], + qNode = frame.qNode.edges[qEdge], + final = node.final && qNode.final, + next = undefined + + if (nEdge in frame.output.edges) { + // an edge already exists for this character + // no need to create a new node, just set the finality + // bit unless this node is already final + next = frame.output.edges[nEdge] + next.final = next.final || final + + } else { + // no edge exists yet, must create one + // set the finality bit and insert it + // into the output + next = new lunr.TokenSet + next.final = final + frame.output.edges[nEdge] = next + } + + stack.push({ + qNode: qNode, + output: next, + node: node + }) + } + } + } + } + + return output +} +lunr.TokenSet.Builder = function () { + this.previousWord = "" + this.root = new lunr.TokenSet + this.uncheckedNodes = [] + this.minimizedNodes = {} +} + +lunr.TokenSet.Builder.prototype.insert = function (word) { + var node, + commonPrefix = 0 + + if (word < this.previousWord) { + throw new Error ("Out of order word insertion") + } + + for (var i = 0; i < word.length && i < this.previousWord.length; i++) { + if (word[i] != this.previousWord[i]) break + commonPrefix++ + } + + this.minimize(commonPrefix) + + if (this.uncheckedNodes.length == 0) { + node = this.root + } else { + node = this.uncheckedNodes[this.uncheckedNodes.length - 1].child + } + + for (var i = commonPrefix; i < word.length; i++) { + var nextNode = new lunr.TokenSet, + char = word[i] + + node.edges[char] = nextNode + + this.uncheckedNodes.push({ + parent: node, + char: char, + child: nextNode + }) + + node = nextNode + } + + node.final = true + this.previousWord = word +} + +lunr.TokenSet.Builder.prototype.finish = function () { + this.minimize(0) +} + +lunr.TokenSet.Builder.prototype.minimize = function (downTo) { + for (var i = this.uncheckedNodes.length - 1; i >= downTo; i--) { + var node = this.uncheckedNodes[i], + childKey = node.child.toString() + + if (childKey in this.minimizedNodes) { + node.parent.edges[node.char] = this.minimizedNodes[childKey] + } else { + // Cache the key for this node since + // we know it can't change anymore + node.child._str = childKey + + this.minimizedNodes[childKey] = node.child + } + + this.uncheckedNodes.pop() + } +} +/*! + * lunr.Index + * Copyright (C) 2020 Oliver Nightingale + */ + +/** + * An index contains the built index of all documents and provides a query interface + * to the index. + * + * Usually instances of lunr.Index will not be created using this constructor, instead + * lunr.Builder should be used to construct new indexes, or lunr.Index.load should be + * used to load previously built and serialized indexes. + * + * @constructor + * @param {Object} attrs - The attributes of the built search index. + * @param {Object} attrs.invertedIndex - An index of term/field to document reference. + * @param {Object} attrs.fieldVectors - Field vectors + * @param {lunr.TokenSet} attrs.tokenSet - An set of all corpus tokens. + * @param {string[]} attrs.fields - The names of indexed document fields. + * @param {lunr.Pipeline} attrs.pipeline - The pipeline to use for search terms. + */ +lunr.Index = function (attrs) { + this.invertedIndex = attrs.invertedIndex + this.fieldVectors = attrs.fieldVectors + this.tokenSet = attrs.tokenSet + this.fields = attrs.fields + this.pipeline = attrs.pipeline +} + +/** + * A result contains details of a document matching a search query. + * @typedef {Object} lunr.Index~Result + * @property {string} ref - The reference of the document this result represents. + * @property {number} score - A number between 0 and 1 representing how similar this document is to the query. + * @property {lunr.MatchData} matchData - Contains metadata about this match including which term(s) caused the match. + */ + +/** + * Although lunr provides the ability to create queries using lunr.Query, it also provides a simple + * query language which itself is parsed into an instance of lunr.Query. + * + * For programmatically building queries it is advised to directly use lunr.Query, the query language + * is best used for human entered text rather than program generated text. + * + * At its simplest queries can just be a single term, e.g. `hello`, multiple terms are also supported + * and will be combined with OR, e.g `hello world` will match documents that contain either 'hello' + * or 'world', though those that contain both will rank higher in the results. + * + * Wildcards can be included in terms to match one or more unspecified characters, these wildcards can + * be inserted anywhere within the term, and more than one wildcard can exist in a single term. Adding + * wildcards will increase the number of documents that will be found but can also have a negative + * impact on query performance, especially with wildcards at the beginning of a term. + * + * Terms can be restricted to specific fields, e.g. `title:hello`, only documents with the term + * hello in the title field will match this query. Using a field not present in the index will lead + * to an error being thrown. + * + * Modifiers can also be added to terms, lunr supports edit distance and boost modifiers on terms. A term + * boost will make documents matching that term score higher, e.g. `foo^5`. Edit distance is also supported + * to provide fuzzy matching, e.g. 'hello~2' will match documents with hello with an edit distance of 2. + * Avoid large values for edit distance to improve query performance. + * + * Each term also supports a presence modifier. By default a term's presence in document is optional, however + * this can be changed to either required or prohibited. For a term's presence to be required in a document the + * term should be prefixed with a '+', e.g. `+foo bar` is a search for documents that must contain 'foo' and + * optionally contain 'bar'. Conversely a leading '-' sets the terms presence to prohibited, i.e. it must not + * appear in a document, e.g. `-foo bar` is a search for documents that do not contain 'foo' but may contain 'bar'. + * + * To escape special characters the backslash character '\' can be used, this allows searches to include + * characters that would normally be considered modifiers, e.g. `foo\~2` will search for a term "foo~2" instead + * of attempting to apply a boost of 2 to the search term "foo". + * + * @typedef {string} lunr.Index~QueryString + * @example Simple single term query + * hello + * @example Multiple term query + * hello world + * @example term scoped to a field + * title:hello + * @example term with a boost of 10 + * hello^10 + * @example term with an edit distance of 2 + * hello~2 + * @example terms with presence modifiers + * -foo +bar baz + */ + +/** + * Performs a search against the index using lunr query syntax. + * + * Results will be returned sorted by their score, the most relevant results + * will be returned first. For details on how the score is calculated, please see + * the {@link https://lunrjs.com/guides/searching.html#scoring|guide}. + * + * For more programmatic querying use lunr.Index#query. + * + * @param {lunr.Index~QueryString} queryString - A string containing a lunr query. + * @throws {lunr.QueryParseError} If the passed query string cannot be parsed. + * @returns {lunr.Index~Result[]} + */ +lunr.Index.prototype.search = function (queryString) { + return this.query(function (query) { + var parser = new lunr.QueryParser(queryString, query) + parser.parse() + }) +} + +/** + * A query builder callback provides a query object to be used to express + * the query to perform on the index. + * + * @callback lunr.Index~queryBuilder + * @param {lunr.Query} query - The query object to build up. + * @this lunr.Query + */ + +/** + * Performs a query against the index using the yielded lunr.Query object. + * + * If performing programmatic queries against the index, this method is preferred + * over lunr.Index#search so as to avoid the additional query parsing overhead. + * + * A query object is yielded to the supplied function which should be used to + * express the query to be run against the index. + * + * Note that although this function takes a callback parameter it is _not_ an + * asynchronous operation, the callback is just yielded a query object to be + * customized. + * + * @param {lunr.Index~queryBuilder} fn - A function that is used to build the query. + * @returns {lunr.Index~Result[]} + */ +lunr.Index.prototype.query = function (fn) { + // for each query clause + // * process terms + // * expand terms from token set + // * find matching documents and metadata + // * get document vectors + // * score documents + + var query = new lunr.Query(this.fields), + matchingFields = Object.create(null), + queryVectors = Object.create(null), + termFieldCache = Object.create(null), + requiredMatches = Object.create(null), + prohibitedMatches = Object.create(null) + + /* + * To support field level boosts a query vector is created per + * field. An empty vector is eagerly created to support negated + * queries. + */ + for (var i = 0; i < this.fields.length; i++) { + queryVectors[this.fields[i]] = new lunr.Vector + } + + fn.call(query, query) + + for (var i = 0; i < query.clauses.length; i++) { + /* + * Unless the pipeline has been disabled for this term, which is + * the case for terms with wildcards, we need to pass the clause + * term through the search pipeline. A pipeline returns an array + * of processed terms. Pipeline functions may expand the passed + * term, which means we may end up performing multiple index lookups + * for a single query term. + */ + var clause = query.clauses[i], + terms = null, + clauseMatches = lunr.Set.empty + + if (clause.usePipeline) { + terms = this.pipeline.runString(clause.term, { + fields: clause.fields + }) + } else { + terms = [clause.term] + } + + for (var m = 0; m < terms.length; m++) { + var term = terms[m] + + /* + * Each term returned from the pipeline needs to use the same query + * clause object, e.g. the same boost and or edit distance. The + * simplest way to do this is to re-use the clause object but mutate + * its term property. + */ + clause.term = term + + /* + * From the term in the clause we create a token set which will then + * be used to intersect the indexes token set to get a list of terms + * to lookup in the inverted index + */ + var termTokenSet = lunr.TokenSet.fromClause(clause), + expandedTerms = this.tokenSet.intersect(termTokenSet).toArray() + + /* + * If a term marked as required does not exist in the tokenSet it is + * impossible for the search to return any matches. We set all the field + * scoped required matches set to empty and stop examining any further + * clauses. + */ + if (expandedTerms.length === 0 && clause.presence === lunr.Query.presence.REQUIRED) { + for (var k = 0; k < clause.fields.length; k++) { + var field = clause.fields[k] + requiredMatches[field] = lunr.Set.empty + } + + break + } + + for (var j = 0; j < expandedTerms.length; j++) { + /* + * For each term get the posting and termIndex, this is required for + * building the query vector. + */ + var expandedTerm = expandedTerms[j], + posting = this.invertedIndex[expandedTerm], + termIndex = posting._index + + for (var k = 0; k < clause.fields.length; k++) { + /* + * For each field that this query term is scoped by (by default + * all fields are in scope) we need to get all the document refs + * that have this term in that field. + * + * The posting is the entry in the invertedIndex for the matching + * term from above. + */ + var field = clause.fields[k], + fieldPosting = posting[field], + matchingDocumentRefs = Object.keys(fieldPosting), + termField = expandedTerm + "/" + field, + matchingDocumentsSet = new lunr.Set(matchingDocumentRefs) + + /* + * if the presence of this term is required ensure that the matching + * documents are added to the set of required matches for this clause. + * + */ + if (clause.presence == lunr.Query.presence.REQUIRED) { + clauseMatches = clauseMatches.union(matchingDocumentsSet) + + if (requiredMatches[field] === undefined) { + requiredMatches[field] = lunr.Set.complete + } + } + + /* + * if the presence of this term is prohibited ensure that the matching + * documents are added to the set of prohibited matches for this field, + * creating that set if it does not yet exist. + */ + if (clause.presence == lunr.Query.presence.PROHIBITED) { + if (prohibitedMatches[field] === undefined) { + prohibitedMatches[field] = lunr.Set.empty + } + + prohibitedMatches[field] = prohibitedMatches[field].union(matchingDocumentsSet) + + /* + * Prohibited matches should not be part of the query vector used for + * similarity scoring and no metadata should be extracted so we continue + * to the next field + */ + continue + } + + /* + * The query field vector is populated using the termIndex found for + * the term and a unit value with the appropriate boost applied. + * Using upsert because there could already be an entry in the vector + * for the term we are working with. In that case we just add the scores + * together. + */ + queryVectors[field].upsert(termIndex, clause.boost, function (a, b) { return a + b }) + + /** + * If we've already seen this term, field combo then we've already collected + * the matching documents and metadata, no need to go through all that again + */ + if (termFieldCache[termField]) { + continue + } + + for (var l = 0; l < matchingDocumentRefs.length; l++) { + /* + * All metadata for this term/field/document triple + * are then extracted and collected into an instance + * of lunr.MatchData ready to be returned in the query + * results + */ + var matchingDocumentRef = matchingDocumentRefs[l], + matchingFieldRef = new lunr.FieldRef (matchingDocumentRef, field), + metadata = fieldPosting[matchingDocumentRef], + fieldMatch + + if ((fieldMatch = matchingFields[matchingFieldRef]) === undefined) { + matchingFields[matchingFieldRef] = new lunr.MatchData (expandedTerm, field, metadata) + } else { + fieldMatch.add(expandedTerm, field, metadata) + } + + } + + termFieldCache[termField] = true + } + } + } + + /** + * If the presence was required we need to update the requiredMatches field sets. + * We do this after all fields for the term have collected their matches because + * the clause terms presence is required in _any_ of the fields not _all_ of the + * fields. + */ + if (clause.presence === lunr.Query.presence.REQUIRED) { + for (var k = 0; k < clause.fields.length; k++) { + var field = clause.fields[k] + requiredMatches[field] = requiredMatches[field].intersect(clauseMatches) + } + } + } + + /** + * Need to combine the field scoped required and prohibited + * matching documents into a global set of required and prohibited + * matches + */ + var allRequiredMatches = lunr.Set.complete, + allProhibitedMatches = lunr.Set.empty + + for (var i = 0; i < this.fields.length; i++) { + var field = this.fields[i] + + if (requiredMatches[field]) { + allRequiredMatches = allRequiredMatches.intersect(requiredMatches[field]) + } + + if (prohibitedMatches[field]) { + allProhibitedMatches = allProhibitedMatches.union(prohibitedMatches[field]) + } + } + + var matchingFieldRefs = Object.keys(matchingFields), + results = [], + matches = Object.create(null) + + /* + * If the query is negated (contains only prohibited terms) + * we need to get _all_ fieldRefs currently existing in the + * index. This is only done when we know that the query is + * entirely prohibited terms to avoid any cost of getting all + * fieldRefs unnecessarily. + * + * Additionally, blank MatchData must be created to correctly + * populate the results. + */ + if (query.isNegated()) { + matchingFieldRefs = Object.keys(this.fieldVectors) + + for (var i = 0; i < matchingFieldRefs.length; i++) { + var matchingFieldRef = matchingFieldRefs[i] + var fieldRef = lunr.FieldRef.fromString(matchingFieldRef) + matchingFields[matchingFieldRef] = new lunr.MatchData + } + } + + for (var i = 0; i < matchingFieldRefs.length; i++) { + /* + * Currently we have document fields that match the query, but we + * need to return documents. The matchData and scores are combined + * from multiple fields belonging to the same document. + * + * Scores are calculated by field, using the query vectors created + * above, and combined into a final document score using addition. + */ + var fieldRef = lunr.FieldRef.fromString(matchingFieldRefs[i]), + docRef = fieldRef.docRef + + if (!allRequiredMatches.contains(docRef)) { + continue + } + + if (allProhibitedMatches.contains(docRef)) { + continue + } + + var fieldVector = this.fieldVectors[fieldRef], + score = queryVectors[fieldRef.fieldName].similarity(fieldVector), + docMatch + + if ((docMatch = matches[docRef]) !== undefined) { + docMatch.score += score + docMatch.matchData.combine(matchingFields[fieldRef]) + } else { + var match = { + ref: docRef, + score: score, + matchData: matchingFields[fieldRef] + } + matches[docRef] = match + results.push(match) + } + } + + /* + * Sort the results objects by score, highest first. + */ + return results.sort(function (a, b) { + return b.score - a.score + }) +} + +/** + * Prepares the index for JSON serialization. + * + * The schema for this JSON blob will be described in a + * separate JSON schema file. + * + * @returns {Object} + */ +lunr.Index.prototype.toJSON = function () { + var invertedIndex = Object.keys(this.invertedIndex) + .sort() + .map(function (term) { + return [term, this.invertedIndex[term]] + }, this) + + var fieldVectors = Object.keys(this.fieldVectors) + .map(function (ref) { + return [ref, this.fieldVectors[ref].toJSON()] + }, this) + + return { + version: lunr.version, + fields: this.fields, + fieldVectors: fieldVectors, + invertedIndex: invertedIndex, + pipeline: this.pipeline.toJSON() + } +} + +/** + * Loads a previously serialized lunr.Index + * + * @param {Object} serializedIndex - A previously serialized lunr.Index + * @returns {lunr.Index} + */ +lunr.Index.load = function (serializedIndex) { + var attrs = {}, + fieldVectors = {}, + serializedVectors = serializedIndex.fieldVectors, + invertedIndex = Object.create(null), + serializedInvertedIndex = serializedIndex.invertedIndex, + tokenSetBuilder = new lunr.TokenSet.Builder, + pipeline = lunr.Pipeline.load(serializedIndex.pipeline) + + if (serializedIndex.version != lunr.version) { + lunr.utils.warn("Version mismatch when loading serialised index. Current version of lunr '" + lunr.version + "' does not match serialized index '" + serializedIndex.version + "'") + } + + for (var i = 0; i < serializedVectors.length; i++) { + var tuple = serializedVectors[i], + ref = tuple[0], + elements = tuple[1] + + fieldVectors[ref] = new lunr.Vector(elements) + } + + for (var i = 0; i < serializedInvertedIndex.length; i++) { + var tuple = serializedInvertedIndex[i], + term = tuple[0], + posting = tuple[1] + + tokenSetBuilder.insert(term) + invertedIndex[term] = posting + } + + tokenSetBuilder.finish() + + attrs.fields = serializedIndex.fields + + attrs.fieldVectors = fieldVectors + attrs.invertedIndex = invertedIndex + attrs.tokenSet = tokenSetBuilder.root + attrs.pipeline = pipeline + + return new lunr.Index(attrs) +} +/*! + * lunr.Builder + * Copyright (C) 2020 Oliver Nightingale + */ + +/** + * lunr.Builder performs indexing on a set of documents and + * returns instances of lunr.Index ready for querying. + * + * All configuration of the index is done via the builder, the + * fields to index, the document reference, the text processing + * pipeline and document scoring parameters are all set on the + * builder before indexing. + * + * @constructor + * @property {string} _ref - Internal reference to the document reference field. + * @property {string[]} _fields - Internal reference to the document fields to index. + * @property {object} invertedIndex - The inverted index maps terms to document fields. + * @property {object} documentTermFrequencies - Keeps track of document term frequencies. + * @property {object} documentLengths - Keeps track of the length of documents added to the index. + * @property {lunr.tokenizer} tokenizer - Function for splitting strings into tokens for indexing. + * @property {lunr.Pipeline} pipeline - The pipeline performs text processing on tokens before indexing. + * @property {lunr.Pipeline} searchPipeline - A pipeline for processing search terms before querying the index. + * @property {number} documentCount - Keeps track of the total number of documents indexed. + * @property {number} _b - A parameter to control field length normalization, setting this to 0 disabled normalization, 1 fully normalizes field lengths, the default value is 0.75. + * @property {number} _k1 - A parameter to control how quickly an increase in term frequency results in term frequency saturation, the default value is 1.2. + * @property {number} termIndex - A counter incremented for each unique term, used to identify a terms position in the vector space. + * @property {array} metadataWhitelist - A list of metadata keys that have been whitelisted for entry in the index. + */ +lunr.Builder = function () { + this._ref = "id" + this._fields = Object.create(null) + this._documents = Object.create(null) + this.invertedIndex = Object.create(null) + this.fieldTermFrequencies = {} + this.fieldLengths = {} + this.tokenizer = lunr.tokenizer + this.pipeline = new lunr.Pipeline + this.searchPipeline = new lunr.Pipeline + this.documentCount = 0 + this._b = 0.75 + this._k1 = 1.2 + this.termIndex = 0 + this.metadataWhitelist = [] +} + +/** + * Sets the document field used as the document reference. Every document must have this field. + * The type of this field in the document should be a string, if it is not a string it will be + * coerced into a string by calling toString. + * + * The default ref is 'id'. + * + * The ref should _not_ be changed during indexing, it should be set before any documents are + * added to the index. Changing it during indexing can lead to inconsistent results. + * + * @param {string} ref - The name of the reference field in the document. + */ +lunr.Builder.prototype.ref = function (ref) { + this._ref = ref +} + +/** + * A function that is used to extract a field from a document. + * + * Lunr expects a field to be at the top level of a document, if however the field + * is deeply nested within a document an extractor function can be used to extract + * the right field for indexing. + * + * @callback fieldExtractor + * @param {object} doc - The document being added to the index. + * @returns {?(string|object|object[])} obj - The object that will be indexed for this field. + * @example Extracting a nested field + * function (doc) { return doc.nested.field } + */ + +/** + * Adds a field to the list of document fields that will be indexed. Every document being + * indexed should have this field. Null values for this field in indexed documents will + * not cause errors but will limit the chance of that document being retrieved by searches. + * + * All fields should be added before adding documents to the index. Adding fields after + * a document has been indexed will have no effect on already indexed documents. + * + * Fields can be boosted at build time. This allows terms within that field to have more + * importance when ranking search results. Use a field boost to specify that matches within + * one field are more important than other fields. + * + * @param {string} fieldName - The name of a field to index in all documents. + * @param {object} attributes - Optional attributes associated with this field. + * @param {number} [attributes.boost=1] - Boost applied to all terms within this field. + * @param {fieldExtractor} [attributes.extractor] - Function to extract a field from a document. + * @throws {RangeError} fieldName cannot contain unsupported characters '/' + */ +lunr.Builder.prototype.field = function (fieldName, attributes) { + if (/\//.test(fieldName)) { + throw new RangeError ("Field '" + fieldName + "' contains illegal character '/'") + } + + this._fields[fieldName] = attributes || {} +} + +/** + * A parameter to tune the amount of field length normalisation that is applied when + * calculating relevance scores. A value of 0 will completely disable any normalisation + * and a value of 1 will fully normalise field lengths. The default is 0.75. Values of b + * will be clamped to the range 0 - 1. + * + * @param {number} number - The value to set for this tuning parameter. + */ +lunr.Builder.prototype.b = function (number) { + if (number < 0) { + this._b = 0 + } else if (number > 1) { + this._b = 1 + } else { + this._b = number + } +} + +/** + * A parameter that controls the speed at which a rise in term frequency results in term + * frequency saturation. The default value is 1.2. Setting this to a higher value will give + * slower saturation levels, a lower value will result in quicker saturation. + * + * @param {number} number - The value to set for this tuning parameter. + */ +lunr.Builder.prototype.k1 = function (number) { + this._k1 = number +} + +/** + * Adds a document to the index. + * + * Before adding fields to the index the index should have been fully setup, with the document + * ref and all fields to index already having been specified. + * + * The document must have a field name as specified by the ref (by default this is 'id') and + * it should have all fields defined for indexing, though null or undefined values will not + * cause errors. + * + * Entire documents can be boosted at build time. Applying a boost to a document indicates that + * this document should rank higher in search results than other documents. + * + * @param {object} doc - The document to add to the index. + * @param {object} attributes - Optional attributes associated with this document. + * @param {number} [attributes.boost=1] - Boost applied to all terms within this document. + */ +lunr.Builder.prototype.add = function (doc, attributes) { + var docRef = doc[this._ref], + fields = Object.keys(this._fields) + + this._documents[docRef] = attributes || {} + this.documentCount += 1 + + for (var i = 0; i < fields.length; i++) { + var fieldName = fields[i], + extractor = this._fields[fieldName].extractor, + field = extractor ? extractor(doc) : doc[fieldName], + tokens = this.tokenizer(field, { + fields: [fieldName] + }), + terms = this.pipeline.run(tokens), + fieldRef = new lunr.FieldRef (docRef, fieldName), + fieldTerms = Object.create(null) + + this.fieldTermFrequencies[fieldRef] = fieldTerms + this.fieldLengths[fieldRef] = 0 + + // store the length of this field for this document + this.fieldLengths[fieldRef] += terms.length + + // calculate term frequencies for this field + for (var j = 0; j < terms.length; j++) { + var term = terms[j] + + if (fieldTerms[term] == undefined) { + fieldTerms[term] = 0 + } + + fieldTerms[term] += 1 + + // add to inverted index + // create an initial posting if one doesn't exist + if (this.invertedIndex[term] == undefined) { + var posting = Object.create(null) + posting["_index"] = this.termIndex + this.termIndex += 1 + + for (var k = 0; k < fields.length; k++) { + posting[fields[k]] = Object.create(null) + } + + this.invertedIndex[term] = posting + } + + // add an entry for this term/fieldName/docRef to the invertedIndex + if (this.invertedIndex[term][fieldName][docRef] == undefined) { + this.invertedIndex[term][fieldName][docRef] = Object.create(null) + } + + // store all whitelisted metadata about this token in the + // inverted index + for (var l = 0; l < this.metadataWhitelist.length; l++) { + var metadataKey = this.metadataWhitelist[l], + metadata = term.metadata[metadataKey] + + if (this.invertedIndex[term][fieldName][docRef][metadataKey] == undefined) { + this.invertedIndex[term][fieldName][docRef][metadataKey] = [] + } + + this.invertedIndex[term][fieldName][docRef][metadataKey].push(metadata) + } + } + + } +} + +/** + * Calculates the average document length for this index + * + * @private + */ +lunr.Builder.prototype.calculateAverageFieldLengths = function () { + + var fieldRefs = Object.keys(this.fieldLengths), + numberOfFields = fieldRefs.length, + accumulator = {}, + documentsWithField = {} + + for (var i = 0; i < numberOfFields; i++) { + var fieldRef = lunr.FieldRef.fromString(fieldRefs[i]), + field = fieldRef.fieldName + + documentsWithField[field] || (documentsWithField[field] = 0) + documentsWithField[field] += 1 + + accumulator[field] || (accumulator[field] = 0) + accumulator[field] += this.fieldLengths[fieldRef] + } + + var fields = Object.keys(this._fields) + + for (var i = 0; i < fields.length; i++) { + var fieldName = fields[i] + accumulator[fieldName] = accumulator[fieldName] / documentsWithField[fieldName] + } + + this.averageFieldLength = accumulator +} + +/** + * Builds a vector space model of every document using lunr.Vector + * + * @private + */ +lunr.Builder.prototype.createFieldVectors = function () { + var fieldVectors = {}, + fieldRefs = Object.keys(this.fieldTermFrequencies), + fieldRefsLength = fieldRefs.length, + termIdfCache = Object.create(null) + + for (var i = 0; i < fieldRefsLength; i++) { + var fieldRef = lunr.FieldRef.fromString(fieldRefs[i]), + fieldName = fieldRef.fieldName, + fieldLength = this.fieldLengths[fieldRef], + fieldVector = new lunr.Vector, + termFrequencies = this.fieldTermFrequencies[fieldRef], + terms = Object.keys(termFrequencies), + termsLength = terms.length + + + var fieldBoost = this._fields[fieldName].boost || 1, + docBoost = this._documents[fieldRef.docRef].boost || 1 + + for (var j = 0; j < termsLength; j++) { + var term = terms[j], + tf = termFrequencies[term], + termIndex = this.invertedIndex[term]._index, + idf, score, scoreWithPrecision + + if (termIdfCache[term] === undefined) { + idf = lunr.idf(this.invertedIndex[term], this.documentCount) + termIdfCache[term] = idf + } else { + idf = termIdfCache[term] + } + + score = idf * ((this._k1 + 1) * tf) / (this._k1 * (1 - this._b + this._b * (fieldLength / this.averageFieldLength[fieldName])) + tf) + score *= fieldBoost + score *= docBoost + scoreWithPrecision = Math.round(score * 1000) / 1000 + // Converts 1.23456789 to 1.234. + // Reducing the precision so that the vectors take up less + // space when serialised. Doing it now so that they behave + // the same before and after serialisation. Also, this is + // the fastest approach to reducing a number's precision in + // JavaScript. + + fieldVector.insert(termIndex, scoreWithPrecision) + } + + fieldVectors[fieldRef] = fieldVector + } + + this.fieldVectors = fieldVectors +} + +/** + * Creates a token set of all tokens in the index using lunr.TokenSet + * + * @private + */ +lunr.Builder.prototype.createTokenSet = function () { + this.tokenSet = lunr.TokenSet.fromArray( + Object.keys(this.invertedIndex).sort() + ) +} + +/** + * Builds the index, creating an instance of lunr.Index. + * + * This completes the indexing process and should only be called + * once all documents have been added to the index. + * + * @returns {lunr.Index} + */ +lunr.Builder.prototype.build = function () { + this.calculateAverageFieldLengths() + this.createFieldVectors() + this.createTokenSet() + + return new lunr.Index({ + invertedIndex: this.invertedIndex, + fieldVectors: this.fieldVectors, + tokenSet: this.tokenSet, + fields: Object.keys(this._fields), + pipeline: this.searchPipeline + }) +} + +/** + * Applies a plugin to the index builder. + * + * A plugin is a function that is called with the index builder as its context. + * Plugins can be used to customise or extend the behaviour of the index + * in some way. A plugin is just a function, that encapsulated the custom + * behaviour that should be applied when building the index. + * + * The plugin function will be called with the index builder as its argument, additional + * arguments can also be passed when calling use. The function will be called + * with the index builder as its context. + * + * @param {Function} plugin The plugin to apply. + */ +lunr.Builder.prototype.use = function (fn) { + var args = Array.prototype.slice.call(arguments, 1) + args.unshift(this) + fn.apply(this, args) +} +/** + * Contains and collects metadata about a matching document. + * A single instance of lunr.MatchData is returned as part of every + * lunr.Index~Result. + * + * @constructor + * @param {string} term - The term this match data is associated with + * @param {string} field - The field in which the term was found + * @param {object} metadata - The metadata recorded about this term in this field + * @property {object} metadata - A cloned collection of metadata associated with this document. + * @see {@link lunr.Index~Result} + */ +lunr.MatchData = function (term, field, metadata) { + var clonedMetadata = Object.create(null), + metadataKeys = Object.keys(metadata || {}) + + // Cloning the metadata to prevent the original + // being mutated during match data combination. + // Metadata is kept in an array within the inverted + // index so cloning the data can be done with + // Array#slice + for (var i = 0; i < metadataKeys.length; i++) { + var key = metadataKeys[i] + clonedMetadata[key] = metadata[key].slice() + } + + this.metadata = Object.create(null) + + if (term !== undefined) { + this.metadata[term] = Object.create(null) + this.metadata[term][field] = clonedMetadata + } +} + +/** + * An instance of lunr.MatchData will be created for every term that matches a + * document. However only one instance is required in a lunr.Index~Result. This + * method combines metadata from another instance of lunr.MatchData with this + * objects metadata. + * + * @param {lunr.MatchData} otherMatchData - Another instance of match data to merge with this one. + * @see {@link lunr.Index~Result} + */ +lunr.MatchData.prototype.combine = function (otherMatchData) { + var terms = Object.keys(otherMatchData.metadata) + + for (var i = 0; i < terms.length; i++) { + var term = terms[i], + fields = Object.keys(otherMatchData.metadata[term]) + + if (this.metadata[term] == undefined) { + this.metadata[term] = Object.create(null) + } + + for (var j = 0; j < fields.length; j++) { + var field = fields[j], + keys = Object.keys(otherMatchData.metadata[term][field]) + + if (this.metadata[term][field] == undefined) { + this.metadata[term][field] = Object.create(null) + } + + for (var k = 0; k < keys.length; k++) { + var key = keys[k] + + if (this.metadata[term][field][key] == undefined) { + this.metadata[term][field][key] = otherMatchData.metadata[term][field][key] + } else { + this.metadata[term][field][key] = this.metadata[term][field][key].concat(otherMatchData.metadata[term][field][key]) + } + + } + } + } +} + +/** + * Add metadata for a term/field pair to this instance of match data. + * + * @param {string} term - The term this match data is associated with + * @param {string} field - The field in which the term was found + * @param {object} metadata - The metadata recorded about this term in this field + */ +lunr.MatchData.prototype.add = function (term, field, metadata) { + if (!(term in this.metadata)) { + this.metadata[term] = Object.create(null) + this.metadata[term][field] = metadata + return + } + + if (!(field in this.metadata[term])) { + this.metadata[term][field] = metadata + return + } + + var metadataKeys = Object.keys(metadata) + + for (var i = 0; i < metadataKeys.length; i++) { + var key = metadataKeys[i] + + if (key in this.metadata[term][field]) { + this.metadata[term][field][key] = this.metadata[term][field][key].concat(metadata[key]) + } else { + this.metadata[term][field][key] = metadata[key] + } + } +} +/** + * A lunr.Query provides a programmatic way of defining queries to be performed + * against a {@link lunr.Index}. + * + * Prefer constructing a lunr.Query using the {@link lunr.Index#query} method + * so the query object is pre-initialized with the right index fields. + * + * @constructor + * @property {lunr.Query~Clause[]} clauses - An array of query clauses. + * @property {string[]} allFields - An array of all available fields in a lunr.Index. + */ +lunr.Query = function (allFields) { + this.clauses = [] + this.allFields = allFields +} + +/** + * Constants for indicating what kind of automatic wildcard insertion will be used when constructing a query clause. + * + * This allows wildcards to be added to the beginning and end of a term without having to manually do any string + * concatenation. + * + * The wildcard constants can be bitwise combined to select both leading and trailing wildcards. + * + * @constant + * @default + * @property {number} wildcard.NONE - The term will have no wildcards inserted, this is the default behaviour + * @property {number} wildcard.LEADING - Prepend the term with a wildcard, unless a leading wildcard already exists + * @property {number} wildcard.TRAILING - Append a wildcard to the term, unless a trailing wildcard already exists + * @see lunr.Query~Clause + * @see lunr.Query#clause + * @see lunr.Query#term + * @example query term with trailing wildcard + * query.term('foo', { wildcard: lunr.Query.wildcard.TRAILING }) + * @example query term with leading and trailing wildcard + * query.term('foo', { + * wildcard: lunr.Query.wildcard.LEADING | lunr.Query.wildcard.TRAILING + * }) + */ + +lunr.Query.wildcard = new String ("*") +lunr.Query.wildcard.NONE = 0 +lunr.Query.wildcard.LEADING = 1 +lunr.Query.wildcard.TRAILING = 2 + +/** + * Constants for indicating what kind of presence a term must have in matching documents. + * + * @constant + * @enum {number} + * @see lunr.Query~Clause + * @see lunr.Query#clause + * @see lunr.Query#term + * @example query term with required presence + * query.term('foo', { presence: lunr.Query.presence.REQUIRED }) + */ +lunr.Query.presence = { + /** + * Term's presence in a document is optional, this is the default value. + */ + OPTIONAL: 1, + + /** + * Term's presence in a document is required, documents that do not contain + * this term will not be returned. + */ + REQUIRED: 2, + + /** + * Term's presence in a document is prohibited, documents that do contain + * this term will not be returned. + */ + PROHIBITED: 3 +} + +/** + * A single clause in a {@link lunr.Query} contains a term and details on how to + * match that term against a {@link lunr.Index}. + * + * @typedef {Object} lunr.Query~Clause + * @property {string[]} fields - The fields in an index this clause should be matched against. + * @property {number} [boost=1] - Any boost that should be applied when matching this clause. + * @property {number} [editDistance] - Whether the term should have fuzzy matching applied, and how fuzzy the match should be. + * @property {boolean} [usePipeline] - Whether the term should be passed through the search pipeline. + * @property {number} [wildcard=lunr.Query.wildcard.NONE] - Whether the term should have wildcards appended or prepended. + * @property {number} [presence=lunr.Query.presence.OPTIONAL] - The terms presence in any matching documents. + */ + +/** + * Adds a {@link lunr.Query~Clause} to this query. + * + * Unless the clause contains the fields to be matched all fields will be matched. In addition + * a default boost of 1 is applied to the clause. + * + * @param {lunr.Query~Clause} clause - The clause to add to this query. + * @see lunr.Query~Clause + * @returns {lunr.Query} + */ +lunr.Query.prototype.clause = function (clause) { + if (!('fields' in clause)) { + clause.fields = this.allFields + } + + if (!('boost' in clause)) { + clause.boost = 1 + } + + if (!('usePipeline' in clause)) { + clause.usePipeline = true + } + + if (!('wildcard' in clause)) { + clause.wildcard = lunr.Query.wildcard.NONE + } + + if ((clause.wildcard & lunr.Query.wildcard.LEADING) && (clause.term.charAt(0) != lunr.Query.wildcard)) { + clause.term = "*" + clause.term + } + + if ((clause.wildcard & lunr.Query.wildcard.TRAILING) && (clause.term.slice(-1) != lunr.Query.wildcard)) { + clause.term = "" + clause.term + "*" + } + + if (!('presence' in clause)) { + clause.presence = lunr.Query.presence.OPTIONAL + } + + this.clauses.push(clause) + + return this +} + +/** + * A negated query is one in which every clause has a presence of + * prohibited. These queries require some special processing to return + * the expected results. + * + * @returns boolean + */ +lunr.Query.prototype.isNegated = function () { + for (var i = 0; i < this.clauses.length; i++) { + if (this.clauses[i].presence != lunr.Query.presence.PROHIBITED) { + return false + } + } + + return true +} + +/** + * Adds a term to the current query, under the covers this will create a {@link lunr.Query~Clause} + * to the list of clauses that make up this query. + * + * The term is used as is, i.e. no tokenization will be performed by this method. Instead conversion + * to a token or token-like string should be done before calling this method. + * + * The term will be converted to a string by calling `toString`. Multiple terms can be passed as an + * array, each term in the array will share the same options. + * + * @param {object|object[]} term - The term(s) to add to the query. + * @param {object} [options] - Any additional properties to add to the query clause. + * @returns {lunr.Query} + * @see lunr.Query#clause + * @see lunr.Query~Clause + * @example adding a single term to a query + * query.term("foo") + * @example adding a single term to a query and specifying search fields, term boost and automatic trailing wildcard + * query.term("foo", { + * fields: ["title"], + * boost: 10, + * wildcard: lunr.Query.wildcard.TRAILING + * }) + * @example using lunr.tokenizer to convert a string to tokens before using them as terms + * query.term(lunr.tokenizer("foo bar")) + */ +lunr.Query.prototype.term = function (term, options) { + if (Array.isArray(term)) { + term.forEach(function (t) { this.term(t, lunr.utils.clone(options)) }, this) + return this + } + + var clause = options || {} + clause.term = term.toString() + + this.clause(clause) + + return this +} +lunr.QueryParseError = function (message, start, end) { + this.name = "QueryParseError" + this.message = message + this.start = start + this.end = end +} + +lunr.QueryParseError.prototype = new Error +lunr.QueryLexer = function (str) { + this.lexemes = [] + this.str = str + this.length = str.length + this.pos = 0 + this.start = 0 + this.escapeCharPositions = [] +} + +lunr.QueryLexer.prototype.run = function () { + var state = lunr.QueryLexer.lexText + + while (state) { + state = state(this) + } +} + +lunr.QueryLexer.prototype.sliceString = function () { + var subSlices = [], + sliceStart = this.start, + sliceEnd = this.pos + + for (var i = 0; i < this.escapeCharPositions.length; i++) { + sliceEnd = this.escapeCharPositions[i] + subSlices.push(this.str.slice(sliceStart, sliceEnd)) + sliceStart = sliceEnd + 1 + } + + subSlices.push(this.str.slice(sliceStart, this.pos)) + this.escapeCharPositions.length = 0 + + return subSlices.join('') +} + +lunr.QueryLexer.prototype.emit = function (type) { + this.lexemes.push({ + type: type, + str: this.sliceString(), + start: this.start, + end: this.pos + }) + + this.start = this.pos +} + +lunr.QueryLexer.prototype.escapeCharacter = function () { + this.escapeCharPositions.push(this.pos - 1) + this.pos += 1 +} + +lunr.QueryLexer.prototype.next = function () { + if (this.pos >= this.length) { + return lunr.QueryLexer.EOS + } + + var char = this.str.charAt(this.pos) + this.pos += 1 + return char +} + +lunr.QueryLexer.prototype.width = function () { + return this.pos - this.start +} + +lunr.QueryLexer.prototype.ignore = function () { + if (this.start == this.pos) { + this.pos += 1 + } + + this.start = this.pos +} + +lunr.QueryLexer.prototype.backup = function () { + this.pos -= 1 +} + +lunr.QueryLexer.prototype.acceptDigitRun = function () { + var char, charCode + + do { + char = this.next() + charCode = char.charCodeAt(0) + } while (charCode > 47 && charCode < 58) + + if (char != lunr.QueryLexer.EOS) { + this.backup() + } +} + +lunr.QueryLexer.prototype.more = function () { + return this.pos < this.length +} + +lunr.QueryLexer.EOS = 'EOS' +lunr.QueryLexer.FIELD = 'FIELD' +lunr.QueryLexer.TERM = 'TERM' +lunr.QueryLexer.EDIT_DISTANCE = 'EDIT_DISTANCE' +lunr.QueryLexer.BOOST = 'BOOST' +lunr.QueryLexer.PRESENCE = 'PRESENCE' + +lunr.QueryLexer.lexField = function (lexer) { + lexer.backup() + lexer.emit(lunr.QueryLexer.FIELD) + lexer.ignore() + return lunr.QueryLexer.lexText +} + +lunr.QueryLexer.lexTerm = function (lexer) { + if (lexer.width() > 1) { + lexer.backup() + lexer.emit(lunr.QueryLexer.TERM) + } + + lexer.ignore() + + if (lexer.more()) { + return lunr.QueryLexer.lexText + } +} + +lunr.QueryLexer.lexEditDistance = function (lexer) { + lexer.ignore() + lexer.acceptDigitRun() + lexer.emit(lunr.QueryLexer.EDIT_DISTANCE) + return lunr.QueryLexer.lexText +} + +lunr.QueryLexer.lexBoost = function (lexer) { + lexer.ignore() + lexer.acceptDigitRun() + lexer.emit(lunr.QueryLexer.BOOST) + return lunr.QueryLexer.lexText +} + +lunr.QueryLexer.lexEOS = function (lexer) { + if (lexer.width() > 0) { + lexer.emit(lunr.QueryLexer.TERM) + } +} + +// This matches the separator used when tokenising fields +// within a document. These should match otherwise it is +// not possible to search for some tokens within a document. +// +// It is possible for the user to change the separator on the +// tokenizer so it _might_ clash with any other of the special +// characters already used within the search string, e.g. :. +// +// This means that it is possible to change the separator in +// such a way that makes some words unsearchable using a search +// string. +lunr.QueryLexer.termSeparator = lunr.tokenizer.separator + +lunr.QueryLexer.lexText = function (lexer) { + while (true) { + var char = lexer.next() + + if (char == lunr.QueryLexer.EOS) { + return lunr.QueryLexer.lexEOS + } + + // Escape character is '\' + if (char.charCodeAt(0) == 92) { + lexer.escapeCharacter() + continue + } + + if (char == ":") { + return lunr.QueryLexer.lexField + } + + if (char == "~") { + lexer.backup() + if (lexer.width() > 0) { + lexer.emit(lunr.QueryLexer.TERM) + } + return lunr.QueryLexer.lexEditDistance + } + + if (char == "^") { + lexer.backup() + if (lexer.width() > 0) { + lexer.emit(lunr.QueryLexer.TERM) + } + return lunr.QueryLexer.lexBoost + } + + // "+" indicates term presence is required + // checking for length to ensure that only + // leading "+" are considered + if (char == "+" && lexer.width() === 1) { + lexer.emit(lunr.QueryLexer.PRESENCE) + return lunr.QueryLexer.lexText + } + + // "-" indicates term presence is prohibited + // checking for length to ensure that only + // leading "-" are considered + if (char == "-" && lexer.width() === 1) { + lexer.emit(lunr.QueryLexer.PRESENCE) + return lunr.QueryLexer.lexText + } + + if (char.match(lunr.QueryLexer.termSeparator)) { + return lunr.QueryLexer.lexTerm + } + } +} + +lunr.QueryParser = function (str, query) { + this.lexer = new lunr.QueryLexer (str) + this.query = query + this.currentClause = {} + this.lexemeIdx = 0 +} + +lunr.QueryParser.prototype.parse = function () { + this.lexer.run() + this.lexemes = this.lexer.lexemes + + var state = lunr.QueryParser.parseClause + + while (state) { + state = state(this) + } + + return this.query +} + +lunr.QueryParser.prototype.peekLexeme = function () { + return this.lexemes[this.lexemeIdx] +} + +lunr.QueryParser.prototype.consumeLexeme = function () { + var lexeme = this.peekLexeme() + this.lexemeIdx += 1 + return lexeme +} + +lunr.QueryParser.prototype.nextClause = function () { + var completedClause = this.currentClause + this.query.clause(completedClause) + this.currentClause = {} +} + +lunr.QueryParser.parseClause = function (parser) { + var lexeme = parser.peekLexeme() + + if (lexeme == undefined) { + return + } + + switch (lexeme.type) { + case lunr.QueryLexer.PRESENCE: + return lunr.QueryParser.parsePresence + case lunr.QueryLexer.FIELD: + return lunr.QueryParser.parseField + case lunr.QueryLexer.TERM: + return lunr.QueryParser.parseTerm + default: + var errorMessage = "expected either a field or a term, found " + lexeme.type + + if (lexeme.str.length >= 1) { + errorMessage += " with value '" + lexeme.str + "'" + } + + throw new lunr.QueryParseError (errorMessage, lexeme.start, lexeme.end) + } +} + +lunr.QueryParser.parsePresence = function (parser) { + var lexeme = parser.consumeLexeme() + + if (lexeme == undefined) { + return + } + + switch (lexeme.str) { + case "-": + parser.currentClause.presence = lunr.Query.presence.PROHIBITED + break + case "+": + parser.currentClause.presence = lunr.Query.presence.REQUIRED + break + default: + var errorMessage = "unrecognised presence operator'" + lexeme.str + "'" + throw new lunr.QueryParseError (errorMessage, lexeme.start, lexeme.end) + } + + var nextLexeme = parser.peekLexeme() + + if (nextLexeme == undefined) { + var errorMessage = "expecting term or field, found nothing" + throw new lunr.QueryParseError (errorMessage, lexeme.start, lexeme.end) + } + + switch (nextLexeme.type) { + case lunr.QueryLexer.FIELD: + return lunr.QueryParser.parseField + case lunr.QueryLexer.TERM: + return lunr.QueryParser.parseTerm + default: + var errorMessage = "expecting term or field, found '" + nextLexeme.type + "'" + throw new lunr.QueryParseError (errorMessage, nextLexeme.start, nextLexeme.end) + } +} + +lunr.QueryParser.parseField = function (parser) { + var lexeme = parser.consumeLexeme() + + if (lexeme == undefined) { + return + } + + if (parser.query.allFields.indexOf(lexeme.str) == -1) { + var possibleFields = parser.query.allFields.map(function (f) { return "'" + f + "'" }).join(', '), + errorMessage = "unrecognised field '" + lexeme.str + "', possible fields: " + possibleFields + + throw new lunr.QueryParseError (errorMessage, lexeme.start, lexeme.end) + } + + parser.currentClause.fields = [lexeme.str] + + var nextLexeme = parser.peekLexeme() + + if (nextLexeme == undefined) { + var errorMessage = "expecting term, found nothing" + throw new lunr.QueryParseError (errorMessage, lexeme.start, lexeme.end) + } + + switch (nextLexeme.type) { + case lunr.QueryLexer.TERM: + return lunr.QueryParser.parseTerm + default: + var errorMessage = "expecting term, found '" + nextLexeme.type + "'" + throw new lunr.QueryParseError (errorMessage, nextLexeme.start, nextLexeme.end) + } +} + +lunr.QueryParser.parseTerm = function (parser) { + var lexeme = parser.consumeLexeme() + + if (lexeme == undefined) { + return + } + + parser.currentClause.term = lexeme.str.toLowerCase() + + if (lexeme.str.indexOf("*") != -1) { + parser.currentClause.usePipeline = false + } + + var nextLexeme = parser.peekLexeme() + + if (nextLexeme == undefined) { + parser.nextClause() + return + } + + switch (nextLexeme.type) { + case lunr.QueryLexer.TERM: + parser.nextClause() + return lunr.QueryParser.parseTerm + case lunr.QueryLexer.FIELD: + parser.nextClause() + return lunr.QueryParser.parseField + case lunr.QueryLexer.EDIT_DISTANCE: + return lunr.QueryParser.parseEditDistance + case lunr.QueryLexer.BOOST: + return lunr.QueryParser.parseBoost + case lunr.QueryLexer.PRESENCE: + parser.nextClause() + return lunr.QueryParser.parsePresence + default: + var errorMessage = "Unexpected lexeme type '" + nextLexeme.type + "'" + throw new lunr.QueryParseError (errorMessage, nextLexeme.start, nextLexeme.end) + } +} + +lunr.QueryParser.parseEditDistance = function (parser) { + var lexeme = parser.consumeLexeme() + + if (lexeme == undefined) { + return + } + + var editDistance = parseInt(lexeme.str, 10) + + if (isNaN(editDistance)) { + var errorMessage = "edit distance must be numeric" + throw new lunr.QueryParseError (errorMessage, lexeme.start, lexeme.end) + } + + parser.currentClause.editDistance = editDistance + + var nextLexeme = parser.peekLexeme() + + if (nextLexeme == undefined) { + parser.nextClause() + return + } + + switch (nextLexeme.type) { + case lunr.QueryLexer.TERM: + parser.nextClause() + return lunr.QueryParser.parseTerm + case lunr.QueryLexer.FIELD: + parser.nextClause() + return lunr.QueryParser.parseField + case lunr.QueryLexer.EDIT_DISTANCE: + return lunr.QueryParser.parseEditDistance + case lunr.QueryLexer.BOOST: + return lunr.QueryParser.parseBoost + case lunr.QueryLexer.PRESENCE: + parser.nextClause() + return lunr.QueryParser.parsePresence + default: + var errorMessage = "Unexpected lexeme type '" + nextLexeme.type + "'" + throw new lunr.QueryParseError (errorMessage, nextLexeme.start, nextLexeme.end) + } +} + +lunr.QueryParser.parseBoost = function (parser) { + var lexeme = parser.consumeLexeme() + + if (lexeme == undefined) { + return + } + + var boost = parseInt(lexeme.str, 10) + + if (isNaN(boost)) { + var errorMessage = "boost must be numeric" + throw new lunr.QueryParseError (errorMessage, lexeme.start, lexeme.end) + } + + parser.currentClause.boost = boost + + var nextLexeme = parser.peekLexeme() + + if (nextLexeme == undefined) { + parser.nextClause() + return + } + + switch (nextLexeme.type) { + case lunr.QueryLexer.TERM: + parser.nextClause() + return lunr.QueryParser.parseTerm + case lunr.QueryLexer.FIELD: + parser.nextClause() + return lunr.QueryParser.parseField + case lunr.QueryLexer.EDIT_DISTANCE: + return lunr.QueryParser.parseEditDistance + case lunr.QueryLexer.BOOST: + return lunr.QueryParser.parseBoost + case lunr.QueryLexer.PRESENCE: + parser.nextClause() + return lunr.QueryParser.parsePresence + default: + var errorMessage = "Unexpected lexeme type '" + nextLexeme.type + "'" + throw new lunr.QueryParseError (errorMessage, nextLexeme.start, nextLexeme.end) + } +} + + /** + * export the module via AMD, CommonJS or as a browser global + * Export code from https://github.com/umdjs/umd/blob/master/returnExports.js + */ + ;(function (root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. Register as an anonymous module. + define(factory) + } else if (typeof exports === 'object') { + /** + * Node. Does not work with strict CommonJS, but + * only CommonJS-like enviroments that support module.exports, + * like Node. + */ + module.exports = factory() + } else { + // Browser globals (root is window) + root.lunr = factory() + } + }(this, function () { + /** + * Just return a value to define the module export. + * This example returns an object, but the module + * can return a function as the exported value. + */ + return lunr + })) +})(); diff --git a/src/assets/js/lunr/lunr.min.js b/src/assets/js/lunr/lunr.min.js new file mode 100644 index 0000000..cdc94cd --- /dev/null +++ b/src/assets/js/lunr/lunr.min.js @@ -0,0 +1,6 @@ +/** + * lunr - http://lunrjs.com - A bit like Solr, but much smaller and not as bright - 2.3.9 + * Copyright (C) 2020 Oliver Nightingale + * @license MIT + */ +!function(){var e=function(t){var r=new e.Builder;return r.pipeline.add(e.trimmer,e.stopWordFilter,e.stemmer),r.searchPipeline.add(e.stemmer),t.call(r,r),r.build()};e.version="2.3.9",e.utils={},e.utils.warn=function(e){return function(t){e.console&&console.warn&&console.warn(t)}}(this),e.utils.asString=function(e){return void 0===e||null===e?"":e.toString()},e.utils.clone=function(e){if(null===e||void 0===e)return e;for(var t=Object.create(null),r=Object.keys(e),i=0;i0){var c=e.utils.clone(r)||{};c.position=[a,l],c.index=s.length,s.push(new e.Token(i.slice(a,o),c))}a=o+1}}return s},e.tokenizer.separator=/[\s\-]+/,e.Pipeline=function(){this._stack=[]},e.Pipeline.registeredFunctions=Object.create(null),e.Pipeline.registerFunction=function(t,r){r in this.registeredFunctions&&e.utils.warn("Overwriting existing registered function: "+r),t.label=r,e.Pipeline.registeredFunctions[t.label]=t},e.Pipeline.warnIfFunctionNotRegistered=function(t){var r=t.label&&t.label in this.registeredFunctions;r||e.utils.warn("Function is not registered with pipeline. This may cause problems when serialising the index.\n",t)},e.Pipeline.load=function(t){var r=new e.Pipeline;return t.forEach(function(t){var i=e.Pipeline.registeredFunctions[t];if(!i)throw new Error("Cannot load unregistered function: "+t);r.add(i)}),r},e.Pipeline.prototype.add=function(){var t=Array.prototype.slice.call(arguments);t.forEach(function(t){e.Pipeline.warnIfFunctionNotRegistered(t),this._stack.push(t)},this)},e.Pipeline.prototype.after=function(t,r){e.Pipeline.warnIfFunctionNotRegistered(r);var i=this._stack.indexOf(t);if(i==-1)throw new Error("Cannot find existingFn");i+=1,this._stack.splice(i,0,r)},e.Pipeline.prototype.before=function(t,r){e.Pipeline.warnIfFunctionNotRegistered(r);var i=this._stack.indexOf(t);if(i==-1)throw new Error("Cannot find existingFn");this._stack.splice(i,0,r)},e.Pipeline.prototype.remove=function(e){var t=this._stack.indexOf(e);t!=-1&&this._stack.splice(t,1)},e.Pipeline.prototype.run=function(e){for(var t=this._stack.length,r=0;r1&&(se&&(r=n),s!=e);)i=r-t,n=t+Math.floor(i/2),s=this.elements[2*n];return s==e?2*n:s>e?2*n:sa?l+=2:o==a&&(t+=r[u+1]*i[l+1],u+=2,l+=2);return t},e.Vector.prototype.similarity=function(e){return this.dot(e)/this.magnitude()||0},e.Vector.prototype.toArray=function(){for(var e=new Array(this.elements.length/2),t=1,r=0;t0){var o,a=s.str.charAt(0);a in s.node.edges?o=s.node.edges[a]:(o=new e.TokenSet,s.node.edges[a]=o),1==s.str.length&&(o["final"]=!0),n.push({node:o,editsRemaining:s.editsRemaining,str:s.str.slice(1)})}if(0!=s.editsRemaining){if("*"in s.node.edges)var u=s.node.edges["*"];else{var u=new e.TokenSet;s.node.edges["*"]=u}if(0==s.str.length&&(u["final"]=!0),n.push({node:u,editsRemaining:s.editsRemaining-1,str:s.str}),s.str.length>1&&n.push({node:s.node,editsRemaining:s.editsRemaining-1,str:s.str.slice(1)}),1==s.str.length&&(s.node["final"]=!0),s.str.length>=1){if("*"in s.node.edges)var l=s.node.edges["*"];else{var l=new e.TokenSet;s.node.edges["*"]=l}1==s.str.length&&(l["final"]=!0),n.push({node:l,editsRemaining:s.editsRemaining-1,str:s.str.slice(1)})}if(s.str.length>1){var c,h=s.str.charAt(0),d=s.str.charAt(1);d in s.node.edges?c=s.node.edges[d]:(c=new e.TokenSet,s.node.edges[d]=c),1==s.str.length&&(c["final"]=!0),n.push({node:c,editsRemaining:s.editsRemaining-1,str:h+s.str.slice(2)})}}}return i},e.TokenSet.fromString=function(t){for(var r=new e.TokenSet,i=r,n=0,s=t.length;n=e;t--){var r=this.uncheckedNodes[t],i=r.child.toString();i in this.minimizedNodes?r.parent.edges[r["char"]]=this.minimizedNodes[i]:(r.child._str=i,this.minimizedNodes[i]=r.child),this.uncheckedNodes.pop()}},e.Index=function(e){this.invertedIndex=e.invertedIndex,this.fieldVectors=e.fieldVectors,this.tokenSet=e.tokenSet,this.fields=e.fields,this.pipeline=e.pipeline},e.Index.prototype.search=function(t){return this.query(function(r){var i=new e.QueryParser(t,r);i.parse()})},e.Index.prototype.query=function(t){for(var r=new e.Query(this.fields),i=Object.create(null),n=Object.create(null),s=Object.create(null),o=Object.create(null),a=Object.create(null),u=0;u1?this._b=1:this._b=e},e.Builder.prototype.k1=function(e){this._k1=e},e.Builder.prototype.add=function(t,r){var i=t[this._ref],n=Object.keys(this._fields);this._documents[i]=r||{},this.documentCount+=1;for(var s=0;s=this.length)return e.QueryLexer.EOS;var t=this.str.charAt(this.pos);return this.pos+=1,t},e.QueryLexer.prototype.width=function(){return this.pos-this.start},e.QueryLexer.prototype.ignore=function(){this.start==this.pos&&(this.pos+=1),this.start=this.pos},e.QueryLexer.prototype.backup=function(){this.pos-=1},e.QueryLexer.prototype.acceptDigitRun=function(){var t,r;do t=this.next(),r=t.charCodeAt(0);while(r>47&&r<58);t!=e.QueryLexer.EOS&&this.backup()},e.QueryLexer.prototype.more=function(){return this.pos1&&(t.backup(),t.emit(e.QueryLexer.TERM)),t.ignore(),t.more())return e.QueryLexer.lexText},e.QueryLexer.lexEditDistance=function(t){return t.ignore(),t.acceptDigitRun(),t.emit(e.QueryLexer.EDIT_DISTANCE),e.QueryLexer.lexText},e.QueryLexer.lexBoost=function(t){return t.ignore(),t.acceptDigitRun(),t.emit(e.QueryLexer.BOOST),e.QueryLexer.lexText},e.QueryLexer.lexEOS=function(t){t.width()>0&&t.emit(e.QueryLexer.TERM)},e.QueryLexer.termSeparator=e.tokenizer.separator,e.QueryLexer.lexText=function(t){for(;;){var r=t.next();if(r==e.QueryLexer.EOS)return e.QueryLexer.lexEOS;if(92!=r.charCodeAt(0)){if(":"==r)return e.QueryLexer.lexField;if("~"==r)return t.backup(),t.width()>0&&t.emit(e.QueryLexer.TERM),e.QueryLexer.lexEditDistance;if("^"==r)return t.backup(),t.width()>0&&t.emit(e.QueryLexer.TERM),e.QueryLexer.lexBoost;if("+"==r&&1===t.width())return t.emit(e.QueryLexer.PRESENCE),e.QueryLexer.lexText;if("-"==r&&1===t.width())return t.emit(e.QueryLexer.PRESENCE),e.QueryLexer.lexText;if(r.match(e.QueryLexer.termSeparator))return e.QueryLexer.lexTerm}else t.escapeCharacter()}},e.QueryParser=function(t,r){this.lexer=new e.QueryLexer(t),this.query=r,this.currentClause={},this.lexemeIdx=0},e.QueryParser.prototype.parse=function(){this.lexer.run(),this.lexemes=this.lexer.lexemes;for(var t=e.QueryParser.parseClause;t;)t=t(this);return this.query},e.QueryParser.prototype.peekLexeme=function(){return this.lexemes[this.lexemeIdx]},e.QueryParser.prototype.consumeLexeme=function(){var e=this.peekLexeme();return this.lexemeIdx+=1,e},e.QueryParser.prototype.nextClause=function(){var e=this.currentClause;this.query.clause(e),this.currentClause={}},e.QueryParser.parseClause=function(t){var r=t.peekLexeme();if(void 0!=r)switch(r.type){case e.QueryLexer.PRESENCE:return e.QueryParser.parsePresence;case e.QueryLexer.FIELD:return e.QueryParser.parseField;case e.QueryLexer.TERM:return e.QueryParser.parseTerm;default:var i="expected either a field or a term, found "+r.type;throw r.str.length>=1&&(i+=" with value '"+r.str+"'"),new e.QueryParseError(i,r.start,r.end)}},e.QueryParser.parsePresence=function(t){var r=t.consumeLexeme();if(void 0!=r){switch(r.str){case"-":t.currentClause.presence=e.Query.presence.PROHIBITED;break;case"+":t.currentClause.presence=e.Query.presence.REQUIRED;break;default:var i="unrecognised presence operator'"+r.str+"'";throw new e.QueryParseError(i,r.start,r.end)}var n=t.peekLexeme();if(void 0==n){var i="expecting term or field, found nothing";throw new e.QueryParseError(i,r.start,r.end)}switch(n.type){case e.QueryLexer.FIELD:return e.QueryParser.parseField;case e.QueryLexer.TERM:return e.QueryParser.parseTerm;default:var i="expecting term or field, found '"+n.type+"'";throw new e.QueryParseError(i,n.start,n.end)}}},e.QueryParser.parseField=function(t){var r=t.consumeLexeme();if(void 0!=r){if(t.query.allFields.indexOf(r.str)==-1){var i=t.query.allFields.map(function(e){return"'"+e+"'"}).join(", "),n="unrecognised field '"+r.str+"', possible fields: "+i;throw new e.QueryParseError(n,r.start,r.end)}t.currentClause.fields=[r.str];var s=t.peekLexeme();if(void 0==s){var n="expecting term, found nothing";throw new e.QueryParseError(n,r.start,r.end)}switch(s.type){case e.QueryLexer.TERM:return e.QueryParser.parseTerm;default:var n="expecting term, found '"+s.type+"'";throw new e.QueryParseError(n,s.start,s.end)}}},e.QueryParser.parseTerm=function(t){var r=t.consumeLexeme();if(void 0!=r){t.currentClause.term=r.str.toLowerCase(),r.str.indexOf("*")!=-1&&(t.currentClause.usePipeline=!1);var i=t.peekLexeme();if(void 0==i)return void t.nextClause();switch(i.type){case e.QueryLexer.TERM:return t.nextClause(),e.QueryParser.parseTerm;case e.QueryLexer.FIELD:return t.nextClause(),e.QueryParser.parseField;case e.QueryLexer.EDIT_DISTANCE:return e.QueryParser.parseEditDistance;case e.QueryLexer.BOOST:return e.QueryParser.parseBoost;case e.QueryLexer.PRESENCE:return t.nextClause(),e.QueryParser.parsePresence;default:var n="Unexpected lexeme type '"+i.type+"'";throw new e.QueryParseError(n,i.start,i.end)}}},e.QueryParser.parseEditDistance=function(t){var r=t.consumeLexeme();if(void 0!=r){var i=parseInt(r.str,10);if(isNaN(i)){var n="edit distance must be numeric";throw new e.QueryParseError(n,r.start,r.end)}t.currentClause.editDistance=i;var s=t.peekLexeme();if(void 0==s)return void t.nextClause();switch(s.type){case e.QueryLexer.TERM:return t.nextClause(),e.QueryParser.parseTerm;case e.QueryLexer.FIELD:return t.nextClause(),e.QueryParser.parseField;case e.QueryLexer.EDIT_DISTANCE:return e.QueryParser.parseEditDistance;case e.QueryLexer.BOOST:return e.QueryParser.parseBoost;case e.QueryLexer.PRESENCE:return t.nextClause(),e.QueryParser.parsePresence;default:var n="Unexpected lexeme type '"+s.type+"'";throw new e.QueryParseError(n,s.start,s.end)}}},e.QueryParser.parseBoost=function(t){var r=t.consumeLexeme();if(void 0!=r){var i=parseInt(r.str,10);if(isNaN(i)){var n="boost must be numeric";throw new e.QueryParseError(n,r.start,r.end)}t.currentClause.boost=i;var s=t.peekLexeme();if(void 0==s)return void t.nextClause();switch(s.type){case e.QueryLexer.TERM:return t.nextClause(),e.QueryParser.parseTerm;case e.QueryLexer.FIELD:return t.nextClause(),e.QueryParser.parseField;case e.QueryLexer.EDIT_DISTANCE:return e.QueryParser.parseEditDistance;case e.QueryLexer.BOOST:return e.QueryParser.parseBoost;case e.QueryLexer.PRESENCE:return t.nextClause(),e.QueryParser.parsePresence;default:var n="Unexpected lexeme type '"+s.type+"'";throw new e.QueryParseError(n,s.start,s.end)}}},function(e,t){"function"==typeof define&&define.amd?define(t):"object"==typeof exports?module.exports=t():e.lunr=t()}(this,function(){return e})}(); diff --git a/src/assets/js/main.min.js b/src/assets/js/main.min.js new file mode 100644 index 0000000..507884f --- /dev/null +++ b/src/assets/js/main.min.js @@ -0,0 +1,6 @@ +/*! + * Minimal Mistakes Jekyll Theme 4.24.0 by Michael Rose + * Copyright 2013-2023 Michael Rose - mademistakes.com | @mmistakes + * Licensed under MIT + */ +!function(e,t){"use strict";"object"==typeof module&&"object"==typeof module.exports?module.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return t(e)}:t(e)}("undefined"!=typeof window?window:this,function(C,e){"use strict";function m(e){return null!=e&&e===e.window}var t=[],n=Object.getPrototypeOf,s=t.slice,g=t.flat?function(e){return t.flat.call(e)}:function(e){return t.concat.apply([],e)},u=t.push,o=t.indexOf,r={},i=r.toString,v=r.hasOwnProperty,a=v.toString,l=a.call(Object),y={},b=function(e){return"function"==typeof e&&"number"!=typeof e.nodeType},T=C.document,c={type:!0,src:!0,nonce:!0,noModule:!0};function x(e,t,n){var r,o,i=(n=n||T).createElement("script");if(i.text=e,t)for(r in c)(o=t[r]||t.getAttribute&&t.getAttribute(r))&&i.setAttribute(r,o);n.head.appendChild(i).parentNode.removeChild(i)}function h(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?r[i.call(e)]||"object":typeof e}var f="3.5.1",E=function(e,t){return new E.fn.init(e,t)};function d(e){var t=!!e&&"length"in e&&e.length,n=h(e);return!b(e)&&!m(e)&&("array"===n||0===t||"number"==typeof t&&0>10|55296,1023&e|56320))}function r(){C()}var e,d,x,i,o,p,h,m,w,u,l,C,T,a,E,g,s,c,v,S="sizzle"+ +new Date,y=n.document,k=0,b=0,A=ue(),N=ue(),j=ue(),I=ue(),L=function(e,t){return e===t&&(l=!0),0},D={}.hasOwnProperty,t=[],O=t.pop,H=t.push,P=t.push,q=t.slice,M=function(e,t){for(var n=0,r=e.length;n+~]|"+$+")"+$+"*"),Q=new RegExp($+"|>"),Y=new RegExp(F),V=new RegExp("^"+R+"$"),G={ID:new RegExp("^#("+R+")"),CLASS:new RegExp("^\\.("+R+")"),TAG:new RegExp("^("+R+"|[*])"),ATTR:new RegExp("^"+B),PSEUDO:new RegExp("^"+F),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+$+"*(even|odd|(([+-]|)(\\d*)n|)"+$+"*(?:([+-]|)"+$+"*(\\d+)|))"+$+"*\\)|)","i"),bool:new RegExp("^(?:"+_+")$","i"),needsContext:new RegExp("^"+$+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+$+"*((?:-\\d)?\\d*)"+$+"*\\)|)(?=[^-]|$)","i")},K=/HTML$/i,Z=/^(?:input|select|textarea|button)$/i,J=/^h\d$/i,ee=/^[^{]+\{\s*\[native \w/,te=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ne=/[+~]/,re=new RegExp("\\\\[\\da-fA-F]{1,6}"+$+"?|\\\\([^\\r\\n\\f])","g"),oe=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,ie=function(e,t){return t?"\0"===e?"�":e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" ":"\\"+e},ae=ye(function(e){return!0===e.disabled&&"fieldset"===e.nodeName.toLowerCase()},{dir:"parentNode",next:"legend"});try{P.apply(t=q.call(y.childNodes),y.childNodes),t[y.childNodes.length].nodeType}catch(e){P={apply:t.length?function(e,t){H.apply(e,q.call(t))}:function(e,t){for(var n=e.length,r=0;e[n++]=t[r++];);e.length=n-1}}}function se(t,e,n,r){var o,i,a,s,u,l,c=e&&e.ownerDocument,f=e?e.nodeType:9;if(n=n||[],"string"!=typeof t||!t||1!==f&&9!==f&&11!==f)return n;if(!r&&(C(e),e=e||T,E)){if(11!==f&&(s=te.exec(t)))if(l=s[1]){if(9===f){if(!(i=e.getElementById(l)))return n;if(i.id===l)return n.push(i),n}else if(c&&(i=c.getElementById(l))&&v(e,i)&&i.id===l)return n.push(i),n}else{if(s[2])return P.apply(n,e.getElementsByTagName(t)),n;if((l=s[3])&&d.getElementsByClassName&&e.getElementsByClassName)return P.apply(n,e.getElementsByClassName(l)),n}if(d.qsa&&!I[t+" "]&&(!g||!g.test(t))&&(1!==f||"object"!==e.nodeName.toLowerCase())){if(l=t,c=e,1===f&&(Q.test(t)||X.test(t))){for((c=ne.test(t)&&me(e.parentNode)||e)===e&&d.scope||((a=e.getAttribute("id"))?a=a.replace(oe,ie):e.setAttribute("id",a=S)),o=(u=p(t)).length;o--;)u[o]=(a?"#"+a:":scope")+" "+ve(u[o]);l=u.join(",")}try{return P.apply(n,c.querySelectorAll(l)),n}catch(e){I(t,!0)}finally{a===S&&e.removeAttribute("id")}}}return m(t.replace(W,"$1"),e,n,r)}function ue(){var n=[];function r(e,t){return n.push(e+" ")>x.cacheLength&&delete r[n.shift()],r[e+" "]=t}return r}function le(e){return e[S]=!0,e}function ce(e){var t=T.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function fe(e,t){for(var n=e.split("|"),r=n.length;r--;)x.attrHandle[n[r]]=t}function de(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&e.sourceIndex-t.sourceIndex;if(r)return r;if(n)for(;n=n.nextSibling;)if(n===t)return-1;return e?1:-1}function pe(t){return function(e){return"form"in e?e.parentNode&&!1===e.disabled?"label"in e?"label"in e.parentNode?e.parentNode.disabled===t:e.disabled===t:e.isDisabled===t||e.isDisabled!==!t&&ae(e)===t:e.disabled===t:"label"in e&&e.disabled===t}}function he(a){return le(function(i){return i=+i,le(function(e,t){for(var n,r=a([],e.length,i),o=r.length;o--;)e[n=r[o]]&&(e[n]=!(t[n]=e[n]))})})}function me(e){return e&&void 0!==e.getElementsByTagName&&e}for(e in d=se.support={},o=se.isXML=function(e){var t=e.namespaceURI,e=(e.ownerDocument||e).documentElement;return!K.test(t||e&&e.nodeName||"HTML")},C=se.setDocument=function(e){var t,e=e?e.ownerDocument||e:y;return e!=T&&9===e.nodeType&&e.documentElement&&(a=(T=e).documentElement,E=!o(T),y!=T&&(t=T.defaultView)&&t.top!==t&&(t.addEventListener?t.addEventListener("unload",r,!1):t.attachEvent&&t.attachEvent("onunload",r)),d.scope=ce(function(e){return a.appendChild(e).appendChild(T.createElement("div")),void 0!==e.querySelectorAll&&!e.querySelectorAll(":scope fieldset div").length}),d.attributes=ce(function(e){return e.className="i",!e.getAttribute("className")}),d.getElementsByTagName=ce(function(e){return e.appendChild(T.createComment("")),!e.getElementsByTagName("*").length}),d.getElementsByClassName=ee.test(T.getElementsByClassName),d.getById=ce(function(e){return a.appendChild(e).id=S,!T.getElementsByName||!T.getElementsByName(S).length}),d.getById?(x.filter.ID=function(e){var t=e.replace(re,f);return function(e){return e.getAttribute("id")===t}},x.find.ID=function(e,t){if(void 0!==t.getElementById&&E){e=t.getElementById(e);return e?[e]:[]}}):(x.filter.ID=function(e){var t=e.replace(re,f);return function(e){e=void 0!==e.getAttributeNode&&e.getAttributeNode("id");return e&&e.value===t}},x.find.ID=function(e,t){if(void 0!==t.getElementById&&E){var n,r,o,i=t.getElementById(e);if(i){if((n=i.getAttributeNode("id"))&&n.value===e)return[i];for(o=t.getElementsByName(e),r=0;i=o[r++];)if((n=i.getAttributeNode("id"))&&n.value===e)return[i]}return[]}}),x.find.TAG=d.getElementsByTagName?function(e,t){return void 0!==t.getElementsByTagName?t.getElementsByTagName(e):d.qsa?t.querySelectorAll(e):void 0}:function(e,t){var n,r=[],o=0,i=t.getElementsByTagName(e);if("*"!==e)return i;for(;n=i[o++];)1===n.nodeType&&r.push(n);return r},x.find.CLASS=d.getElementsByClassName&&function(e,t){if(void 0!==t.getElementsByClassName&&E)return t.getElementsByClassName(e)},s=[],g=[],(d.qsa=ee.test(T.querySelectorAll))&&(ce(function(e){var t;a.appendChild(e).innerHTML="",e.querySelectorAll("[msallowcapture^='']").length&&g.push("[*^$]="+$+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||g.push("\\["+$+"*(?:value|"+_+")"),e.querySelectorAll("[id~="+S+"-]").length||g.push("~="),(t=T.createElement("input")).setAttribute("name",""),e.appendChild(t),e.querySelectorAll("[name='']").length||g.push("\\["+$+"*name"+$+"*="+$+"*(?:''|\"\")"),e.querySelectorAll(":checked").length||g.push(":checked"),e.querySelectorAll("a#"+S+"+*").length||g.push(".#.+[+~]"),e.querySelectorAll("\\\f"),g.push("[\\r\\n\\f]")}),ce(function(e){e.innerHTML="";var t=T.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&g.push("name"+$+"*[*^$|!~]?="),2!==e.querySelectorAll(":enabled").length&&g.push(":enabled",":disabled"),a.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&g.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),g.push(",.*:")})),(d.matchesSelector=ee.test(c=a.matches||a.webkitMatchesSelector||a.mozMatchesSelector||a.oMatchesSelector||a.msMatchesSelector))&&ce(function(e){d.disconnectedMatch=c.call(e,"*"),c.call(e,"[s!='']:x"),s.push("!=",F)}),g=g.length&&new RegExp(g.join("|")),s=s.length&&new RegExp(s.join("|")),t=ee.test(a.compareDocumentPosition),v=t||ee.test(a.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,t=t&&t.parentNode;return e===t||!(!t||1!==t.nodeType||!(n.contains?n.contains(t):e.compareDocumentPosition&&16&e.compareDocumentPosition(t)))}:function(e,t){if(t)for(;t=t.parentNode;)if(t===e)return!0;return!1},L=t?function(e,t){if(e===t)return l=!0,0;var n=!e.compareDocumentPosition-!t.compareDocumentPosition;return n||(1&(n=(e.ownerDocument||e)==(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!d.sortDetached&&t.compareDocumentPosition(e)===n?e==T||e.ownerDocument==y&&v(y,e)?-1:t==T||t.ownerDocument==y&&v(y,t)?1:u?M(u,e)-M(u,t):0:4&n?-1:1)}:function(e,t){if(e===t)return l=!0,0;var n,r=0,o=e.parentNode,i=t.parentNode,a=[e],s=[t];if(!o||!i)return e==T?-1:t==T?1:o?-1:i?1:u?M(u,e)-M(u,t):0;if(o===i)return de(e,t);for(n=e;n=n.parentNode;)a.unshift(n);for(n=t;n=n.parentNode;)s.unshift(n);for(;a[r]===s[r];)r++;return r?de(a[r],s[r]):a[r]==y?-1:s[r]==y?1:0}),T},se.matches=function(e,t){return se(e,null,null,t)},se.matchesSelector=function(e,t){if(C(e),d.matchesSelector&&E&&!I[t+" "]&&(!s||!s.test(t))&&(!g||!g.test(t)))try{var n=c.call(e,t);if(n||d.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(e){I(t,!0)}return 0":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(re,f),e[3]=(e[3]||e[4]||e[5]||"").replace(re,f),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||se.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&se.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return G.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&Y.test(n)&&(t=p(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(re,f).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=A[e+" "];return t||(t=new RegExp("(^|"+$+")"+e+"("+$+"|$)"))&&A(e,function(e){return t.test("string"==typeof e.className&&e.className||void 0!==e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(t,n,r){return function(e){e=se.attr(e,t);return null==e?"!="===n:!n||(e+="","="===n?e===r:"!="===n?e!==r:"^="===n?r&&0===e.indexOf(r):"*="===n?r&&-1:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function j(e,n,r){return b(n)?E.grep(e,function(e,t){return!!n.call(e,t,e)!==r}):n.nodeType?E.grep(e,function(e){return e===n!==r}):"string"!=typeof n?E.grep(e,function(e){return-1)[^>]*|#([\w-]+))$/;(E.fn.init=function(e,t,n){if(!e)return this;if(n=n||L,"string"!=typeof e)return e.nodeType?(this[0]=e,this.length=1,this):b(e)?void 0!==n.ready?n.ready(e):e(E):E.makeArray(e,this);if(!(r="<"===e[0]&&">"===e[e.length-1]&&3<=e.length?[null,e,null]:I.exec(e))||!r[1]&&t)return(!t||t.jquery?t||n:this.constructor(t)).find(e);if(r[1]){if(t=t instanceof E?t[0]:t,E.merge(this,E.parseHTML(r[1],t&&t.nodeType?t.ownerDocument||t:T,!0)),N.test(r[1])&&E.isPlainObject(t))for(var r in t)b(this[r])?this[r](t[r]):this.attr(r,t[r]);return this}return(e=T.getElementById(r[2]))&&(this[0]=e,this.length=1),this}).prototype=E.fn;var L=E(T),D=/^(?:parents|prev(?:Until|All))/,O={children:!0,contents:!0,next:!0,prev:!0};function H(e,t){for(;(e=e[t])&&1!==e.nodeType;);return e}E.fn.extend({has:function(e){var t=E(e,this),n=t.length;return this.filter(function(){for(var e=0;e\x20\t\r\n\f]*)/i,de=/^$|^module$|\/(?:java|ecma)script/i;f=T.createDocumentFragment().appendChild(T.createElement("div")),(p=T.createElement("input")).setAttribute("type","radio"),p.setAttribute("checked","checked"),p.setAttribute("name","t"),f.appendChild(p),y.checkClone=f.cloneNode(!0).cloneNode(!0).lastChild.checked,f.innerHTML="",y.noCloneChecked=!!f.cloneNode(!0).lastChild.defaultValue,f.innerHTML="",y.option=!!f.lastChild;var pe={thead:[1,"","
"],col:[2,"","
"],tr:[2,"","
"],td:[3,"","
"],_default:[0,"",""]};function he(e,t){var n=void 0!==e.getElementsByTagName?e.getElementsByTagName(t||"*"):void 0!==e.querySelectorAll?e.querySelectorAll(t||"*"):[];return void 0===t||t&&A(e,t)?E.merge([e],n):n}function me(e,t){for(var n=0,r=e.length;n",""]);var ge=/<|&#?\w+;/;function ve(e,t,n,r,o){for(var i,a,s,u,l,c=t.createDocumentFragment(),f=[],d=0,p=e.length;d\s*$/g;function je(e,t){return A(e,"table")&&A(11!==t.nodeType?t:t.firstChild,"tr")&&E(e).children("tbody")[0]||e}function Ie(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function Le(e){return"true/"===(e.type||"").slice(0,5)?e.type=e.type.slice(5):e.removeAttribute("type"),e}function De(e,t){var n,r,o,i;if(1===t.nodeType){if(V.hasData(e)&&(i=V.get(e).events))for(o in V.remove(t,"handle events"),i)for(n=0,r=i[o].length;n").attr(n.scriptAttrs||{}).prop({charset:n.scriptCharset,src:n.url}).on("load error",o=function(e){r.remove(),o=null,e&&t("error"===e.type?404:200,e.type)}),T.head.appendChild(r[0])},abort:function(){o&&o()}}});var Gt=[],Kt=/(=)\?(?=&|$)|\?\?/;E.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=Gt.pop()||E.expando+"_"+jt.guid++;return this[e]=!0,e}}),E.ajaxPrefilter("json jsonp",function(e,t,n){var r,o,i,a=!1!==e.jsonp&&(Kt.test(e.url)?"url":"string"==typeof e.data&&0===(e.contentType||"").indexOf("application/x-www-form-urlencoded")&&Kt.test(e.data)&&"data");if(a||"jsonp"===e.dataTypes[0])return r=e.jsonpCallback=b(e.jsonpCallback)?e.jsonpCallback():e.jsonpCallback,a?e[a]=e[a].replace(Kt,"$1"+r):!1!==e.jsonp&&(e.url+=(It.test(e.url)?"&":"?")+e.jsonp+"="+r),e.converters["script json"]=function(){return i||E.error(r+" was not called"),i[0]},e.dataTypes[0]="json",o=C[r],C[r]=function(){i=arguments},n.always(function(){void 0===o?E(C).removeProp(r):C[r]=o,e[r]&&(e.jsonpCallback=t.jsonpCallback,Gt.push(r)),i&&b(o)&&o(i[0]),i=o=void 0}),"script"}),y.createHTMLDocument=((f=T.implementation.createHTMLDocument("").body).innerHTML="
",2===f.childNodes.length),E.parseHTML=function(e,t,n){return"string"!=typeof e?[]:("boolean"==typeof t&&(n=t,t=!1),t||(y.createHTMLDocument?((r=(t=T.implementation.createHTMLDocument("")).createElement("base")).href=T.location.href,t.head.appendChild(r)):t=T),r=!n&&[],(n=N.exec(e))?[t.createElement(n[1])]:(n=ve([e],t,r),r&&r.length&&E(r).remove(),E.merge([],n.childNodes)));var r},E.fn.load=function(e,t,n){var r,o,i,a=this,s=e.indexOf(" ");return-1").append(E.parseHTML(e)).find(r):e)}).always(n&&function(e,t){a.each(function(){n.apply(this,i||[e.responseText,t,e])})}),this},E.expr.pseudos.animated=function(t){return E.grep(E.timers,function(e){return t===e.elem}).length},E.offset={setOffset:function(e,t,n){var r,o,i,a,s=E.css(e,"position"),u=E(e),l={};"static"===s&&(e.style.position="relative"),i=u.offset(),r=E.css(e,"top"),a=E.css(e,"left"),a=("absolute"===s||"fixed"===s)&&-1<(r+a).indexOf("auto")?(o=(s=u.position()).top,s.left):(o=parseFloat(r)||0,parseFloat(a)||0),null!=(t=b(t)?t.call(e,n,E.extend({},i)):t).top&&(l.top=t.top-i.top+o),null!=t.left&&(l.left=t.left-i.left+a),"using"in t?t.using.call(e,l):("number"==typeof l.top&&(l.top+="px"),"number"==typeof l.left&&(l.left+="px"),u.css(l))}},E.fn.extend({offset:function(t){if(arguments.length)return void 0===t?this:this.each(function(e){E.offset.setOffset(this,t,e)});var e,n=this[0];return n?n.getClientRects().length?(e=n.getBoundingClientRect(),n=n.ownerDocument.defaultView,{top:e.top+n.pageYOffset,left:e.left+n.pageXOffset}):{top:0,left:0}:void 0},position:function(){if(this[0]){var e,t,n,r=this[0],o={top:0,left:0};if("fixed"===E.css(r,"position"))t=r.getBoundingClientRect();else{for(t=this.offset(),n=r.ownerDocument,e=r.offsetParent||n.documentElement;e&&(e===n.body||e===n.documentElement)&&"static"===E.css(e,"position");)e=e.parentNode;e&&e!==r&&1===e.nodeType&&((o=E(e).offset()).top+=E.css(e,"borderTopWidth",!0),o.left+=E.css(e,"borderLeftWidth",!0))}return{top:t.top-o.top-E.css(r,"marginTop",!0),left:t.left-o.left-E.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){for(var e=this.offsetParent;e&&"static"===E.css(e,"position");)e=e.offsetParent;return e||re})}}),E.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(t,o){var i="pageYOffset"===o;E.fn[t]=function(e){return F(this,function(e,t,n){var r;return m(e)?r=e:9===e.nodeType&&(r=e.defaultView),void 0===n?r?r[o]:e[t]:void(r?r.scrollTo(i?r.pageXOffset:n,i?n:r.pageYOffset):e[t]=n)},t,e,arguments.length)}}),E.each(["top","left"],function(e,n){E.cssHooks[n]=Ge(y.pixelPosition,function(e,t){if(t)return t=Ve(e,n),We.test(t)?E(e).position()[n]+"px":t})}),E.each({Height:"height",Width:"width"},function(a,s){E.each({padding:"inner"+a,content:s,"":"outer"+a},function(r,i){E.fn[i]=function(e,t){var n=arguments.length&&(r||"boolean"!=typeof e),o=r||(!0===e||!0===t?"margin":"border");return F(this,function(e,t,n){var r;return m(e)?0===i.indexOf("outer")?e["inner"+a]:e.document.documentElement["client"+a]:9===e.nodeType?(r=e.documentElement,Math.max(e.body["scroll"+a],r["scroll"+a],e.body["offset"+a],r["offset"+a],r["client"+a])):void 0===n?E.css(e,t,o):E.style(e,t,n,o)},s,n?e:void 0,n)}})}),E.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){E.fn[t]=function(e){return this.on(t,e)}}),E.fn.extend({bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)},hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)}}),E.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(e,n){E.fn[n]=function(e,t){return 0x

',t.appendChild(n.childNodes[1])),e&&i.extend(o,e),this.each(function(){var e=['iframe[src*="player.vimeo.com"]','iframe[src*="youtube.com"]','iframe[src*="youtube-nocookie.com"]','iframe[src*="kickstarter.com"][src*="video.html"]',"object","embed"];o.customSelector&&e.push(o.customSelector);var r=".fitvidsignore";o.ignore&&(r=r+", "+o.ignore);e=i(this).find(e.join(","));(e=(e=e.not("object object")).not(r)).each(function(e){var t,n=i(this);0').parent(".fluid-width-video-wrapper").css("padding-top",100*t+"%"),n.removeAttr("height").removeAttr("width"))})})}}(window.jQuery||window.Zepto),$(function(){var n,r,e,o,t=$("nav.greedy-nav .greedy-nav__toggle"),i=$("nav.greedy-nav .visible-links"),a=$("nav.greedy-nav .hidden-links"),s=$("nav.greedy-nav"),u=$("nav.greedy-nav .site-logo"),l=$("nav.greedy-nav .site-logo img"),c=$("nav.greedy-nav .site-title"),f=$("nav.greedy-nav button.search__toggle");function d(){function t(e,t){r+=t,n+=1,o.push(r)}r=n=0,e=1e3,o=[],i.children().outerWidth(t),a.children().each(function(){var e;(e=(e=$(this)).clone()).css("visibility","hidden"),i.append(e),t(0,e.outerWidth()),e.remove()})}d();var p,h,m,g,v=$(window).width(),y=v<768?0:v<1024?1:v<1280?2:3;function b(){var e=(v=$(window).width())<768?0:v<1024?1:v<1280?2:3;e!==y&&d(),y=e,h=i.children().length,p=s.innerWidth()-(0!==u.length?u.outerWidth(!0):0)-c.outerWidth(!0)-(0!==f.length?f.outerWidth(!0):0)-(h!==o.length?t.outerWidth(!0):0),m=o[h-1],po[h]&&(a.children().first().appendTo(i),h+=1,b()),t.attr("count",n-h),h===n?t.addClass("hidden"):t.removeClass("hidden")}$(window).resize(function(){b()}),t.on("click",function(){a.toggleClass("hidden"),$(this).toggleClass("close"),clearTimeout(g)}),a.on("mouseleave",function(){g=setTimeout(function(){a.addClass("hidden")},e)}).on("mouseenter",function(){clearTimeout(g)}),0===l.length||l[0].complete||0!==l[0].naturalWidth?b():l.one("load error",b)}),function(e){"function"==typeof define&&define.amd?define(["jquery"],e):"object"==typeof exports?e(require("jquery")):e(window.jQuery||window.Zepto)}(function(l){function e(){}function c(e,t){h.ev.on("mfp"+e+x,t)}function f(e,t,n,r){var o=document.createElement("div");return o.className="mfp-"+e,n&&(o.innerHTML=n),r?t&&t.appendChild(o):(o=l(o),t&&o.appendTo(t)),o}function d(e,t){h.ev.triggerHandler("mfp"+e,t),h.st.callbacks&&(e=e.charAt(0).toLowerCase()+e.slice(1),h.st.callbacks[e]&&h.st.callbacks[e].apply(h,l.isArray(t)?t:[t]))}function p(e){return e===t&&h.currTemplate.closeBtn||(h.currTemplate.closeBtn=l(h.st.closeMarkup.replace("%title%",h.st.tClose)),t=e),h.currTemplate.closeBtn}function i(){l.magnificPopup.instance||((h=new e).init(),l.magnificPopup.instance=h)}var h,r,m,o,g,t,u="Close",v="BeforeClose",y="MarkupParse",b="Open",x=".mfp",w="mfp-ready",n="mfp-removing",a="mfp-prevent-close",s=!!window.jQuery,C=l(window);e.prototype={constructor:e,init:function(){var e=navigator.appVersion;h.isLowIE=h.isIE8=document.all&&!document.addEventListener,h.isAndroid=/android/gi.test(e),h.isIOS=/iphone|ipad|ipod/gi.test(e),h.supportsTransition=function(){var e=document.createElement("p").style,t=["ms","O","Moz","Webkit"];if(void 0!==e.transition)return!0;for(;t.length;)if(t.pop()+"Transition"in e)return!0;return!1}(),h.probablyMobile=h.isAndroid||h.isIOS||/(Opera Mini)|Kindle|webOS|BlackBerry|(Opera Mobi)|(Windows Phone)|IEMobile/i.test(navigator.userAgent),m=l(document),h.popupsCache={}},open:function(e){if(!1===e.isObj){h.items=e.items.toArray(),h.index=0;for(var t,n=e.items,r=0;r(e||C.height())},_setFocus:function(){(h.st.focus?h.content.find(h.st.focus).eq(0):h.wrap).focus()},_onFocusIn:function(e){if(e.target!==h.wrap[0]&&!l.contains(h.wrap[0],e.target))return h._setFocus(),!1},_parseMarkup:function(o,e,t){var i;t.data&&(e=l.extend(t.data,e)),d(y,[o,e,t]),l.each(e,function(e,t){return void 0===t||!1===t||void(1<(i=e.split("_")).length?0<(n=o.find(x+"-"+i[0])).length&&("replaceWith"===(r=i[1])?n[0]!==t[0]&&n.replaceWith(t):"img"===r?n.is("img")?n.attr("src",t):n.replaceWith(l("").attr("src",t).attr("class",n.attr("class"))):n.attr(i[1],t)):o.find(x+"-"+e).html(t));var n,r})},_getScrollbarSize:function(){var e;return void 0===h.scrollbarSize&&((e=document.createElement("div")).style.cssText="width: 99px; height: 99px; overflow: scroll; position: absolute; top: -9999px;",document.body.appendChild(e),h.scrollbarSize=e.offsetWidth-e.clientWidth,document.body.removeChild(e)),h.scrollbarSize}},l.magnificPopup={instance:null,proto:e.prototype,modules:[],open:function(e,t){return i(),(e=e?l.extend(!0,{},e):{}).isObj=!0,e.index=t||0,this.instance.open(e)},close:function(){return l.magnificPopup.instance&&l.magnificPopup.instance.close()},registerModule:function(e,t){t.options&&(l.magnificPopup.defaults[e]=t.options),l.extend(this.proto,t.proto),this.modules.push(e)},defaults:{disableOn:0,key:null,midClick:!1,mainClass:"",preloader:!0,focus:"",closeOnContentClick:!1,closeOnBgClick:!0,closeBtnInside:!0,showCloseBtn:!0,enableEscapeKey:!0,modal:!1,alignTop:!1,removalDelay:0,prependTo:null,fixedContentPos:"auto",fixedBgPos:"auto",overflowY:"auto",closeMarkup:'',tClose:"Close (Esc)",tLoading:"Loading...",autoFocusLast:!0}},l.fn.magnificPopup=function(e){i();var t,n,r,o=l(this);return"string"==typeof e?"open"===e?(t=s?o.data("magnificPopup"):o[0].magnificPopup,n=parseInt(arguments[1],10)||0,r=t.items?t.items[n]:(r=o,(r=t.delegate?o.find(t.delegate):r).eq(n)),h._openClick({mfpEl:r},o,t)):h.isOpen&&h[e].apply(h,Array.prototype.slice.call(arguments,1)):(e=l.extend(!0,{},e),s?o.data("magnificPopup",e):o[0].magnificPopup=e,h.addGroup(o,e)),o};function T(){k&&(S.after(k.addClass(E)).detach(),k=null)}var E,S,k,A="inline";l.magnificPopup.registerModule(A,{options:{hiddenClass:"hide",markup:"",tNotFound:"Content not found"},proto:{initInline:function(){h.types.push(A),c(u+"."+A,function(){T()})},getInline:function(e,t){if(T(),e.src){var n,r=h.st.inline,o=l(e.src);return o.length?((n=o[0].parentNode)&&n.tagName&&(S||(E=r.hiddenClass,S=f(E),E="mfp-"+E),k=o.after(S).detach().removeClass(E)),h.updateStatus("ready")):(h.updateStatus("error",r.tNotFound),o=l("
")),e.inlineElement=o}return h.updateStatus("ready"),h._parseMarkup(t,{},e),t}}});function N(){I&&l(document.body).removeClass(I)}function j(){N(),h.req&&h.req.abort()}var I,L="ajax";l.magnificPopup.registerModule(L,{options:{settings:null,cursor:"mfp-ajax-cur",tError:'The content could not be loaded.'},proto:{initAjax:function(){h.types.push(L),I=h.st.ajax.cursor,c(u+"."+L,j),c("BeforeChange."+L,j)},getAjax:function(r){I&&l(document.body).addClass(I),h.updateStatus("loading");var e=l.extend({url:r.src,success:function(e,t,n){n={data:e,xhr:n};d("ParseAjax",n),h.appendContent(l(n.data),L),r.finished=!0,N(),h._setFocus(),setTimeout(function(){h.wrap.addClass(w)},16),h.updateStatus("ready"),d("AjaxContentAdded")},error:function(){N(),r.finished=r.loadError=!0,h.updateStatus("error",h.st.ajax.tError.replace("%url%",r.src))}},h.st.ajax.settings);return h.req=l.ajax(e),""}}});var D;l.magnificPopup.registerModule("image",{options:{markup:'
',cursor:"mfp-zoom-out-cur",titleSrc:"title",verticalFit:!0,tError:'The image could not be loaded.'},proto:{initImage:function(){var e=h.st.image,t=".image";h.types.push("image"),c(b+t,function(){"image"===h.currItem.type&&e.cursor&&l(document.body).addClass(e.cursor)}),c(u+t,function(){e.cursor&&l(document.body).removeClass(e.cursor),C.off("resize"+x)}),c("Resize"+t,h.resizeImage),h.isLowIE&&c("AfterChange",h.resizeImage)},resizeImage:function(){var e,t=h.currItem;t&&t.img&&h.st.image.verticalFit&&(e=0,h.isLowIE&&(e=parseInt(t.img.css("padding-top"),10)+parseInt(t.img.css("padding-bottom"),10)),t.img.css("max-height",h.wH-e))},_onImageHasSize:function(e){e.img&&(e.hasSize=!0,D&&clearInterval(D),e.isCheckingImgSize=!1,d("ImageHasSize",e),e.imgHidden&&(h.content&&h.content.removeClass("mfp-loading"),e.imgHidden=!1))},findImageSize:function(t){var n=0,r=t.img[0],o=function(e){D&&clearInterval(D),D=setInterval(function(){0
',srcAction:"iframe_src",patterns:{youtube:{index:"youtube.com",id:"v=",src:"//www.youtube.com/embed/%id%?autoplay=1"},vimeo:{index:"vimeo.com/",id:"/",src:"//player.vimeo.com/video/%id%?autoplay=1"},gmaps:{index:"//maps.google.",src:"%id%&output=embed"}}},proto:{initIframe:function(){h.types.push(P),c("BeforeChange",function(e,t,n){t!==n&&(t===P?H():n===P&&H(!0))}),c(u+"."+P,function(){H()})},getIframe:function(e,t){var n=e.src,r=h.st.iframe;l.each(r.patterns,function(){if(-1',preload:[0,2],navigateByImgClick:!0,arrows:!0,tPrev:"Previous (Left arrow key)",tNext:"Next (Right arrow key)",tCounter:"%curr% of %total%"},proto:{initGallery:function(){var i=h.st.gallery,e=".mfp-gallery";if(h.direction=!0,!i||!i.enabled)return!1;g+=" mfp-gallery",c(b+e,function(){i.navigateByImgClick&&h.wrap.on("click"+e,".mfp-img",function(){if(1=h.index,h.index=e,h.updateItemHTML()},preloadNearbyImages:function(){for(var e=h.st.gallery.preload,t=Math.min(e[0],h.items.length),n=Math.min(e[1],h.items.length),r=1;r<=(h.direction?n:t);r++)h._preloadItem(h.index+r);for(r=1;r<=(h.direction?t:n);r++)h._preloadItem(h.index-r)},_preloadItem:function(e){var t;e=q(e),h.items[e].preloaded||((t=h.items[e]).parsed||(t=h.parseEl(e)),d("LazyLoad",t),"image"===t.type&&(t.img=l('').on("load.mfploader",function(){t.hasSize=!0}).on("error.mfploader",function(){t.hasSize=!0,t.loadError=!0,d("LazyLoadError",t)}).attr("src",t.src)),t.preloaded=!0)}}});var _="retina";l.magnificPopup.registerModule(_,{options:{replaceSrc:function(e){return e.src.replace(/\.\w+$/,function(e){return"@2x"+e})},ratio:1},proto:{initRetina:function(){var n,r;1t.durationMax?t.durationMax:t.durationMin&&e=u)return b.cancelScroll(!0),e=t,n=g,0===(t=r)&&document.body.focus(),n||(t.focus(),document.activeElement!==t&&(t.setAttribute("tabindex","-1"),t.focus(),t.style.outline="none"),x.scrollTo(0,e)),E("scrollStop",m,r,o),!(y=f=null)},h=function(e){var t,n,r;l+=e-(f=f||e),d=i+s*(n=d=1<(d=0===c?0:l/c)?1:d,"easeInQuad"===(t=m).easing&&(r=n*n),"easeOutQuad"===t.easing&&(r=n*(2-n)),"easeInOutQuad"===t.easing&&(r=n<.5?2*n*n:(4-2*n)*n-1),"easeInCubic"===t.easing&&(r=n*n*n),"easeOutCubic"===t.easing&&(r=--n*n*n+1),"easeInOutCubic"===t.easing&&(r=n<.5?4*n*n*n:(n-1)*(2*n-2)*(2*n-2)+1),"easeInQuart"===t.easing&&(r=n*n*n*n),"easeOutQuart"===t.easing&&(r=1- --n*n*n*n),"easeInOutQuart"===t.easing&&(r=n<.5?8*n*n*n*n:1-8*--n*n*n*n),"easeInQuint"===t.easing&&(r=n*n*n*n*n),"easeOutQuint"===t.easing&&(r=1+--n*n*n*n*n),"easeInOutQuint"===t.easing&&(r=n<.5?16*n*n*n*n*n:1+16*--n*n*n*n*n),(r=t.customEasing?t.customEasing(n):r)||n),x.scrollTo(0,Math.floor(d)),p(d,a)||(y=x.requestAnimationFrame(h),f=e)},0===x.pageYOffset&&x.scrollTo(0,0),t=r,e=m,g||history.pushState&&e.updateURL&&history.pushState({smoothScroll:JSON.stringify(e),anchor:t.id},document.title,t===document.documentElement?"#top":"#"+t.id),"matchMedia"in x&&x.matchMedia("(prefers-reduced-motion)").matches?x.scrollTo(0,Math.floor(a)):(E("scrollStart",m,r,o),b.cancelScroll(!0),x.requestAnimationFrame(h)))};function t(e){if(!e.defaultPrevented&&!(0!==e.button||e.metaKey||e.ctrlKey||e.shiftKey)&&"closest"in e.target&&(o=e.target.closest(r))&&"a"===o.tagName.toLowerCase()&&!e.target.closest(v.ignore)&&o.hostname===x.location.hostname&&o.pathname===x.location.pathname&&/#/.test(o.href)){var t,n;try{n=a(decodeURIComponent(o.hash))}catch(e){n=a(o.hash)}if("#"===n){if(!v.topOnEmptyHash)return;t=document.documentElement}else t=document.querySelector(n);(t=t||"#top"!==n?t:document.documentElement)&&(e.preventDefault(),n=v,history.replaceState&&n.updateURL&&!history.state&&(e=(e=x.location.hash)||"",history.replaceState({smoothScroll:JSON.stringify(n),anchor:e||x.pageYOffset},document.title,e||x.location.href)),b.animateScroll(t,o))}}function i(e){var t;null!==history.state&&history.state.smoothScroll&&history.state.smoothScroll===JSON.stringify(v)&&("string"==typeof(t=history.state.anchor)&&t&&!(t=document.querySelector(a(history.state.anchor)))||b.animateScroll(t,null,{updateURL:!1}))}b.destroy=function(){v&&(document.removeEventListener("click",t,!1),x.removeEventListener("popstate",i,!1),b.cancelScroll(),y=n=o=v=null)};return function(){if(!("querySelector"in document&&"addEventListener"in x&&"requestAnimationFrame"in x&&"closest"in x.Element.prototype))throw"Smooth Scroll: This browser does not support the required JavaScript methods and browser APIs.";b.destroy(),v=w(S,e||{}),n=v.header?document.querySelector(v.header):null,document.addEventListener("click",t,!1),v.updateURL&&v.popstate&&x.addEventListener("popstate",i,!1)}(),b}}),function(e,t){"function"==typeof define&&define.amd?define([],function(){return t(e)}):"object"==typeof exports?module.exports=t(e):e.Gumshoe=t(e)}("undefined"!=typeof global?global:"undefined"!=typeof window?window:this,function(c){"use strict";function f(e,t,n){n.settings.events&&(n=new CustomEvent(e,{bubbles:!0,cancelable:!0,detail:n}),t.dispatchEvent(n))}function n(e){var t=0;if(e.offsetParent)for(;e;)t+=e.offsetTop,e=e.offsetParent;return 0<=t?t:0}function d(e){e&&e.sort(function(e,t){return n(e.content)=Math.max(document.body.scrollHeight,document.documentElement.scrollHeight,document.body.offsetHeight,document.documentElement.offsetHeight,document.body.clientHeight,document.documentElement.clientHeight)}function p(e,t){var n,r,o=e[e.length-1];if(n=o,r=t,!(!s()||!a(n.content,r,!0)))return o;for(var i=e.length-1;0<=i;i--)if(a(e[i].content,t))return e[i]}function h(e,t){var n;!e||(n=e.nav.closest("li"))&&(n.classList.remove(t.navClass),e.content.classList.remove(t.contentClass),r(n,t),f("gumshoeDeactivate",n,{link:e.nav,content:e.content,settings:t}))}var m={navClass:"active",contentClass:"active",nested:!1,nestedClass:"active",offset:0,reflow:!1,events:!0},r=function(e,t){!t.nested||(e=e.parentNode.closest("li"))&&(e.classList.remove(t.nestedClass),r(e,t))},g=function(e,t){!t.nested||(e=e.parentNode.closest("li"))&&(e.classList.add(t.nestedClass),g(e,t))};return function(e,t){var n,o,i,r,a,s={setup:function(){n=document.querySelectorAll(e),o=[],Array.prototype.forEach.call(n,function(e){var t=document.getElementById(decodeURIComponent(e.hash.substr(1)));t&&o.push({nav:e,content:t})}),d(o)}};s.detect=function(){var e,t,n,r=p(o,a);r?i&&r.content===i.content||(h(i,a),t=a,!(e=r)||(n=e.nav.closest("li"))&&(n.classList.add(t.navClass),e.content.classList.add(t.contentClass),g(n,t),f("gumshoeActivate",n,{link:e.nav,content:e.content,settings:t})),i=r):i&&(h(i,a),i=null)};function u(e){r&&c.cancelAnimationFrame(r),r=c.requestAnimationFrame(s.detect)}function l(e){r&&c.cancelAnimationFrame(r),r=c.requestAnimationFrame(function(){d(o),s.detect()})}s.destroy=function(){i&&h(i,a),c.removeEventListener("scroll",u,!1),a.reflow&&c.removeEventListener("resize",l,!1),a=r=i=n=o=null};return a=function(){var n={};return Array.prototype.forEach.call(arguments,function(e){for(var t in e){if(!e.hasOwnProperty(t))return;n[t]=e[t]}}),n}(m,t||{}),s.setup(),s.detect(),c.addEventListener("scroll",u,!1),a.reflow&&c.addEventListener("resize",l,!1),s}}),$(document).ready(function(){$("#main").fitVids();function e(){(0===$(".author__urls-wrapper button").length?1024<$(window).width():!$(".author__urls-wrapper button").is(":visible"))?$(".sidebar").addClass("sticky"):$(".sidebar").removeClass("sticky")}e(),$(window).resize(function(){e()}),$(".author__urls-wrapper button").on("click",function(){$(".author__urls").toggleClass("is--visible"),$(".author__urls-wrapper button").toggleClass("open")}),$(document).keyup(function(e){27===e.keyCode&&$(".initial-content").hasClass("is--hidden")&&($(".search-content").toggleClass("is--visible"),$(".initial-content").toggleClass("is--hidden"))}),$(".search__toggle").on("click",function(){$(".search-content").toggleClass("is--visible"),$(".initial-content").toggleClass("is--hidden"),setTimeout(function(){$(".search-content input").focus()},400)});new SmoothScroll('a[href*="#"]',{offset:20,speed:400,speedAsDuration:!0,durationMax:500});0<$("nav.toc").length&&new Gumshoe("nav.toc a",{navClass:"active",contentClass:"active",nested:!1,nestedClass:"active",offset:20,reflow:!0,events:!0}),$("a[href$='.jpg'],a[href$='.jpeg'],a[href$='.JPG'],a[href$='.png'],a[href$='.gif'],a[href$='.webp']").addClass("image-popup"),$(".image-popup").magnificPopup({type:"image",tLoading:"Loading image #%curr%...",gallery:{enabled:!0,navigateByImgClick:!0,preload:[0,1]},image:{tError:'Image #%curr% could not be loaded.'},removalDelay:500,mainClass:"mfp-zoom-in",callbacks:{beforeOpen:function(){this.st.image.markup=this.st.image.markup.replace("mfp-figure","mfp-figure mfp-with-anim")}},closeOnContentClick:!0,midClick:!0}),$(".page__content").find("h1, h2, h3, h4, h5, h6").each(function(){var e,t=$(this).attr("id");t&&((e=document.createElement("a")).className="header-link",e.href="#"+t,e.innerHTML='Permalink',e.title="Permalink",$(this).append(e))})}); \ No newline at end of file diff --git a/src/assets/js/plugins/gumshoe.js b/src/assets/js/plugins/gumshoe.js new file mode 100644 index 0000000..713b6eb --- /dev/null +++ b/src/assets/js/plugins/gumshoe.js @@ -0,0 +1,484 @@ +/*! + * gumshoejs v5.1.1 + * A simple, framework-agnostic scrollspy script. + * (c) 2019 Chris Ferdinandi + * MIT License + * http://github.com/cferdinandi/gumshoe + */ + +(function (root, factory) { + if ( typeof define === 'function' && define.amd ) { + define([], (function () { + return factory(root); + })); + } else if ( typeof exports === 'object' ) { + module.exports = factory(root); + } else { + root.Gumshoe = factory(root); + } +})(typeof global !== 'undefined' ? global : typeof window !== 'undefined' ? window : this, (function (window) { + + 'use strict'; + + // + // Defaults + // + + var defaults = { + + // Active classes + navClass: 'active', + contentClass: 'active', + + // Nested navigation + nested: false, + nestedClass: 'active', + + // Offset & reflow + offset: 0, + reflow: false, + + // Event support + events: true + + }; + + + // + // Methods + // + + /** + * Merge two or more objects together. + * @param {Object} objects The objects to merge together + * @returns {Object} Merged values of defaults and options + */ + var extend = function () { + var merged = {}; + Array.prototype.forEach.call(arguments, (function (obj) { + for (var key in obj) { + if (!obj.hasOwnProperty(key)) return; + merged[key] = obj[key]; + } + })); + return merged; + }; + + /** + * Emit a custom event + * @param {String} type The event type + * @param {Node} elem The element to attach the event to + * @param {Object} detail Any details to pass along with the event + */ + var emitEvent = function (type, elem, detail) { + + // Make sure events are enabled + if (!detail.settings.events) return; + + // Create a new event + var event = new CustomEvent(type, { + bubbles: true, + cancelable: true, + detail: detail + }); + + // Dispatch the event + elem.dispatchEvent(event); + + }; + + /** + * Get an element's distance from the top of the Document. + * @param {Node} elem The element + * @return {Number} Distance from the top in pixels + */ + var getOffsetTop = function (elem) { + var location = 0; + if (elem.offsetParent) { + while (elem) { + location += elem.offsetTop; + elem = elem.offsetParent; + } + } + return location >= 0 ? location : 0; + }; + + /** + * Sort content from first to last in the DOM + * @param {Array} contents The content areas + */ + var sortContents = function (contents) { + if(contents) { + contents.sort((function (item1, item2) { + var offset1 = getOffsetTop(item1.content); + var offset2 = getOffsetTop(item2.content); + if (offset1 < offset2) return -1; + return 1; + })); + } + }; + + /** + * Get the offset to use for calculating position + * @param {Object} settings The settings for this instantiation + * @return {Float} The number of pixels to offset the calculations + */ + var getOffset = function (settings) { + + // if the offset is a function run it + if (typeof settings.offset === 'function') { + return parseFloat(settings.offset()); + } + + // Otherwise, return it as-is + return parseFloat(settings.offset); + + }; + + /** + * Get the document element's height + * @private + * @returns {Number} + */ + var getDocumentHeight = function () { + return Math.max( + document.body.scrollHeight, document.documentElement.scrollHeight, + document.body.offsetHeight, document.documentElement.offsetHeight, + document.body.clientHeight, document.documentElement.clientHeight + ); + }; + + /** + * Determine if an element is in view + * @param {Node} elem The element + * @param {Object} settings The settings for this instantiation + * @param {Boolean} bottom If true, check if element is above bottom of viewport instead + * @return {Boolean} Returns true if element is in the viewport + */ + var isInView = function (elem, settings, bottom) { + var bounds = elem.getBoundingClientRect(); + var offset = getOffset(settings); + if (bottom) { + return parseInt(bounds.bottom, 10) < (window.innerHeight || document.documentElement.clientHeight); + } + return parseInt(bounds.top, 10) <= offset; + }; + + /** + * Check if at the bottom of the viewport + * @return {Boolean} If true, page is at the bottom of the viewport + */ + var isAtBottom = function () { + if (window.innerHeight + window.pageYOffset >= getDocumentHeight()) return true; + return false; + }; + + /** + * Check if the last item should be used (even if not at the top of the page) + * @param {Object} item The last item + * @param {Object} settings The settings for this instantiation + * @return {Boolean} If true, use the last item + */ + var useLastItem = function (item, settings) { + if (isAtBottom() && isInView(item.content, settings, true)) return true; + return false; + }; + + /** + * Get the active content + * @param {Array} contents The content areas + * @param {Object} settings The settings for this instantiation + * @return {Object} The content area and matching navigation link + */ + var getActive = function (contents, settings) { + var last = contents[contents.length-1]; + if (useLastItem(last, settings)) return last; + for (var i = contents.length - 1; i >= 0; i--) { + if (isInView(contents[i].content, settings)) return contents[i]; + } + }; + + /** + * Deactivate parent navs in a nested navigation + * @param {Node} nav The starting navigation element + * @param {Object} settings The settings for this instantiation + */ + var deactivateNested = function (nav, settings) { + + // If nesting isn't activated, bail + if (!settings.nested) return; + + // Get the parent navigation + var li = nav.parentNode.closest('li'); + if (!li) return; + + // Remove the active class + li.classList.remove(settings.nestedClass); + + // Apply recursively to any parent navigation elements + deactivateNested(li, settings); + + }; + + /** + * Deactivate a nav and content area + * @param {Object} items The nav item and content to deactivate + * @param {Object} settings The settings for this instantiation + */ + var deactivate = function (items, settings) { + + // Make sure their are items to deactivate + if (!items) return; + + // Get the parent list item + var li = items.nav.closest('li'); + if (!li) return; + + // Remove the active class from the nav and content + li.classList.remove(settings.navClass); + items.content.classList.remove(settings.contentClass); + + // Deactivate any parent navs in a nested navigation + deactivateNested(li, settings); + + // Emit a custom event + emitEvent('gumshoeDeactivate', li, { + link: items.nav, + content: items.content, + settings: settings + }); + + }; + + + /** + * Activate parent navs in a nested navigation + * @param {Node} nav The starting navigation element + * @param {Object} settings The settings for this instantiation + */ + var activateNested = function (nav, settings) { + + // If nesting isn't activated, bail + if (!settings.nested) return; + + // Get the parent navigation + var li = nav.parentNode.closest('li'); + if (!li) return; + + // Add the active class + li.classList.add(settings.nestedClass); + + // Apply recursively to any parent navigation elements + activateNested(li, settings); + + }; + + /** + * Activate a nav and content area + * @param {Object} items The nav item and content to activate + * @param {Object} settings The settings for this instantiation + */ + var activate = function (items, settings) { + + // Make sure their are items to activate + if (!items) return; + + // Get the parent list item + var li = items.nav.closest('li'); + if (!li) return; + + // Add the active class to the nav and content + li.classList.add(settings.navClass); + items.content.classList.add(settings.contentClass); + + // Activate any parent navs in a nested navigation + activateNested(li, settings); + + // Emit a custom event + emitEvent('gumshoeActivate', li, { + link: items.nav, + content: items.content, + settings: settings + }); + + }; + + /** + * Create the Constructor object + * @param {String} selector The selector to use for navigation items + * @param {Object} options User options and settings + */ + var Constructor = function (selector, options) { + + // + // Variables + // + + var publicAPIs = {}; + var navItems, contents, current, timeout, settings; + + + // + // Methods + // + + /** + * Set variables from DOM elements + */ + publicAPIs.setup = function () { + + // Get all nav items + navItems = document.querySelectorAll(selector); + + // Create contents array + contents = []; + + // Loop through each item, get it's matching content, and push to the array + Array.prototype.forEach.call(navItems, (function (item) { + + // Get the content for the nav item + var content = document.getElementById(decodeURIComponent(item.hash.substr(1))); + if (!content) return; + + // Push to the contents array + contents.push({ + nav: item, + content: content + }); + + })); + + // Sort contents by the order they appear in the DOM + sortContents(contents); + + }; + + /** + * Detect which content is currently active + */ + publicAPIs.detect = function () { + + // Get the active content + var active = getActive(contents, settings); + + // if there's no active content, deactivate and bail + if (!active) { + if (current) { + deactivate(current, settings); + current = null; + } + return; + } + + // If the active content is the one currently active, do nothing + if (current && active.content === current.content) return; + + // Deactivate the current content and activate the new content + deactivate(current, settings); + activate(active, settings); + + // Update the currently active content + current = active; + + }; + + /** + * Detect the active content on scroll + * Debounced for performance + */ + var scrollHandler = function (event) { + + // If there's a timer, cancel it + if (timeout) { + window.cancelAnimationFrame(timeout); + } + + // Setup debounce callback + timeout = window.requestAnimationFrame(publicAPIs.detect); + + }; + + /** + * Update content sorting on resize + * Debounced for performance + */ + var resizeHandler = function (event) { + + // If there's a timer, cancel it + if (timeout) { + window.cancelAnimationFrame(timeout); + } + + // Setup debounce callback + timeout = window.requestAnimationFrame((function () { + sortContents(contents); + publicAPIs.detect(); + })); + + }; + + /** + * Destroy the current instantiation + */ + publicAPIs.destroy = function () { + + // Undo DOM changes + if (current) { + deactivate(current, settings); + } + + // Remove event listeners + window.removeEventListener('scroll', scrollHandler, false); + if (settings.reflow) { + window.removeEventListener('resize', resizeHandler, false); + } + + // Reset variables + contents = null; + navItems = null; + current = null; + timeout = null; + settings = null; + + }; + + /** + * Initialize the current instantiation + */ + var init = function () { + + // Merge user options into defaults + settings = extend(defaults, options || {}); + + // Setup variables based on the current DOM + publicAPIs.setup(); + + // Find the currently active content + publicAPIs.detect(); + + // Setup event listeners + window.addEventListener('scroll', scrollHandler, false); + if (settings.reflow) { + window.addEventListener('resize', resizeHandler, false); + } + + }; + + + // + // Initialize and return the public APIs + // + + init(); + return publicAPIs; + + }; + + + // + // Return the Constructor + // + + return Constructor; + +})); \ No newline at end of file diff --git a/src/assets/js/plugins/jquery.ba-throttle-debounce.js b/src/assets/js/plugins/jquery.ba-throttle-debounce.js new file mode 100644 index 0000000..fa30bdf --- /dev/null +++ b/src/assets/js/plugins/jquery.ba-throttle-debounce.js @@ -0,0 +1,252 @@ +/*! + * jQuery throttle / debounce - v1.1 - 3/7/2010 + * http://benalman.com/projects/jquery-throttle-debounce-plugin/ + * + * Copyright (c) 2010 "Cowboy" Ben Alman + * Dual licensed under the MIT and GPL licenses. + * http://benalman.com/about/license/ + */ + +// Script: jQuery throttle / debounce: Sometimes, less is more! +// +// *Version: 1.1, Last updated: 3/7/2010* +// +// Project Home - http://benalman.com/projects/jquery-throttle-debounce-plugin/ +// GitHub - http://github.com/cowboy/jquery-throttle-debounce/ +// Source - http://github.com/cowboy/jquery-throttle-debounce/raw/master/jquery.ba-throttle-debounce.js +// (Minified) - http://github.com/cowboy/jquery-throttle-debounce/raw/master/jquery.ba-throttle-debounce.min.js (0.7kb) +// +// About: License +// +// Copyright (c) 2010 "Cowboy" Ben Alman, +// Dual licensed under the MIT and GPL licenses. +// http://benalman.com/about/license/ +// +// About: Examples +// +// These working examples, complete with fully commented code, illustrate a few +// ways in which this plugin can be used. +// +// Throttle - http://benalman.com/code/projects/jquery-throttle-debounce/examples/throttle/ +// Debounce - http://benalman.com/code/projects/jquery-throttle-debounce/examples/debounce/ +// +// About: Support and Testing +// +// Information about what version or versions of jQuery this plugin has been +// tested with, what browsers it has been tested in, and where the unit tests +// reside (so you can test it yourself). +// +// jQuery Versions - none, 1.3.2, 1.4.2 +// Browsers Tested - Internet Explorer 6-8, Firefox 2-3.6, Safari 3-4, Chrome 4-5, Opera 9.6-10.1. +// Unit Tests - http://benalman.com/code/projects/jquery-throttle-debounce/unit/ +// +// About: Release History +// +// 1.1 - (3/7/2010) Fixed a bug in where trailing callbacks +// executed later than they should. Reworked a fair amount of internal +// logic as well. +// 1.0 - (3/6/2010) Initial release as a stand-alone project. Migrated over +// from jquery-misc repo v0.4 to jquery-throttle repo v1.0, added the +// no_trailing throttle parameter and debounce functionality. +// +// Topic: Note for non-jQuery users +// +// jQuery isn't actually required for this plugin, because nothing internal +// uses any jQuery methods or properties. jQuery is just used as a namespace +// under which these methods can exist. +// +// Since jQuery isn't actually required for this plugin, if jQuery doesn't exist +// when this plugin is loaded, the method described below will be created in +// the `Cowboy` namespace. Usage will be exactly the same, but instead of +// $.method() or jQuery.method(), you'll need to use Cowboy.method(). + +(function(window,undefined){ + '$:nomunge'; // Used by YUI compressor. + + // Since jQuery really isn't required for this plugin, use `jQuery` as the + // namespace only if it already exists, otherwise use the `Cowboy` namespace, + // creating it if necessary. + var $ = window.jQuery || window.Cowboy || ( window.Cowboy = {} ), + + // Internal method reference. + jq_throttle; + + // Method: jQuery.throttle + // + // Throttle execution of a function. Especially useful for rate limiting + // execution of handlers on events like resize and scroll. If you want to + // rate-limit execution of a function to a single time, see the + // method. + // + // In this visualization, | is a throttled-function call and X is the actual + // callback execution: + // + // > Throttled with `no_trailing` specified as false or unspecified: + // > ||||||||||||||||||||||||| (pause) ||||||||||||||||||||||||| + // > X X X X X X X X X X X X + // > + // > Throttled with `no_trailing` specified as true: + // > ||||||||||||||||||||||||| (pause) ||||||||||||||||||||||||| + // > X X X X X X X X X X + // + // Usage: + // + // > var throttled = jQuery.throttle( delay, [ no_trailing, ] callback ); + // > + // > jQuery('selector').bind( 'someevent', throttled ); + // > jQuery('selector').unbind( 'someevent', throttled ); + // + // This also works in jQuery 1.4+: + // + // > jQuery('selector').bind( 'someevent', jQuery.throttle( delay, [ no_trailing, ] callback ) ); + // > jQuery('selector').unbind( 'someevent', callback ); + // + // Arguments: + // + // delay - (Number) A zero-or-greater delay in milliseconds. For event + // callbacks, values around 100 or 250 (or even higher) are most useful. + // no_trailing - (Boolean) Optional, defaults to false. If no_trailing is + // true, callback will only execute every `delay` milliseconds while the + // throttled-function is being called. If no_trailing is false or + // unspecified, callback will be executed one final time after the last + // throttled-function call. (After the throttled-function has not been + // called for `delay` milliseconds, the internal counter is reset) + // callback - (Function) A function to be executed after delay milliseconds. + // The `this` context and all arguments are passed through, as-is, to + // `callback` when the throttled-function is executed. + // + // Returns: + // + // (Function) A new, throttled, function. + + $.throttle = jq_throttle = function( delay, no_trailing, callback, debounce_mode ) { + // After wrapper has stopped being called, this timeout ensures that + // `callback` is executed at the proper times in `throttle` and `end` + // debounce modes. + var timeout_id, + + // Keep track of the last time `callback` was executed. + last_exec = 0; + + // `no_trailing` defaults to falsy. + if ( typeof no_trailing !== 'boolean' ) { + debounce_mode = callback; + callback = no_trailing; + no_trailing = undefined; + } + + // The `wrapper` function encapsulates all of the throttling / debouncing + // functionality and when executed will limit the rate at which `callback` + // is executed. + function wrapper() { + var that = this, + elapsed = +new Date() - last_exec, + args = arguments; + + // Execute `callback` and update the `last_exec` timestamp. + function exec() { + last_exec = +new Date(); + callback.apply( that, args ); + }; + + // If `debounce_mode` is true (at_begin) this is used to clear the flag + // to allow future `callback` executions. + function clear() { + timeout_id = undefined; + }; + + if ( debounce_mode && !timeout_id ) { + // Since `wrapper` is being called for the first time and + // `debounce_mode` is true (at_begin), execute `callback`. + exec(); + } + + // Clear any existing timeout. + timeout_id && clearTimeout( timeout_id ); + + if ( debounce_mode === undefined && elapsed > delay ) { + // In throttle mode, if `delay` time has been exceeded, execute + // `callback`. + exec(); + + } else if ( no_trailing !== true ) { + // In trailing throttle mode, since `delay` time has not been + // exceeded, schedule `callback` to execute `delay` ms after most + // recent execution. + // + // If `debounce_mode` is true (at_begin), schedule `clear` to execute + // after `delay` ms. + // + // If `debounce_mode` is false (at end), schedule `callback` to + // execute after `delay` ms. + timeout_id = setTimeout( debounce_mode ? clear : exec, debounce_mode === undefined ? delay - elapsed : delay ); + } + }; + + // Set the guid of `wrapper` function to the same of original callback, so + // it can be removed in jQuery 1.4+ .unbind or .die by using the original + // callback as a reference. + if ( $.guid ) { + wrapper.guid = callback.guid = callback.guid || $.guid++; + } + + // Return the wrapper function. + return wrapper; + }; + + // Method: jQuery.debounce + // + // Debounce execution of a function. Debouncing, unlike throttling, + // guarantees that a function is only executed a single time, either at the + // very beginning of a series of calls, or at the very end. If you want to + // simply rate-limit execution of a function, see the + // method. + // + // In this visualization, | is a debounced-function call and X is the actual + // callback execution: + // + // > Debounced with `at_begin` specified as false or unspecified: + // > ||||||||||||||||||||||||| (pause) ||||||||||||||||||||||||| + // > X X + // > + // > Debounced with `at_begin` specified as true: + // > ||||||||||||||||||||||||| (pause) ||||||||||||||||||||||||| + // > X X + // + // Usage: + // + // > var debounced = jQuery.debounce( delay, [ at_begin, ] callback ); + // > + // > jQuery('selector').bind( 'someevent', debounced ); + // > jQuery('selector').unbind( 'someevent', debounced ); + // + // This also works in jQuery 1.4+: + // + // > jQuery('selector').bind( 'someevent', jQuery.debounce( delay, [ at_begin, ] callback ) ); + // > jQuery('selector').unbind( 'someevent', callback ); + // + // Arguments: + // + // delay - (Number) A zero-or-greater delay in milliseconds. For event + // callbacks, values around 100 or 250 (or even higher) are most useful. + // at_begin - (Boolean) Optional, defaults to false. If at_begin is false or + // unspecified, callback will only be executed `delay` milliseconds after + // the last debounced-function call. If at_begin is true, callback will be + // executed only at the first debounced-function call. (After the + // throttled-function has not been called for `delay` milliseconds, the + // internal counter is reset) + // callback - (Function) A function to be executed after delay milliseconds. + // The `this` context and all arguments are passed through, as-is, to + // `callback` when the debounced-function is executed. + // + // Returns: + // + // (Function) A new, debounced, function. + + $.debounce = function( delay, at_begin, callback ) { + return callback === undefined + ? jq_throttle( delay, at_begin, false ) + : jq_throttle( delay, callback, at_begin !== false ); + }; + +})(this); diff --git a/src/assets/js/plugins/jquery.fitvids.js b/src/assets/js/plugins/jquery.fitvids.js new file mode 100644 index 0000000..5c2f85c --- /dev/null +++ b/src/assets/js/plugins/jquery.fitvids.js @@ -0,0 +1,82 @@ +/*jshint browser:true */ +/*! +* FitVids 1.1 +* +* Copyright 2013, Chris Coyier - http://css-tricks.com + Dave Rupert - http://daverupert.com +* Credit to Thierry Koblentz - http://www.alistapart.com/articles/creating-intrinsic-ratios-for-video/ +* Released under the WTFPL license - http://sam.zoy.org/wtfpl/ +* +*/ + +;(function( $ ){ + + 'use strict'; + + $.fn.fitVids = function( options ) { + var settings = { + customSelector: null, + ignore: null + }; + + if(!document.getElementById('fit-vids-style')) { + // appendStyles: https://github.com/toddmotto/fluidvids/blob/master/dist/fluidvids.js + var head = document.head || document.getElementsByTagName('head')[0]; + var css = '.fluid-width-video-wrapper{width:100%;position:relative;padding:0;}.fluid-width-video-wrapper iframe,.fluid-width-video-wrapper object,.fluid-width-video-wrapper embed {position:absolute;top:0;left:0;width:100%;height:100%;}'; + var div = document.createElement("div"); + div.innerHTML = '

x

'; + head.appendChild(div.childNodes[1]); + } + + if ( options ) { + $.extend( settings, options ); + } + + return this.each(function(){ + var selectors = [ + 'iframe[src*="player.vimeo.com"]', + 'iframe[src*="youtube.com"]', + 'iframe[src*="youtube-nocookie.com"]', + 'iframe[src*="kickstarter.com"][src*="video.html"]', + 'object', + 'embed' + ]; + + if (settings.customSelector) { + selectors.push(settings.customSelector); + } + + var ignoreList = '.fitvidsignore'; + + if(settings.ignore) { + ignoreList = ignoreList + ', ' + settings.ignore; + } + + var $allVideos = $(this).find(selectors.join(',')); + $allVideos = $allVideos.not('object object'); // SwfObj conflict patch + $allVideos = $allVideos.not(ignoreList); // Disable FitVids on this video. + + $allVideos.each(function(count){ + var $this = $(this); + if($this.parents(ignoreList).length > 0) { + return; // Disable FitVids on this video. + } + if (this.tagName.toLowerCase() === 'embed' && $this.parent('object').length || $this.parent('.fluid-width-video-wrapper').length) { return; } + if ((!$this.css('height') && !$this.css('width')) && (isNaN($this.attr('height')) || isNaN($this.attr('width')))) + { + $this.attr('height', 9); + $this.attr('width', 16); + } + var height = ( this.tagName.toLowerCase() === 'object' || ($this.attr('height') && !isNaN(parseInt($this.attr('height'), 10))) ) ? parseInt($this.attr('height'), 10) : $this.height(), + width = !isNaN(parseInt($this.attr('width'), 10)) ? parseInt($this.attr('width'), 10) : $this.width(), + aspectRatio = height / width; + if(!$this.attr('id')){ + var videoID = 'fitvid' + count; + $this.attr('id', videoID); + } + $this.wrap('
').parent('.fluid-width-video-wrapper').css('padding-top', (aspectRatio * 100)+'%'); + $this.removeAttr('height').removeAttr('width'); + }); + }); + }; +// Works with either jQuery or Zepto +})( window.jQuery || window.Zepto ); \ No newline at end of file diff --git a/src/assets/js/plugins/jquery.greedy-navigation.js b/src/assets/js/plugins/jquery.greedy-navigation.js new file mode 100644 index 0000000..d8f3237 --- /dev/null +++ b/src/assets/js/plugins/jquery.greedy-navigation.js @@ -0,0 +1,127 @@ +/* +GreedyNav.js - http://lukejacksonn.com/actuate +Licensed under the MIT license - http://opensource.org/licenses/MIT +Copyright (c) 2015 Luke Jackson +*/ + +$(function() { + + var $btn = $("nav.greedy-nav .greedy-nav__toggle"); + var $vlinks = $("nav.greedy-nav .visible-links"); + var $hlinks = $("nav.greedy-nav .hidden-links"); + var $nav = $("nav.greedy-nav"); + var $logo = $('nav.greedy-nav .site-logo'); + var $logoImg = $('nav.greedy-nav .site-logo img'); + var $title = $("nav.greedy-nav .site-title"); + var $search = $('nav.greedy-nav button.search__toggle'); + + var numOfItems, totalSpace, closingTime, breakWidths; + + // This function measures both hidden and visible links and sets the navbar breakpoints + // This is called the first time the script runs and everytime the "check()" function detects a change of window width that reached a different CSS width breakpoint, which affects the size of navbar Items + // Please note that "CSS width breakpoints" (which are only 4) !== "navbar breakpoints" (which are as many as the number of items on the navbar) + function measureLinks(){ + numOfItems = 0; + totalSpace = 0; + closingTime = 1000; + breakWidths = []; + + // Adds the width of a navItem in order to create breakpoints for the navbar + function addWidth(i, w) { + totalSpace += w; + numOfItems += 1; + breakWidths.push(totalSpace); + } + + // Measures the width of hidden links by making a temporary clone of them and positioning under visible links + function hiddenWidth(obj){ + var clone = obj.clone(); + clone.css("visibility","hidden"); + $vlinks.append(clone); + addWidth(0, clone.outerWidth()); + clone.remove(); + } + // Measure both visible and hidden links widths + $vlinks.children().outerWidth(addWidth); + $hlinks.children().each(function(){hiddenWidth($(this))}); + } + // Get initial state + measureLinks(); + + var winWidth = $( window ).width(); + // Set the last measured CSS width breakpoint: 0: <768px, 1: <1024px, 2: < 1280px, 3: >= 1280px. + var lastBreakpoint = winWidth < 768 ? 0 : winWidth < 1024 ? 1 : winWidth < 1280 ? 2 : 3; + + var availableSpace, numOfVisibleItems, requiredSpace, timer; + + function check() { + + winWidth = $( window ).width(); + // Set the current CSS width breakpoint: 0: <768px, 1: <1024px, 2: < 1280px, 3: >= 1280px. + var curBreakpoint = winWidth < 768 ? 0 : winWidth < 1024 ? 1 : winWidth < 1280 ? 2 : 3; + // If current breakpoint is different from last measured breakpoint, measureLinks again + if(curBreakpoint !== lastBreakpoint) measureLinks(); + // Set the last measured CSS width breakpoint with the current breakpoint + lastBreakpoint = curBreakpoint; + + // Get instant state + numOfVisibleItems = $vlinks.children().length; + // Decrease the width of visible elements from the nav innerWidth to find out the available space for navItems + availableSpace = /* nav */ $nav.innerWidth() + - /* logo */ ($logo.length !== 0 ? $logo.outerWidth(true) : 0) + - /* title */ $title.outerWidth(true) + - /* search */ ($search.length !== 0 ? $search.outerWidth(true) : 0) + - /* toggle */ (numOfVisibleItems !== breakWidths.length ? $btn.outerWidth(true) : 0); + requiredSpace = breakWidths[numOfVisibleItems - 1]; + + // There is not enought space + if (requiredSpace > availableSpace) { + $vlinks.children().last().prependTo($hlinks); + numOfVisibleItems -= 1; + check(); + // There is more than enough space. If only one element is hidden, add the toggle width to the available space + } else if (availableSpace + (numOfVisibleItems === breakWidths.length - 1?$btn.outerWidth(true):0) > breakWidths[numOfVisibleItems]) { + $hlinks.children().first().appendTo($vlinks); + numOfVisibleItems += 1; + check(); + } + // Update the button accordingly + $btn.attr("count", numOfItems - numOfVisibleItems); + if (numOfVisibleItems === numOfItems) { + $btn.addClass('hidden'); + } else $btn.removeClass('hidden'); + } + + // Window listeners + $(window).resize(function() { + check(); + }); + + $btn.on('click', function() { + $hlinks.toggleClass('hidden'); + $(this).toggleClass('close'); + clearTimeout(timer); + }); + + $hlinks.on('mouseleave', function() { + // Mouse has left, start the timer + timer = setTimeout(function() { + $hlinks.addClass('hidden'); + }, closingTime); + }).on('mouseenter', function() { + // Mouse is back, cancel the timer + clearTimeout(timer); + }) + + // check if page has a logo + if($logoImg.length !== 0){ + // check if logo is not loaded + if(!($logoImg[0].complete || $logoImg[0].naturalWidth !== 0)){ + // if logo is not loaded wait for logo to load or fail to check + $logoImg.one("load error", check); + // if logo is already loaded just check + } else check(); + // if page does not have a logo just check + } else check(); + +}); diff --git a/src/assets/js/plugins/jquery.magnific-popup.js b/src/assets/js/plugins/jquery.magnific-popup.js new file mode 100644 index 0000000..7d1d197 --- /dev/null +++ b/src/assets/js/plugins/jquery.magnific-popup.js @@ -0,0 +1,1860 @@ +/*! Magnific Popup - v1.1.0 - 2016-02-20 +* http://dimsemenov.com/plugins/magnific-popup/ +* Copyright (c) 2016 Dmitry Semenov; */ +;(function (factory) { + if (typeof define === 'function' && define.amd) { + // AMD. Register as an anonymous module. + define(['jquery'], factory); + } else if (typeof exports === 'object') { + // Node/CommonJS + factory(require('jquery')); + } else { + // Browser globals + factory(window.jQuery || window.Zepto); + } + }(function($) { + + /*>>core*/ + /** + * + * Magnific Popup Core JS file + * + */ + + + /** + * Private static constants + */ + var CLOSE_EVENT = 'Close', + BEFORE_CLOSE_EVENT = 'BeforeClose', + AFTER_CLOSE_EVENT = 'AfterClose', + BEFORE_APPEND_EVENT = 'BeforeAppend', + MARKUP_PARSE_EVENT = 'MarkupParse', + OPEN_EVENT = 'Open', + CHANGE_EVENT = 'Change', + NS = 'mfp', + EVENT_NS = '.' + NS, + READY_CLASS = 'mfp-ready', + REMOVING_CLASS = 'mfp-removing', + PREVENT_CLOSE_CLASS = 'mfp-prevent-close'; + + + /** + * Private vars + */ + /*jshint -W079 */ + var mfp, // As we have only one instance of MagnificPopup object, we define it locally to not to use 'this' + MagnificPopup = function(){}, + _isJQ = !!(window.jQuery), + _prevStatus, + _window = $(window), + _document, + _prevContentType, + _wrapClasses, + _currPopupType; + + + /** + * Private functions + */ + var _mfpOn = function(name, f) { + mfp.ev.on(NS + name + EVENT_NS, f); + }, + _getEl = function(className, appendTo, html, raw) { + var el = document.createElement('div'); + el.className = 'mfp-'+className; + if(html) { + el.innerHTML = html; + } + if(!raw) { + el = $(el); + if(appendTo) { + el.appendTo(appendTo); + } + } else if(appendTo) { + appendTo.appendChild(el); + } + return el; + }, + _mfpTrigger = function(e, data) { + mfp.ev.triggerHandler(NS + e, data); + + if(mfp.st.callbacks) { + // converts "mfpEventName" to "eventName" callback and triggers it if it's present + e = e.charAt(0).toLowerCase() + e.slice(1); + if(mfp.st.callbacks[e]) { + mfp.st.callbacks[e].apply(mfp, $.isArray(data) ? data : [data]); + } + } + }, + _getCloseBtn = function(type) { + if(type !== _currPopupType || !mfp.currTemplate.closeBtn) { + mfp.currTemplate.closeBtn = $( mfp.st.closeMarkup.replace('%title%', mfp.st.tClose ) ); + _currPopupType = type; + } + return mfp.currTemplate.closeBtn; + }, + // Initialize Magnific Popup only when called at least once + _checkInstance = function() { + if(!$.magnificPopup.instance) { + /*jshint -W020 */ + mfp = new MagnificPopup(); + mfp.init(); + $.magnificPopup.instance = mfp; + } + }, + // CSS transition detection, http://stackoverflow.com/questions/7264899/detect-css-transitions-using-javascript-and-without-modernizr + supportsTransitions = function() { + var s = document.createElement('p').style, // 's' for style. better to create an element if body yet to exist + v = ['ms','O','Moz','Webkit']; // 'v' for vendor + + if( s['transition'] !== undefined ) { + return true; + } + + while( v.length ) { + if( v.pop() + 'Transition' in s ) { + return true; + } + } + + return false; + }; + + + + /** + * Public functions + */ + MagnificPopup.prototype = { + + constructor: MagnificPopup, + + /** + * Initializes Magnific Popup plugin. + * This function is triggered only once when $.fn.magnificPopup or $.magnificPopup is executed + */ + init: function() { + var appVersion = navigator.appVersion; + mfp.isLowIE = mfp.isIE8 = document.all && !document.addEventListener; + mfp.isAndroid = (/android/gi).test(appVersion); + mfp.isIOS = (/iphone|ipad|ipod/gi).test(appVersion); + mfp.supportsTransition = supportsTransitions(); + + // We disable fixed positioned lightbox on devices that don't handle it nicely. + // If you know a better way of detecting this - let me know. + mfp.probablyMobile = (mfp.isAndroid || mfp.isIOS || /(Opera Mini)|Kindle|webOS|BlackBerry|(Opera Mobi)|(Windows Phone)|IEMobile/i.test(navigator.userAgent) ); + _document = $(document); + + mfp.popupsCache = {}; + }, + + /** + * Opens popup + * @param data [description] + */ + open: function(data) { + + var i; + + if(data.isObj === false) { + // convert jQuery collection to array to avoid conflicts later + mfp.items = data.items.toArray(); + + mfp.index = 0; + var items = data.items, + item; + for(i = 0; i < items.length; i++) { + item = items[i]; + if(item.parsed) { + item = item.el[0]; + } + if(item === data.el[0]) { + mfp.index = i; + break; + } + } + } else { + mfp.items = $.isArray(data.items) ? data.items : [data.items]; + mfp.index = data.index || 0; + } + + // if popup is already opened - we just update the content + if(mfp.isOpen) { + mfp.updateItemHTML(); + return; + } + + mfp.types = []; + _wrapClasses = ''; + if(data.mainEl && data.mainEl.length) { + mfp.ev = data.mainEl.eq(0); + } else { + mfp.ev = _document; + } + + if(data.key) { + if(!mfp.popupsCache[data.key]) { + mfp.popupsCache[data.key] = {}; + } + mfp.currTemplate = mfp.popupsCache[data.key]; + } else { + mfp.currTemplate = {}; + } + + + + mfp.st = $.extend(true, {}, $.magnificPopup.defaults, data ); + mfp.fixedContentPos = mfp.st.fixedContentPos === 'auto' ? !mfp.probablyMobile : mfp.st.fixedContentPos; + + if(mfp.st.modal) { + mfp.st.closeOnContentClick = false; + mfp.st.closeOnBgClick = false; + mfp.st.showCloseBtn = false; + mfp.st.enableEscapeKey = false; + } + + + // Building markup + // main containers are created only once + if(!mfp.bgOverlay) { + + // Dark overlay + mfp.bgOverlay = _getEl('bg').on('click'+EVENT_NS, function() { + mfp.close(); + }); + + mfp.wrap = _getEl('wrap').attr('tabindex', -1).on('click'+EVENT_NS, function(e) { + if(mfp._checkIfClose(e.target)) { + mfp.close(); + } + }); + + mfp.container = _getEl('container', mfp.wrap); + } + + mfp.contentContainer = _getEl('content'); + if(mfp.st.preloader) { + mfp.preloader = _getEl('preloader', mfp.container, mfp.st.tLoading); + } + + + // Initializing modules + var modules = $.magnificPopup.modules; + for(i = 0; i < modules.length; i++) { + var n = modules[i]; + n = n.charAt(0).toUpperCase() + n.slice(1); + mfp['init'+n].call(mfp); + } + _mfpTrigger('BeforeOpen'); + + + if(mfp.st.showCloseBtn) { + // Close button + if(!mfp.st.closeBtnInside) { + mfp.wrap.append( _getCloseBtn() ); + } else { + _mfpOn(MARKUP_PARSE_EVENT, function(e, template, values, item) { + values.close_replaceWith = _getCloseBtn(item.type); + }); + _wrapClasses += ' mfp-close-btn-in'; + } + } + + if(mfp.st.alignTop) { + _wrapClasses += ' mfp-align-top'; + } + + + + if(mfp.fixedContentPos) { + mfp.wrap.css({ + overflow: mfp.st.overflowY, + overflowX: 'hidden', + overflowY: mfp.st.overflowY + }); + } else { + mfp.wrap.css({ + top: _window.scrollTop(), + position: 'absolute' + }); + } + if( mfp.st.fixedBgPos === false || (mfp.st.fixedBgPos === 'auto' && !mfp.fixedContentPos) ) { + mfp.bgOverlay.css({ + height: _document.height(), + position: 'absolute' + }); + } + + + + if(mfp.st.enableEscapeKey) { + // Close on ESC key + _document.on('keyup' + EVENT_NS, function(e) { + if(e.keyCode === 27) { + mfp.close(); + } + }); + } + + _window.on('resize' + EVENT_NS, function() { + mfp.updateSize(); + }); + + + if(!mfp.st.closeOnContentClick) { + _wrapClasses += ' mfp-auto-cursor'; + } + + if(_wrapClasses) + mfp.wrap.addClass(_wrapClasses); + + + // this triggers recalculation of layout, so we get it once to not to trigger twice + var windowHeight = mfp.wH = _window.height(); + + + var windowStyles = {}; + + if( mfp.fixedContentPos ) { + if(mfp._hasScrollBar(windowHeight)){ + var s = mfp._getScrollbarSize(); + if(s) { + windowStyles.marginRight = s; + } + } + } + + if(mfp.fixedContentPos) { + if(!mfp.isIE7) { + windowStyles.overflow = 'hidden'; + } else { + // ie7 double-scroll bug + $('body, html').css('overflow', 'hidden'); + } + } + + + + var classesToadd = mfp.st.mainClass; + if(mfp.isIE7) { + classesToadd += ' mfp-ie7'; + } + if(classesToadd) { + mfp._addClassToMFP( classesToadd ); + } + + // add content + mfp.updateItemHTML(); + + _mfpTrigger('BuildControls'); + + // remove scrollbar, add margin e.t.c + $('html').css(windowStyles); + + // add everything to DOM + mfp.bgOverlay.add(mfp.wrap).prependTo( mfp.st.prependTo || $(document.body) ); + + // Save last focused element + mfp._lastFocusedEl = document.activeElement; + + // Wait for next cycle to allow CSS transition + setTimeout(function() { + + if(mfp.content) { + mfp._addClassToMFP(READY_CLASS); + mfp._setFocus(); + } else { + // if content is not defined (not loaded e.t.c) we add class only for BG + mfp.bgOverlay.addClass(READY_CLASS); + } + + // Trap the focus in popup + _document.on('focusin' + EVENT_NS, mfp._onFocusIn); + + }, 16); + + mfp.isOpen = true; + mfp.updateSize(windowHeight); + _mfpTrigger(OPEN_EVENT); + + return data; + }, + + /** + * Closes the popup + */ + close: function() { + if(!mfp.isOpen) return; + _mfpTrigger(BEFORE_CLOSE_EVENT); + + mfp.isOpen = false; + // for CSS3 animation + if(mfp.st.removalDelay && !mfp.isLowIE && mfp.supportsTransition ) { + mfp._addClassToMFP(REMOVING_CLASS); + setTimeout(function() { + mfp._close(); + }, mfp.st.removalDelay); + } else { + mfp._close(); + } + }, + + /** + * Helper for close() function + */ + _close: function() { + _mfpTrigger(CLOSE_EVENT); + + var classesToRemove = REMOVING_CLASS + ' ' + READY_CLASS + ' '; + + mfp.bgOverlay.detach(); + mfp.wrap.detach(); + mfp.container.empty(); + + if(mfp.st.mainClass) { + classesToRemove += mfp.st.mainClass + ' '; + } + + mfp._removeClassFromMFP(classesToRemove); + + if(mfp.fixedContentPos) { + var windowStyles = {marginRight: ''}; + if(mfp.isIE7) { + $('body, html').css('overflow', ''); + } else { + windowStyles.overflow = ''; + } + $('html').css(windowStyles); + } + + _document.off('keyup' + EVENT_NS + ' focusin' + EVENT_NS); + mfp.ev.off(EVENT_NS); + + // clean up DOM elements that aren't removed + mfp.wrap.attr('class', 'mfp-wrap').removeAttr('style'); + mfp.bgOverlay.attr('class', 'mfp-bg'); + mfp.container.attr('class', 'mfp-container'); + + // remove close button from target element + if(mfp.st.showCloseBtn && + (!mfp.st.closeBtnInside || mfp.currTemplate[mfp.currItem.type] === true)) { + if(mfp.currTemplate.closeBtn) + mfp.currTemplate.closeBtn.detach(); + } + + + if(mfp.st.autoFocusLast && mfp._lastFocusedEl) { + $(mfp._lastFocusedEl).focus(); // put tab focus back + } + mfp.currItem = null; + mfp.content = null; + mfp.currTemplate = null; + mfp.prevHeight = 0; + + _mfpTrigger(AFTER_CLOSE_EVENT); + }, + + updateSize: function(winHeight) { + + if(mfp.isIOS) { + // fixes iOS nav bars https://github.com/dimsemenov/Magnific-Popup/issues/2 + var zoomLevel = document.documentElement.clientWidth / window.innerWidth; + var height = window.innerHeight * zoomLevel; + mfp.wrap.css('height', height); + mfp.wH = height; + } else { + mfp.wH = winHeight || _window.height(); + } + // Fixes #84: popup incorrectly positioned with position:relative on body + if(!mfp.fixedContentPos) { + mfp.wrap.css('height', mfp.wH); + } + + _mfpTrigger('Resize'); + + }, + + /** + * Set content of popup based on current index + */ + updateItemHTML: function() { + var item = mfp.items[mfp.index]; + + // Detach and perform modifications + mfp.contentContainer.detach(); + + if(mfp.content) + mfp.content.detach(); + + if(!item.parsed) { + item = mfp.parseEl( mfp.index ); + } + + var type = item.type; + + _mfpTrigger('BeforeChange', [mfp.currItem ? mfp.currItem.type : '', type]); + // BeforeChange event works like so: + // _mfpOn('BeforeChange', function(e, prevType, newType) { }); + + mfp.currItem = item; + + if(!mfp.currTemplate[type]) { + var markup = mfp.st[type] ? mfp.st[type].markup : false; + + // allows to modify markup + _mfpTrigger('FirstMarkupParse', markup); + + if(markup) { + mfp.currTemplate[type] = $(markup); + } else { + // if there is no markup found we just define that template is parsed + mfp.currTemplate[type] = true; + } + } + + if(_prevContentType && _prevContentType !== item.type) { + mfp.container.removeClass('mfp-'+_prevContentType+'-holder'); + } + + var newContent = mfp['get' + type.charAt(0).toUpperCase() + type.slice(1)](item, mfp.currTemplate[type]); + mfp.appendContent(newContent, type); + + item.preloaded = true; + + _mfpTrigger(CHANGE_EVENT, item); + _prevContentType = item.type; + + // Append container back after its content changed + mfp.container.prepend(mfp.contentContainer); + + _mfpTrigger('AfterChange'); + }, + + + /** + * Set HTML content of popup + */ + appendContent: function(newContent, type) { + mfp.content = newContent; + + if(newContent) { + if(mfp.st.showCloseBtn && mfp.st.closeBtnInside && + mfp.currTemplate[type] === true) { + // if there is no markup, we just append close button element inside + if(!mfp.content.find('.mfp-close').length) { + mfp.content.append(_getCloseBtn()); + } + } else { + mfp.content = newContent; + } + } else { + mfp.content = ''; + } + + _mfpTrigger(BEFORE_APPEND_EVENT); + mfp.container.addClass('mfp-'+type+'-holder'); + + mfp.contentContainer.append(mfp.content); + }, + + + /** + * Creates Magnific Popup data object based on given data + * @param {int} index Index of item to parse + */ + parseEl: function(index) { + var item = mfp.items[index], + type; + + if(item.tagName) { + item = { el: $(item) }; + } else { + type = item.type; + item = { data: item, src: item.src }; + } + + if(item.el) { + var types = mfp.types; + + // check for 'mfp-TYPE' class + for(var i = 0; i < types.length; i++) { + if( item.el.hasClass('mfp-'+types[i]) ) { + type = types[i]; + break; + } + } + + item.src = item.el.attr('data-mfp-src'); + if(!item.src) { + item.src = item.el.attr('href'); + } + } + + item.type = type || mfp.st.type || 'inline'; + item.index = index; + item.parsed = true; + mfp.items[index] = item; + _mfpTrigger('ElementParse', item); + + return mfp.items[index]; + }, + + + /** + * Initializes single popup or a group of popups + */ + addGroup: function(el, options) { + var eHandler = function(e) { + e.mfpEl = this; + mfp._openClick(e, el, options); + }; + + if(!options) { + options = {}; + } + + var eName = 'click.magnificPopup'; + options.mainEl = el; + + if(options.items) { + options.isObj = true; + el.off(eName).on(eName, eHandler); + } else { + options.isObj = false; + if(options.delegate) { + el.off(eName).on(eName, options.delegate , eHandler); + } else { + options.items = el; + el.off(eName).on(eName, eHandler); + } + } + }, + _openClick: function(e, el, options) { + var midClick = options.midClick !== undefined ? options.midClick : $.magnificPopup.defaults.midClick; + + + if(!midClick && ( e.which === 2 || e.ctrlKey || e.metaKey || e.altKey || e.shiftKey ) ) { + return; + } + + var disableOn = options.disableOn !== undefined ? options.disableOn : $.magnificPopup.defaults.disableOn; + + if(disableOn) { + if($.isFunction(disableOn)) { + if( !disableOn.call(mfp) ) { + return true; + } + } else { // else it's number + if( _window.width() < disableOn ) { + return true; + } + } + } + + if(e.type) { + e.preventDefault(); + + // This will prevent popup from closing if element is inside and popup is already opened + if(mfp.isOpen) { + e.stopPropagation(); + } + } + + options.el = $(e.mfpEl); + if(options.delegate) { + options.items = el.find(options.delegate); + } + mfp.open(options); + }, + + + /** + * Updates text on preloader + */ + updateStatus: function(status, text) { + + if(mfp.preloader) { + if(_prevStatus !== status) { + mfp.container.removeClass('mfp-s-'+_prevStatus); + } + + if(!text && status === 'loading') { + text = mfp.st.tLoading; + } + + var data = { + status: status, + text: text + }; + // allows to modify status + _mfpTrigger('UpdateStatus', data); + + status = data.status; + text = data.text; + + mfp.preloader.html(text); + + mfp.preloader.find('a').on('click', function(e) { + e.stopImmediatePropagation(); + }); + + mfp.container.addClass('mfp-s-'+status); + _prevStatus = status; + } + }, + + + /* + "Private" helpers that aren't private at all + */ + // Check to close popup or not + // "target" is an element that was clicked + _checkIfClose: function(target) { + + if($(target).hasClass(PREVENT_CLOSE_CLASS)) { + return; + } + + var closeOnContent = mfp.st.closeOnContentClick; + var closeOnBg = mfp.st.closeOnBgClick; + + if(closeOnContent && closeOnBg) { + return true; + } else { + + // We close the popup if click is on close button or on preloader. Or if there is no content. + if(!mfp.content || $(target).hasClass('mfp-close') || (mfp.preloader && target === mfp.preloader[0]) ) { + return true; + } + + // if click is outside the content + if( (target !== mfp.content[0] && !$.contains(mfp.content[0], target)) ) { + if(closeOnBg) { + // last check, if the clicked element is in DOM, (in case it's removed onclick) + if( $.contains(document, target) ) { + return true; + } + } + } else if(closeOnContent) { + return true; + } + + } + return false; + }, + _addClassToMFP: function(cName) { + mfp.bgOverlay.addClass(cName); + mfp.wrap.addClass(cName); + }, + _removeClassFromMFP: function(cName) { + this.bgOverlay.removeClass(cName); + mfp.wrap.removeClass(cName); + }, + _hasScrollBar: function(winHeight) { + return ( (mfp.isIE7 ? _document.height() : document.body.scrollHeight) > (winHeight || _window.height()) ); + }, + _setFocus: function() { + (mfp.st.focus ? mfp.content.find(mfp.st.focus).eq(0) : mfp.wrap).focus(); + }, + _onFocusIn: function(e) { + if( e.target !== mfp.wrap[0] && !$.contains(mfp.wrap[0], e.target) ) { + mfp._setFocus(); + return false; + } + }, + _parseMarkup: function(template, values, item) { + var arr; + if(item.data) { + values = $.extend(item.data, values); + } + _mfpTrigger(MARKUP_PARSE_EVENT, [template, values, item] ); + + $.each(values, function(key, value) { + if(value === undefined || value === false) { + return true; + } + arr = key.split('_'); + if(arr.length > 1) { + var el = template.find(EVENT_NS + '-'+arr[0]); + + if(el.length > 0) { + var attr = arr[1]; + if(attr === 'replaceWith') { + if(el[0] !== value[0]) { + el.replaceWith(value); + } + } else if(attr === 'img') { + if(el.is('img')) { + el.attr('src', value); + } else { + el.replaceWith( $('').attr('src', value).attr('class', el.attr('class')) ); + } + } else { + el.attr(arr[1], value); + } + } + + } else { + template.find(EVENT_NS + '-'+key).html(value); + } + }); + }, + + _getScrollbarSize: function() { + // thx David + if(mfp.scrollbarSize === undefined) { + var scrollDiv = document.createElement("div"); + scrollDiv.style.cssText = 'width: 99px; height: 99px; overflow: scroll; position: absolute; top: -9999px;'; + document.body.appendChild(scrollDiv); + mfp.scrollbarSize = scrollDiv.offsetWidth - scrollDiv.clientWidth; + document.body.removeChild(scrollDiv); + } + return mfp.scrollbarSize; + } + + }; /* MagnificPopup core prototype end */ + + + + + /** + * Public static functions + */ + $.magnificPopup = { + instance: null, + proto: MagnificPopup.prototype, + modules: [], + + open: function(options, index) { + _checkInstance(); + + if(!options) { + options = {}; + } else { + options = $.extend(true, {}, options); + } + + options.isObj = true; + options.index = index || 0; + return this.instance.open(options); + }, + + close: function() { + return $.magnificPopup.instance && $.magnificPopup.instance.close(); + }, + + registerModule: function(name, module) { + if(module.options) { + $.magnificPopup.defaults[name] = module.options; + } + $.extend(this.proto, module.proto); + this.modules.push(name); + }, + + defaults: { + + // Info about options is in docs: + // http://dimsemenov.com/plugins/magnific-popup/documentation.html#options + + disableOn: 0, + + key: null, + + midClick: false, + + mainClass: '', + + preloader: true, + + focus: '', // CSS selector of input to focus after popup is opened + + closeOnContentClick: false, + + closeOnBgClick: true, + + closeBtnInside: true, + + showCloseBtn: true, + + enableEscapeKey: true, + + modal: false, + + alignTop: false, + + removalDelay: 0, + + prependTo: null, + + fixedContentPos: 'auto', + + fixedBgPos: 'auto', + + overflowY: 'auto', + + closeMarkup: '', + + tClose: 'Close (Esc)', + + tLoading: 'Loading...', + + autoFocusLast: true + + } + }; + + + + $.fn.magnificPopup = function(options) { + _checkInstance(); + + var jqEl = $(this); + + // We call some API method of first param is a string + if (typeof options === "string" ) { + + if(options === 'open') { + var items, + itemOpts = _isJQ ? jqEl.data('magnificPopup') : jqEl[0].magnificPopup, + index = parseInt(arguments[1], 10) || 0; + + if(itemOpts.items) { + items = itemOpts.items[index]; + } else { + items = jqEl; + if(itemOpts.delegate) { + items = items.find(itemOpts.delegate); + } + items = items.eq( index ); + } + mfp._openClick({mfpEl:items}, jqEl, itemOpts); + } else { + if(mfp.isOpen) + mfp[options].apply(mfp, Array.prototype.slice.call(arguments, 1)); + } + + } else { + // clone options obj + options = $.extend(true, {}, options); + + /* + * As Zepto doesn't support .data() method for objects + * and it works only in normal browsers + * we assign "options" object directly to the DOM element. FTW! + */ + if(_isJQ) { + jqEl.data('magnificPopup', options); + } else { + jqEl[0].magnificPopup = options; + } + + mfp.addGroup(jqEl, options); + + } + return jqEl; + }; + + /*>>core*/ + + /*>>inline*/ + + var INLINE_NS = 'inline', + _hiddenClass, + _inlinePlaceholder, + _lastInlineElement, + _putInlineElementsBack = function() { + if(_lastInlineElement) { + _inlinePlaceholder.after( _lastInlineElement.addClass(_hiddenClass) ).detach(); + _lastInlineElement = null; + } + }; + + $.magnificPopup.registerModule(INLINE_NS, { + options: { + hiddenClass: 'hide', // will be appended with `mfp-` prefix + markup: '', + tNotFound: 'Content not found' + }, + proto: { + + initInline: function() { + mfp.types.push(INLINE_NS); + + _mfpOn(CLOSE_EVENT+'.'+INLINE_NS, function() { + _putInlineElementsBack(); + }); + }, + + getInline: function(item, template) { + + _putInlineElementsBack(); + + if(item.src) { + var inlineSt = mfp.st.inline, + el = $(item.src); + + if(el.length) { + + // If target element has parent - we replace it with placeholder and put it back after popup is closed + var parent = el[0].parentNode; + if(parent && parent.tagName) { + if(!_inlinePlaceholder) { + _hiddenClass = inlineSt.hiddenClass; + _inlinePlaceholder = _getEl(_hiddenClass); + _hiddenClass = 'mfp-'+_hiddenClass; + } + // replace target inline element with placeholder + _lastInlineElement = el.after(_inlinePlaceholder).detach().removeClass(_hiddenClass); + } + + mfp.updateStatus('ready'); + } else { + mfp.updateStatus('error', inlineSt.tNotFound); + el = $('
'); + } + + item.inlineElement = el; + return el; + } + + mfp.updateStatus('ready'); + mfp._parseMarkup(template, {}, item); + return template; + } + } + }); + + /*>>inline*/ + + /*>>ajax*/ + var AJAX_NS = 'ajax', + _ajaxCur, + _removeAjaxCursor = function() { + if(_ajaxCur) { + $(document.body).removeClass(_ajaxCur); + } + }, + _destroyAjaxRequest = function() { + _removeAjaxCursor(); + if(mfp.req) { + mfp.req.abort(); + } + }; + + $.magnificPopup.registerModule(AJAX_NS, { + + options: { + settings: null, + cursor: 'mfp-ajax-cur', + tError: 'The content could not be loaded.' + }, + + proto: { + initAjax: function() { + mfp.types.push(AJAX_NS); + _ajaxCur = mfp.st.ajax.cursor; + + _mfpOn(CLOSE_EVENT+'.'+AJAX_NS, _destroyAjaxRequest); + _mfpOn('BeforeChange.' + AJAX_NS, _destroyAjaxRequest); + }, + getAjax: function(item) { + + if(_ajaxCur) { + $(document.body).addClass(_ajaxCur); + } + + mfp.updateStatus('loading'); + + var opts = $.extend({ + url: item.src, + success: function(data, textStatus, jqXHR) { + var temp = { + data:data, + xhr:jqXHR + }; + + _mfpTrigger('ParseAjax', temp); + + mfp.appendContent( $(temp.data), AJAX_NS ); + + item.finished = true; + + _removeAjaxCursor(); + + mfp._setFocus(); + + setTimeout(function() { + mfp.wrap.addClass(READY_CLASS); + }, 16); + + mfp.updateStatus('ready'); + + _mfpTrigger('AjaxContentAdded'); + }, + error: function() { + _removeAjaxCursor(); + item.finished = item.loadError = true; + mfp.updateStatus('error', mfp.st.ajax.tError.replace('%url%', item.src)); + } + }, mfp.st.ajax.settings); + + mfp.req = $.ajax(opts); + + return ''; + } + } + }); + + /*>>ajax*/ + + /*>>image*/ + var _imgInterval, + _getTitle = function(item) { + if(item.data && item.data.title !== undefined) + return item.data.title; + + var src = mfp.st.image.titleSrc; + + if(src) { + if($.isFunction(src)) { + return src.call(mfp, item); + } else if(item.el) { + return item.el.attr(src) || ''; + } + } + return ''; + }; + + $.magnificPopup.registerModule('image', { + + options: { + markup: '
'+ + '
'+ + '
'+ + '
'+ + '
'+ + '
'+ + '
'+ + '
'+ + '
'+ + '
'+ + '
'+ + '
', + cursor: 'mfp-zoom-out-cur', + titleSrc: 'title', + verticalFit: true, + tError: 'The image could not be loaded.' + }, + + proto: { + initImage: function() { + var imgSt = mfp.st.image, + ns = '.image'; + + mfp.types.push('image'); + + _mfpOn(OPEN_EVENT+ns, function() { + if(mfp.currItem.type === 'image' && imgSt.cursor) { + $(document.body).addClass(imgSt.cursor); + } + }); + + _mfpOn(CLOSE_EVENT+ns, function() { + if(imgSt.cursor) { + $(document.body).removeClass(imgSt.cursor); + } + _window.off('resize' + EVENT_NS); + }); + + _mfpOn('Resize'+ns, mfp.resizeImage); + if(mfp.isLowIE) { + _mfpOn('AfterChange', mfp.resizeImage); + } + }, + resizeImage: function() { + var item = mfp.currItem; + if(!item || !item.img) return; + + if(mfp.st.image.verticalFit) { + var decr = 0; + // fix box-sizing in ie7/8 + if(mfp.isLowIE) { + decr = parseInt(item.img.css('padding-top'), 10) + parseInt(item.img.css('padding-bottom'),10); + } + item.img.css('max-height', mfp.wH-decr); + } + }, + _onImageHasSize: function(item) { + if(item.img) { + + item.hasSize = true; + + if(_imgInterval) { + clearInterval(_imgInterval); + } + + item.isCheckingImgSize = false; + + _mfpTrigger('ImageHasSize', item); + + if(item.imgHidden) { + if(mfp.content) + mfp.content.removeClass('mfp-loading'); + + item.imgHidden = false; + } + + } + }, + + /** + * Function that loops until the image has size to display elements that rely on it asap + */ + findImageSize: function(item) { + + var counter = 0, + img = item.img[0], + mfpSetInterval = function(delay) { + + if(_imgInterval) { + clearInterval(_imgInterval); + } + // decelerating interval that checks for size of an image + _imgInterval = setInterval(function() { + if(img.naturalWidth > 0) { + mfp._onImageHasSize(item); + return; + } + + if(counter > 200) { + clearInterval(_imgInterval); + } + + counter++; + if(counter === 3) { + mfpSetInterval(10); + } else if(counter === 40) { + mfpSetInterval(50); + } else if(counter === 100) { + mfpSetInterval(500); + } + }, delay); + }; + + mfpSetInterval(1); + }, + + getImage: function(item, template) { + + var guard = 0, + + // image load complete handler + onLoadComplete = function() { + if(item) { + if (item.img[0].complete) { + item.img.off('.mfploader'); + + if(item === mfp.currItem){ + mfp._onImageHasSize(item); + + mfp.updateStatus('ready'); + } + + item.hasSize = true; + item.loaded = true; + + _mfpTrigger('ImageLoadComplete'); + + } + else { + // if image complete check fails 200 times (20 sec), we assume that there was an error. + guard++; + if(guard < 200) { + setTimeout(onLoadComplete,100); + } else { + onLoadError(); + } + } + } + }, + + // image error handler + onLoadError = function() { + if(item) { + item.img.off('.mfploader'); + if(item === mfp.currItem){ + mfp._onImageHasSize(item); + mfp.updateStatus('error', imgSt.tError.replace('%url%', item.src) ); + } + + item.hasSize = true; + item.loaded = true; + item.loadError = true; + } + }, + imgSt = mfp.st.image; + + + var el = template.find('.mfp-img'); + if(el.length) { + var img = document.createElement('img'); + img.className = 'mfp-img'; + if(item.el && item.el.find('img').length) { + img.alt = item.el.find('img').attr('alt'); + } + item.img = $(img).on('load.mfploader', onLoadComplete).on('error.mfploader', onLoadError); + img.src = item.src; + + // without clone() "error" event is not firing when IMG is replaced by new IMG + // TODO: find a way to avoid such cloning + if(el.is('img')) { + item.img = item.img.clone(); + } + + img = item.img[0]; + if(img.naturalWidth > 0) { + item.hasSize = true; + } else if(!img.width) { + item.hasSize = false; + } + } + + mfp._parseMarkup(template, { + title: _getTitle(item), + img_replaceWith: item.img + }, item); + + mfp.resizeImage(); + + if(item.hasSize) { + if(_imgInterval) clearInterval(_imgInterval); + + if(item.loadError) { + template.addClass('mfp-loading'); + mfp.updateStatus('error', imgSt.tError.replace('%url%', item.src) ); + } else { + template.removeClass('mfp-loading'); + mfp.updateStatus('ready'); + } + return template; + } + + mfp.updateStatus('loading'); + item.loading = true; + + if(!item.hasSize) { + item.imgHidden = true; + template.addClass('mfp-loading'); + mfp.findImageSize(item); + } + + return template; + } + } + }); + + /*>>image*/ + + /*>>zoom*/ + var hasMozTransform, + getHasMozTransform = function() { + if(hasMozTransform === undefined) { + hasMozTransform = document.createElement('p').style.MozTransform !== undefined; + } + return hasMozTransform; + }; + + $.magnificPopup.registerModule('zoom', { + + options: { + enabled: false, + easing: 'ease-in-out', + duration: 300, + opener: function(element) { + return element.is('img') ? element : element.find('img'); + } + }, + + proto: { + + initZoom: function() { + var zoomSt = mfp.st.zoom, + ns = '.zoom', + image; + + if(!zoomSt.enabled || !mfp.supportsTransition) { + return; + } + + var duration = zoomSt.duration, + getElToAnimate = function(image) { + var newImg = image.clone().removeAttr('style').removeAttr('class').addClass('mfp-animated-image'), + transition = 'all '+(zoomSt.duration/1000)+'s ' + zoomSt.easing, + cssObj = { + position: 'fixed', + zIndex: 9999, + left: 0, + top: 0, + '-webkit-backface-visibility': 'hidden' + }, + t = 'transition'; + + cssObj['-webkit-'+t] = cssObj['-moz-'+t] = cssObj['-o-'+t] = cssObj[t] = transition; + + newImg.css(cssObj); + return newImg; + }, + showMainContent = function() { + mfp.content.css('visibility', 'visible'); + }, + openTimeout, + animatedImg; + + _mfpOn('BuildControls'+ns, function() { + if(mfp._allowZoom()) { + + clearTimeout(openTimeout); + mfp.content.css('visibility', 'hidden'); + + // Basically, all code below does is clones existing image, puts in on top of the current one and animated it + + image = mfp._getItemToZoom(); + + if(!image) { + showMainContent(); + return; + } + + animatedImg = getElToAnimate(image); + + animatedImg.css( mfp._getOffset() ); + + mfp.wrap.append(animatedImg); + + openTimeout = setTimeout(function() { + animatedImg.css( mfp._getOffset( true ) ); + openTimeout = setTimeout(function() { + + showMainContent(); + + setTimeout(function() { + animatedImg.remove(); + image = animatedImg = null; + _mfpTrigger('ZoomAnimationEnded'); + }, 16); // avoid blink when switching images + + }, duration); // this timeout equals animation duration + + }, 16); // by adding this timeout we avoid short glitch at the beginning of animation + + + // Lots of timeouts... + } + }); + _mfpOn(BEFORE_CLOSE_EVENT+ns, function() { + if(mfp._allowZoom()) { + + clearTimeout(openTimeout); + + mfp.st.removalDelay = duration; + + if(!image) { + image = mfp._getItemToZoom(); + if(!image) { + return; + } + animatedImg = getElToAnimate(image); + } + + animatedImg.css( mfp._getOffset(true) ); + mfp.wrap.append(animatedImg); + mfp.content.css('visibility', 'hidden'); + + setTimeout(function() { + animatedImg.css( mfp._getOffset() ); + }, 16); + } + + }); + + _mfpOn(CLOSE_EVENT+ns, function() { + if(mfp._allowZoom()) { + showMainContent(); + if(animatedImg) { + animatedImg.remove(); + } + image = null; + } + }); + }, + + _allowZoom: function() { + return mfp.currItem.type === 'image'; + }, + + _getItemToZoom: function() { + if(mfp.currItem.hasSize) { + return mfp.currItem.img; + } else { + return false; + } + }, + + // Get element postion relative to viewport + _getOffset: function(isLarge) { + var el; + if(isLarge) { + el = mfp.currItem.img; + } else { + el = mfp.st.zoom.opener(mfp.currItem.el || mfp.currItem); + } + + var offset = el.offset(); + var paddingTop = parseInt(el.css('padding-top'),10); + var paddingBottom = parseInt(el.css('padding-bottom'),10); + offset.top -= ( $(window).scrollTop() - paddingTop ); + + + /* + + Animating left + top + width/height looks glitchy in Firefox, but perfect in Chrome. And vice-versa. + + */ + var obj = { + width: el.width(), + // fix Zepto height+padding issue + height: (_isJQ ? el.innerHeight() : el[0].offsetHeight) - paddingBottom - paddingTop + }; + + // I hate to do this, but there is no another option + if( getHasMozTransform() ) { + obj['-moz-transform'] = obj['transform'] = 'translate(' + offset.left + 'px,' + offset.top + 'px)'; + } else { + obj.left = offset.left; + obj.top = offset.top; + } + return obj; + } + + } + }); + + + + /*>>zoom*/ + + /*>>iframe*/ + + var IFRAME_NS = 'iframe', + _emptyPage = '//about:blank', + + _fixIframeBugs = function(isShowing) { + if(mfp.currTemplate[IFRAME_NS]) { + var el = mfp.currTemplate[IFRAME_NS].find('iframe'); + if(el.length) { + // reset src after the popup is closed to avoid "video keeps playing after popup is closed" bug + if(!isShowing) { + el[0].src = _emptyPage; + } + + // IE8 black screen bug fix + if(mfp.isIE8) { + el.css('display', isShowing ? 'block' : 'none'); + } + } + } + }; + + $.magnificPopup.registerModule(IFRAME_NS, { + + options: { + markup: '
'+ + '
'+ + ''+ + '
', + + srcAction: 'iframe_src', + + // we don't care and support only one default type of URL by default + patterns: { + youtube: { + index: 'youtube.com', + id: 'v=', + src: '//www.youtube.com/embed/%id%?autoplay=1' + }, + vimeo: { + index: 'vimeo.com/', + id: '/', + src: '//player.vimeo.com/video/%id%?autoplay=1' + }, + gmaps: { + index: '//maps.google.', + src: '%id%&output=embed' + } + } + }, + + proto: { + initIframe: function() { + mfp.types.push(IFRAME_NS); + + _mfpOn('BeforeChange', function(e, prevType, newType) { + if(prevType !== newType) { + if(prevType === IFRAME_NS) { + _fixIframeBugs(); // iframe if removed + } else if(newType === IFRAME_NS) { + _fixIframeBugs(true); // iframe is showing + } + }// else { + // iframe source is switched, don't do anything + //} + }); + + _mfpOn(CLOSE_EVENT + '.' + IFRAME_NS, function() { + _fixIframeBugs(); + }); + }, + + getIframe: function(item, template) { + var embedSrc = item.src; + var iframeSt = mfp.st.iframe; + + $.each(iframeSt.patterns, function() { + if(embedSrc.indexOf( this.index ) > -1) { + if(this.id) { + if(typeof this.id === 'string') { + embedSrc = embedSrc.substr(embedSrc.lastIndexOf(this.id)+this.id.length, embedSrc.length); + } else { + embedSrc = this.id.call( this, embedSrc ); + } + } + embedSrc = this.src.replace('%id%', embedSrc ); + return false; // break; + } + }); + + var dataObj = {}; + if(iframeSt.srcAction) { + dataObj[iframeSt.srcAction] = embedSrc; + } + mfp._parseMarkup(template, dataObj, item); + + mfp.updateStatus('ready'); + + return template; + } + } + }); + + + + /*>>iframe*/ + + /*>>gallery*/ + /** + * Get looped index depending on number of slides + */ + var _getLoopedId = function(index) { + var numSlides = mfp.items.length; + if(index > numSlides - 1) { + return index - numSlides; + } else if(index < 0) { + return numSlides + index; + } + return index; + }, + _replaceCurrTotal = function(text, curr, total) { + return text.replace(/%curr%/gi, curr + 1).replace(/%total%/gi, total); + }; + + $.magnificPopup.registerModule('gallery', { + + options: { + enabled: false, + arrowMarkup: '', + preload: [0,2], + navigateByImgClick: true, + arrows: true, + + tPrev: 'Previous (Left arrow key)', + tNext: 'Next (Right arrow key)', + tCounter: '%curr% of %total%' + }, + + proto: { + initGallery: function() { + + var gSt = mfp.st.gallery, + ns = '.mfp-gallery'; + + mfp.direction = true; // true - next, false - prev + + if(!gSt || !gSt.enabled ) return false; + + _wrapClasses += ' mfp-gallery'; + + _mfpOn(OPEN_EVENT+ns, function() { + + if(gSt.navigateByImgClick) { + mfp.wrap.on('click'+ns, '.mfp-img', function() { + if(mfp.items.length > 1) { + mfp.next(); + return false; + } + }); + } + + _document.on('keydown'+ns, function(e) { + if (e.keyCode === 37) { + mfp.prev(); + } else if (e.keyCode === 39) { + mfp.next(); + } + }); + }); + + _mfpOn('UpdateStatus'+ns, function(e, data) { + if(data.text) { + data.text = _replaceCurrTotal(data.text, mfp.currItem.index, mfp.items.length); + } + }); + + _mfpOn(MARKUP_PARSE_EVENT+ns, function(e, element, values, item) { + var l = mfp.items.length; + values.counter = l > 1 ? _replaceCurrTotal(gSt.tCounter, item.index, l) : ''; + }); + + _mfpOn('BuildControls' + ns, function() { + if(mfp.items.length > 1 && gSt.arrows && !mfp.arrowLeft) { + var markup = gSt.arrowMarkup, + arrowLeft = mfp.arrowLeft = $( markup.replace(/%title%/gi, gSt.tPrev).replace(/%dir%/gi, 'left') ).addClass(PREVENT_CLOSE_CLASS), + arrowRight = mfp.arrowRight = $( markup.replace(/%title%/gi, gSt.tNext).replace(/%dir%/gi, 'right') ).addClass(PREVENT_CLOSE_CLASS); + + arrowLeft.click(function() { + mfp.prev(); + }); + arrowRight.click(function() { + mfp.next(); + }); + + mfp.container.append(arrowLeft.add(arrowRight)); + } + }); + + _mfpOn(CHANGE_EVENT+ns, function() { + if(mfp._preloadTimeout) clearTimeout(mfp._preloadTimeout); + + mfp._preloadTimeout = setTimeout(function() { + mfp.preloadNearbyImages(); + mfp._preloadTimeout = null; + }, 16); + }); + + + _mfpOn(CLOSE_EVENT+ns, function() { + _document.off(ns); + mfp.wrap.off('click'+ns); + mfp.arrowRight = mfp.arrowLeft = null; + }); + + }, + next: function() { + mfp.direction = true; + mfp.index = _getLoopedId(mfp.index + 1); + mfp.updateItemHTML(); + }, + prev: function() { + mfp.direction = false; + mfp.index = _getLoopedId(mfp.index - 1); + mfp.updateItemHTML(); + }, + goTo: function(newIndex) { + mfp.direction = (newIndex >= mfp.index); + mfp.index = newIndex; + mfp.updateItemHTML(); + }, + preloadNearbyImages: function() { + var p = mfp.st.gallery.preload, + preloadBefore = Math.min(p[0], mfp.items.length), + preloadAfter = Math.min(p[1], mfp.items.length), + i; + + for(i = 1; i <= (mfp.direction ? preloadAfter : preloadBefore); i++) { + mfp._preloadItem(mfp.index+i); + } + for(i = 1; i <= (mfp.direction ? preloadBefore : preloadAfter); i++) { + mfp._preloadItem(mfp.index-i); + } + }, + _preloadItem: function(index) { + index = _getLoopedId(index); + + if(mfp.items[index].preloaded) { + return; + } + + var item = mfp.items[index]; + if(!item.parsed) { + item = mfp.parseEl( index ); + } + + _mfpTrigger('LazyLoad', item); + + if(item.type === 'image') { + item.img = $('').on('load.mfploader', function() { + item.hasSize = true; + }).on('error.mfploader', function() { + item.hasSize = true; + item.loadError = true; + _mfpTrigger('LazyLoadError', item); + }).attr('src', item.src); + } + + + item.preloaded = true; + } + } + }); + + /*>>gallery*/ + + /*>>retina*/ + + var RETINA_NS = 'retina'; + + $.magnificPopup.registerModule(RETINA_NS, { + options: { + replaceSrc: function(item) { + return item.src.replace(/\.\w+$/, function(m) { return '@2x' + m; }); + }, + ratio: 1 // Function or number. Set to 1 to disable. + }, + proto: { + initRetina: function() { + if(window.devicePixelRatio > 1) { + + var st = mfp.st.retina, + ratio = st.ratio; + + ratio = !isNaN(ratio) ? ratio : ratio(); + + if(ratio > 1) { + _mfpOn('ImageHasSize' + '.' + RETINA_NS, function(e, item) { + item.img.css({ + 'max-width': item.img[0].naturalWidth / ratio, + 'width': '100%' + }); + }); + _mfpOn('ElementParse' + '.' + RETINA_NS, function(e, item) { + item.src = st.replaceSrc(item, ratio); + }); + } + } + + } + } + }); + + /*>>retina*/ + _checkInstance(); })); \ No newline at end of file diff --git a/src/assets/js/plugins/smooth-scroll.js b/src/assets/js/plugins/smooth-scroll.js new file mode 100644 index 0000000..c4179a7 --- /dev/null +++ b/src/assets/js/plugins/smooth-scroll.js @@ -0,0 +1,650 @@ +/*! + * smooth-scroll v16.1.2 + * Animate scrolling to anchor links + * (c) 2020 Chris Ferdinandi + * MIT License + * http://github.com/cferdinandi/smooth-scroll + */ + +(function (root, factory) { + if (typeof define === 'function' && define.amd) { + define([], (function () { + return factory(root); + })); + } else if (typeof exports === 'object') { + module.exports = factory(root); + } else { + root.SmoothScroll = factory(root); + } +})(typeof global !== 'undefined' ? global : typeof window !== 'undefined' ? window : this, (function (window) { + + 'use strict'; + + // + // Default settings + // + + var defaults = { + + // Selectors + ignore: '[data-scroll-ignore]', + header: null, + topOnEmptyHash: true, + + // Speed & Duration + speed: 500, + speedAsDuration: false, + durationMax: null, + durationMin: null, + clip: true, + offset: 0, + + // Easing + easing: 'easeInOutCubic', + customEasing: null, + + // History + updateURL: true, + popstate: true, + + // Custom Events + emitEvents: true + + }; + + + // + // Utility Methods + // + + /** + * Check if browser supports required methods + * @return {Boolean} Returns true if all required methods are supported + */ + var supports = function () { + return ( + 'querySelector' in document && + 'addEventListener' in window && + 'requestAnimationFrame' in window && + 'closest' in window.Element.prototype + ); + }; + + /** + * Merge two or more objects together. + * @param {Object} objects The objects to merge together + * @returns {Object} Merged values of defaults and options + */ + var extend = function () { + var merged = {}; + Array.prototype.forEach.call(arguments, (function (obj) { + for (var key in obj) { + if (!obj.hasOwnProperty(key)) return; + merged[key] = obj[key]; + } + })); + return merged; + }; + + /** + * Check to see if user prefers reduced motion + * @param {Object} settings Script settings + */ + var reduceMotion = function () { + if ('matchMedia' in window && window.matchMedia('(prefers-reduced-motion)').matches) { + return true; + } + return false; + }; + + /** + * Get the height of an element. + * @param {Node} elem The element to get the height of + * @return {Number} The element's height in pixels + */ + var getHeight = function (elem) { + return parseInt(window.getComputedStyle(elem).height, 10); + }; + + /** + * Escape special characters for use with querySelector + * @author Mathias Bynens + * @link https://github.com/mathiasbynens/CSS.escape + * @param {String} id The anchor ID to escape + */ + var escapeCharacters = function (id) { + + // Remove leading hash + if (id.charAt(0) === '#') { + id = id.substr(1); + } + + var string = String(id); + var length = string.length; + var index = -1; + var codeUnit; + var result = ''; + var firstCodeUnit = string.charCodeAt(0); + while (++index < length) { + codeUnit = string.charCodeAt(index); + // Note: there’s no need to special-case astral symbols, surrogate + // pairs, or lone surrogates. + + // If the character is NULL (U+0000), then throw an + // `InvalidCharacterError` exception and terminate these steps. + if (codeUnit === 0x0000) { + throw new InvalidCharacterError( + 'Invalid character: the input contains U+0000.' + ); + } + + if ( + // If the character is in the range [\1-\1F] (U+0001 to U+001F) or is + // U+007F, […] + (codeUnit >= 0x0001 && codeUnit <= 0x001F) || codeUnit == 0x007F || + // If the character is the first character and is in the range [0-9] + // (U+0030 to U+0039), […] + (index === 0 && codeUnit >= 0x0030 && codeUnit <= 0x0039) || + // If the character is the second character and is in the range [0-9] + // (U+0030 to U+0039) and the first character is a `-` (U+002D), […] + ( + index === 1 && + codeUnit >= 0x0030 && codeUnit <= 0x0039 && + firstCodeUnit === 0x002D + ) + ) { + // http://dev.w3.org/csswg/cssom/#escape-a-character-as-code-point + result += '\\' + codeUnit.toString(16) + ' '; + continue; + } + + // If the character is not handled by one of the above rules and is + // greater than or equal to U+0080, is `-` (U+002D) or `_` (U+005F), or + // is in one of the ranges [0-9] (U+0030 to U+0039), [A-Z] (U+0041 to + // U+005A), or [a-z] (U+0061 to U+007A), […] + if ( + codeUnit >= 0x0080 || + codeUnit === 0x002D || + codeUnit === 0x005F || + codeUnit >= 0x0030 && codeUnit <= 0x0039 || + codeUnit >= 0x0041 && codeUnit <= 0x005A || + codeUnit >= 0x0061 && codeUnit <= 0x007A + ) { + // the character itself + result += string.charAt(index); + continue; + } + + // Otherwise, the escaped character. + // http://dev.w3.org/csswg/cssom/#escape-a-character + result += '\\' + string.charAt(index); + + } + + // Return sanitized hash + return '#' + result; + + }; + + /** + * Calculate the easing pattern + * @link https://gist.github.com/gre/1650294 + * @param {String} type Easing pattern + * @param {Number} time Time animation should take to complete + * @returns {Number} + */ + var easingPattern = function (settings, time) { + var pattern; + + // Default Easing Patterns + if (settings.easing === 'easeInQuad') pattern = time * time; // accelerating from zero velocity + if (settings.easing === 'easeOutQuad') pattern = time * (2 - time); // decelerating to zero velocity + if (settings.easing === 'easeInOutQuad') pattern = time < 0.5 ? 2 * time * time : -1 + (4 - 2 * time) * time; // acceleration until halfway, then deceleration + if (settings.easing === 'easeInCubic') pattern = time * time * time; // accelerating from zero velocity + if (settings.easing === 'easeOutCubic') pattern = (--time) * time * time + 1; // decelerating to zero velocity + if (settings.easing === 'easeInOutCubic') pattern = time < 0.5 ? 4 * time * time * time : (time - 1) * (2 * time - 2) * (2 * time - 2) + 1; // acceleration until halfway, then deceleration + if (settings.easing === 'easeInQuart') pattern = time * time * time * time; // accelerating from zero velocity + if (settings.easing === 'easeOutQuart') pattern = 1 - (--time) * time * time * time; // decelerating to zero velocity + if (settings.easing === 'easeInOutQuart') pattern = time < 0.5 ? 8 * time * time * time * time : 1 - 8 * (--time) * time * time * time; // acceleration until halfway, then deceleration + if (settings.easing === 'easeInQuint') pattern = time * time * time * time * time; // accelerating from zero velocity + if (settings.easing === 'easeOutQuint') pattern = 1 + (--time) * time * time * time * time; // decelerating to zero velocity + if (settings.easing === 'easeInOutQuint') pattern = time < 0.5 ? 16 * time * time * time * time * time : 1 + 16 * (--time) * time * time * time * time; // acceleration until halfway, then deceleration + + // Custom Easing Patterns + if (!!settings.customEasing) pattern = settings.customEasing(time); + + return pattern || time; // no easing, no acceleration + }; + + /** + * Determine the document's height + * @returns {Number} + */ + var getDocumentHeight = function () { + return Math.max( + document.body.scrollHeight, document.documentElement.scrollHeight, + document.body.offsetHeight, document.documentElement.offsetHeight, + document.body.clientHeight, document.documentElement.clientHeight + ); + }; + + /** + * Calculate how far to scroll + * Clip support added by robjtede - https://github.com/cferdinandi/smooth-scroll/issues/405 + * @param {Element} anchor The anchor element to scroll to + * @param {Number} headerHeight Height of a fixed header, if any + * @param {Number} offset Number of pixels by which to offset scroll + * @param {Boolean} clip If true, adjust scroll distance to prevent abrupt stops near the bottom of the page + * @returns {Number} + */ + var getEndLocation = function (anchor, headerHeight, offset, clip) { + var location = 0; + if (anchor.offsetParent) { + do { + location += anchor.offsetTop; + anchor = anchor.offsetParent; + } while (anchor); + } + location = Math.max(location - headerHeight - offset, 0); + if (clip) { + location = Math.min(location, getDocumentHeight() - window.innerHeight); + } + return location; + }; + + /** + * Get the height of the fixed header + * @param {Node} header The header + * @return {Number} The height of the header + */ + var getHeaderHeight = function (header) { + return !header ? 0 : (getHeight(header) + header.offsetTop); + }; + + /** + * Calculate the speed to use for the animation + * @param {Number} distance The distance to travel + * @param {Object} settings The plugin settings + * @return {Number} How fast to animate + */ + var getSpeed = function (distance, settings) { + var speed = settings.speedAsDuration ? settings.speed : Math.abs(distance / 1000 * settings.speed); + if (settings.durationMax && speed > settings.durationMax) return settings.durationMax; + if (settings.durationMin && speed < settings.durationMin) return settings.durationMin; + return parseInt(speed, 10); + }; + + var setHistory = function (options) { + + // Make sure this should run + if (!history.replaceState || !options.updateURL || history.state) return; + + // Get the hash to use + var hash = window.location.hash; + hash = hash ? hash : ''; + + // Set a default history + history.replaceState( + { + smoothScroll: JSON.stringify(options), + anchor: hash ? hash : window.pageYOffset + }, + document.title, + hash ? hash : window.location.href + ); + + }; + + /** + * Update the URL + * @param {Node} anchor The anchor that was scrolled to + * @param {Boolean} isNum If true, anchor is a number + * @param {Object} options Settings for Smooth Scroll + */ + var updateURL = function (anchor, isNum, options) { + + // Bail if the anchor is a number + if (isNum) return; + + // Verify that pushState is supported and the updateURL option is enabled + if (!history.pushState || !options.updateURL) return; + + // Update URL + history.pushState( + { + smoothScroll: JSON.stringify(options), + anchor: anchor.id + }, + document.title, + anchor === document.documentElement ? '#top' : '#' + anchor.id + ); + + }; + + /** + * Bring the anchored element into focus + * @param {Node} anchor The anchor element + * @param {Number} endLocation The end location to scroll to + * @param {Boolean} isNum If true, scroll is to a position rather than an element + */ + var adjustFocus = function (anchor, endLocation, isNum) { + + // Is scrolling to top of page, blur + if (anchor === 0) { + document.body.focus(); + } + + // Don't run if scrolling to a number on the page + if (isNum) return; + + // Otherwise, bring anchor element into focus + anchor.focus(); + if (document.activeElement !== anchor) { + anchor.setAttribute('tabindex', '-1'); + anchor.focus(); + anchor.style.outline = 'none'; + } + window.scrollTo(0 , endLocation); + + }; + + /** + * Emit a custom event + * @param {String} type The event type + * @param {Object} options The settings object + * @param {Node} anchor The anchor element + * @param {Node} toggle The toggle element + */ + var emitEvent = function (type, options, anchor, toggle) { + if (!options.emitEvents || typeof window.CustomEvent !== 'function') return; + var event = new CustomEvent(type, { + bubbles: true, + detail: { + anchor: anchor, + toggle: toggle + } + }); + document.dispatchEvent(event); + }; + + + // + // SmoothScroll Constructor + // + + var SmoothScroll = function (selector, options) { + + // + // Variables + // + + var smoothScroll = {}; // Object for public APIs + var settings, anchor, toggle, fixedHeader, eventTimeout, animationInterval; + + + // + // Methods + // + + /** + * Cancel a scroll-in-progress + */ + smoothScroll.cancelScroll = function (noEvent) { + cancelAnimationFrame(animationInterval); + animationInterval = null; + if (noEvent) return; + emitEvent('scrollCancel', settings); + }; + + /** + * Start/stop the scrolling animation + * @param {Node|Number} anchor The element or position to scroll to + * @param {Element} toggle The element that toggled the scroll event + * @param {Object} options + */ + smoothScroll.animateScroll = function (anchor, toggle, options) { + + // Cancel any in progress scrolls + smoothScroll.cancelScroll(); + + // Local settings + var _settings = extend(settings || defaults, options || {}); // Merge user options with defaults + + // Selectors and variables + var isNum = Object.prototype.toString.call(anchor) === '[object Number]' ? true : false; + var anchorElem = isNum || !anchor.tagName ? null : anchor; + if (!isNum && !anchorElem) return; + var startLocation = window.pageYOffset; // Current location on the page + if (_settings.header && !fixedHeader) { + // Get the fixed header if not already set + fixedHeader = document.querySelector(_settings.header); + } + var headerHeight = getHeaderHeight(fixedHeader); + var endLocation = isNum ? anchor : getEndLocation(anchorElem, headerHeight, parseInt((typeof _settings.offset === 'function' ? _settings.offset(anchor, toggle) : _settings.offset), 10), _settings.clip); // Location to scroll to + var distance = endLocation - startLocation; // distance to travel + var documentHeight = getDocumentHeight(); + var timeLapsed = 0; + var speed = getSpeed(distance, _settings); + var start, percentage, position; + + /** + * Stop the scroll animation when it reaches its target (or the bottom/top of page) + * @param {Number} position Current position on the page + * @param {Number} endLocation Scroll to location + * @param {Number} animationInterval How much to scroll on this loop + */ + var stopAnimateScroll = function (position, endLocation) { + + // Get the current location + var currentLocation = window.pageYOffset; + + // Check if the end location has been reached yet (or we've hit the end of the document) + if (position == endLocation || currentLocation == endLocation || ((startLocation < endLocation && window.innerHeight + currentLocation) >= documentHeight)) { + + // Clear the animation timer + smoothScroll.cancelScroll(true); + + // Bring the anchored element into focus + adjustFocus(anchor, endLocation, isNum); + + // Emit a custom event + emitEvent('scrollStop', _settings, anchor, toggle); + + // Reset start + start = null; + animationInterval = null; + + return true; + + } + }; + + /** + * Loop scrolling animation + */ + var loopAnimateScroll = function (timestamp) { + if (!start) { start = timestamp; } + timeLapsed += timestamp - start; + percentage = speed === 0 ? 0 : (timeLapsed / speed); + percentage = (percentage > 1) ? 1 : percentage; + position = startLocation + (distance * easingPattern(_settings, percentage)); + window.scrollTo(0, Math.floor(position)); + if (!stopAnimateScroll(position, endLocation)) { + animationInterval = window.requestAnimationFrame(loopAnimateScroll); + start = timestamp; + } + }; + + /** + * Reset position to fix weird iOS bug + * @link https://github.com/cferdinandi/smooth-scroll/issues/45 + */ + if (window.pageYOffset === 0) { + window.scrollTo(0, 0); + } + + // Update the URL + updateURL(anchor, isNum, _settings); + + // If the user prefers reduced motion, jump to location + if (reduceMotion()) { + window.scrollTo(0, Math.floor(endLocation)); + return; + } + + // Emit a custom event + emitEvent('scrollStart', _settings, anchor, toggle); + + // Start scrolling animation + smoothScroll.cancelScroll(true); + window.requestAnimationFrame(loopAnimateScroll); + + }; + + /** + * If smooth scroll element clicked, animate scroll + */ + var clickHandler = function (event) { + + // Don't run if event was canceled but still bubbled up + // By @mgreter - https://github.com/cferdinandi/smooth-scroll/pull/462/ + if (event.defaultPrevented) return; + + // Don't run if right-click or command/control + click or shift + click + if (event.button !== 0 || event.metaKey || event.ctrlKey || event.shiftKey) return; + + // Check if event.target has closest() method + // By @totegi - https://github.com/cferdinandi/smooth-scroll/pull/401/ + if (!('closest' in event.target)) return; + + // Check if a smooth scroll link was clicked + toggle = event.target.closest(selector); + if (!toggle || toggle.tagName.toLowerCase() !== 'a' || event.target.closest(settings.ignore)) return; + + // Only run if link is an anchor and points to the current page + if (toggle.hostname !== window.location.hostname || toggle.pathname !== window.location.pathname || !/#/.test(toggle.href)) return; + + // Get an escaped version of the hash + var hash; + try { + hash = escapeCharacters(decodeURIComponent(toggle.hash)); + } catch(e) { + hash = escapeCharacters(toggle.hash); + } + + // Get the anchored element + var anchor; + if (hash === '#') { + if (!settings.topOnEmptyHash) return; + anchor = document.documentElement; + } else { + anchor = document.querySelector(hash); + } + anchor = !anchor && hash === '#top' ? document.documentElement : anchor; + + // If anchored element exists, scroll to it + if (!anchor) return; + event.preventDefault(); + setHistory(settings); + smoothScroll.animateScroll(anchor, toggle); + + }; + + /** + * Animate scroll on popstate events + */ + var popstateHandler = function (event) { + + // Stop if history.state doesn't exist (ex. if clicking on a broken anchor link). + // fixes `Cannot read property 'smoothScroll' of null` error getting thrown. + if (history.state === null) return; + + // Only run if state is a popstate record for this instantiation + if (!history.state.smoothScroll || history.state.smoothScroll !== JSON.stringify(settings)) return; + + // Only run if state includes an anchor + + // if (!history.state.anchor && history.state.anchor !== 0) return; + + // Get the anchor + var anchor = history.state.anchor; + if (typeof anchor === 'string' && anchor) { + anchor = document.querySelector(escapeCharacters(history.state.anchor)); + if (!anchor) return; + } + + // Animate scroll to anchor link + smoothScroll.animateScroll(anchor, null, {updateURL: false}); + + }; + + /** + * Destroy the current initialization. + */ + smoothScroll.destroy = function () { + + // If plugin isn't already initialized, stop + if (!settings) return; + + // Remove event listeners + document.removeEventListener('click', clickHandler, false); + window.removeEventListener('popstate', popstateHandler, false); + + // Cancel any scrolls-in-progress + smoothScroll.cancelScroll(); + + // Reset variables + settings = null; + anchor = null; + toggle = null; + fixedHeader = null; + eventTimeout = null; + animationInterval = null; + + }; + + /** + * Initialize Smooth Scroll + * @param {Object} options User settings + */ + var init = function () { + + // feature test + if (!supports()) throw 'Smooth Scroll: This browser does not support the required JavaScript methods and browser APIs.'; + + // Destroy any existing initializations + smoothScroll.destroy(); + + // Selectors and variables + settings = extend(defaults, options || {}); // Merge user options with defaults + fixedHeader = settings.header ? document.querySelector(settings.header) : null; // Get the fixed header + + // When a toggle is clicked, run the click handler + document.addEventListener('click', clickHandler, false); + + // If updateURL and popState are enabled, listen for pop events + if (settings.updateURL && settings.popstate) { + window.addEventListener('popstate', popstateHandler, false); + } + + }; + + + // + // Initialize plugin + // + + init(); + + + // + // Public APIs + // + + return smoothScroll; + + }; + + return SmoothScroll; + +})); diff --git a/src/banner.js b/src/banner.js new file mode 100644 index 0000000..db3974c --- /dev/null +++ b/src/banner.js @@ -0,0 +1,19 @@ +const fs = require("fs"); +const pkg = require("./package.json"); +const filename = "assets/js/main.min.js"; +const script = fs.readFileSync(filename); +const padStart = str => ("0" + str).slice(-2); +const dateObj = new Date(); +const date = `${dateObj.getFullYear()}-${padStart( + dateObj.getMonth() + 1 +)}-${padStart(dateObj.getDate())}`; +const banner = `/*! + * Minimal Mistakes Jekyll Theme ${pkg.version} by ${pkg.author} + * Copyright 2013-${dateObj.getFullYear()} Michael Rose - mademistakes.com | @mmistakes + * Licensed under ${pkg.license} + */ +`; + +if (script.slice(0, 3) != "/**") { + fs.writeFileSync(filename, banner + script); +}