From baf334c4fd5c6deb491805a8c68a4996d481509a Mon Sep 17 00:00:00 2001 From: curben Date: Mon, 1 Oct 2018 14:56:20 +0930 Subject: [PATCH] Add Netlify header file A separate header file is necessary, even though header rule exists in netlify.toml Revert aab11bcf14e9ca7b57d5cda5b9a41bf8d8b0f498 --- _config.yml | 2 +- source/_headers | 13 +++++++++++++ source/_posts/how-to-create-a-hexo-blog.md | 2 +- 3 files changed, 15 insertions(+), 2 deletions(-) create mode 100644 source/_headers diff --git a/_config.yml b/_config.yml index 588a28d..dcfde93 100644 --- a/_config.yml +++ b/_config.yml @@ -27,7 +27,7 @@ code_dir: downloads/code i18n_dir: :lang skip_render: include: - - _headers + - _headers # Netlify header file # Writing new_post_name: :title.md # File name of new posts diff --git a/source/_headers b/source/_headers new file mode 100644 index 0000000..8a183ad --- /dev/null +++ b/source/_headers @@ -0,0 +1,13 @@ +/* + X-Frame-Options: DENY + X-XSS-Protection: 1; mode=block + X-Content-Type-Options: nosniff + +/*.html + Content-Encoding: gzip, br + +/*.css + Content-Encoding: gzip, br + +/*.js + Content-Encoding: gzip, br diff --git a/source/_posts/how-to-create-a-hexo-blog.md b/source/_posts/how-to-create-a-hexo-blog.md index f20791a..6afb980 100644 --- a/source/_posts/how-to-create-a-hexo-blog.md +++ b/source/_posts/how-to-create-a-hexo-blog.md @@ -11,7 +11,7 @@ Create a website/blog (hosted by [GitLab](https://about.gitlab.com/features/page 3. Shared Runners should be enabled. Go to your (forked) project `Settings -> CI / CD -> Shared Runners`. 4. Change project website to a user website. This is so that the website's home page is `.gitlab.io/`, instead of `.gitlab.io/hexo`. Go to `Settings -> General -> Advanced -> Rename repository`. Change the Path to `.gitlab.io`. -5. You can start writing a new post straightaway without [installing](#installation) Hexo. You still need to change the blog's name and favicon though ([how-to](#naming). +5. You can start writing a new post straightaway without [installing](#installation) Hexo. You still need to change the blog's name and favicon though ([how-to](#naming)). 1. To create a new post (through GitLab.com), create a new `.md` file in `source/_posts` folder. 2. Start with the following header/[front-matter](https://hexo.io/docs/front-matter): ```