Skip to content

Commit

Permalink
✨ Fea(temp)t: add pageStyle option (#62)
Browse files Browse the repository at this point in the history
Tip: This commit needs to be improved and to be tested. Please don't update to it!
  • Loading branch information
Lruihao committed Feb 16, 2022
1 parent 231cfc3 commit 7f3ab2e
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 6 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ All notable changes to this project will be documented in this file.

- :tada: Feat: add Artalk comment support ([#54](https://github.com/Lruihao/FixIt/issues/54))
- :sparkles: Style: add media style for print view ([#61](https://github.com/Lruihao/FixIt/issues/61))
- :sparkles: Feat: add pageStyle option ([#62](https://github.com/Lruihao/FixIt/issues/62))
- :sparkles: Feat: update watermark 1.0.3-RC (fontFamily support)
- :pencil2: Style: fix typo discription should be: description ([#60](https://github.com/Lruihao/FixIt/issues/60))
- :fire: Feat: remove shortcode cardlink
Expand Down
7 changes: 3 additions & 4 deletions assets/css/_core/_media.scss
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
@media only screen and (max-width: 1440px) {
.page {
width: 56%;
width: 56%; // TODO - To be adjusted.
}
}

@media only screen and (max-width: 1200px) {
.page {
width: 52%;
width: 52%; // TODO - To be adjusted.
}

#header-desktop .header-wrapper {
Expand Down Expand Up @@ -86,11 +86,10 @@
@page {
size: A4 portrait;
margin: 1.27cm;
page-break-after: auto;
}

.page {
width: 100%;
width: 100%!important;
padding-top: 0!important;

.single-title,
Expand Down
5 changes: 4 additions & 1 deletion assets/css/_page/_index.scss
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
.page {
position: relative;
max-width: 800px;
width: 60%;
margin: 0 auto;

[page-style=wide] & {
width: 70%;
}

[header-desktop] & {
padding-top: $header-height;
}
Expand Down
7 changes: 7 additions & 0 deletions exampleSite/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ themesDir = "../.."
# 网站标题
title = "FixIt"

# Ignore errors
# 忽略错误
ignoreErrors = ["error-remote-getjson"]

# whether to use robots.txt
# 是否使用 robots.txt
enableRobotsTXT = true
Expand Down Expand Up @@ -610,6 +614,9 @@ enableEmoji = true
# whether to show the full text content in RSS
# 是否在 RSS 中显示全文内容
rssFullText = false
# Page style ("normal", "wide")
# 页面样式 ("normal", "wide")
pageStyle = "wide"
# Table of the contents config
# 目录配置
[params.page.toc]
Expand Down
3 changes: 2 additions & 1 deletion layouts/_default/baseof.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@
<div class="wrapper">
{{- partial "header.html" . -}}
<main class="main">
<div class="container">
{{- $pageStyle := (.Scratch.Get "params").pageStyle | default "normal" -}}
<div class="container" page-style="{{ $pageStyle }}">
{{- block "content" . }}{{ end -}}
</div>
</main>
Expand Down

0 comments on commit 7f3ab2e

Please sign in to comment.