From d80f204fa350aa5ea1ab68cf3cb3b8125759ef17 Mon Sep 17 00:00:00 2001 From: Eric Date: Mon, 6 Jun 2022 16:40:56 -0500 Subject: [PATCH] Website: Add article subtitle styles, update mobile article styles (#6110) * Website: update mobile styles, article subtitle styles, fix issues in two markdown articles * add comment --- ...ata-to-snowflake-from-fleet-and-osquery.md | 2 +- ...but-it-might-not-be-as-bad-as-you-think.md | 2 +- .../js/pages/articles/basic-article.page.js | 8 +++- .../styles/pages/articles/basic-article.less | 44 +++++++++++++++++-- .../views/pages/articles/basic-article.ejs | 3 +- 5 files changed, 52 insertions(+), 7 deletions(-) diff --git a/articles/delivering-data-to-snowflake-from-fleet-and-osquery.md b/articles/delivering-data-to-snowflake-from-fleet-and-osquery.md index 59126b8c1..7d6229bf4 100644 --- a/articles/delivering-data-to-snowflake-from-fleet-and-osquery.md +++ b/articles/delivering-data-to-snowflake-from-fleet-and-osquery.md @@ -40,7 +40,7 @@ The two features I want to focus on for this blog post are the live queries and ![The queries page in Fleet](../website/assets/images/articles/delivering-data-to-snowflake-from-fleet-and-osquery-1-415x400@2x.png) -###Scheduled Queries Interface: +### Scheduled Queries Interface: ![The schedule page in Fleet](../website/assets/images/articles/delivering-data-to-snowflake-from-fleet-and-osquery-2-700x203@2x.png) diff --git a/articles/work-may-be-watching-but-it-might-not-be-as-bad-as-you-think.md b/articles/work-may-be-watching-but-it-might-not-be-as-bad-as-you-think.md index 7ad7ad29b..4dffa3eb7 100644 --- a/articles/work-may-be-watching-but-it-might-not-be-as-bad-as-you-think.md +++ b/articles/work-may-be-watching-but-it-might-not-be-as-bad-as-you-think.md @@ -1,4 +1,4 @@ -## Work may be watching, but it might not be as bad as you think. +# Work may be watching, but it might not be as bad as you think. ![A friendly eye of Sauron watching someone work](../website/assets/images/articles/work-may-be-watching-but-it-might-not-be-as-bad-as-you-think-cover-800x502@2x.png) *Transparency and collaboration are becoming the norm for company device monitoring.* diff --git a/website/assets/js/pages/articles/basic-article.page.js b/website/assets/js/pages/articles/basic-article.page.js index 593807543..f8ff613fc 100644 --- a/website/assets/js/pages/articles/basic-article.page.js +++ b/website/assets/js/pages/articles/basic-article.page.js @@ -3,7 +3,8 @@ parasails.registerPage('basic-article', { // ║║║║║ ║ ║╠═╣║ ╚═╗ ║ ╠═╣ ║ ║╣ // ╩╝╚╝╩ ╩ ╩╩ ╩╩═╝ ╚═╝ ╩ ╩ ╩ ╩ ╚═╝ data: { - //… + articleHasSubtitle: false, + articleSubtitle: undefined, }, // ╦ ╦╔═╗╔═╗╔═╗╦ ╦╔═╗╦ ╔═╗ @@ -14,6 +15,11 @@ parasails.registerPage('basic-article', { }, mounted: async function() { //… + // If the article has a subtitle (an H2 immediatly after an H1), we'll set articleSubtitle to be the text of that heading + this.articleHasSubtitle = $('[purpose="article-content"]').find('h1 + h2'); + if(this.articleHasSubtitle.length > 0 && this.articleHasSubtitle[0].innerText) { + this.articleSubtitle = this.articleHasSubtitle[0].innerText; + } }, // ╦╔╗╔╔╦╗╔═╗╦═╗╔═╗╔═╗╔╦╗╦╔═╗╔╗╔╔═╗ diff --git a/website/assets/styles/pages/articles/basic-article.less b/website/assets/styles/pages/articles/basic-article.less index 0db365700..21dd716c4 100644 --- a/website/assets/styles/pages/articles/basic-article.less +++ b/website/assets/styles/pages/articles/basic-article.less @@ -12,10 +12,16 @@ [purpose='article-title'] { padding-top: 80px; + margin-bottom: 28px; h1 { - margin-bottom: 16px; + margin-bottom: 4px; line-height: 38px; } + h2 { + font-size: 24px; + font-weight: 400; + line-height: 32px; + } } [purpose='article-details'] { @@ -37,6 +43,9 @@ h1:first-of-type { display: none; } + h1:first-of-type + h2:first-of-type { + display: none; + } img { max-width: 100%; width: auto; @@ -44,7 +53,7 @@ max-height: 100%; margin-left: auto; margin-right: auto; - padding: 24px 0px 40px 0px; + padding: 24px 0px 16px 0px; } a { color: @core-vibrant-blue; @@ -72,10 +81,11 @@ } img + em { // Image captions position: relative; - top: -24px; + top: -12px; display: flex; align-items: center; flex-direction: column; + margin-bottom: 16px; } ul, ol { padding-left: 16px; @@ -142,6 +152,10 @@ } } } + [purpose='large-button-text'] { + display: block; + } + @media (max-width: 991px) { [purpose='article-title'] { padding-top: 60px; @@ -151,6 +165,30 @@ } } + @media (max-width: 769px) { + [purpose='article-title'] { + padding-top: 40px; + margin-bottom: 8px; + h1 { + font-size: 28px; + line-height: 38px; + } + } + [purpose='article-content'] { + img { + padding-bottom: 0px; + } + img + em { // Image captions + top: 4px; + margin-bottom: 16px; + } + } + } + @media (max-width: 375px) { + [purpose='large-button-text'] { // Changes the Slack call to action (Join the Fleet community on Slack -> Join Fleet on Slack) + display: none; + } + } } diff --git a/website/views/pages/articles/basic-article.ejs b/website/views/pages/articles/basic-article.ejs index 4f97743fe..590e66573 100644 --- a/website/views/pages/articles/basic-article.ejs +++ b/website/views/pages/articles/basic-article.ejs @@ -2,6 +2,7 @@

{{thisPage.meta.articleTitle}}

+

{{articleSubtitle}}