From 230e98ce128a3a6c59c3f9434522ad28b3802f94 Mon Sep 17 00:00:00 2001 From: Nick Bowler Date: Tue, 23 Feb 2021 23:08:16 -0500 Subject: [PATCH] Use special SCSS comments for source and copyright info. SCSS will preserve comments that begin with /*! even when writing out compressed CSS. While I'm not sure if I want to actually do this, let's write out such comments for the source and copyright info which should not be omitted. --- content/style.scss | 2 +- lib/css-source.rb | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/content/style.scss b/content/style.scss index 5e91c9e..dd666c0 100644 --- a/content/style.scss +++ b/content/style.scss @@ -1,4 +1,4 @@ -/* +/*! * Nick's web site: default stylesheet * * Copyright © 2018-2021 Nick Bowler diff --git a/lib/css-source.rb b/lib/css-source.rb index 211c155..3185089 100644 --- a/lib/css-source.rb +++ b/lib/css-source.rb @@ -1,7 +1,7 @@ # Nick's web site: css_source filter. Add a notice to generated CSS # files where the reader may find the source code. # -# Copyright © 2020 Nick Bowler +# Copyright © 2020-2021 Nick Bowler # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -33,7 +33,7 @@ class CssSourceFilter < Nanoc::Filter end copymsgs = copymsgs.scan(copypattern) - ["/*", + ["/*!", " * Generated file, do not edit!", " * Compiled from " + item_source(@item) + " on " + Time.now.gmtime.strftime("%Y-%m-%d %H:%M UTC"), -- 2.43.0