From 0690a920e28e6b9ee541a8767405f5f1f736dfa0 Mon Sep 17 00:00:00 2001 From: Eltrac Date: Tue, 19 Nov 2024 22:04:02 +0800 Subject: chore(hugo): stop importing theme as a git submodule --- themes/yinyang | 1 - themes/yinyang/archetypes/default.md | 2 + .../yinyang/assets/css/flexboxgrid-6.3.1.min.css | 852 +++++++++++++ themes/yinyang/assets/css/index.css | 480 ++++++++ themes/yinyang/assets/css/waline.css | 1281 ++++++++++++++++++++ themes/yinyang/exampleSite/.gitignore | 27 + themes/yinyang/exampleSite/LICENSE | 21 + themes/yinyang/exampleSite/README.md | 26 + themes/yinyang/exampleSite/config.toml | 32 + themes/yinyang/exampleSite/content/about.md | 18 + themes/yinyang/exampleSite/content/cn/posts/cn.md | 17 + .../exampleSite/content/en/posts/goisforlovers.md | 343 ++++++ .../content/en/posts/hugoisforlovers.md | 88 ++ .../content/en/posts/migrate-from-jekyll.md | 159 +++ themes/yinyang/exampleSite/layouts/.gitkeep | 0 themes/yinyang/exampleSite/static/.gitignore | 0 themes/yinyang/images/screenshot.png | Bin 0 -> 16867 bytes themes/yinyang/images/tn.png | Bin 0 -> 9668 bytes themes/yinyang/layouts/404.html | 7 + themes/yinyang/layouts/_default/list.html | 40 + themes/yinyang/layouts/_default/single.html | 95 ++ themes/yinyang/layouts/gallery/single.html | 45 + themes/yinyang/layouts/index.html | 72 ++ themes/yinyang/layouts/partials/disqus.html | 19 + themes/yinyang/layouts/partials/footer.html | 11 + themes/yinyang/layouts/partials/head.html | 72 ++ themes/yinyang/layouts/partials/header.html | 23 + themes/yinyang/layouts/partials/related.html | 11 + themes/yinyang/layouts/partials/scripts.html | 16 + themes/yinyang/layouts/partials/seo.html | 29 + themes/yinyang/layouts/shortcodes/callout.html | 6 + themes/yinyang/static/fonts/Arvo.woff2 | Bin 0 -> 10600 bytes .../static/fonts/PermanentMarker-Regular.woff2 | Bin 0 -> 29352 bytes themes/yinyang/static/images/tag.svg | 1 + themes/yinyang/static/js/lazyload.min.js | 2 + themes/yinyang/static/js/waline.js | 83 ++ themes/yinyang/theme.toml | 25 + 37 files changed, 3903 insertions(+), 1 deletion(-) delete mode 160000 themes/yinyang create mode 100644 themes/yinyang/archetypes/default.md create mode 100644 themes/yinyang/assets/css/flexboxgrid-6.3.1.min.css create mode 100644 themes/yinyang/assets/css/index.css create mode 100644 themes/yinyang/assets/css/waline.css create mode 100644 themes/yinyang/exampleSite/.gitignore create mode 100644 themes/yinyang/exampleSite/LICENSE create mode 100644 themes/yinyang/exampleSite/README.md create mode 100644 themes/yinyang/exampleSite/config.toml create mode 100644 themes/yinyang/exampleSite/content/about.md create mode 100644 themes/yinyang/exampleSite/content/cn/posts/cn.md create mode 100644 themes/yinyang/exampleSite/content/en/posts/goisforlovers.md create mode 100644 themes/yinyang/exampleSite/content/en/posts/hugoisforlovers.md create mode 100644 themes/yinyang/exampleSite/content/en/posts/migrate-from-jekyll.md create mode 100644 themes/yinyang/exampleSite/layouts/.gitkeep create mode 100644 themes/yinyang/exampleSite/static/.gitignore create mode 100644 themes/yinyang/images/screenshot.png create mode 100644 themes/yinyang/images/tn.png create mode 100644 themes/yinyang/layouts/404.html create mode 100644 themes/yinyang/layouts/_default/list.html create mode 100644 themes/yinyang/layouts/_default/single.html create mode 100644 themes/yinyang/layouts/gallery/single.html create mode 100644 themes/yinyang/layouts/index.html create mode 100644 themes/yinyang/layouts/partials/disqus.html create mode 100644 themes/yinyang/layouts/partials/footer.html create mode 100644 themes/yinyang/layouts/partials/head.html create mode 100644 themes/yinyang/layouts/partials/header.html create mode 100644 themes/yinyang/layouts/partials/related.html create mode 100644 themes/yinyang/layouts/partials/scripts.html create mode 100644 themes/yinyang/layouts/partials/seo.html create mode 100644 themes/yinyang/layouts/shortcodes/callout.html create mode 100644 themes/yinyang/static/fonts/Arvo.woff2 create mode 100644 themes/yinyang/static/fonts/PermanentMarker-Regular.woff2 create mode 100644 themes/yinyang/static/images/tag.svg create mode 100644 themes/yinyang/static/js/lazyload.min.js create mode 100644 themes/yinyang/static/js/waline.js create mode 100644 themes/yinyang/theme.toml (limited to 'themes') diff --git a/themes/yinyang b/themes/yinyang deleted file mode 160000 index 088f1780..00000000 --- a/themes/yinyang +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 088f1780703c96f8e0c2e4fd51a70f50e4e2329e diff --git a/themes/yinyang/archetypes/default.md b/themes/yinyang/archetypes/default.md new file mode 100644 index 00000000..ac36e062 --- /dev/null +++ b/themes/yinyang/archetypes/default.md @@ -0,0 +1,2 @@ ++++ ++++ diff --git a/themes/yinyang/assets/css/flexboxgrid-6.3.1.min.css b/themes/yinyang/assets/css/flexboxgrid-6.3.1.min.css new file mode 100644 index 00000000..7e27ea94 --- /dev/null +++ b/themes/yinyang/assets/css/flexboxgrid-6.3.1.min.css @@ -0,0 +1,852 @@ +.container, +.container-fluid { + margin-right: auto; + margin-left: auto +} + +.container-fluid { + padding-right: 2rem; + padding-left: 2rem +} + +.row { + box-sizing: border-box; + display: -webkit-box; + display: -ms-flexbox; + display: flex; + -webkit-box-flex: 0; + -ms-flex: 0 1 auto; + flex: 0 1 auto; + -webkit-box-orient: horizontal; + -webkit-box-direction: normal; + -ms-flex-direction: row; + flex-direction: row; + -ms-flex-wrap: wrap; + flex-wrap: wrap; + margin-right: -.5rem; + margin-left: -.5rem +} + +.row.reverse { + -webkit-box-orient: horizontal; + -webkit-box-direction: reverse; + -ms-flex-direction: row-reverse; + flex-direction: row-reverse +} + +.col.reverse { + -webkit-box-orient: vertical; + -webkit-box-direction: reverse; + -ms-flex-direction: column-reverse; + flex-direction: column-reverse +} + +.col-xs, +.col-xs-1, +.col-xs-10, +.col-xs-11, +.col-xs-12, +.col-xs-2, +.col-xs-3, +.col-xs-4, +.col-xs-5, +.col-xs-6, +.col-xs-7, +.col-xs-8, +.col-xs-9, +.col-xs-offset-0, +.col-xs-offset-1, +.col-xs-offset-10, +.col-xs-offset-11, +.col-xs-offset-12, +.col-xs-offset-2, +.col-xs-offset-3, +.col-xs-offset-4, +.col-xs-offset-5, +.col-xs-offset-6, +.col-xs-offset-7, +.col-xs-offset-8, +.col-xs-offset-9 { + box-sizing: border-box; + -webkit-box-flex: 0; + -ms-flex: 0 0 auto; + flex: 0 0 auto; + padding-right: .5rem; + padding-left: .5rem +} + +.col-xs { + -webkit-box-flex: 1; + -ms-flex-positive: 1; + flex-grow: 1; + -ms-flex-preferred-size: 0; + flex-basis: 0; + max-width: 100% +} + +.col-xs-1 { + -ms-flex-preferred-size: 8.33333333%; + flex-basis: 8.33333333%; + max-width: 8.33333333% +} + +.col-xs-2 { + -ms-flex-preferred-size: 16.66666667%; + flex-basis: 16.66666667%; + max-width: 16.66666667% +} + +.col-xs-3 { + -ms-flex-preferred-size: 25%; + flex-basis: 25%; + max-width: 25% +} + +.col-xs-4 { + -ms-flex-preferred-size: 33.33333333%; + flex-basis: 33.33333333%; + max-width: 33.33333333% +} + +.col-xs-5 { + -ms-flex-preferred-size: 41.66666667%; + flex-basis: 41.66666667%; + max-width: 41.66666667% +} + +.col-xs-6 { + -ms-flex-preferred-size: 50%; + flex-basis: 50%; + max-width: 50% +} + +.col-xs-7 { + -ms-flex-preferred-size: 58.33333333%; + flex-basis: 58.33333333%; + max-width: 58.33333333% +} + +.col-xs-8 { + -ms-flex-preferred-size: 66.66666667%; + flex-basis: 66.66666667%; + max-width: 66.66666667% +} + +.col-xs-9 { + -ms-flex-preferred-size: 75%; + flex-basis: 75%; + max-width: 75% +} + +.col-xs-10 { + -ms-flex-preferred-size: 83.33333333%; + flex-basis: 83.33333333%; + max-width: 83.33333333% +} + +.col-xs-11 { + -ms-flex-preferred-size: 91.66666667%; + flex-basis: 91.66666667%; + max-width: 91.66666667% +} + +.col-xs-12 { + -ms-flex-preferred-size: 100%; + flex-basis: 100%; + max-width: 100% +} + +.col-xs-offset-0 { + margin-left: 0 +} + +.col-xs-offset-1 { + margin-left: 8.33333333% +} + +.col-xs-offset-2 { + margin-left: 16.66666667% +} + +.col-xs-offset-3 { + margin-left: 25% +} + +.col-xs-offset-4 { + margin-left: 33.33333333% +} + +.col-xs-offset-5 { + margin-left: 41.66666667% +} + +.col-xs-offset-6 { + margin-left: 50% +} + +.col-xs-offset-7 { + margin-left: 58.33333333% +} + +.col-xs-offset-8 { + margin-left: 66.66666667% +} + +.col-xs-offset-9 { + margin-left: 75% +} + +.col-xs-offset-10 { + margin-left: 83.33333333% +} + +.col-xs-offset-11 { + margin-left: 91.66666667% +} + +.start-xs { + -webkit-box-pack: start; + -ms-flex-pack: start; + justify-content: flex-start; + text-align: start +} + +.center-xs { + -webkit-box-pack: center; + -ms-flex-pack: center; + justify-content: center; + text-align: center +} + +.end-xs { + -webkit-box-pack: end; + -ms-flex-pack: end; + justify-content: flex-end; + text-align: end +} + +.top-xs { + -webkit-box-align: start; + -ms-flex-align: start; + align-items: flex-start +} + +.middle-xs { + -webkit-box-align: center; + -ms-flex-align: center; + align-items: center +} + +.bottom-xs { + -webkit-box-align: end; + -ms-flex-align: end; + align-items: flex-end +} + +.around-xs { + -ms-flex-pack: distribute; + justify-content: space-around +} + +.between-xs { + -webkit-box-pack: justify; + -ms-flex-pack: justify; + justify-content: space-between +} + +.first-xs { + -webkit-box-ordinal-group: 0; + -ms-flex-order: -1; + order: -1 +} + +.last-xs { + -webkit-box-ordinal-group: 2; + -ms-flex-order: 1; + order: 1 +} + +@media only screen and (min-width:48em) { + .container { + width: 49rem + } + .col-sm, + .col-sm-1, + .col-sm-10, + .col-sm-11, + .col-sm-12, + .col-sm-2, + .col-sm-3, + .col-sm-4, + .col-sm-5, + .col-sm-6, + .col-sm-7, + .col-sm-8, + .col-sm-9, + .col-sm-offset-0, + .col-sm-offset-1, + .col-sm-offset-10, + .col-sm-offset-11, + .col-sm-offset-12, + .col-sm-offset-2, + .col-sm-offset-3, + .col-sm-offset-4, + .col-sm-offset-5, + .col-sm-offset-6, + .col-sm-offset-7, + .col-sm-offset-8, + .col-sm-offset-9 { + box-sizing: border-box; + -webkit-box-flex: 0; + -ms-flex: 0 0 auto; + flex: 0 0 auto; + padding-right: .5rem; + padding-left: .5rem + } + .col-sm { + -webkit-box-flex: 1; + -ms-flex-positive: 1; + flex-grow: 1; + -ms-flex-preferred-size: 0; + flex-basis: 0; + max-width: 100% + } + .col-sm-1 { + -ms-flex-preferred-size: 8.33333333%; + flex-basis: 8.33333333%; + max-width: 8.33333333% + } + .col-sm-2 { + -ms-flex-preferred-size: 16.66666667%; + flex-basis: 16.66666667%; + max-width: 16.66666667% + } + .col-sm-3 { + -ms-flex-preferred-size: 25%; + flex-basis: 25%; + max-width: 25% + } + .col-sm-4 { + -ms-flex-preferred-size: 33.33333333%; + flex-basis: 33.33333333%; + max-width: 33.33333333% + } + .col-sm-5 { + -ms-flex-preferred-size: 41.66666667%; + flex-basis: 41.66666667%; + max-width: 41.66666667% + } + .col-sm-6 { + -ms-flex-preferred-size: 50%; + flex-basis: 50%; + max-width: 50% + } + .col-sm-7 { + -ms-flex-preferred-size: 58.33333333%; + flex-basis: 58.33333333%; + max-width: 58.33333333% + } + .col-sm-8 { + -ms-flex-preferred-size: 66.66666667%; + flex-basis: 66.66666667%; + max-width: 66.66666667% + } + .col-sm-9 { + -ms-flex-preferred-size: 75%; + flex-basis: 75%; + max-width: 75% + } + .col-sm-10 { + -ms-flex-preferred-size: 83.33333333%; + flex-basis: 83.33333333%; + max-width: 83.33333333% + } + .col-sm-11 { + -ms-flex-preferred-size: 91.66666667%; + flex-basis: 91.66666667%; + max-width: 91.66666667% + } + .col-sm-12 { + -ms-flex-preferred-size: 100%; + flex-basis: 100%; + max-width: 100% + } + .col-sm-offset-0 { + margin-left: 0 + } + .col-sm-offset-1 { + margin-left: 8.33333333% + } + .col-sm-offset-2 { + margin-left: 16.66666667% + } + .col-sm-offset-3 { + margin-left: 25% + } + .col-sm-offset-4 { + margin-left: 33.33333333% + } + .col-sm-offset-5 { + margin-left: 41.66666667% + } + .col-sm-offset-6 { + margin-left: 50% + } + .col-sm-offset-7 { + margin-left: 58.33333333% + } + .col-sm-offset-8 { + margin-left: 66.66666667% + } + .col-sm-offset-9 { + margin-left: 75% + } + .col-sm-offset-10 { + margin-left: 83.33333333% + } + .col-sm-offset-11 { + margin-left: 91.66666667% + } + .start-sm { + -webkit-box-pack: start; + -ms-flex-pack: start; + justify-content: flex-start; + text-align: start + } + .center-sm { + -webkit-box-pack: center; + -ms-flex-pack: center; + justify-content: center; + text-align: center + } + .end-sm { + -webkit-box-pack: end; + -ms-flex-pack: end; + justify-content: flex-end; + text-align: end + } + .top-sm { + -webkit-box-align: start; + -ms-flex-align: start; + align-items: flex-start + } + .middle-sm { + -webkit-box-align: center; + -ms-flex-align: center; + align-items: center + } + .bottom-sm { + -webkit-box-align: end; + -ms-flex-align: end; + align-items: flex-end + } + .around-sm { + -ms-flex-pack: distribute; + justify-content: space-around + } + .between-sm { + -webkit-box-pack: justify; + -ms-flex-pack: justify; + justify-content: space-between + } + .first-sm { + -webkit-box-ordinal-group: 0; + -ms-flex-order: -1; + order: -1 + } + .last-sm { + -webkit-box-ordinal-group: 2; + -ms-flex-order: 1; + order: 1 + } +} + +@media only screen and (min-width:64em) { + .container { + width: 65rem + } + .col-md, + .col-md-1, + .col-md-10, + .col-md-11, + .col-md-12, + .col-md-2, + .col-md-3, + .col-md-4, + .col-md-5, + .col-md-6, + .col-md-7, + .col-md-8, + .col-md-9, + .col-md-offset-0, + .col-md-offset-1, + .col-md-offset-10, + .col-md-offset-11, + .col-md-offset-12, + .col-md-offset-2, + .col-md-offset-3, + .col-md-offset-4, + .col-md-offset-5, + .col-md-offset-6, + .col-md-offset-7, + .col-md-offset-8, + .col-md-offset-9 { + box-sizing: border-box; + -webkit-box-flex: 0; + -ms-flex: 0 0 auto; + flex: 0 0 auto; + padding-right: .5rem; + padding-left: .5rem + } + .col-md { + -webkit-box-flex: 1; + -ms-flex-positive: 1; + flex-grow: 1; + -ms-flex-preferred-size: 0; + flex-basis: 0; + max-width: 100% + } + .col-md-1 { + -ms-flex-preferred-size: 8.33333333%; + flex-basis: 8.33333333%; + max-width: 8.33333333% + } + .col-md-2 { + -ms-flex-preferred-size: 16.66666667%; + flex-basis: 16.66666667%; + max-width: 16.66666667% + } + .col-md-3 { + -ms-flex-preferred-size: 25%; + flex-basis: 25%; + max-width: 25% + } + .col-md-4 { + -ms-flex-preferred-size: 33.33333333%; + flex-basis: 33.33333333%; + max-width: 33.33333333% + } + .col-md-5 { + -ms-flex-preferred-size: 41.66666667%; + flex-basis: 41.66666667%; + max-width: 41.66666667% + } + .col-md-6 { + -ms-flex-preferred-size: 50%; + flex-basis: 50%; + max-width: 50% + } + .col-md-7 { + -ms-flex-preferred-size: 58.33333333%; + flex-basis: 58.33333333%; + max-width: 58.33333333% + } + .col-md-8 { + -ms-flex-preferred-size: 66.66666667%; + flex-basis: 66.66666667%; + max-width: 66.66666667% + } + .col-md-9 { + -ms-flex-preferred-size: 75%; + flex-basis: 75%; + max-width: 75% + } + .col-md-10 { + -ms-flex-preferred-size: 83.33333333%; + flex-basis: 83.33333333%; + max-width: 83.33333333% + } + .col-md-11 { + -ms-flex-preferred-size: 91.66666667%; + flex-basis: 91.66666667%; + max-width: 91.66666667% + } + .col-md-12 { + -ms-flex-preferred-size: 100%; + flex-basis: 100%; + max-width: 100% + } + .col-md-offset-0 { + margin-left: 0 + } + .col-md-offset-1 { + margin-left: 8.33333333% + } + .col-md-offset-2 { + margin-left: 16.66666667% + } + .col-md-offset-3 { + margin-left: 25% + } + .col-md-offset-4 { + margin-left: 33.33333333% + } + .col-md-offset-5 { + margin-left: 41.66666667% + } + .col-md-offset-6 { + margin-left: 50% + } + .col-md-offset-7 { + margin-left: 58.33333333% + } + .col-md-offset-8 { + margin-left: 66.66666667% + } + .col-md-offset-9 { + margin-left: 75% + } + .col-md-offset-10 { + margin-left: 83.33333333% + } + .col-md-offset-11 { + margin-left: 91.66666667% + } + .start-md { + -webkit-box-pack: start; + -ms-flex-pack: start; + justify-content: flex-start; + text-align: start + } + .center-md { + -webkit-box-pack: center; + -ms-flex-pack: center; + justify-content: center; + text-align: center + } + .end-md { + -webkit-box-pack: end; + -ms-flex-pack: end; + justify-content: flex-end; + text-align: end + } + .top-md { + -webkit-box-align: start; + -ms-flex-align: start; + align-items: flex-start + } + .middle-md { + -webkit-box-align: center; + -ms-flex-align: center; + align-items: center + } + .bottom-md { + -webkit-box-align: end; + -ms-flex-align: end; + align-items: flex-end + } + .around-md { + -ms-flex-pack: distribute; + justify-content: space-around + } + .between-md { + -webkit-box-pack: justify; + -ms-flex-pack: justify; + justify-content: space-between + } + .first-md { + -webkit-box-ordinal-group: 0; + -ms-flex-order: -1; + order: -1 + } + .last-md { + -webkit-box-ordinal-group: 2; + -ms-flex-order: 1; + order: 1 + } +} + +@media only screen and (min-width:75em) { + .container { + width: 76rem + } + .col-lg, + .col-lg-1, + .col-lg-10, + .col-lg-11, + .col-lg-12, + .col-lg-2, + .col-lg-3, + .col-lg-4, + .col-lg-5, + .col-lg-6, + .col-lg-7, + .col-lg-8, + .col-lg-9, + .col-lg-offset-0, + .col-lg-offset-1, + .col-lg-offset-10, + .col-lg-offset-11, + .col-lg-offset-12, + .col-lg-offset-2, + .col-lg-offset-3, + .col-lg-offset-4, + .col-lg-offset-5, + .col-lg-offset-6, + .col-lg-offset-7, + .col-lg-offset-8, + .col-lg-offset-9 { + box-sizing: border-box; + -webkit-box-flex: 0; + -ms-flex: 0 0 auto; + flex: 0 0 auto; + padding-right: .5rem; + padding-left: .5rem + } + .col-lg { + -webkit-box-flex: 1; + -ms-flex-positive: 1; + flex-grow: 1; + -ms-flex-preferred-size: 0; + flex-basis: 0; + max-width: 100% + } + .col-lg-1 { + -ms-flex-preferred-size: 8.33333333%; + flex-basis: 8.33333333%; + max-width: 8.33333333% + } + .col-lg-2 { + -ms-flex-preferred-size: 16.66666667%; + flex-basis: 16.66666667%; + max-width: 16.66666667% + } + .col-lg-3 { + -ms-flex-preferred-size: 25%; + flex-basis: 25%; + max-width: 25% + } + .col-lg-4 { + -ms-flex-preferred-size: 33.33333333%; + flex-basis: 33.33333333%; + max-width: 33.33333333% + } + .col-lg-5 { + -ms-flex-preferred-size: 41.66666667%; + flex-basis: 41.66666667%; + max-width: 41.66666667% + } + .col-lg-6 { + -ms-flex-preferred-size: 50%; + flex-basis: 50%; + max-width: 50% + } + .col-lg-7 { + -ms-flex-preferred-size: 58.33333333%; + flex-basis: 58.33333333%; + max-width: 58.33333333% + } + .col-lg-8 { + -ms-flex-preferred-size: 66.66666667%; + flex-basis: 66.66666667%; + max-width: 66.66666667% + } + .col-lg-9 { + -ms-flex-preferred-size: 75%; + flex-basis: 75%; + max-width: 75% + } + .col-lg-10 { + -ms-flex-preferred-size: 83.33333333%; + flex-basis: 83.33333333%; + max-width: 83.33333333% + } + .col-lg-11 { + -ms-flex-preferred-size: 91.66666667%; + flex-basis: 91.66666667%; + max-width: 91.66666667% + } + .col-lg-12 { + -ms-flex-preferred-size: 100%; + flex-basis: 100%; + max-width: 100% + } + .col-lg-offset-0 { + margin-left: 0 + } + .col-lg-offset-1 { + margin-left: 8.33333333% + } + .col-lg-offset-2 { + margin-left: 16.66666667% + } + .col-lg-offset-3 { + margin-left: 25% + } + .col-lg-offset-4 { + margin-left: 33.33333333% + } + .col-lg-offset-5 { + margin-left: 41.66666667% + } + .col-lg-offset-6 { + margin-left: 50% + } + .col-lg-offset-7 { + margin-left: 58.33333333% + } + .col-lg-offset-8 { + margin-left: 66.66666667% + } + .col-lg-offset-9 { + margin-left: 75% + } + .col-lg-offset-10 { + margin-left: 83.33333333% + } + .col-lg-offset-11 { + margin-left: 91.66666667% + } + .start-lg { + -webkit-box-pack: start; + -ms-flex-pack: start; + justify-content: flex-start; + text-align: start + } + .center-lg { + -webkit-box-pack: center; + -ms-flex-pack: center; + justify-content: center; + text-align: center + } + .end-lg { + -webkit-box-pack: end; + -ms-flex-pack: end; + justify-content: flex-end; + text-align: end + } + .top-lg { + -webkit-box-align: start; + -ms-flex-align: start; + align-items: flex-start + } + .middle-lg { + -webkit-box-align: center; + -ms-flex-align: center; + align-items: center + } + .bottom-lg { + -webkit-box-align: end; + -ms-flex-align: end; + align-items: flex-end + } + .around-lg { + -ms-flex-pack: distribute; + justify-content: space-around + } + .between-lg { + -webkit-box-pack: justify; + -ms-flex-pack: justify; + justify-content: space-between + } + .first-lg { + -webkit-box-ordinal-group: 0; + -ms-flex-order: -1; + order: -1 + } + .last-lg { + -webkit-box-ordinal-group: 2; + -ms-flex-order: 1; + order: 1 + } +} \ No newline at end of file diff --git a/themes/yinyang/assets/css/index.css b/themes/yinyang/assets/css/index.css new file mode 100644 index 00000000..8a1fe949 --- /dev/null +++ b/themes/yinyang/assets/css/index.css @@ -0,0 +1,480 @@ +/* global */ + +:root { + --background-color: #F5F5F7; + --block-background-color: #E9E8ED; + --border-color: #d0d7de; + --text-color: #1D1D1F; + --secondary-text-color: #6E6E73; + --link-color: #277BD9; + + --strong-text-color: #B6506A; + --em-text-color: #0271A4; + + --mono-font-family: "Courier New", Courier, "Menlo", "Monaco", Consolas, "Liberation Mono", + "Lucida Console", monospace; + --serif-font-family: "Noto Serif SC", "Source Han Serif", "STSong", "Hiragino Mincho Pro", + "SimSun", serif; +} + +.dark { + --background-color: #1D2021; + --block-background-color: #181A1B; + --border-color: #d0d7de; + --text-color: #D2CEC9; + --secondary-text-color: #A1998D; + --link-color: #277BD9 +} + +@media (prefers-color-scheme: dark) { + :root { + --background-color: #1D2021; + --block-background-color: #181A1B; + --border-color: #d0d7de; + --text-color: #D2CEC9; + --secondary-text-color: #A1998D; + --link-color: #277BD9 + } +} + +body { + font-family: var(--serif-font-family); + -webkit-font-smoothing: antialiased; + margin: 0 20px; + background-color: var(--background-color); + color: var(--text-color) +} + +body::before { + content: ""; + position: absolute; + top: 0; + left: 0; + right: 0; + width: 100%; + z-index: -1; + height: 5rem; + background-image: linear-gradient(to bottom, var(--block-background-color), transparent) +} + +article { + max-width: 700px; + margin-left: auto; + margin-right: auto; +} + +a { + color: var(--text-color); + text-decoration: none; + text-underline-offset: 0.25rem; +} + +a:hover { + text-decoration: underline; +} + +.post-ads { + margin: 50px 0; +} + +.markdown-body { + font-size: 18px; + max-width: 100%; +} + +.markdown-body a { + text-decoration: underline; + color: var(--link-color); +} + +.markdown-body blockquote { + margin: 0; + padding: 0 1em; + color: var(--secondary-text-color); + border-left: 0.25em solid var(--border-color); +} + +.markdown-body pre { + padding: 16px; + overflow: auto; + border-radius: 10px; +} + +.markdown-body code { + padding: 0.2em 0.4em; + font-size: 85%; + background-color: var(--block-background-color); + border-radius: 6px; +} + +/* reset code */ + +.markdown-body pre > code { + padding: 0; + font-size: 100%; + background-color: inherit; + border: 0; +} + +/* i18n */ + +.Chinese .markdown-body { + line-height: 200%; +} + +/* header */ + +.site-date-catalog { + font-size: 2rem; +} + +.header-title { + font-size: 2rem; + font-weight: 900; + margin-top: 32px; + text-align: center; + letter-spacing: .15rem; +} +.header-title a { + text-decoration: none; +} + +.header-subtitle { + color: var(--secondary-text-color); +} + +.header-items { + margin: 1rem auto; + display: flex; + justify-content: center; + align-items: center; + background-color: var(--text-color); + width: fit-content; + padding: 0.25rem 0.75rem; + border-radius: 1rem; +} + +.header-item a { + color: var(--background-color); +} + +.header-item { + margin: 0 5px; +} + +.header-line { + width: 100%; + border-width: 1px; + border-color: var(--border-color); + border-style: solid none none none; +} + +.lang-switch { + font-weight: 600; +} + +/* posts list */ + +#posts-list { + min-height: 600px; +} + +#posts-list ul { + list-style-type: none; + padding-inline-start: 1em; +} + +.featured-post .posts-title a { + font-weight: 800; + display: block; +} + +.posts-line { + font-size: 1.2rem; + margin: 12px 0; +} + +#posts-list > section:nth-child(1) > ul:nth-child(3) > li.first-post > div > div.posts-title.col-xs-9.col-sm-10 > div { + align-items: flex-start; +} + +.posts-categories { + font-size: 0.8rem; + text-align: center; +} + +.posts-category { + padding: 3px 0; + border: var(--border-color) 2px solid; + border-radius: 5px; + background-color: var(--background-color); + /* margin-bottom: 3px; */ +} + +.posts-date { + font-family: var(--mono-font-family); + color: var(--secondary-text-color) +} + +.posts-year-section { + --section-height: 9rem; + min-height: var(--section-height); + position: relative; + margin: 2rem 0; +} + +.posts-year-title { + font-weight: 900; + position: absolute; + right: 0; + color: var(--text-color); + opacity: 0.25; + font-size: calc(var(--section-height) / 2); + margin: 0; + line-height: 1; + z-index: -1; +} + +#posts-list hr { + border: 1px solid var(--border-color); + margin: 3rem 0; +} + +.posts-subtitle { + color: var(--secondary-text-color) +} + +.site-footer { + margin-top: 50px; + /* margin-bottom: 80px; */ + /* display: flex; */ + /* justify-content: flex-end; */ + /* flex-wrap: wrap; */ + /* padding: 12px 0; */ + /* border-width: 3px; */ + /* border-style: solid none; */ + /* border-color: #000; */ +} + +.site-footer-item { + margin-right: 12px; +} + +/* post */ + +.post-header { + margin-bottom: 2rem; +} + +.post-title { + font-size: 2rem; + font-weight: 900; +} + +.post-subtitle { + display: block; + color: var(--secondary-text-color); + font-style: italic; + font-size: 1.2rem; +} + +.post-tags { + display: inline; + font-weight: 600; + padding: 2px 5px; + margin-right: 6px; + border: var(--text-color) 2px solid; + border-radius: 5px; +} + +.post-date { + color: var(--secondary-text-color) +} + +.post-author { + float: right; + font-weight: 600; +} + +.page-content { + min-height: 60%; +} + +.post-content { + margin-bottom: 50px; + line-height: 2 +} + +.post-content p { + hyphens: auto; + text-justify: ideographic; + margin-bottom: 1em; +} + +.post-content strong { + color: var(--strong-text-color) +} + +.post-content em { + color: var(--em-text-color) +} + +.post-content hr { + margin: 2.5rem auto; + border: 0.1rem dashed var(--border-color); +} + +.post-content ul { + list-style-type: square; +} + +.post-content img { + max-width: 100%; + display: block; + margin-right: auto; + margin-top: 6px; +} + +.post-content .post-gallery { + display: flex; + flex-wrap: wrap; + gap: 6px; +} + +.post-content .post-gallery img { + margin-right: auto; + margin-top: auto; + width: calc(50% - 3px); +} + +.post-content figure { + margin: 0; +} + +.post-content figure figcaption h4 { + font-size: 0.9rem; + color: var(--secondary-text-color); + font-weight: 400; +} + +.related-content { + border-width: 3px; + border-style: solid; + border-color: #000; + padding: 0 10px; + margin-bottom: 50px; + margin-top: 100px; +} + +.related-content li { + margin: 5px 0; +} + +/* taxonomy */ + +.taxonomy-term { + font-size: 2rem; + text-align: center; + display: flex; + justify-content: center; + align-items: center; + + background-color: var(--block-background-color); + padding: 0.5rem 1rem; + border-radius: 1rem; + width: fit-content; + margin: 2rem auto +} + +.taxonomy-term::before, +.taxonomy-term::after { + margin: 0.5rem; + color: var(--secondary-text-color); + font-size: 0.75em +} + +.taxonomy-term::before { + content: "《"; +} + +.taxonomy-term::after { + content: "》"; +} + +/* gallery */ + +.gallery-img { + text-align: center; +} + +.gallery-img span { + text-align: center; +} + +.gallery-img-desc { + font-size: 0.8em; + font-weight: 800; +} + +/* disqus */ + +#disqus_thread { + position: relative; +} + +#disqus_thread:after { + content: ""; + display: block; + height: 55px; + width: 100%; + position: absolute; + bottom: 0; + background: var(--background-color); +} + +@media screen and (max-width: 600px) { + .header-title, + .header-subtitle, + .header-items { + /* text-align: center; */ + } + + .posts-line { + font-size: 16px; + } + + .markdown-body { + font-size: 16px; + } + .post-title { + font-size: 2rem; + } + .post-content p { + letter-spacing: 0.05em; + } + .post-content .post-gallery img { + width: 100%; + } +} + +@media screen and (max-width: 48em) { + .posts-category { + display: none; + } +} + +/* callouts */ + +.callout { + background-color: var(--block-background-color); + border-radius: .25rem; + padding: 1rem 1.25rem; + line-height: 1.75; + + display: flex; + gap: .75rem; +} + +.callout .callout-content p { + margin: 0; +} diff --git a/themes/yinyang/assets/css/waline.css b/themes/yinyang/assets/css/waline.css new file mode 100644 index 00000000..45cb4e0f --- /dev/null +++ b/themes/yinyang/assets/css/waline.css @@ -0,0 +1,1281 @@ +:root { + --waline-font-size: 1rem; + --waline-white: #fff; + --waline-light-grey: #999; + --waline-dark-grey: #666; + --waline-theme-color: #27ae60; + --waline-active-color: #2ecc71; + --waline-color: #444; + --waline-bg-color: #fff; + --waline-bg-color-light: #f8f8f8; + --waline-bg-color-hover: #f0f0f0; + --waline-border-color: #ddd; + --waline-disable-bg-color: #f8f8f8; + --waline-disable-color: #000; + --waline-code-bg-color: #282c34; + --waline-bq-color: #f0f0f0; + --waline-avatar-size: 3.25rem; + --waline-m-avatar-size: calc(var(--waline-avatar-size) * 9 / 13); + --waline-badge-color: #3498db; + --waline-badge-font-size: 0.75em; + --waline-info-bg-color: #f8f8f8; + --waline-info-color: #999; + --waline-info-font-size: 0.625em; + --waline-border: 1px solid var(--waline-border-color); + --waline-avatar-radius: 50%; + --waline-box-shadow: none +} + +[data-waline] { + font-size: var(--waline-font-size); + text-align: start +} + +[dir=rtl] [data-waline] { + direction: rtl +} + +[data-waline] * { + box-sizing: content-box; + line-height: 1.75 +} + +[data-waline] p { + color: var(--waline-color) +} + +[data-waline] a { + position: relative; + display: inline-block; + color: var(--waline-theme-color); + text-decoration: none; + word-break: break-word; + cursor: pointer +} + +[data-waline] a:hover { + color: var(--waline-active-color) +} + +[data-waline] img { + max-width: 100%; + max-height: 400px; + border: none +} + +[data-waline] hr { + margin: .825em 0; + border-style: dashed; + border-color: var(--waline-bg-color-light) +} + +[data-waline] code,[data-waline] pre { + margin: 0; + padding: .2em .4em; + border-radius: 3px; + background: var(--waline-bg-color-light); + font-size: 85% +} + +[data-waline] pre { + overflow: auto; + padding: 10px; + line-height: 1.45 +} + +[data-waline] pre::-webkit-scrollbar { + width: 6px; + height: 6px +} + +[data-waline] pre::-webkit-scrollbar-track-piece:horizontal { + -webkit-border-radius: 6px; + border-radius: 6px; + background: rgba(0,0,0,.1) +} + +[data-waline] pre::-webkit-scrollbar-thumb:horizontal { + width: 6px; + -webkit-border-radius: 6px; + border-radius: 6px; + background: var(--waline-theme-color) +} + +[data-waline] pre code { + padding: 0; + background: rgba(0,0,0,0); + color: var(--waline-color); + white-space: pre-wrap; + word-break: keep-all +} + +[data-waline] blockquote { + margin: .5em 0; + padding: .5em 0 .5em 1em; + border-inline-start:8px solid var(--waline-bq-color);color: var(--waline-dark-grey) +} + +[data-waline] blockquote>p { + margin: 0 +} + +[data-waline] ol,[data-waline] ul { + margin-inline-start:1.25em;padding: 0 +} + +[data-waline] input[type=checkbox],[data-waline] input[type=radio] { + display: inline-block; + vertical-align: middle; + margin-top: -2px +} + +.wl-btn { + display: inline-block; + vertical-align: middle; + min-width: 2.5em; + margin-bottom: 0; + padding: .5em 1em; + border: 1px solid var(--waline-border-color); + border-radius: .5em; + background: rgba(0,0,0,0); + color: var(--waline-color); + font-weight: 400; + font-size: .75em; + line-height: 1.5; + text-align: center; + white-space: nowrap; + cursor: pointer; + user-select: none; + touch-action: manipulation; + transition-duration: .4s +} + +.wl-btn:hover,.wl-btn:active { + border-color: var(--waline-theme-color); + color: var(--waline-theme-color) +} + +.wl-btn:disabled { + border-color: var(--waline-border-color); + background: var(--waline-disable-bg-color); + color: var(--waline-disable-color); + cursor: not-allowed +} + +.wl-btn.primary { + border-color: var(--waline-theme-color); + background: var(--waline-theme-color); + color: var(--waline-white) +} + +.wl-btn.primary:hover,.wl-btn.primary:active { + border-color: var(--waline-active-color); + background: var(--waline-active-color); + color: var(--waline-white) +} + +.wl-btn.primary:disabled { + border-color: var(--waline-border-color); + background: var(--waline-disable-bg-color); + color: var(--waline-disable-color); + cursor: not-allowed +} + +.wl-loading { + text-align: center +} + +.wl-loading svg { + margin: 0 auto +} + +.wl-comment { + position: relative; + display: flex; + margin-bottom: .75em +} + +.wl-close { + position: absolute; + inset-inline-end: -4px; + top: -4px; + padding: 0; + border: none; + background: rgba(0,0,0,0); + line-height: 1; + cursor: pointer +} + +.wl-login-info { + max-width: 80px; + margin-top: .75em; + text-align: center +} + +.wl-logout-btn { + position: absolute; + inset-inline-end: -10px; + top: -10px; + padding: 3px; + border: none; + background: rgba(0,0,0,0); + line-height: 0; + cursor: pointer +} + +.wl-avatar { + position: relative; + width: var(--waline-avatar-size); + height: var(--waline-avatar-size); + margin: 0 auto; + border: var(--waline-border); + border-radius: var(--waline-avatar-radius) +} + +@media(max-width: 720px) { + .wl-avatar { + width:var(--waline-m-avatar-size); + height: var(--waline-m-avatar-size) + } +} + +.wl-avatar img { + width: 100%; + height: 100%; + border-radius: var(--waline-avatar-radius) +} + +.wl-login-nick { + display: block; + color: var(--waline-theme-color); + font-size: .75em; + word-break: break-all +} + +.wl-panel { + position: relative; + flex-shrink: 1; + width: 100%; + margin: .5em; + border: var(--waline-border); + border-radius: .75em; + background: var(--waline-bg-color); + box-shadow: var(--waline-box-shadow) +} + +.wl-header { + display: flex; + overflow: hidden; + padding: 0 4px; + border-bottom: 2px dashed var(--waline-border-color); + border-top-left-radius: .75em; + border-top-right-radius: .75em +} + +@media(max-width: 580px) { + .wl-header { + display:block + } +} + +.wl-header label { + min-width: 40px; + padding: .75em .5em; + color: var(--waline-color); + font-size: .75em; + text-align: center +} + +.wl-header input { + flex: 1; + resize: none; + width: 0; + padding: .5em; + background: rgba(0,0,0,0); + font-size: .625em +} + +.wl-header-item { + display: flex; + flex: 1 +} + +@media(max-width: 580px) { + .wl-header-item:not(:last-child) { + border-bottom:2px dashed var(--waline-border-color) + } +} + +.wl-header-1 .wl-header-item { + width: 100% +} + +.wl-header-2 .wl-header-item { + width: 50% +} + +@media(max-width: 580px) { + .wl-header-2 .wl-header-item { + flex:0; + width: 100% + } +} + +.wl-header-3 .wl-header-item { + width: 33.33% +} + +@media(max-width: 580px) { + .wl-header-3 .wl-header-item { + width:100% + } +} + +.wl-editor { + position: relative; + resize: vertical; + width: calc(100% - 1em); + min-height: 8.75em; + margin: .75em .5em; + border-radius: .5em; + background: rgba(0,0,0,0); + font-size: .875em +} + +.wl-editor,.wl-input { + max-width: 100%; + border: none; + color: var(--waline-color); + outline: none; + transition: all .25s ease +} + +.wl-editor:focus,.wl-input:focus { + background: var(--waline-bg-color-light) +} + +.wl-preview { + padding: 0 .5em .5em +} + +.wl-preview h4 { + margin: .25em; + font-weight: bold; + font-size: .9375em +} + +.wl-preview .wl-content { + min-height: 1.25em; + padding: .25em; + word-break: break-word; + hyphens: auto +} + +.wl-preview .wl-content>*:first-child { + margin-top: 0 +} + +.wl-preview .wl-content>*:last-child { + margin-bottom: 0 +} + +.wl-footer { + position: relative; + display: flex; + flex-wrap: wrap; + margin: .5em .75em +} + +.wl-actions { + display: flex; + flex: 2; + align-items: center +} + +.wl-action { + display: inline-flex; + align-items: center; + justify-content: center; + width: 1.5em; + height: 1.5em; + margin: 2px; + padding: 0; + border: none; + background: rgba(0,0,0,0); + color: var(--waline-color); + font-size: 16px; + cursor: pointer +} + +.wl-action:hover { + color: var(--waline-theme-color) +} + +.wl-action.active { + color: var(--waline-active-color) +} + +#wl-image-upload { + display: none +} + +#wl-image-upload:focus+label { + color: var(--waline-color) +} + +#wl-image-upload:focus-visible+label { + outline: -webkit-focus-ring-color auto 1px +} + +.wl-info { + display: flex; + flex: 3; + align-items: center; + justify-content: flex-end +} + +.wl-info .wl-text-number { + color: var(--waline-info-color); + font-size: .75em +} + +.wl-info .wl-text-number .illegal { + color: red +} + +.wl-info button { + margin-inline-start:.75em} + +.wl-info button svg { + display: block; + margin: 0 auto; + line-height: 18px +} + +.wl-emoji-popup { + position: absolute; + inset-inline-start: 1.25em; + top: 100%; + z-index: 10; + display: none; + width: 100%; + max-width: 526px; + border: var(--waline-border); + border-radius: 6px; + background: var(--waline-bg-color); + box-shadow: var(--waline-box-shadow) +} + +.wl-emoji-popup.display { + display: block +} + +.wl-emoji-popup button { + display: inline-block; + vertical-align: middle; + width: 2em; + margin: .125em; + padding: 0; + border-width: 0; + background: rgba(0,0,0,0); + font-size: inherit; + line-height: 2; + text-align: center; + cursor: pointer +} + +.wl-emoji-popup button:hover { + background: var(--waline-bg-color-hover) +} + +.wl-emoji-popup .wl-emoji { + display: inline-block; + vertical-align: middle; + max-width: 1.5em; + max-height: 1.5em +} + +.wl-emoji-popup .wl-tab-wrapper { + overflow-y: auto; + max-height: 145px; + padding: .5em +} + +.wl-emoji-popup .wl-tab-wrapper::-webkit-scrollbar { + width: 6px; + height: 6px +} + +.wl-emoji-popup .wl-tab-wrapper::-webkit-scrollbar-track-piece:vertical { + -webkit-border-radius: 6px; + border-radius: 6px; + background: rgba(0,0,0,.1) +} + +.wl-emoji-popup .wl-tab-wrapper::-webkit-scrollbar-thumb:vertical { + width: 6px; + -webkit-border-radius: 6px; + border-radius: 6px; + background: var(--waline-theme-color) +} + +.wl-emoji-popup .wl-tabs { + position: relative; + overflow-x: auto; + padding: 0 6px; + white-space: nowrap +} + +.wl-emoji-popup .wl-tabs::before { + content: " "; + position: absolute; + top: 0; + right: 0; + left: 0; + z-index: 2; + height: 1px; + background: var(--waline-border-color) +} + +.wl-emoji-popup .wl-tabs::-webkit-scrollbar { + width: 6px; + height: 6px +} + +.wl-emoji-popup .wl-tabs::-webkit-scrollbar-track-piece:horizontal { + -webkit-border-radius: 6px; + border-radius: 6px; + background: rgba(0,0,0,.1) +} + +.wl-emoji-popup .wl-tabs::-webkit-scrollbar-thumb:horizontal { + height: 6px; + -webkit-border-radius: 6px; + border-radius: 6px; + background: var(--waline-theme-color) +} + +.wl-emoji-popup .wl-tab { + position: relative; + margin: 0; + padding: 0 .5em +} + +.wl-emoji-popup .wl-tab.active { + z-index: 3; + border: 1px solid var(--waline-border-color); + border-top-width: 0; + border-bottom-right-radius: 6px; + border-bottom-left-radius: 6px; + background: var(--waline-bg-color) +} + +.wl-gif-popup { + position: absolute; + inset-inline-start: 1.25em; + top: 100%; + z-index: 10; + width: calc(100% - 3em); + padding: .75em .75em .25em; + border: var(--waline-border); + border-radius: 6px; + background: var(--waline-bg-color); + box-shadow: var(--waline-box-shadow); + opacity: 0; + visibility: hidden; + transition: transform .2s ease-out,opacity .2s ease-out; + transform: scale(0.9, 0.9); + transform-origin: 0 0 +} + +.wl-gif-popup.display { + opacity: 1; + visibility: visible; + transform: none +} + +.wl-gif-popup input { + box-sizing: border-box; + width: 100%; + margin-bottom: 10px; + padding: 3px 5px; + border: var(--waline-border) +} + +.wl-gif-popup img { + display: block; + box-sizing: border-box; + width: 100%; + border-width: 2px; + border-style: solid; + border-color: #fff; + cursor: pointer +} + +.wl-gif-popup img:hover { + border-color: var(--waline-theme-color); + border-radius: 2px +} + +.wl-gallery { + display: flex; + overflow-y: auto; + max-height: 80vh +} + +.wl-gallery-column { + display: flex; + flex: 1; + flex-direction: column; + height: -webkit-max-content; + height: -moz-max-content; + height: max-content +} + +.wl-cards .wl-user { + --avatar-size: var(--waline-avatar-size); + position: relative; + margin-inline-end:.75em} + +@media(max-width: 720px) { + .wl-cards .wl-user { + --avatar-size: var(--waline-m-avatar-size) + } +} + +.wl-cards .wl-user .wl-user-avatar { + width: var(--avatar-size); + height: var(--avatar-size); + border-radius: var(--waline-avatar-radius); + box-shadow: var(--waline-box-shadow) +} + +.wl-cards .wl-user .verified-icon { + position: absolute; + inset-inline-start: calc(var(--avatar-size)*3/4); + top: calc(var(--avatar-size)*3/4); + border-radius: 50%; + background: var(--waline-bg-color); + box-shadow: var(--waline-box-shadow) +} + +.wl-card-item { + position: relative; + display: flex; + padding: .5em +} + +.wl-card-item .wl-card-item { + padding-inline-end:0} + +.wl-card { + flex: 1; + width: 0; + padding-bottom: .5em; + border-bottom: 1px dashed var(--waline-border-color) +} + +.wl-card:first-child { + margin-inline-start:1em} + +.wl-card-item:last-child>.wl-card { + border-bottom: none +} + +.wl-card .wl-nick svg { + position: relative; + bottom: -0.125em; + line-height: 1 +} + +.wl-card .wl-head { + overflow: hidden; + line-height: 1.5 +} + +.wl-card .wl-head .wl-nick { + position: relative; + display: inline-block; + margin-inline-end:.5em;font-weight: bold; + font-size: .875em; + line-height: 1; + text-decoration: none +} + +.wl-card span.wl-nick { + color: var(--waline-dark-grey) +} + +.wl-card .wl-badge { + display: inline-block; + margin-inline-end:1em;padding: 0 .3em; + border: 1px solid var(--waline-badge-color); + border-radius: 4px; + color: var(--waline-badge-color); + font-size: var(--waline-badge-font-size) +} + +.wl-card .wl-time { + margin-inline-end:.875em;color: var(--waline-info-color); + font-size: .75em +} + +.wl-card .wl-meta { + position: relative; + line-height: 1 +} + +.wl-card .wl-meta>span { + display: inline-block; + margin-inline-end:.25em;padding: 2px 4px; + border-radius: .2em; + background: var(--waline-info-bg-color); + color: var(--waline-info-color); + font-size: var(--waline-info-font-size); + line-height: 1.5 +} + +.wl-card .wl-meta>span:empty { + display: none +} + +.wl-card .wl-comment-actions { + float: right; + line-height: 1 +} + +[dir=rtl] .wl-card .wl-comment-actions { + float: left +} + +.wl-card .wl-delete,.wl-card .wl-like,.wl-card .wl-reply,.wl-card .wl-edit { + display: inline-flex; + align-items: center; + border: none; + background: rgba(0,0,0,0); + color: var(--waline-color); + line-height: 1; + cursor: pointer; + transition: color .2s ease +} + +.wl-card .wl-delete:hover,.wl-card .wl-like:hover,.wl-card .wl-reply:hover,.wl-card .wl-edit:hover { + color: var(--waline-theme-color) +} + +.wl-card .wl-delete.active,.wl-card .wl-like.active,.wl-card .wl-reply.active,.wl-card .wl-edit.active { + color: var(--waline-active-color) +} + +.wl-card .wl-content { + position: relative; + margin-bottom: .75em; + padding-top: .625em; + font-size: .875em; + line-height: 2; + word-wrap: break-word +} + +.wl-card .wl-content.expand { + overflow: hidden; + max-height: 8em; + cursor: pointer +} + +.wl-card .wl-content.expand::before { + content: ""; + position: absolute; + inset-inline-start: 0; + top: 0; + bottom: 3.15em; + z-index: 999; + display: block; + width: 100%; + background: linear-gradient(180deg, #000, rgba(255, 255, 255, 0.9)) +} + +.wl-card .wl-content.expand::after { + content: attr(data-expand); + position: absolute; + inset-inline-start: 0; + bottom: 0; + z-index: 999; + display: block; + width: 100%; + height: 3.15em; + background: rgba(255,255,255,.9); + color: #828586; + line-height: 3.15em; + text-align: center +} + +.wl-card .wl-content>*:first-child { + margin-top: 0 +} + +.wl-card .wl-content>*:last-child { + margin-bottom: 0 +} + +.wl-card .wl-admin-actions { + margin: 8px 0; + font-size: 12px; + text-align: right +} + +.wl-card .wl-comment-status { + margin: 0 8px +} + +.wl-card .wl-comment-status .wl-btn { + border-radius: 0 +} + +.wl-card .wl-comment-status .wl-btn:first-child { + border-inline-end:0;border-radius: .5em 0 0 .5em +} + +.wl-card .wl-comment-status .wl-btn:last-child { + border-inline-start:0;border-radius: 0 .5em .5em 0 +} + +.wl-card .wl-quote { + border-inline-start:1px dashed rgba(237,237,237,.5)} + +.wl-card .wl-quote .wl-user { + --avatar-size: var(--waline-m-avatar-size) +} + +.wl-close-icon { + color: var(--waline-border-color) +} + +.wl-content .vemoji,.wl-content .wl-emoji { + display: inline-block; + vertical-align: baseline; + height: 1.25em; + margin: -0.125em .25em +} + +.wl-content .wl-tex { + background: var(--waline-info-bg-color); + color: var(--waline-info-color) +} + +.wl-content span.wl-tex { + display: inline-block; + margin-inline-end:.25em;padding: 2px 4px; + border-radius: .2em; + font-size: var(--waline-info-font-size); + line-height: 1.5 +} + +.wl-content p.wl-tex { + text-align: center +} + +.wl-content .katex-display { + overflow: auto hidden; + padding-top: .2em; + padding-bottom: .2em; + -webkit-overflow-scrolling: touch +} + +.wl-content .katex-display::-webkit-scrollbar { + height: 3px +} + +.wl-content .katex-error { + color: red +} + +.wl-count { + flex: 1; + font-weight: bold; + font-size: 1.25em +} + +.wl-empty { + overflow: auto; + padding: 1.25em; + color: var(--waline-color); + text-align: center +} + +.wl-operation { + text-align: center +} + +.wl-operation button { + margin: 1em 0 +} + +.wl-power { + padding: .5em 0; + color: var(--waline-light-grey); + font-size: var(--waline-info-font-size); + text-align: end +} + +.wl-meta-head { + display: flex; + flex-direction: row; + align-items: center; + padding: .375em +} + +.wl-sort { + margin: 0; + list-style-type: none +} + +.wl-sort li { + display: inline-block; + color: var(--waline-info-color); + font-size: .75em; + cursor: pointer +} + +.wl-sort li.active { + color: var(--waline-theme-color) +} + +.wl-sort li+li { + margin-inline-start:1em} + +.wl-reaction { + overflow: auto hidden; + margin-bottom: 1.75em; + text-align: center +} + +.wl-reaction img { + width: 100%; + height: 100%; + transition: all 250ms ease-in-out +} + +.wl-reaction-title { + margin: 16px auto; + font-weight: bold; + font-size: 18px +} + +.wl-reaction-list { + display: flex; + flex-direction: row; + gap: 16px; + justify-content: center; + margin: 0; + padding: 8px; + list-style-type: none +} + +@media(max-width: 580px) { + .wl-reaction-list { + gap:12px + } +} + +[data-waline] .wl-reaction-list { + margin-inline-start:0} + +.wl-reaction-item { + display: flex; + flex-direction: column; + align-items: center; + cursor: pointer +} + +.wl-reaction-item:hover img,.wl-reaction-item.active img { + transform: scale(1.15) +} + +.wl-reaction-img { + position: relative; + width: 42px; + height: 42px +} + +@media(max-width: 580px) { + .wl-reaction-img { + width:32px; + height: 32px + } +} + +.wl-reaction-loading { + position: absolute; + inset-inline-end: -5px; + top: -4px; + width: 18px; + height: 18px; + color: var(--waline-theme-color) +} + +.wl-reaction-votes { + position: absolute; + inset-inline-end: -9px; + top: -9px; + min-width: 1em; + padding: 2px; + border: 1px solid var(--waline-theme-color); + border-radius: 1em; + background: var(--waline-bg-color); + color: var(--waline-theme-color); + font-weight: 700; + font-size: .75em; + line-height: 1 +} + +.wl-reaction-item.active .wl-reaction-votes { + background: var(--waline-theme-color); + color: var(--waline-bg-color) +} + +.wl-reaction-text { + font-size: .875em +} + +.wl-reaction-item.active .wl-reaction-text { + color: var(--waline-theme-color) +} + +.wl-content pre,.wl-content pre[class*=language-] { + overflow: auto; + margin: .75rem 0; + padding: 1rem 1.25rem; + border-radius: 6px; + background: var(--waline-code-bg-color); + line-height: 1.4 +} + +.wl-content pre code,.wl-content pre[class*=language-] code { + padding: 0; + border-radius: 0; + background: rgba(0,0,0,0) !important; + color: #bbb; + direction: ltr +} + +.wl-content code[class*=language-],.wl-content pre[class*=language-] { + background: none; + color: #ccc; + font-size: 1em; + font-family: Consolas,Monaco,"Andale Mono","Ubuntu Mono",monospace; + text-align: left; + white-space: pre; + word-spacing: normal; + word-wrap: normal; + word-break: normal; + tab-size: 4; + hyphens: none +} + +.wl-content pre[class*=language-] { + overflow: auto +} + +.wl-content :not(pre)>code[class*=language-],.wl-content pre[class*=language-] { + background: #2d2d2d +} + +.wl-content :not(pre)>code[class*=language-] { + padding: .1em; + border-radius: .3em; + white-space: normal +} + +.wl-content .token.comment,.wl-content .token.block-comment,.wl-content .token.prolog,.wl-content .token.doctype,.wl-content .token.cdata { + color: #999 +} + +.wl-content .token.punctuation { + color: #ccc +} + +.wl-content .token.tag,.wl-content .token.attr-name,.wl-content .token.namespace,.wl-content .token.deleted { + color: #e2777a +} + +.wl-content .token.function-name { + color: #6196cc +} + +.wl-content .token.boolean,.wl-content .token.number,.wl-content .token.function { + color: #f08d49 +} + +.wl-content .token.property,.wl-content .token.class-name,.wl-content .token.constant,.wl-content .token.symbol { + color: #f8c555 +} + +.wl-content .token.selector,.wl-content .token.important,.wl-content .token.atrule,.wl-content .token.keyword,.wl-content .token.builtin { + color: #cc99cd +} + +.wl-content .token.string,.wl-content .token.char,.wl-content .token.attr-value,.wl-content .token.regex,.wl-content .token.variable { + color: #7ec699 +} + +.wl-content .token.operator,.wl-content .token.entity,.wl-content .token.url { + color: #67cdcc +} + +.wl-content .token.important,.wl-content .token.bold { + font-weight: bold +} + +.wl-content .token.italic { + font-style: italic +} + +.wl-content .token.entity { + cursor: help +} + +.wl-content .token.inserted { + color: green +} + +.wl-recent-item p { + display: inline +} + +.wl-user-list { + padding: 0; + list-style: none +} + +.wl-user-list a,.wl-user-list a:hover,.wl-user-list a:visited { + color: var(--waline-color); + text-decoration: none +} + +.wl-user-list .wl-user-avatar { + position: relative; + display: inline-block; + overflow: hidden; + margin-inline-end:10px;border-radius: 4px; + line-height: 0 +} + +.wl-user-list .wl-user-avatar>img { + width: var(--waline-user-avatar-size, 48px); + height: var(--waline-user-avatar-size, 48px) +} + +.wl-user-list .wl-user-badge { + position: absolute; + inset-inline-end: 0; + bottom: 0; + min-width: .7em; + height: 1.5em; + padding: 0 .4em; + border-radius: 4px; + background: var(--waline-info-bg-color); + color: var(--waline-info-color); + font-weight: bold; + font-size: 10px; + line-height: 1.5em; + text-align: center +} + +.wl-user-list .wl-user-item { + margin: 10px 0 +} + +.wl-user-list .wl-user-item:nth-child(1) .wl-user-badge { + background: var(--waline-rank-gold-bg-color, #fa3939); + color: var(--waline-white); + font-weight: bold +} + +.wl-user-list .wl-user-item:nth-child(2) .wl-user-badge { + background: var(--waline-rank-silver-bg-color, #fb811c); + color: var(--waline-white); + font-weight: bold +} + +.wl-user-list .wl-user-item:nth-child(3) .wl-user-badge { + background: var(--waline-rank-copper-bg-color, #feb207); + color: var(--waline-white) +} + +.wl-user-list .wl-user-meta { + display: inline-block; + vertical-align: top +} + +.wl-user-list .wl-badge { + display: inline-block; + vertical-align: text-top; + margin-inline-start:.5em;padding: 0 .3em; + border: 1px solid var(--waline-badge-color); + border-radius: 4px; + color: var(--waline-badge-color); + font-size: var(--waline-badge-font-size) +} + +.wl-user-wall { + padding: 0; + list-style: none +} + +.wl-user-wall .wl-user-badge,.wl-user-wall .wl-user-meta { + display: none +} + +.wl-user-wall .wl-user-item { + position: relative; + display: inline-block; + transition: transform ease-in-out .2s +} + +.wl-user-wall .wl-user-item::before,.wl-user-wall .wl-user-item::after { + position: absolute; + bottom: 100%; + left: 50%; + z-index: 10; + opacity: 0; + pointer-events: none; + transition: all .18s ease-out .18s; + transform: translate(-50%, 4px); + transform-origin: top +} + +.wl-user-wall .wl-user-item::before { + content: ""; + width: 0; + height: 0; + border: 5px solid rgba(0,0,0,0); + border-top-color: rgba(16,16,16,.95) +} + +.wl-user-wall .wl-user-item::after { + content: attr(aria-label); + margin-bottom: 10px; + padding: .5em 1em; + border-radius: 2px; + background: rgba(16,16,16,.95); + color: #fff; + font-size: 12px; + white-space: nowrap +} + +.wl-user-wall .wl-user-item:hover { + transform: scale(1.1) +} + +.wl-user-wall .wl-user-item:hover::before,.wl-user-wall .wl-user-item:hover::after { + opacity: 1; + pointer-events: none; + transform: translate(-50%, 0) +} + +.wl-user-wall .wl-user-item img { + width: var(--waline-user-avatar-size, 48px); + height: var(--waline-user-avatar-size, 48px) +} + +/*# sourceMappingURL=waline.css.map */ diff --git a/themes/yinyang/exampleSite/.gitignore b/themes/yinyang/exampleSite/.gitignore new file mode 100644 index 00000000..ca4d540a --- /dev/null +++ b/themes/yinyang/exampleSite/.gitignore @@ -0,0 +1,27 @@ +# Compiled Object files, Static and Dynamic libs (Shared Objects) +*.o +*.a +*.so + +# Folders +_obj +_test + +# Architecture specific extensions/prefixes +*.[568vq] +[568vq].out + +*.cgo1.go +*.cgo2.c +_cgo_defun.c +_cgo_gotypes.go +_cgo_export.* + +_testmain.go + +*.exe +*.test + +/public +/themes +.DS_Store diff --git a/themes/yinyang/exampleSite/LICENSE b/themes/yinyang/exampleSite/LICENSE new file mode 100644 index 00000000..4527efb9 --- /dev/null +++ b/themes/yinyang/exampleSite/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014 Steve Francia + +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. \ No newline at end of file diff --git a/themes/yinyang/exampleSite/README.md b/themes/yinyang/exampleSite/README.md new file mode 100644 index 00000000..49eb04a2 --- /dev/null +++ b/themes/yinyang/exampleSite/README.md @@ -0,0 +1,26 @@ +# hugoBasicExample + +This is an example site for [Hugo](https://gohugo.io/). + +It is intended to be a demo site for the various [Hugo themes](https://themes.gohugo.io/). + +# Using + +1. [Install Hugo](https://gohugo.io/overview/installing/) +2. Clone this repository +```bash +git clone https://github.com/gohugoio/hugoBasicExample.git +cd hugoBasicExample +``` +3. Clone the repository you want to test. If you want to test all hugo themes, you can clone [the full list](https://github.com/gohugoio/hugoThemes) +```bash +git clone --recursive https://URL/OF/YOUR/THEME themes/YOURTHEME +``` +or +```bash +git clone --recursive https://github.com/gohugoio/hugoThemes.git themes +``` +4. Run Hugo and select the theme of your choosing +```bash +hugo server -t YOURTHEME +``` diff --git a/themes/yinyang/exampleSite/config.toml b/themes/yinyang/exampleSite/config.toml new file mode 100644 index 00000000..8af9b605 --- /dev/null +++ b/themes/yinyang/exampleSite/config.toml @@ -0,0 +1,32 @@ +baseURL = "https://example.com" +languageCode = "en-us" +title = "Example YinYong Blog" +theme = "yinyang" +DefaultContentLanguage = "en" + +[author] + name = "Joway Wang" + homepage = "https://joway.io/" + +[languages] + [languages.en] + contentDir = "content/en" + languageName = "English" + weight = 1 + [languages.cn] + contentDir = "content/cn" + languageName = "Chinese" + weight = 1 + +[params] +disqus = "joway" # disqus account name +extraHead = '' +mainSections = ["posts"] + +[[params.socials]] +name = "RSS" +link = "/index.xml" + +[[params.socials]] +name = "About" +link = "https://joway.io" diff --git a/themes/yinyang/exampleSite/content/about.md b/themes/yinyang/exampleSite/content/about.md new file mode 100644 index 00000000..77adcf16 --- /dev/null +++ b/themes/yinyang/exampleSite/content/about.md @@ -0,0 +1,18 @@ ++++ +title = "About Hugo" +date = "2014-04-09" +menu = "main" ++++ + +Hugo is the **world’s fastest framework for building websites**. It is written in Go. + +It makes use of a variety of open source projects including: + +* https://github.com/russross/blackfriday +* https://github.com/alecthomas/chroma +* https://github.com/muesli/smartcrop +* https://github.com/spf13/cobra +* https://github.com/spf13/viper + +Learn more and contribute on [GitHub](https://github.com/gohugoio). + diff --git a/themes/yinyang/exampleSite/content/cn/posts/cn.md b/themes/yinyang/exampleSite/content/cn/posts/cn.md new file mode 100644 index 00000000..94f27abf --- /dev/null +++ b/themes/yinyang/exampleSite/content/cn/posts/cn.md @@ -0,0 +1,17 @@ +--- +title: 赤壁赋 +date: 2018-03-04 +categories: ['诗歌'] +draft: false +--- + +## 原文 + +壬戌之秋,七月既望,蘇子與客泛舟遊於赤壁之下。清風徐來,水波不興。舉酒屬客,誦明月之詩,歌窈窕之章。少焉,月出於東山之上,徘徊於斗牛之間。白露橫江,水光接天。縱一葦之所如,凌萬頃之茫然。浩浩乎如馮虛御風,而不知其所止;飄飄乎如遺世獨立,羽化而登仙。 + +於是飲酒樂甚,扣舷而歌之。歌曰:“桂棹兮蘭槳,擊空明兮溯流光。渺渺兮予懷,望美人兮天一方。”客有吹洞簫者,倚歌而和之。其聲嗚嗚然,如怨如慕,如泣如訴;餘音嫋嫋,不絕如縷。舞幽壑之潛蛟,泣孤舟之嫠婦。 + +蘇子愀然,正襟危坐,而問客曰:“何爲其然也?”客曰:“‘月明星稀,烏鵲南飛。’此非曹孟德之詩乎?西望夏口,東望武昌,山川相繆,鬱乎蒼蒼,此非孟德之困於周郎者乎?方其破荊州,下江陵,順流而東也,舳艫千里,旌旗蔽空,釃酒臨江,橫槊賦詩,固一世之雄也,而今安在哉?況吾與子漁樵於江渚之上,侶魚蝦而友麋鹿,駕一葉之扁舟,舉匏樽以相屬。寄蜉蝣於天地,渺滄海之一粟。哀吾生之須臾,羨長 江之無窮。挾飛仙以遨遊,抱明月而長終。知不可乎驟得,託遺響於悲風。” + +蘇子曰:“客亦知夫水與月乎?逝者如斯,而未嘗往也;盈虛者如彼,而卒莫消長也。蓋將自其變者而觀之,則天地曾不能以一瞬;自其不變者而觀之,則物與我皆無盡也,而又何羨乎!且夫天地之間,物各有主,苟非吾之所有,雖一毫而莫取。惟江上之清風,與山間之明月,耳得之而爲聲,目遇之而成色,取之無禁,用之不竭。是造物者之無盡藏也,而吾與子之所共適。”(共適 一作:共食) +客喜而笑,洗盞更酌。餚核既盡,杯盤狼籍。相與枕藉乎舟中,不知東方之既白。 diff --git a/themes/yinyang/exampleSite/content/en/posts/goisforlovers.md b/themes/yinyang/exampleSite/content/en/posts/goisforlovers.md new file mode 100644 index 00000000..5171f65c --- /dev/null +++ b/themes/yinyang/exampleSite/content/en/posts/goisforlovers.md @@ -0,0 +1,343 @@ ++++ +title = "(Hu)go Template Primer" +description = "" +tags = [ + "go", + "golang", + "templates", + "themes", + "development", +] +date = "2014-04-02" +categories = [ + "Develop", +] +menu = "main" ++++ + +Hugo uses the excellent [Go][] [html/template][gohtmltemplate] library for +its template engine. It is an extremely lightweight engine that provides a very +small amount of logic. In our experience that it is just the right amount of +logic to be able to create a good static website. If you have used other +template systems from different languages or frameworks you will find a lot of +similarities in Go templates. + +This document is a brief primer on using Go templates. The [Go docs][gohtmltemplate] +provide more details. + +## Introduction to Go Templates + +Go templates provide an extremely simple template language. It adheres to the +belief that only the most basic of logic belongs in the template or view layer. +One consequence of this simplicity is that Go templates parse very quickly. + +A unique characteristic of Go templates is they are content aware. Variables and +content will be sanitized depending on the context of where they are used. More +details can be found in the [Go docs][gohtmltemplate]. + +## Basic Syntax + +Golang templates are HTML files with the addition of variables and +functions. + +**Go variables and functions are accessible within {{ }}** + +Accessing a predefined variable "foo": + + {{ foo }} + +**Parameters are separated using spaces** + +Calling the add function with input of 1, 2: + + {{ add 1 2 }} + +**Methods and fields are accessed via dot notation** + +Accessing the Page Parameter "bar" + + {{ .Params.bar }} + +**Parentheses can be used to group items together** + + {{ if or (isset .Params "alt") (isset .Params "caption") }} Caption {{ end }} + + +## Variables + +Each Go template has a struct (object) made available to it. In hugo each +template is passed either a page or a node struct depending on which type of +page you are rendering. More details are available on the +[variables](/layout/variables) page. + +A variable is accessed by referencing the variable name. + + {{ .Title }} + +Variables can also be defined and referenced. + + {{ $address := "123 Main St."}} + {{ $address }} + + +## Functions + +Go template ship with a few functions which provide basic functionality. The Go +template system also provides a mechanism for applications to extend the +available functions with their own. [Hugo template +functions](/layout/functions) provide some additional functionality we believe +are useful for building websites. Functions are called by using their name +followed by the required parameters separated by spaces. Template +functions cannot be added without recompiling hugo. + +**Example:** + + {{ add 1 2 }} + +## Includes + +When including another template you will pass to it the data it will be +able to access. To pass along the current context please remember to +include a trailing dot. The templates location will always be starting at +the /layout/ directory within Hugo. + +**Example:** + + {{ template "chrome/header.html" . }} + + +## Logic + +Go templates provide the most basic iteration and conditional logic. + +### Iteration + +Just like in Go, the Go templates make heavy use of range to iterate over +a map, array or slice. The following are different examples of how to use +range. + +**Example 1: Using Context** + + {{ range array }} + {{ . }} + {{ end }} + +**Example 2: Declaring value variable name** + + {{range $element := array}} + {{ $element }} + {{ end }} + +**Example 2: Declaring key and value variable name** + + {{range $index, $element := array}} + {{ $index }} + {{ $element }} + {{ end }} + +### Conditionals + +If, else, with, or, & and provide the framework for handling conditional +logic in Go Templates. Like range, each statement is closed with `end`. + + +Go Templates treat the following values as false: + +* false +* 0 +* any array, slice, map, or string of length zero + +**Example 1: If** + + {{ if isset .Params "title" }}

{{ index .Params "title" }}

{{ end }} + +**Example 2: If -> Else** + + {{ if isset .Params "alt" }} + {{ index .Params "alt" }} + {{else}} + {{ index .Params "caption" }} + {{ end }} + +**Example 3: And & Or** + + {{ if and (or (isset .Params "title") (isset .Params "caption")) (isset .Params "attr")}} + +**Example 4: With** + +An alternative way of writing "if" and then referencing the same value +is to use "with" instead. With rebinds the context `.` within its scope, +and skips the block if the variable is absent. + +The first example above could be simplified as: + + {{ with .Params.title }}

{{ . }}

{{ end }} + +**Example 5: If -> Else If** + + {{ if isset .Params "alt" }} + {{ index .Params "alt" }} + {{ else if isset .Params "caption" }} + {{ index .Params "caption" }} + {{ end }} + +## Pipes + +One of the most powerful components of Go templates is the ability to +stack actions one after another. This is done by using pipes. Borrowed +from unix pipes, the concept is simple, each pipeline's output becomes the +input of the following pipe. + +Because of the very simple syntax of Go templates, the pipe is essential +to being able to chain together function calls. One limitation of the +pipes is that they only can work with a single value and that value +becomes the last parameter of the next pipeline. + +A few simple examples should help convey how to use the pipe. + +**Example 1 :** + + {{ if eq 1 1 }} Same {{ end }} + +is the same as + + {{ eq 1 1 | if }} Same {{ end }} + +It does look odd to place the if at the end, but it does provide a good +illustration of how to use the pipes. + +**Example 2 :** + + {{ index .Params "disqus_url" | html }} + +Access the page parameter called "disqus_url" and escape the HTML. + +**Example 3 :** + + {{ if or (or (isset .Params "title") (isset .Params "caption")) (isset .Params "attr")}} + Stuff Here + {{ end }} + +Could be rewritten as + + {{ isset .Params "caption" | or isset .Params "title" | or isset .Params "attr" | if }} + Stuff Here + {{ end }} + + +## Context (aka. the dot) + +The most easily overlooked concept to understand about Go templates is that {{ . }} +always refers to the current context. In the top level of your template this +will be the data set made available to it. Inside of a iteration it will have +the value of the current item. When inside of a loop the context has changed. . +will no longer refer to the data available to the entire page. If you need to +access this from within the loop you will likely want to set it to a variable +instead of depending on the context. + +**Example:** + + {{ $title := .Site.Title }} + {{ range .Params.tags }} +
  • {{ . }} - {{ $title }}
  • + {{ end }} + +Notice how once we have entered the loop the value of {{ . }} has changed. We +have defined a variable outside of the loop so we have access to it from within +the loop. + +# Hugo Parameters + +Hugo provides the option of passing values to the template language +through the site configuration (for sitewide values), or through the meta +data of each specific piece of content. You can define any values of any +type (supported by your front matter/config format) and use them however +you want to inside of your templates. + + +## Using Content (page) Parameters + +In each piece of content you can provide variables to be used by the +templates. This happens in the [front matter](/content/front-matter). + +An example of this is used in this documentation site. Most of the pages +benefit from having the table of contents provided. Sometimes the TOC just +doesn't make a lot of sense. We've defined a variable in our front matter +of some pages to turn off the TOC from being displayed. + +Here is the example front matter: + +``` +--- +title: "Permalinks" +date: "2013-11-18" +aliases: + - "/doc/permalinks/" +groups: ["extras"] +groups_weight: 30 +notoc: true +--- +``` + +Here is the corresponding code inside of the template: + + {{ if not .Params.notoc }} +
    + {{ .TableOfContents }} +
    + {{ end }} + + + +## Using Site (config) Parameters +In your top-level configuration file (eg, `config.yaml`) you can define site +parameters, which are values which will be available to you in chrome. + +For instance, you might declare: + +```yaml +params: + CopyrightHTML: "Copyright © 2013 John Doe. All Rights Reserved." + TwitterUser: "spf13" + SidebarRecentLimit: 5 +``` + +Within a footer layout, you might then declare a `