From 60f34937b75a26c413e5e37cab2066b70239a9f6 Mon Sep 17 00:00:00 2001 From: "martin@ashbysoft.com" Date: Fri, 17 Sep 2021 22:01:14 +0000 Subject: move old site content into hugo --- .gitmodules | 3 + config.toml | 5 +- content/posts/2018-05-31-new-site.md | 13 +++ content/posts/2018-06-01-mailu.md | 52 +++++++++++ content/posts/2018-06-02-unicornpaint.md | 11 +++ old/_posts/2018-05-31-new-site.markdown | 15 --- old/_posts/2018-06-01-mailu.md | 53 ----------- old/_posts/2018-06-02-unicornpaint.md | 12 --- old/assets/mailu_screenshot.png | Bin 146724 -> 0 bytes old/assets/reprap.jpg | Bin 642610 -> 0 bytes old/assets/unicorn.gif | Bin 1564408 -> 0 bytes old/assets/unicorn1.jpg | Bin 992877 -> 0 bytes old/assets/unicorn2.jpg | Bin 1374406 -> 0 bytes old/assets/unicorn3.jpg | Bin 1449703 -> 0 bytes old/assets/unicorn_small.gif | Bin 25003 -> 0 bytes static/mailu_screenshot.png | Bin 0 -> 146724 bytes static/reprap.jpg | Bin 0 -> 642610 bytes static/unicorn.gif | Bin 0 -> 1564408 bytes static/unicorn1.jpg | Bin 0 -> 992877 bytes static/unicorn2.jpg | Bin 0 -> 1374406 bytes static/unicorn3.jpg | Bin 0 -> 1449703 bytes static/unicorn_small.gif | Bin 0 -> 25003 bytes themes/XMin/.gitignore | 5 + themes/XMin/LICENSE.md | 20 ++++ themes/XMin/README.md | 28 ++++++ themes/XMin/archetypes/default.md | 4 + themes/XMin/exampleSite/config.yaml | 38 ++++++++ themes/XMin/exampleSite/content/_index.Rmarkdown | 25 +++++ themes/XMin/exampleSite/content/_index.markdown | 38 ++++++++ themes/XMin/exampleSite/content/about.md | 101 +++++++++++++++++++++ .../content/note/2017-06-13-a-quick-note.md | 15 +++ .../content/note/2017-06-14-another-note.md | 14 +++ .../content/post/2015-07-23-lorem-ipsum.md | 18 ++++ .../content/post/2016-02-14-hello-markdown.md | 92 +++++++++++++++++++ .../exampleSite/layouts/partials/foot_custom.html | 4 + themes/XMin/hugo-xmin.Rproj | 16 ++++ themes/XMin/images/screenshot.png | Bin 0 -> 37151 bytes themes/XMin/images/tn.png | Bin 0 -> 21823 bytes themes/XMin/layouts/404.html | 5 + themes/XMin/layouts/_default/list.html | 20 ++++ themes/XMin/layouts/_default/single.html | 12 +++ themes/XMin/layouts/_default/terms.html | 13 +++ themes/XMin/layouts/partials/foot_custom.html | 0 themes/XMin/layouts/partials/footer.html | 9 ++ themes/XMin/layouts/partials/head_custom.html | 0 themes/XMin/layouts/partials/header.html | 20 ++++ themes/XMin/static/css/fonts.css | 7 ++ themes/XMin/static/css/style.css | 51 +++++++++++ themes/XMin/theme.toml | 12 +++ 49 files changed, 649 insertions(+), 82 deletions(-) create mode 100644 .gitmodules create mode 100644 content/posts/2018-05-31-new-site.md create mode 100644 content/posts/2018-06-01-mailu.md create mode 100644 content/posts/2018-06-02-unicornpaint.md delete mode 100644 old/_posts/2018-05-31-new-site.markdown delete mode 100644 old/_posts/2018-06-01-mailu.md delete mode 100644 old/_posts/2018-06-02-unicornpaint.md delete mode 100644 old/assets/mailu_screenshot.png delete mode 100644 old/assets/reprap.jpg delete mode 100644 old/assets/unicorn.gif delete mode 100644 old/assets/unicorn1.jpg delete mode 100644 old/assets/unicorn2.jpg delete mode 100644 old/assets/unicorn3.jpg delete mode 100644 old/assets/unicorn_small.gif create mode 100644 static/mailu_screenshot.png create mode 100644 static/reprap.jpg create mode 100644 static/unicorn.gif create mode 100644 static/unicorn1.jpg create mode 100644 static/unicorn2.jpg create mode 100644 static/unicorn3.jpg create mode 100644 static/unicorn_small.gif create mode 100644 themes/XMin/.gitignore create mode 100644 themes/XMin/LICENSE.md create mode 100644 themes/XMin/README.md create mode 100644 themes/XMin/archetypes/default.md create mode 100644 themes/XMin/exampleSite/config.yaml create mode 100644 themes/XMin/exampleSite/content/_index.Rmarkdown create mode 100644 themes/XMin/exampleSite/content/_index.markdown create mode 100644 themes/XMin/exampleSite/content/about.md create mode 100644 themes/XMin/exampleSite/content/note/2017-06-13-a-quick-note.md create mode 100644 themes/XMin/exampleSite/content/note/2017-06-14-another-note.md create mode 100644 themes/XMin/exampleSite/content/post/2015-07-23-lorem-ipsum.md create mode 100644 themes/XMin/exampleSite/content/post/2016-02-14-hello-markdown.md create mode 100644 themes/XMin/exampleSite/layouts/partials/foot_custom.html create mode 100644 themes/XMin/hugo-xmin.Rproj create mode 100644 themes/XMin/images/screenshot.png create mode 100644 themes/XMin/images/tn.png create mode 100644 themes/XMin/layouts/404.html create mode 100644 themes/XMin/layouts/_default/list.html create mode 100644 themes/XMin/layouts/_default/single.html create mode 100644 themes/XMin/layouts/_default/terms.html create mode 100644 themes/XMin/layouts/partials/foot_custom.html create mode 100644 themes/XMin/layouts/partials/footer.html create mode 100644 themes/XMin/layouts/partials/head_custom.html create mode 100644 themes/XMin/layouts/partials/header.html create mode 100644 themes/XMin/static/css/fonts.css create mode 100644 themes/XMin/static/css/style.css create mode 100644 themes/XMin/theme.toml diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..a38e1fb --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "hugo-xmin"] + path = hugo-xmin + url = git@github.com:yihui/hugo-xmin diff --git a/config.toml b/config.toml index 1d7c819..97169c9 100644 --- a/config.toml +++ b/config.toml @@ -1,3 +1,4 @@ -baseURL = 'http://example.org/' +baseURL = 'https://mfashby.net/' languageCode = 'en-us' -title = 'My New Hugo Site' +title = 'mfashby.net' +theme = "XMin" diff --git a/content/posts/2018-05-31-new-site.md b/content/posts/2018-05-31-new-site.md new file mode 100644 index 0000000..7dfd4c3 --- /dev/null +++ b/content/posts/2018-05-31-new-site.md @@ -0,0 +1,13 @@ +--- +layout: post +title: "New Site" +date: 2018-05-31 17:51:07 +0100 +--- + +I'm intending to write more online about the stuff I tinker with. + +You can expect posts about +* what I do with my [Raspberry Pi](https://www.raspberrypi.org), +* websites and servers that I run including [my wife's blog](https://heyworlditshenry.com) and my [email server](https://mail.mfashby.net) +* more physical projects like getting a [RepRap](https://reprap.org/) up and running + diff --git a/content/posts/2018-06-01-mailu.md b/content/posts/2018-06-01-mailu.md new file mode 100644 index 0000000..415cc20 --- /dev/null +++ b/content/posts/2018-06-01-mailu.md @@ -0,0 +1,52 @@ +--- +layout: post +title: "Mailu" +date: 2018-06-01 20:17:00 +0100 +--- + +## My search for an email server + +![Rainloop Screenshot](/mailu_screenshot.png) + +A big theme in the news recently is data protection, how your personal data is being used (and abused), and taking back control of your data. Part of the problem is that people's personal data is kept in huge private corporate networks, and historically companies have been able to do (essentially) whatever they like with it. I started investigating how difficult it would be to really re-take control of my personal data - beginning with my email. + +Email is complicated: this is because it is old, and it has changed over time. [One of the first articles I found](https://www.digitalocean.com/community/tutorials/why-you-may-not-want-to-run-your-own-mail-serve) is a quick rundown of how complex the email system is. [Ars technica][ars-technica-guide] ran a guide for setting up your own email server: + +>Why do battle with arcane dragons to roll your own e-mail solution? + +The arcane dragons are the pieces of software that have become the most popular choices for email servers. A typical email server configuration contains the following pieces of open-source software: dovecot, postfix, spamassassin, clamav, sendmail, roundcube, mysql. Each of them fills a different role in the email system, and each of them can be configured to operate in many different ways. + +I began setting up my email server in this way, however I gave up pretty quickly: I found that walkthroughs on the internet were often out of date, and configuration options had changed or been removed. I also found it really difficult to understand from the guides how all the pieces of the puzzle fit together. I started looking for alternative routes. + +Microsoft Exchange Server fulfils all the roles of the separate open-source components in a single piece of software. This sounds much easier to configure: however I don't have a Windows server, and nor do I want to pay licensing costs for it. + +I started looking for an open-source project that fulfils the same role. I found [Maddy](https://github.com/emersion/maddy), inspired by the new minimal-configuration http/2 server [Caddy][caddy]. Sadly, the project is seriously incomplete right now, but the principle sounds great: a self-contained email server with minimal configuration conforming to best practices by default. + +Although I made a [little effort](https://github.com/MFAshby/gomail) to cobble together this project into a working email server, I discovered this was a much bigger task than I had anticipated. I discovered some more arcane dragons in the form of the email standards for SMTP and IMAP. These are old, stateful protocols with many extensions, versions and awkward syntax. Modern systems are built with REST APIs for a reason: they are much quicker for the developer to understand and build with (they are also way easier to load balance, due to the lack of state) + +I came back around to the idea of using the existing software, but this time I started looking for pre-configured systems. I discovered [iRedMail][iredmail] which claims to turn a fresh Debian or Ubuntu install into a working email server. This isn't bad, but I want to run a few other services from my Raspberry as well, and I'd rather not clobber them by re-installing Debian. + +This approach actually leads really neatly onto the last solution I tried, and the one I actually have working: [Mailu][mailu]. This project provides all the same open-source email components (postfix, dovecot), but pre-configured and packaged as [Docker][docker] images. I feel like this is the best approach for a few reasons: + +* You don't need a fresh Debian install, you just need a working Docker host. +* The hard configuration has been done for you. Just a single config file with a few easy to understand options is required. +* It's portable: copy over the mailu directory and the docker-compose.yml file to another machine, execute `docker-compose up -d` and it's back online with all the same accounts. +* An admin interface is included. +* It's open source so you can check if it conforms to current security practices, and modify it if you need to. +* The maintainer [kaiyou](https://github.com/kaiyou) is very helpful, and gratefully accepts pull requests. + +Although the project didn't work out of the box with Raspberry Pi this was a pretty easy thing to fix. I now maintain a permanent fork of mailu for Raspberry Pi over [here][mailu-rpi] + +[rpi]:https://www.raspberrypi.org/ +[dovecot-basic]:https://wiki.dovecot.org/BasicConfiguration +[ars-technica-guide]:https://arstechnica.com/information-technology/2014/02/how-to-run-your-own-e-mail-server-with-your-own-domain-part-1/ +[golang]:https://golang.org/ +[caddy]:https://caddyserver.com/ +[gomail]:https://github.com/MFAshby/gomail +[emersion]:https://github.com/emersion +[maddy]:https://github.com/emersion/maddy +[caddy-forum-non-http]:https://caddy.community/t/server-types-other-than-http/65/7 +[iredmail]:https://www.iredmail.org/ +[mailu]:https://github.com/Mailu/Mailu +[docker]:http://docker.io/ +[mailu-rpi]:https://github.com/MFAshby/mailu diff --git a/content/posts/2018-06-02-unicornpaint.md b/content/posts/2018-06-02-unicornpaint.md new file mode 100644 index 0000000..d17122f --- /dev/null +++ b/content/posts/2018-06-02-unicornpaint.md @@ -0,0 +1,11 @@ +--- +layout: post +title: "Unicorn Paint" +date: 2018-06-02 22:33:00 +0100 +--- + +See [unicornpaint] for details. I'll write about this later... + +![animated image](/unicorn.gif) + +[unicornpaint]:https://unicorn.mfashby.net diff --git a/old/_posts/2018-05-31-new-site.markdown b/old/_posts/2018-05-31-new-site.markdown deleted file mode 100644 index bcdd652..0000000 --- a/old/_posts/2018-05-31-new-site.markdown +++ /dev/null @@ -1,15 +0,0 @@ ---- -layout: post -title: "New Site" -date: 2018-05-31 17:51:07 +0100 -categories: jekyll update ---- - -I'm intending to write more online about the stuff I tinker with. - -You can expect posts about -* what I do with my [Raspberry Pi](https://www.raspberrypi.org), -* websites and servers that I run including [my wife's blog](https://heyworlditshenry.com) and my [email server](https://mail.mfashby.net) -* more physical projects like getting a [RepRap](https://reprap.org/) up and running - -![reprap from above]({{ "/assets/reprap.jpg" | absolute_url }}) \ No newline at end of file diff --git a/old/_posts/2018-06-01-mailu.md b/old/_posts/2018-06-01-mailu.md deleted file mode 100644 index 20c655d..0000000 --- a/old/_posts/2018-06-01-mailu.md +++ /dev/null @@ -1,53 +0,0 @@ ---- -layout: post -title: "Mailu" -date: 2018-06-01 20:17:00 +0100 -categories: jekyll update ---- - -## My search for an email server - -![Rainloop Screenshot]({{ "/assets/mailu_screenshot.png" | absolute_url }}) - -A big theme in the news recently is data protection, how your personal data is being used (and abused), and taking back control of your data. Part of the problem is that people's personal data is kept in huge private corporate networks, and historically companies have been able to do (essentially) whatever they like with it. I started investigating how difficult it would be to really re-take control of my personal data - beginning with my email. - -Email is complicated: this is because it is old, and it has changed over time. [One of the first articles I found](https://www.digitalocean.com/community/tutorials/why-you-may-not-want-to-run-your-own-mail-serve) is a quick rundown of how complex the email system is. [Ars technica][ars-technica-guide] ran a guide for setting up your own email server: - ->Why do battle with arcane dragons to roll your own e-mail solution? - -The arcane dragons are the pieces of software that have become the most popular choices for email servers. A typical email server configuration contains the following pieces of open-source software: dovecot, postfix, spamassassin, clamav, sendmail, roundcube, mysql. Each of them fills a different role in the email system, and each of them can be configured to operate in many different ways. - -I began setting up my email server in this way, however I gave up pretty quickly: I found that walkthroughs on the internet were often out of date, and configuration options had changed or been removed. I also found it really difficult to understand from the guides how all the pieces of the puzzle fit together. I started looking for alternative routes. - -Microsoft Exchange Server fulfils all the roles of the separate open-source components in a single piece of software. This sounds much easier to configure: however I don't have a Windows server, and nor do I want to pay licensing costs for it. - -I started looking for an open-source project that fulfils the same role. I found [Maddy](https://github.com/emersion/maddy), inspired by the new minimal-configuration http/2 server [Caddy][caddy]. Sadly, the project is seriously incomplete right now, but the principle sounds great: a self-contained email server with minimal configuration conforming to best practices by default. - -Although I made a [little effort](https://github.com/MFAshby/gomail) to cobble together this project into a working email server, I discovered this was a much bigger task than I had anticipated. I discovered some more arcane dragons in the form of the email standards for SMTP and IMAP. These are old, stateful protocols with many extensions, versions and awkward syntax. Modern systems are built with REST APIs for a reason: they are much quicker for the developer to understand and build with (they are also way easier to load balance, due to the lack of state) - -I came back around to the idea of using the existing software, but this time I started looking for pre-configured systems. I discovered [iRedMail][iredmail] which claims to turn a fresh Debian or Ubuntu install into a working email server. This isn't bad, but I want to run a few other services from my Raspberry as well, and I'd rather not clobber them by re-installing Debian. - -This approach actually leads really neatly onto the last solution I tried, and the one I actually have working: [Mailu][mailu]. This project provides all the same open-source email components (postfix, dovecot), but pre-configured and packaged as [Docker][docker] images. I feel like this is the best approach for a few reasons: - -* You don't need a fresh Debian install, you just need a working Docker host. -* The hard configuration has been done for you. Just a single config file with a few easy to understand options is required. -* It's portable: copy over the mailu directory and the docker-compose.yml file to another machine, execute `docker-compose up -d` and it's back online with all the same accounts. -* An admin interface is included. -* It's open source so you can check if it conforms to current security practices, and modify it if you need to. -* The maintainer [kaiyou](https://github.com/kaiyou) is very helpful, and gratefully accepts pull requests. - -Although the project didn't work out of the box with Raspberry Pi this was a pretty easy thing to fix. I now maintain a permanent fork of mailu for Raspberry Pi over [here][mailu-rpi] - -[rpi]:https://www.raspberrypi.org/ -[dovecot-basic]:https://wiki.dovecot.org/BasicConfiguration -[ars-technica-guide]:https://arstechnica.com/information-technology/2014/02/how-to-run-your-own-e-mail-server-with-your-own-domain-part-1/ -[golang]:https://golang.org/ -[caddy]:https://caddyserver.com/ -[gomail]:https://github.com/MFAshby/gomail -[emersion]:https://github.com/emersion -[maddy]:https://github.com/emersion/maddy -[caddy-forum-non-http]:https://caddy.community/t/server-types-other-than-http/65/7 -[iredmail]:https://www.iredmail.org/ -[mailu]:https://github.com/Mailu/Mailu -[docker]:http://docker.io/ -[mailu-rpi]:https://github.com/MFAshby/mailu \ No newline at end of file diff --git a/old/_posts/2018-06-02-unicornpaint.md b/old/_posts/2018-06-02-unicornpaint.md deleted file mode 100644 index 059cd0a..0000000 --- a/old/_posts/2018-06-02-unicornpaint.md +++ /dev/null @@ -1,12 +0,0 @@ ---- -layout: post -title: "Unicorn Paint" -date: 2018-06-02 22:33:00 +0100 -categories: jekyll update ---- - -See [unicornpaint] for details. I'll write about this later... - -![animated image]({{ "/assets/unicorn.gif" | absolute_url }}) - -[unicornpaint]:https://unicorn.mfashby.net \ No newline at end of file diff --git a/old/assets/mailu_screenshot.png b/old/assets/mailu_screenshot.png deleted file mode 100644 index 97541cc..0000000 Binary files a/old/assets/mailu_screenshot.png and /dev/null differ diff --git a/old/assets/reprap.jpg b/old/assets/reprap.jpg deleted file mode 100644 index f6ca8dd..0000000 Binary files a/old/assets/reprap.jpg and /dev/null differ diff --git a/old/assets/unicorn.gif b/old/assets/unicorn.gif deleted file mode 100644 index 5dab1c7..0000000 Binary files a/old/assets/unicorn.gif and /dev/null differ diff --git a/old/assets/unicorn1.jpg b/old/assets/unicorn1.jpg deleted file mode 100644 index e44bf60..0000000 Binary files a/old/assets/unicorn1.jpg and /dev/null differ diff --git a/old/assets/unicorn2.jpg b/old/assets/unicorn2.jpg deleted file mode 100644 index ff64679..0000000 Binary files a/old/assets/unicorn2.jpg and /dev/null differ diff --git a/old/assets/unicorn3.jpg b/old/assets/unicorn3.jpg deleted file mode 100644 index aff166a..0000000 Binary files a/old/assets/unicorn3.jpg and /dev/null differ diff --git a/old/assets/unicorn_small.gif b/old/assets/unicorn_small.gif deleted file mode 100644 index 4334034..0000000 Binary files a/old/assets/unicorn_small.gif and /dev/null differ diff --git a/static/mailu_screenshot.png b/static/mailu_screenshot.png new file mode 100644 index 0000000..97541cc Binary files /dev/null and b/static/mailu_screenshot.png differ diff --git a/static/reprap.jpg b/static/reprap.jpg new file mode 100644 index 0000000..f6ca8dd Binary files /dev/null and b/static/reprap.jpg differ diff --git a/static/unicorn.gif b/static/unicorn.gif new file mode 100644 index 0000000..5dab1c7 Binary files /dev/null and b/static/unicorn.gif differ diff --git a/static/unicorn1.jpg b/static/unicorn1.jpg new file mode 100644 index 0000000..e44bf60 Binary files /dev/null and b/static/unicorn1.jpg differ diff --git a/static/unicorn2.jpg b/static/unicorn2.jpg new file mode 100644 index 0000000..ff64679 Binary files /dev/null and b/static/unicorn2.jpg differ diff --git a/static/unicorn3.jpg b/static/unicorn3.jpg new file mode 100644 index 0000000..aff166a Binary files /dev/null and b/static/unicorn3.jpg differ diff --git a/static/unicorn_small.gif b/static/unicorn_small.gif new file mode 100644 index 0000000..4334034 Binary files /dev/null and b/static/unicorn_small.gif differ diff --git a/themes/XMin/.gitignore b/themes/XMin/.gitignore new file mode 100644 index 0000000..ce130a0 --- /dev/null +++ b/themes/XMin/.gitignore @@ -0,0 +1,5 @@ +.Rproj.user +.Rhistory +.RData +.Ruserdata +exampleSite/public diff --git a/themes/XMin/LICENSE.md b/themes/XMin/LICENSE.md new file mode 100644 index 0000000..fa77e18 --- /dev/null +++ b/themes/XMin/LICENSE.md @@ -0,0 +1,20 @@ +The MIT License (MIT) + +Copyright (c) 2017 Yihui Xie + +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. diff --git a/themes/XMin/README.md b/themes/XMin/README.md new file mode 100644 index 0000000..2cd5279 --- /dev/null +++ b/themes/XMin/README.md @@ -0,0 +1,28 @@ +# HUGO XMIN + +## _Keep it simple, but not simpler_ + +**XMin** is a Hugo theme written by [Yihui Xie](https://yihui.org) in about four hours: half an hour was spent on the Hugo templates, and 3.5 hours were spent on styling. The main motivation for writing this theme was to provide a really minimal example to beginners of Hugo templates. This XMin theme contains about 130 lines of code in total, including the code in HTML templates and CSS (also counting empty lines). + + +```bash +find . -not -path '*/exampleSite/*' \( -name '*.html' -o -name '*.css' \) | xargs wc -l +``` + +``` + 5 ./layouts/404.html + 12 ./layouts/_default/single.html + 20 ./layouts/_default/list.html + 13 ./layouts/_default/terms.html + 0 ./layouts/partials/foot_custom.html + 0 ./layouts/partials/head_custom.html + 9 ./layouts/partials/footer.html + 20 ./layouts/partials/header.html + 51 ./static/css/style.css + 7 ./static/css/fonts.css + 137 total +``` + +I can certainly further reduce the code, for example, by eliminating the CSS, but I believe a tiny bit of CSS can greatly improve readability. You cannot really find many CSS frameworks that only contain 50 lines of code. + +[![Screenshot](https://github.com/yihui/hugo-xmin/raw/master/images/screenshot.png)](https://xmin.yihui.org) diff --git a/themes/XMin/archetypes/default.md b/themes/XMin/archetypes/default.md new file mode 100644 index 0000000..fb98e92 --- /dev/null +++ b/themes/XMin/archetypes/default.md @@ -0,0 +1,4 @@ +--- +title: '' +date: '' +--- diff --git a/themes/XMin/exampleSite/config.yaml b/themes/XMin/exampleSite/config.yaml new file mode 100644 index 0000000..6b5e2eb --- /dev/null +++ b/themes/XMin/exampleSite/config.yaml @@ -0,0 +1,38 @@ +baseurl: "/" +languageCode: "en-us" +title: "A minimal Hugo website" +theme: "hugo-xmin" +googleAnalytics: "" +disqusShortname: "" +ignoreFiles: ["\\.Rmd$", "\\.Rmarkdown$", "_cache$", "\\.knit\\.md$", "\\.utf8\\.md$"] +footnotereturnlinkcontents: "↩" + +permalinks: + note: "/note/:year/:month/:day/:slug/" + post: "/post/:year/:month/:day/:slug/" + +menu: + main: + - name: Home + url: "" + weight: 1 + - name: About + url: "about/" + weight: 2 + - name: Categories + url: "categories/" + weight: 3 + - name: Tags + url: "tags/" + weight: 4 + - name: Subscribe + url: "index.xml" + +params: + description: "A website built through Hugo and blogdown." + footer: "© [Yihui Xie](https://yihui.org) 2017 -- 2020 | [Github](https://github.com/yihui) | [Twitter](https://twitter.com/xieyihui)" + +markup: + goldmark: + renderer: + unsafe: true diff --git a/themes/XMin/exampleSite/content/_index.Rmarkdown b/themes/XMin/exampleSite/content/_index.Rmarkdown new file mode 100644 index 0000000..bae7bb6 --- /dev/null +++ b/themes/XMin/exampleSite/content/_index.Rmarkdown @@ -0,0 +1,25 @@ +--- +title: Home +--- + +[Github repo](https://github.com/yihui/hugo-xmin) + +# HUGO XMIN + +## _Keep it simple, but not simpler_ + +**XMin** is a Hugo theme written by [Yihui Xie](https://yihui.org) in about four hours: half an hour was spent on the Hugo templates, and 3.5 hours were spent on styling. The main motivation for writing this theme was to provide a really minimal example to beginners of Hugo templates. This XMin theme contains about 130 lines of code in total, including the code in HTML templates and CSS (also counting empty lines). + +```{bash, comment='', echo=3, eval=Sys.which('bash') != '', message=FALSE} +cd ../..; +if [ ! -f 'theme.toml' ]; then exit 0; fi # only run find below within the theme example site +find . -not -path '*/exampleSite/*' \( -name '*.html' -o -name '*.css' \) | xargs wc -l +``` + +I can certainly further reduce the code, for example, by eliminating the CSS, but I believe a tiny bit of CSS can greatly improve readability. You cannot really find many CSS frameworks that only contain 50 lines of code. + +Although it is a minimal theme, it is actually fully functional. It supports pages (including the home page), blog posts, a navigation menu, categories, tags, and RSS. With [a little bit customization](https://github.com/yihui/hugo-xmin/blob/master/exampleSite/layouts/partials/foot_custom.html), it can easily support LaTeX math expressions, e.g., + +`$${\sqrt {n}}\left(\left({\frac {1}{n}}\sum _{i=1}^{n}X_{i}\right)-\mu \right)\ {\xrightarrow {d}}\ N\left(0,\sigma ^{2}\right)$$` + +All pages not under the root directory of the website are listed below. You can also visit the list page of a single section, e.g., [posts](/post/), or [notes](/note/). See the [About](/about/) page for the usage of this theme. diff --git a/themes/XMin/exampleSite/content/_index.markdown b/themes/XMin/exampleSite/content/_index.markdown new file mode 100644 index 0000000..5a92003 --- /dev/null +++ b/themes/XMin/exampleSite/content/_index.markdown @@ -0,0 +1,38 @@ +--- +title: Home +--- + +[Github repo](https://github.com/yihui/hugo-xmin) + +# HUGO XMIN + +## _Keep it simple, but not simpler_ + +**XMin** is a Hugo theme written by [Yihui Xie](https://yihui.org) in about four hours: half an hour was spent on the Hugo templates, and 3.5 hours were spent on styling. The main motivation for writing this theme was to provide a really minimal example to beginners of Hugo templates. This XMin theme contains about 130 lines of code in total, including the code in HTML templates and CSS (also counting empty lines). + + +```bash +find . -not -path '*/exampleSite/*' \( -name '*.html' -o -name '*.css' \) | xargs wc -l +``` + +``` + 5 ./layouts/404.html + 12 ./layouts/_default/single.html + 20 ./layouts/_default/list.html + 13 ./layouts/_default/terms.html + 0 ./layouts/partials/foot_custom.html + 0 ./layouts/partials/head_custom.html + 9 ./layouts/partials/footer.html + 20 ./layouts/partials/header.html + 51 ./static/css/style.css + 7 ./static/css/fonts.css + 137 total +``` + +I can certainly further reduce the code, for example, by eliminating the CSS, but I believe a tiny bit of CSS can greatly improve readability. You cannot really find many CSS frameworks that only contain 50 lines of code. + +Although it is a minimal theme, it is actually fully functional. It supports pages (including the home page), blog posts, a navigation menu, categories, tags, and RSS. With [a little bit customization](https://github.com/yihui/hugo-xmin/blob/master/exampleSite/layouts/partials/foot_custom.html), it can easily support LaTeX math expressions, e.g., + +`$${\sqrt {n}}\left(\left({\frac {1}{n}}\sum _{i=1}^{n}X_{i}\right)-\mu \right)\ {\xrightarrow {d}}\ N\left(0,\sigma ^{2}\right)$$` + +All pages not under the root directory of the website are listed below. You can also visit the list page of a single section, e.g., [posts](/post/), or [notes](/note/). See the [About](/about/) page for the usage of this theme. diff --git a/themes/XMin/exampleSite/content/about.md b/themes/XMin/exampleSite/content/about.md new file mode 100644 index 0000000..210bb35 --- /dev/null +++ b/themes/XMin/exampleSite/content/about.md @@ -0,0 +1,101 @@ +--- +title: About Hugo XMin +author: Yihui Xie +--- + +**XMin** is the first Hugo theme I have designed. The original reason that I wrote it was I needed a minimal example of Hugo themes when I was writing the [**blogdown**](https://github.com/rstudio/blogdown) book. Basically I wanted a simple theme that supports a navigation menu, a home page, other single pages, lists of pages, blog posts, categories, tags, and RSS. That is all. Nothing fancy. In terms of CSS and JavaScript, I really want to keep them minimal. In fact, this theme does not contain any JavaScript code at all, although on this example website I did introduce some JavaScript code (still relatively simple anyway). The theme does not contain any images, either, and is pretty much a plain-text theme. + +The theme name "XMin" can be interpreted as "**X**ie's **Min**imal theme" (Xie is my last name) or "e**X**tremely **Min**imal theme". + +# config.toml + +For this example site, I defined permalinks for two sections, `post` and `note`, so that the links to pages under these directories will contain the date info, e.g., `https://xmin.yihui.org/post/2016/02/14/a-plain-markdown-post/`. This is optional, and it is up to your personal taste of URLs. + +``` +[permalinks] + post = "/post/:year/:month/:day/:slug/" + note = "/note/:year/:month/:day/:slug/" +``` + +You can define the menu through `menu.main`, e.g., + +``` +[[menu.main]] + name = "Home" + url = "/" + weight = 1 +[[menu.main]] + name = "About" + url = "/about/" + weight = 2 +[[menu.main]] + name = "Categories" + url = "/categories/" + weight = 3 +[[menu.main]] + name = "Tags" + url = "/tags/" + weight = 4 +[[menu.main]] + name = "Subscribe" + url = "/index.xml" +``` + +Alternatively, you can add `menu: main` to the YAML metadata of any of your pages, so that these pages will appear in the menu. + +The page footer can be defined in `.Params.footer`, and the text is treated as Markdown, e.g., + +``` +[params] + footer = "© [Yihui Xie](https://yihui.org) 2017" +``` + +# Custom layouts + +There are two layout files under `layouts/partials/` that you may want to override: `head_custom.html` and `foot_custom.html`. This is how you inject arbitrary HTML code to the head and foot areas. For example, this site has a file `layouts/partials/foot_custom.html` to support LaTeX math via MathJax and center images automatically: + +```html + + + + +``` + +You can certainly enable highlight.js for syntax highlighting by yourself through `head_custom.html` and `foot_custom.html` if you want. + +If you do not like the default fonts (e.g., `Palatino`), you may provide your own `static/css/fonts.css` under the root directory of your website to override the `fonts.css` in the theme. + +# Other features + +I could have added more features to this theme, but I decided not to, since I have no intention to make this theme feature-rich. However, I will teach you how. I have prepared several examples via pull requests at https://github.com/yihui/hugo-xmin/pulls, so that you can see the implementations of these features when you check out the diffs in the pull requests. For example, you can: + +- [Enable Google Analytics](https://github.com/yihui/hugo-xmin/pull/3) + +- [Enable Disqus comments](https://github.com/yihui/hugo-xmin/pull/4) + +- [Enable highlight.js for syntax highlighting of code blocks](https://github.com/yihui/hugo-xmin/pull/5) + +- [Display categories and tags on a page](https://github.com/yihui/hugo-xmin/pull/2) + +- [Add a table of contents](https://github.com/yihui/hugo-xmin/pull/7) + +- [Add a link in the footer of each page to "Edit this page" on Github](https://github.com/yihui/hugo-xmin/pull/6) + +To fully understand these examples, you have to read [the section on Hugo templates](https://bookdown.org/yihui/blogdown/templates.html) in the **blogdown** book. + +# Design philosophy + +Lastly, a few words about my design philosophy for this theme: I have been relying on existing frameworks like Bootstrap for years since I'm not really a designer, and I was always scared by the complexity of CSS. + +When I started writing this theme, I asked myself, "_What if I just write from scratch?_" No Bootstrap. No Normalize.css. I don't care about IE (life could be so much easier without IE) or inconsistencies among browsers (for personal websites). As long as the theme looks okay in Chrome, Firefox, and Safari, I'm done. Thanks to the simplicity of Markdown, you cannot really produce very complicated HTML, and I think styling the HTML output from Markdown is much simpler than general HTML documents. For example, I do not need to care much about form elements like textareas or buttons. + +After I finished this theme, I started to wonder why I'd need `normalize.css` at all (it sounds like a religious belief). The default appearance of modern browsers actually looks pretty good in my eyes, after I tweak the typeface a little bit. + +Compared to inconsistencies across browsers, I care much more about these properties of HTML elements: + +- Tables should always be centered, and striped tables are easier to read especially when they are wide. Tables should not have vertical borders. +- An image should be centered if it is the only child element of a paragraph. +- The `max-width` of images, videos, and iframes should be `100%`. + +I hope you can enjoy this theme. The source code is [on Github](https://github.com/yihui/hugo-xmin). Happy hacking! diff --git a/themes/XMin/exampleSite/content/note/2017-06-13-a-quick-note.md b/themes/XMin/exampleSite/content/note/2017-06-13-a-quick-note.md new file mode 100644 index 0000000..9d855a4 --- /dev/null +++ b/themes/XMin/exampleSite/content/note/2017-06-13-a-quick-note.md @@ -0,0 +1,15 @@ +--- +title: A Quick Note on Two Beautiful Websites +author: Yihui Xie +date: '2017-06-13' +categories: + - Example +slug: a-quick-note +--- + +To me, the two most impressive websites based on **blogdown** are: + +1. [Rob J Hyndman](https://robjhyndman.com)'s personal website. +1. [Live Free or Dichotomize](http://livefreeordichotomize.com) by Lucy and Nick _et al_. + +I'm sure there will be more. diff --git a/themes/XMin/exampleSite/content/note/2017-06-14-another-note.md b/themes/XMin/exampleSite/content/note/2017-06-14-another-note.md new file mode 100644 index 0000000..76442de --- /dev/null +++ b/themes/XMin/exampleSite/content/note/2017-06-14-another-note.md @@ -0,0 +1,14 @@ +--- +title: Another Note on A blogdown Tutorial +author: Yihui Xie +date: '2017-06-14' +categories: + - Example +tags: + - Tutorial +slug: another-note +--- + +I just discovered [an awesome tutorial](https://apreshill.rbind.io/post/up-and-running-with-blogdown/) on **blogdown** written by Alison. I have to admit this is _the_ best **blogdown** tutorial I have seen so far. + +![Alison's blogdown tutorial](https://alison.rbind.io/post/2017-06-12-up-and-running-with-blogdown/blogdown-signpost-1.png) diff --git a/themes/XMin/exampleSite/content/post/2015-07-23-lorem-ipsum.md b/themes/XMin/exampleSite/content/post/2015-07-23-lorem-ipsum.md new file mode 100644 index 0000000..ef58622 --- /dev/null +++ b/themes/XMin/exampleSite/content/post/2015-07-23-lorem-ipsum.md @@ -0,0 +1,18 @@ +--- +title: Lorem Ipsum +date: '2015-07-23' +categories: + - Example +tags: + - Markdown +--- + +**Lorem ipsum** dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore _magna aliqua_. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. + +Quisque mattis volutpat lorem vitae feugiat. Praesent porta est quis porta imperdiet. Aenean porta, mi non cursus volutpat, mi est mollis libero, id suscipit orci urna a augue. In fringilla euismod lacus, vitae tristique massa ultricies vitae. Mauris accumsan ligula tristique, viverra nulla sed, porta sapien. Vestibulum facilisis nec nisl blandit convallis. Maecenas venenatis porta malesuada. Ut ac erat tortor. Orci varius natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nulla sodales quam sit amet tincidunt egestas. In et turpis at orci vestibulum ullamcorper. Aliquam sed ante libero. Sed hendrerit arcu lacus. + +> Sed luctus volutpat sem in dapibus. Ut pellentesque vitae magna ac mattis. Sed vestibulum, nulla at condimentum semper, magna quam posuere dui, quis sagittis enim nisi eget ex. Vivamus tempor erat a sem dapibus porta. Fusce varius dapibus tempus. Nam bibendum dignissim fringilla. Phasellus eu justo facilisis, ullamcorper urna in, feugiat mauris. Quisque dignissim purus vitae ullamcorper scelerisque. Sed at magna at nisi consequat euismod. Curabitur justo ex, efficitur in fermentum luctus, tincidunt nec lectus. Aliquam a neque metus. Etiam nulla nunc, tristique vitae accumsan ullamcorper, placerat eget nunc. Cras porta eleifend dolor maximus molestie. Etiam vitae pellentesque turpis, quis accumsan ligula. Mauris auctor, nisi nec ullamcorper pulvinar, libero magna sagittis enim, sollicitudin dignissim urna justo et tortor. + +Morbi non sem euismod, suscipit purus id, gravida velit. Quisque mollis luctus ligula non suscipit. Curabitur massa arcu, aliquam ac dolor a, pellentesque dignissim dui. Donec at vestibulum magna. Quisque fermentum, tortor id sodales egestas, ligula ligula interdum ipsum, et volutpat elit massa vitae nibh. Morbi eleifend libero quis pretium viverra. Etiam congue, velit ac vestibulum finibus, velit nibh fringilla purus, eu semper dui est eu nunc. Etiam feugiat scelerisque diam vitae sodales. Etiam luctus in urna eu lobortis. Nam vestibulum eros et nibh elementum ullamcorper. Nam tristique porttitor orci, nec pretium est vestibulum at. Quisque posuere semper orci, vel semper justo commodo sed. Nullam accumsan risus rhoncus fringilla porta. Morbi interdum condimentum pharetra. Donec eu elit quam. Vivamus eleifend posuere mi, vel accumsan urna sollicitudin ut. + +Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Nulla nec nunc felis. Sed bibendum vel leo id semper. Maecenas vitae iaculis ante. Nam ut tempor est, eu molestie augue. Quisque tincidunt sagittis odio sed tristique. Aenean et felis quis mi viverra consequat. diff --git a/themes/XMin/exampleSite/content/post/2016-02-14-hello-markdown.md b/themes/XMin/exampleSite/content/post/2016-02-14-hello-markdown.md new file mode 100644 index 0000000..21ee28d --- /dev/null +++ b/themes/XMin/exampleSite/content/post/2016-02-14-hello-markdown.md @@ -0,0 +1,92 @@ +--- +title: A Plain Markdown Post +author: Yihui Xie +date: '2016-02-14' +categories: + - Example + - Hugo +tags: + - blogdown + - Markdown + - MathJax + - Pandoc + - RStudio +--- + +This sample post is mainly for [**blogdown**](https://github.com/rstudio/blogdown) users. If you do not use **blogdown**, you can skip the first section. + +# 1. Markdown or R Markdown + +This is a post written in plain Markdown (`*.md`) instead of R Markdown (`*.Rmd`). The major differences are: + +1. You cannot run any R code in a plain Markdown document, whereas in an R Markdown document, you can embed R code chunks (```` ```{r} ````); +2. A plain Markdown post is rendered through [Blackfriday](https://gohugo.io/overview/configuration/), and an R Markdown document is compiled by [**rmarkdown**](http://rmarkdown.rstudio.com) and [Pandoc](http://pandoc.org). + +There are many differences in syntax between Blackfriday's Markdown and Pandoc's Markdown. For example, you can write a task list with Blackfriday but not with Pandoc: + +- [x] Write an R package. +- [ ] Write a book. +- [ ] ... +- [ ] Profit! + +Similarly, Blackfriday does not support LaTeX math and Pandoc does. I have added the MathJax support to this theme ([hugo-xmin](https://github.com/yihui/hugo-xmin)) but there is a caveat for plain Markdown posts: you have to include math expressions in a pair of backticks (inline: `` `$ $` ``; display style: `` `$$ $$` ``), e.g., `$S_n = \sum_{i=1}^n X_i$`.^[This is because we have to protect the math expressions from being interpreted as Markdown.] For R Markdown posts, you do not need the backticks, because Pandoc can identify and process math expressions. + +When creating a new post, you have to decide whether the post format is Markdown or R Markdown, and this can be done via the `rmd` argument of the function `blogdown::new_post()`, e.g. + +```r +blogdown::new_post("Post Title", rmd = FALSE) +``` + +Actually I recommend you to use the RStudio addin "New Post" instead: + +![RStudio addin New Post](https://bookdown.org/yihui/blogdown/images/new-post.png) + +# 2. Sample Text + +## Second-level header + +### Third-level header + +#### Fourth-level header + +A paragraph (with a footnote): + +**Lorem ipsum** dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore _magna aliqua_. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.^[I'm sure you are bored by the text here.] + +A blockquote (a gray bar at the left and lightgray background): + +> Quisque mattis volutpat lorem vitae feugiat. Praesent porta est quis porta imperdiet. Aenean porta, mi non cursus volutpat, mi est mollis libero, id suscipit orci urna a augue. In fringilla euismod lacus, vitae tristique massa ultricies vitae. Mauris accumsan ligula tristique, viverra nulla sed, porta sapien. Vestibulum facilisis nec nisl blandit convallis. Maecenas venenatis porta malesuada. Ut ac erat tortor. Orci varius natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nulla sodales quam sit amet tincidunt egestas. In et turpis at orci vestibulum ullamcorper. Aliquam sed ante libero. Sed hendrerit arcu lacus. + +Some code (with a drop-shadow effect): + +```js +(function() { + var quotes = document.getElementsByTagName('blockquote'), i, quote; + for (i = 0; i < quotes.length; i++) { + quote = quotes[i]; + var n = quote.children.length; + if (n === 0) continue; + var el = quote.children[n - 1]; + if (!el || el.nodeName !== 'P') continue; + // right-align a quote footer if it starts with --- + if (/^—/.test(el.textContent)) el.style.textAlign = 'right'; + } +})(); +``` + +A table (centered by default): + +| Sepal.Length| Sepal.Width| Petal.Length| Petal.Width|Species | +|------------:|-----------:|------------:|-----------:|:-------| +| 5.1| 3.5| 1.4| 0.2|setosa | +| 4.9| 3.0| 1.4| 0.2|setosa | +| 4.7| 3.2| 1.3| 0.2|setosa | +| 4.6| 3.1| 1.5| 0.2|setosa | +| 5.0| 3.6| 1.4| 0.2|setosa | +| 5.4| 3.9| 1.7| 0.4|setosa | + +An image (automatically centered when it is appropriate): + +![Happy Elmo](https://slides.yihui.org/gif/happy-elmo.gif) + +Looks good? diff --git a/themes/XMin/exampleSite/layouts/partials/foot_custom.html b/themes/XMin/exampleSite/layouts/partials/foot_custom.html new file mode 100644 index 0000000..3389d46 --- /dev/null +++ b/themes/XMin/exampleSite/layouts/partials/foot_custom.html @@ -0,0 +1,4 @@ + + + + diff --git a/themes/XMin/hugo-xmin.Rproj b/themes/XMin/hugo-xmin.Rproj new file mode 100644 index 0000000..d64e28b --- /dev/null +++ b/themes/XMin/hugo-xmin.Rproj @@ -0,0 +1,16 @@ +Version: 1.0 + +RestoreWorkspace: Default +SaveWorkspace: Default +AlwaysSaveHistory: Default + +EnableCodeIndexing: Yes +UseSpacesForTab: Yes +NumSpacesForTab: 2 +Encoding: UTF-8 + +RnwWeave: knitr +LaTeX: pdfLaTeX + +AutoAppendNewline: Yes +StripTrailingWhitespace: Yes diff --git a/themes/XMin/images/screenshot.png b/themes/XMin/images/screenshot.png new file mode 100644 index 0000000..3df0a14 Binary files /dev/null and b/themes/XMin/images/screenshot.png differ diff --git a/themes/XMin/images/tn.png b/themes/XMin/images/tn.png new file mode 100644 index 0000000..389a20c Binary files /dev/null and b/themes/XMin/images/tn.png differ diff --git a/themes/XMin/layouts/404.html b/themes/XMin/layouts/404.html new file mode 100644 index 0000000..c2e4e40 --- /dev/null +++ b/themes/XMin/layouts/404.html @@ -0,0 +1,5 @@ +{{ partial "header.html" . }} + +404 NOT FOUND + +{{ partial "footer.html" . }} diff --git a/themes/XMin/layouts/_default/list.html b/themes/XMin/layouts/_default/list.html new file mode 100644 index 0000000..06b290a --- /dev/null +++ b/themes/XMin/layouts/_default/list.html @@ -0,0 +1,20 @@ +{{ partial "header.html" . }} + +{{if not .IsHome }} +

{{ .Title | markdownify }}

+{{ end }} + +{{ .Content }} + + + +{{ partial "footer.html" . }} diff --git a/themes/XMin/layouts/_default/single.html b/themes/XMin/layouts/_default/single.html new file mode 100644 index 0000000..de3f121 --- /dev/null +++ b/themes/XMin/layouts/_default/single.html @@ -0,0 +1,12 @@ +{{ partial "header.html" . }} +
+

{{ .Title | markdownify }}

+{{ with .Params.author }}

{{ . }}

{{ end }} +{{ if (gt .Params.date 0) }}

{{ .Date.Format "2006/01/02" }}

{{ end }} +
+ +
+{{ .Content }} +
+ +{{ partial "footer.html" . }} diff --git a/themes/XMin/layouts/_default/terms.html b/themes/XMin/layouts/_default/terms.html new file mode 100644 index 0000000..71f47e7 --- /dev/null +++ b/themes/XMin/layouts/_default/terms.html @@ -0,0 +1,13 @@ +{{ partial "header.html" . }} + +

{{ .Title }}

+ + + +{{ partial "footer.html" . }} diff --git a/themes/XMin/layouts/partials/foot_custom.html b/themes/XMin/layouts/partials/foot_custom.html new file mode 100644 index 0000000..e69de29 diff --git a/themes/XMin/layouts/partials/footer.html b/themes/XMin/layouts/partials/footer.html new file mode 100644 index 0000000..3f46ea5 --- /dev/null +++ b/themes/XMin/layouts/partials/footer.html @@ -0,0 +1,9 @@ + + + diff --git a/themes/XMin/layouts/partials/head_custom.html b/themes/XMin/layouts/partials/head_custom.html new file mode 100644 index 0000000..e69de29 diff --git a/themes/XMin/layouts/partials/header.html b/themes/XMin/layouts/partials/header.html new file mode 100644 index 0000000..4f431eb --- /dev/null +++ b/themes/XMin/layouts/partials/header.html @@ -0,0 +1,20 @@ + + + + + + {{ .Title }} | {{ .Site.Title }} + + + {{ partial "head_custom.html" . }} + + + + diff --git a/themes/XMin/static/css/fonts.css b/themes/XMin/static/css/fonts.css new file mode 100644 index 0000000..8ffcecd --- /dev/null +++ b/themes/XMin/static/css/fonts.css @@ -0,0 +1,7 @@ +body { + font-family: Optima, Candara, Calibri, Arial, sans-serif; +} +code { + font-family: "Lucida Console", Monaco, monospace; + font-size: 85%; +} diff --git a/themes/XMin/static/css/style.css b/themes/XMin/static/css/style.css new file mode 100644 index 0000000..4dc3ae4 --- /dev/null +++ b/themes/XMin/static/css/style.css @@ -0,0 +1,51 @@ +body { + max-width: 800px; + margin: auto; + padding: 1em; + line-height: 1.5em; +} + +/* header and footer areas */ +.menu { padding: 0; } +.menu li { display: inline-block; } +.article-meta, .menu a { + text-decoration: none; + background: #eee; + padding: 5px; + border-radius: 5px; +} +.menu, .article-meta, footer { text-align: center; } +.title { font-size: 1.1em; } +footer a { text-decoration: none; } +hr { + border-style: dashed; + color: #ddd; +} + +/* code */ +pre { + border: 1px solid #ddd; + box-shadow: 5px 5px 5px #eee; + padding: 1em; + overflow-x: auto; +} +code { background: #f9f9f9; } +pre code { background: none; } + +/* misc elements */ +img, iframe, video { max-width: 100%; } +main { hyphens: auto; } +blockquote { + background: #f9f9f9; + border-left: 5px solid #ccc; + padding: 3px 1em 3px; +} + +table { + margin: auto; + border-top: 1px solid #666; + border-bottom: 1px solid #666; +} +table thead th { border-bottom: 1px solid #ddd; } +th, td { padding: 5px; } +thead, tfoot, tr:nth-child(even) { background: #eee; } diff --git a/themes/XMin/theme.toml b/themes/XMin/theme.toml new file mode 100644 index 0000000..4233eb6 --- /dev/null +++ b/themes/XMin/theme.toml @@ -0,0 +1,12 @@ +name = "XMin" +license = "MIT" +licenselink = "https://github.com/yihui/hugo-xmin/blob/master/LICENSE.md" +description = "eXtremely Minimal Hugo theme: about 150 lines of code in total, including HTML and CSS" +homepage = "https://xmin.yihui.org" +tags = ["minimal", "blog", "personal", "clean", "simple", "starter", "minimalist"] +features = ["blog"] +min_version = "0.18" + +[author] + name = "Yihui Xie" + homepage = "https://yihui.org" -- cgit v1.2.3-ZIG