diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000000..2ee88430a8 --- /dev/null +++ b/.gitignore @@ -0,0 +1,5 @@ +.Rproj.user +.Rhistory +.RData +.Ruserdata +public diff --git a/config.toml b/config.toml new file mode 100644 index 0000000000..bfdd670775 --- /dev/null +++ b/config.toml @@ -0,0 +1,46 @@ +baseurl = "/" +languageCode = "en-us" +title = "Hugo XMag" +theme = "hugo-xmag" +googleAnalytics = "" +disqusShortname = "" +ignoreFiles = ["\\.Rmd$", "_files$", "_cache$"] +preserveTaxonomyNames = true +footnotereturnlinkcontents = "↩" +hasCJKLanguage = true +enableEmoji = true +paginate = 6 + +[permalinks] + post = "/post/:year/:month/:day/:slug/" + +[[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" + +[params] + description = "A website built through Hugo and blogdown." + summary_length = 300 + github_edit = "https://github.com/yihui/hugo-xmag/edit/master/exampleSite/content/" + footer = "© [Yihui Xie](https://yihui.name) 2017 | [Github](https://github.com/yihui) | [Twitter](https://twitter.com/xieyihui)" + +[params.text] + back = "← Back to Home" + edit = "Edit this page →" + truncated = "…" diff --git a/content/_index.md b/content/_index.md new file mode 100644 index 0000000000..a2d43b12ec --- /dev/null +++ b/content/_index.md @@ -0,0 +1,3 @@ +--- +title: Hugo XMag +--- diff --git a/content/about.md b/content/about.md new file mode 100644 index 0000000000..eabbdc119a --- /dev/null +++ b/content/about.md @@ -0,0 +1,121 @@ +--- +title: About Hugo XMag +author: Yihui Xie +--- + +**XMag** is the second Hugo theme I have designed. It is based on my first Hugo theme [**XMin**](https://github.com/yihui/hugo-xmin), and similarly, features minimalism but with a magazine style on the homepage inspired by [The Signpost](https://en.wikipedia.org/wiki/Wikipedia:Wikipedia_Signpost) on Wikipedia. You can find its source code on Github: https://github.com/yihui/hugo-xmag (licensed under MIT). + +# Features + +This theme includes a few cool features: + +- Responsive article summary blocks on homepage + +- Thumbnails in summary blocks + +- Magazine title in Blackletter (𝔅𝔏𝔄ℭ𝔎 𝔏𝔈𝔗𝔗𝔈ℜ) + +- Github edit links + +- Author info and site info at the bottom of an article + +- Multiple authors of a single page + +- MathJax for LaTeX math expressions + +It also supports features that are probably not even worth mentioning: + +- Google Analytics + +- highlight.js for syntax highlighting of code blocks + +- Display categories and tags on single pages + +- Table of contents for single pages + +Most features can be configured through `config.toml`, and a few can be enabled by custom layouts. + +# config.toml + +By default, your site title will be displayed at the top in Blackletter fonts if your web browser and operating system support Blackletter fonts. Essentially, for every English letter `X` in your site title, it is substituted with `𝔛`, e.g. the Blackletter version of `A` is `𝔄` (𝔄). Below are the letters from A to Z: + +## 𝔄𝔅ℭ𝔇𝔈𝔉𝔊ℌℑ𝔍𝔎𝔏𝔐𝔑𝔒𝔓𝔔ℜ𝔖𝔗𝔘𝔙𝔚𝔛𝔜ℨ + +Alternatively, you can provide a banner image: + +```toml +[params.banner] + src = "/path/to/banner.png" + alt = "alternative text on image" +``` + +By default, each summary block on the homepage contains the first 200 letters extracted from all paragraphs of an article. I find Hugo's built in `.Summary` often unsatisfactory (e.g. it may contain headings and code blocks, which really should not go to the summary), so I wrote my own version. It works much better and the size of most summary blocks will be the same, unless certain articles are really short. The length 200 can be customized via `params.summary_length`. + +If you are not satisfied with the automatic summary, you can specify the `description` option in the (YAML) metadata of your Markdown document, e.g., + +```yaml +title: "My Cool Post" +description: "Please use this as the summary." +``` + +Each summary block may contain a thumbnail, which is the first image in an article if exists. You can override it by providing the `thumbnail` option in the meta data of your Markdown document, e.g., + +```yaml +--- +title: "My Cool Post" +thumbnail: "/url/of/the/image" +--- +``` + +For each page, this theme adds an edit link to the top-right if a parameter `github_edit` is provided, so that your reader may easily help you edit a page and submit a pull request on Github. + +The page footer can be defined in `.Params.footer`, and the text is treated as Markdown. Below are some sample configurations: + +```toml +[params] + summary_length = 200 + github_edit = "https://github.com/yihui/hugo-xmag/edit/master/exampleSite/content/" + footer = "© [Yihui Xie](https://yihui.name) 2017" +``` + +There are a few phrases that you can "translate" (I didn't use Hugo's multi-language feature just because I'm lazy): + +```toml +[params.text] + about_author = "About the Author" + author_delimiter = ", " + back = "Back to Home" + edit = "Edit this page" + tags = "Tags: " + truncated = " …" + uncategorized = "Uncategorized" +``` + +You can define a data file under `data/` to store all authors information, e.g., you can use a TOML file `data/authors.toml` (or YAML/JSON): + +``` +"Alice Wonder" = "I'm Alice. More about me on [my homepage](http://example.com)." +"Yihui Xie" = "Hey this is Yihui. You don't want to follow me on Twitter @xieyihui." +``` + +Then for an article with an author name that can be found in `data/authors.toml`, the author info will be added to the bottom of a page. For example, on this page, you can find information about me. You can change the phrase "About the Author" by changing the parameter `about_author` in `config.toml`. + +To add a table of contents to an article, you can add `toc: true` to the YAML metadata of the Markdown document. + +# Custom layouts + +Besides the custom layout^[If this is the first time you have heard about "customizing layouts", please read the Hugo documentation first: https://gohugo.io/themes/customizing/.] files `head_custom.html` and `foot_custom.html` supported in **XMin** (see [documentation](https://xmin.yihui.name/about/)), this theme added a few more layout files such as `banner.html`, `comments.html` and `info.html` under `layouts/partials/`. The first can be used to customize the banner. The second can be used to add a comment section, e.g., if you want to use Hugo's default Disqus template, just add this to `comments.html`: + +``` +{{ template "_internal/disqus.html" . }} +``` + +You can also append arbitrary text to each article through `info.html`. For example, you may declare copyrights or briefly introduce your site. + +There are other partial templates in this theme and I encourage you to read the source code to figure out what they do. + +# Final words + +I feel the world has become so noisy that I'm often at a loss when looking at a web page, because there are so many things to distract me. I was heavily influenced by the book [_Amusing Ourselves to Death_](https://en.wikipedia.org/wiki/Amusing_Ourselves_to_Death) after I read it in early 2017. From then on, I was hoping to design a theme for a website that gives articles the top priority. Everything else must give way to articles. That is why the navigation menu is at the bottom instead of in the conventional position (top or sidebar). There isn't much to do other than reading an article when you open a page. By the way, this is a pure plain-text theme. You can certainly add images if you want, but this theme itself contains zero binary files. Out of my [OCD](https://en.wikipedia.org/wiki/Obsessive%E2%80%93compulsive_disorder), I was just trying to push the limits of web design without using any images or JavaScript libraries (I'm a totally amateur).^[I used MathJax and highlight.js anyway in this theme because they are helpful.] + +I hope you can enjoy this theme. Again, the source code is [on Github](https://github.com/yihui/hugo-xmag). Happy hacking! diff --git a/content/post/2015-07-23-lorem-ipsum.md b/content/post/2015-07-23-lorem-ipsum.md new file mode 100644 index 0000000000..f8f9c11f5b --- /dev/null +++ b/content/post/2015-07-23-lorem-ipsum.md @@ -0,0 +1,21 @@ +--- +title: Jeff Leek is the Uniformly Most Powerful Jeff +author: Michael Hoffman +date: '2015-07-23' +categories: + - Statistics +tags: + - Markdown + - Lorem Ipsum +thumbnail: https://db.yihui.name/images/saga7.gif +--- + +**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/content/post/2015-07-23-lorem-ipsum2.md b/content/post/2015-07-23-lorem-ipsum2.md new file mode 100644 index 0000000000..6f02cd77de --- /dev/null +++ b/content/post/2015-07-23-lorem-ipsum2.md @@ -0,0 +1,21 @@ +--- +title: Jeff Leek always obtains unbiased estimators +author: Mauricio Vargas +date: '2015-07-24' +categories: + - Statistics +tags: + - Markdown + - Lorem Ipsum +thumbnail: https://db.yihui.name/imgur/4rHon0B.png +--- + +**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/content/post/2015-07-23-lorem-ipsum3.md b/content/post/2015-07-23-lorem-ipsum3.md new file mode 100644 index 0000000000..3672c495f4 --- /dev/null +++ b/content/post/2015-07-23-lorem-ipsum3.md @@ -0,0 +1,21 @@ +--- +title: Git commits to Jeff Leek +author: Martin J Frigaard +date: '2015-07-25' +categories: + - Tech +tags: + - Markdown + - Lorem Ipsum +thumbnail: https://db.yihui.name/images/git-diff-gui.png +--- + +**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/content/post/2015-07-23-lorem-ipsum4.md b/content/post/2015-07-23-lorem-ipsum4.md new file mode 100644 index 0000000000..2a89fa850f --- /dev/null +++ b/content/post/2015-07-23-lorem-ipsum4.md @@ -0,0 +1,21 @@ +--- +title: Jeff Leek counted to infinity. Twice. +author: Brian Caffo +date: '2015-07-26' +categories: + - Leekaso +tags: + - Markdown + - Lorem Ipsum +thumbnail: https://db.yihui.name/imgur/2R9iyPv.jpg +--- + +**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/content/post/2015-07-23-lorem-ipsum5.md b/content/post/2015-07-23-lorem-ipsum5.md new file mode 100644 index 0000000000..11e1645494 --- /dev/null +++ b/content/post/2015-07-23-lorem-ipsum5.md @@ -0,0 +1,21 @@ +--- +title: Correlation implies whatever Jeff Leek tells it to imply +author: Kenny Shirley +date: '2015-07-27' +categories: + - Leekaso +tags: + - Markdown + - Lorem Ipsum +thumbnail: https://db.yihui.name/imgur/3mdv0k9.jpg +--- + +**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/content/post/2015-07-23-lorem-ipsum6.md b/content/post/2015-07-23-lorem-ipsum6.md new file mode 100644 index 0000000000..a7b96ae15f --- /dev/null +++ b/content/post/2015-07-23-lorem-ipsum6.md @@ -0,0 +1,21 @@ +--- +title: Jeff Leek can do zero-fold cross-validation +date: '2015-07-28' +author: Thomas Lumley +categories: + - Machine Learning +tags: + - Markdown + - Lorem Ipsum +thumbnail: https://db.yihui.name/imgur/CwBsAqs.png +--- + +**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/content/post/2015-07-23-r-rmarkdown.Rmd b/content/post/2015-07-23-r-rmarkdown.Rmd new file mode 100644 index 0000000000..48298a8d9a --- /dev/null +++ b/content/post/2015-07-23-r-rmarkdown.Rmd @@ -0,0 +1,37 @@ +--- +title: "Hello R Markdown" +author: "Frida Gomam" +date: 2015-07-23T21:13:14-05:00 +categories: ["R"] +tags: ["R Markdown", "plot", "regression"] +--- + +```{r setup, include=FALSE} +knitr::opts_chunk$set(collapse = TRUE) +``` + +# R Markdown + +This is an R Markdown document. Markdown is a simple formatting syntax for authoring HTML, PDF, and MS Word documents. For more details on using R Markdown see . + +You can embed an R code chunk like this: + +```{r cars} +summary(cars) +fit <- lm(dist ~ speed, data = cars) +fit +``` + +# Including Plots + +You can also embed plots. See Figure \@ref(fig:pie) for example: + +```{r pie, fig.cap='A fancy pie chart.', tidy=FALSE} +par(mar = c(0, 1, 0, 1)) +pie( + c(280, 60, 20), + c('Sky', 'Sunny side of pyramid', 'Shady side of pyramid'), + col = c('#0292D8', '#F7EA39', '#C4B632'), + init.angle = -50, border = NA +) +``` diff --git a/content/post/2017-02-14-hello-markdown.md b/content/post/2017-02-14-hello-markdown.md new file mode 100644 index 0000000000..30b62df5d2 --- /dev/null +++ b/content/post/2017-02-14-hello-markdown.md @@ -0,0 +1,89 @@ +--- +title: A Plain Markdown Post +author: + - Yihui Xie + - Frida Gomam +date: '2017-02-14' +categories: + - Example + - Hugo +tags: + - blogdown + - Markdown + - MathJax + - Pandoc + - RStudio +toc: true +--- + +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. To know more about the Hugo XMag theme, please read the [About](/about/) page. + +# 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-xmag)) 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. You may not need the backticks if your math expression does not contain any special Markdown syntax such as underscores or asterisks, but it is always a safer choice to use backticks. When you happen to have a pair of literal dollar signs inside the same element, you can escape one dollar sign, e.g., `\$50 and $100` renders "\$50 and $100".] For R Markdown posts, you do not need the backticks, because Pandoc can identify and process math expressions. + +When creating a new post, I recommend you to use the RStudio addin "New Post": + +![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.name/gif/happy-elmo.gif) + +Looks good? diff --git a/daily.Rproj b/daily.Rproj new file mode 100644 index 0000000000..875ffc98c9 --- /dev/null +++ b/daily.Rproj @@ -0,0 +1,15 @@ +Version: 1.0 + +RestoreWorkspace: Default +SaveWorkspace: Default +AlwaysSaveHistory: Default + +EnableCodeIndexing: Yes +UseSpacesForTab: Yes +NumSpacesForTab: 8 +Encoding: UTF-8 + +RnwWeave: knitr +LaTeX: XeLaTeX + +BuildType: Website diff --git a/data/authors.yaml b/data/authors.yaml new file mode 100644 index 0000000000..800a25ad60 --- /dev/null +++ b/data/authors.yaml @@ -0,0 +1,2 @@ +"Yihui Xie": "Yihui Xie is currently a softwaren engineer at [RStudio](https://www.rstudio.com). You can find more information about him at https://yihui.name." +"Frida Gomam": "Frida Gomam is a joke." diff --git a/index.Rmd b/index.Rmd new file mode 100644 index 0000000000..b8510951d8 --- /dev/null +++ b/index.Rmd @@ -0,0 +1,3 @@ +--- +site: blogdown:::blogdown_site +--- diff --git a/themes/hugo-xmag/.gitignore b/themes/hugo-xmag/.gitignore new file mode 100644 index 0000000000..ce130a0a8a --- /dev/null +++ b/themes/hugo-xmag/.gitignore @@ -0,0 +1,5 @@ +.Rproj.user +.Rhistory +.RData +.Ruserdata +exampleSite/public diff --git a/themes/hugo-xmag/LICENSE.md b/themes/hugo-xmag/LICENSE.md new file mode 100644 index 0000000000..fa77e18e60 --- /dev/null +++ b/themes/hugo-xmag/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/hugo-xmag/README.md b/themes/hugo-xmag/README.md new file mode 100644 index 0000000000..310dda5bcb --- /dev/null +++ b/themes/hugo-xmag/README.md @@ -0,0 +1,31 @@ +# HUGO XMAG + +**XMag** is designed based on the Hugo theme [**XMin**](https://github.com/yihui/hugo-xmin), and similarly, features minimalism but with a magazine style on the homepage inspired by [The Signpost](https://en.wikipedia.org/wiki/Wikipedia:Wikipedia_Signpost) on Wikipedia. + +This theme includes a few cool features: + +- Responsive article summary blocks on homepage + +- Thumbnails in summary blocks + +- Magazine title in Blackletter (𝔅𝔏𝔄ℭ𝔎 𝔏𝔈𝔗𝔗𝔈ℜ) + +- Github edit links + +- Author info and site info at the bottom of an article + +- MathJax for LaTeX math expressions + +It also supports features that are probably not even worth mentioning: + +- Google Analytics + +- highlight.js for syntax highlighting of code blocks + +- Display categories and tags on single pages + +- Table of contents for single pages + +Most features can be configured through `config.toml`, and a few can be enabled by custom layouts. Please see the detailed documentation on the [About](https://xmag.yihui.name/about/) page of the theme website. The source code is available [on Github](https://github.com/yihui/hugo-xmag) (MIT license). + +[![Screenshot](https://github.com/yihui/hugo-xmag/raw/master/images/screenshot.png)](https://xmag.yihui.name) diff --git a/themes/hugo-xmag/archetypes/default.md b/themes/hugo-xmag/archetypes/default.md new file mode 100644 index 0000000000..fb98e92c44 --- /dev/null +++ b/themes/hugo-xmag/archetypes/default.md @@ -0,0 +1,4 @@ +--- +title: '' +date: '' +--- diff --git a/themes/hugo-xmag/exampleSite/config.toml b/themes/hugo-xmag/exampleSite/config.toml new file mode 100644 index 0000000000..bfdd670775 --- /dev/null +++ b/themes/hugo-xmag/exampleSite/config.toml @@ -0,0 +1,46 @@ +baseurl = "/" +languageCode = "en-us" +title = "Hugo XMag" +theme = "hugo-xmag" +googleAnalytics = "" +disqusShortname = "" +ignoreFiles = ["\\.Rmd$", "_files$", "_cache$"] +preserveTaxonomyNames = true +footnotereturnlinkcontents = "↩" +hasCJKLanguage = true +enableEmoji = true +paginate = 6 + +[permalinks] + post = "/post/:year/:month/:day/:slug/" + +[[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" + +[params] + description = "A website built through Hugo and blogdown." + summary_length = 300 + github_edit = "https://github.com/yihui/hugo-xmag/edit/master/exampleSite/content/" + footer = "© [Yihui Xie](https://yihui.name) 2017 | [Github](https://github.com/yihui) | [Twitter](https://twitter.com/xieyihui)" + +[params.text] + back = "← Back to Home" + edit = "Edit this page →" + truncated = "…" diff --git a/themes/hugo-xmag/exampleSite/content/_index.md b/themes/hugo-xmag/exampleSite/content/_index.md new file mode 100644 index 0000000000..a2d43b12ec --- /dev/null +++ b/themes/hugo-xmag/exampleSite/content/_index.md @@ -0,0 +1,3 @@ +--- +title: Hugo XMag +--- diff --git a/themes/hugo-xmag/exampleSite/content/about.md b/themes/hugo-xmag/exampleSite/content/about.md new file mode 100644 index 0000000000..eabbdc119a --- /dev/null +++ b/themes/hugo-xmag/exampleSite/content/about.md @@ -0,0 +1,121 @@ +--- +title: About Hugo XMag +author: Yihui Xie +--- + +**XMag** is the second Hugo theme I have designed. It is based on my first Hugo theme [**XMin**](https://github.com/yihui/hugo-xmin), and similarly, features minimalism but with a magazine style on the homepage inspired by [The Signpost](https://en.wikipedia.org/wiki/Wikipedia:Wikipedia_Signpost) on Wikipedia. You can find its source code on Github: https://github.com/yihui/hugo-xmag (licensed under MIT). + +# Features + +This theme includes a few cool features: + +- Responsive article summary blocks on homepage + +- Thumbnails in summary blocks + +- Magazine title in Blackletter (𝔅𝔏𝔄ℭ𝔎 𝔏𝔈𝔗𝔗𝔈ℜ) + +- Github edit links + +- Author info and site info at the bottom of an article + +- Multiple authors of a single page + +- MathJax for LaTeX math expressions + +It also supports features that are probably not even worth mentioning: + +- Google Analytics + +- highlight.js for syntax highlighting of code blocks + +- Display categories and tags on single pages + +- Table of contents for single pages + +Most features can be configured through `config.toml`, and a few can be enabled by custom layouts. + +# config.toml + +By default, your site title will be displayed at the top in Blackletter fonts if your web browser and operating system support Blackletter fonts. Essentially, for every English letter `X` in your site title, it is substituted with `𝔛`, e.g. the Blackletter version of `A` is `𝔄` (𝔄). Below are the letters from A to Z: + +## 𝔄𝔅ℭ𝔇𝔈𝔉𝔊ℌℑ𝔍𝔎𝔏𝔐𝔑𝔒𝔓𝔔ℜ𝔖𝔗𝔘𝔙𝔚𝔛𝔜ℨ + +Alternatively, you can provide a banner image: + +```toml +[params.banner] + src = "/path/to/banner.png" + alt = "alternative text on image" +``` + +By default, each summary block on the homepage contains the first 200 letters extracted from all paragraphs of an article. I find Hugo's built in `.Summary` often unsatisfactory (e.g. it may contain headings and code blocks, which really should not go to the summary), so I wrote my own version. It works much better and the size of most summary blocks will be the same, unless certain articles are really short. The length 200 can be customized via `params.summary_length`. + +If you are not satisfied with the automatic summary, you can specify the `description` option in the (YAML) metadata of your Markdown document, e.g., + +```yaml +title: "My Cool Post" +description: "Please use this as the summary." +``` + +Each summary block may contain a thumbnail, which is the first image in an article if exists. You can override it by providing the `thumbnail` option in the meta data of your Markdown document, e.g., + +```yaml +--- +title: "My Cool Post" +thumbnail: "/url/of/the/image" +--- +``` + +For each page, this theme adds an edit link to the top-right if a parameter `github_edit` is provided, so that your reader may easily help you edit a page and submit a pull request on Github. + +The page footer can be defined in `.Params.footer`, and the text is treated as Markdown. Below are some sample configurations: + +```toml +[params] + summary_length = 200 + github_edit = "https://github.com/yihui/hugo-xmag/edit/master/exampleSite/content/" + footer = "© [Yihui Xie](https://yihui.name) 2017" +``` + +There are a few phrases that you can "translate" (I didn't use Hugo's multi-language feature just because I'm lazy): + +```toml +[params.text] + about_author = "About the Author" + author_delimiter = ", " + back = "Back to Home" + edit = "Edit this page" + tags = "Tags: " + truncated = " …" + uncategorized = "Uncategorized" +``` + +You can define a data file under `data/` to store all authors information, e.g., you can use a TOML file `data/authors.toml` (or YAML/JSON): + +``` +"Alice Wonder" = "I'm Alice. More about me on [my homepage](http://example.com)." +"Yihui Xie" = "Hey this is Yihui. You don't want to follow me on Twitter @xieyihui." +``` + +Then for an article with an author name that can be found in `data/authors.toml`, the author info will be added to the bottom of a page. For example, on this page, you can find information about me. You can change the phrase "About the Author" by changing the parameter `about_author` in `config.toml`. + +To add a table of contents to an article, you can add `toc: true` to the YAML metadata of the Markdown document. + +# Custom layouts + +Besides the custom layout^[If this is the first time you have heard about "customizing layouts", please read the Hugo documentation first: https://gohugo.io/themes/customizing/.] files `head_custom.html` and `foot_custom.html` supported in **XMin** (see [documentation](https://xmin.yihui.name/about/)), this theme added a few more layout files such as `banner.html`, `comments.html` and `info.html` under `layouts/partials/`. The first can be used to customize the banner. The second can be used to add a comment section, e.g., if you want to use Hugo's default Disqus template, just add this to `comments.html`: + +``` +{{ template "_internal/disqus.html" . }} +``` + +You can also append arbitrary text to each article through `info.html`. For example, you may declare copyrights or briefly introduce your site. + +There are other partial templates in this theme and I encourage you to read the source code to figure out what they do. + +# Final words + +I feel the world has become so noisy that I'm often at a loss when looking at a web page, because there are so many things to distract me. I was heavily influenced by the book [_Amusing Ourselves to Death_](https://en.wikipedia.org/wiki/Amusing_Ourselves_to_Death) after I read it in early 2017. From then on, I was hoping to design a theme for a website that gives articles the top priority. Everything else must give way to articles. That is why the navigation menu is at the bottom instead of in the conventional position (top or sidebar). There isn't much to do other than reading an article when you open a page. By the way, this is a pure plain-text theme. You can certainly add images if you want, but this theme itself contains zero binary files. Out of my [OCD](https://en.wikipedia.org/wiki/Obsessive%E2%80%93compulsive_disorder), I was just trying to push the limits of web design without using any images or JavaScript libraries (I'm a totally amateur).^[I used MathJax and highlight.js anyway in this theme because they are helpful.] + +I hope you can enjoy this theme. Again, the source code is [on Github](https://github.com/yihui/hugo-xmag). Happy hacking! diff --git a/themes/hugo-xmag/exampleSite/content/post/2015-07-23-lorem-ipsum.md b/themes/hugo-xmag/exampleSite/content/post/2015-07-23-lorem-ipsum.md new file mode 100644 index 0000000000..f8f9c11f5b --- /dev/null +++ b/themes/hugo-xmag/exampleSite/content/post/2015-07-23-lorem-ipsum.md @@ -0,0 +1,21 @@ +--- +title: Jeff Leek is the Uniformly Most Powerful Jeff +author: Michael Hoffman +date: '2015-07-23' +categories: + - Statistics +tags: + - Markdown + - Lorem Ipsum +thumbnail: https://db.yihui.name/images/saga7.gif +--- + +**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/hugo-xmag/exampleSite/content/post/2015-07-23-lorem-ipsum2.md b/themes/hugo-xmag/exampleSite/content/post/2015-07-23-lorem-ipsum2.md new file mode 100644 index 0000000000..6f02cd77de --- /dev/null +++ b/themes/hugo-xmag/exampleSite/content/post/2015-07-23-lorem-ipsum2.md @@ -0,0 +1,21 @@ +--- +title: Jeff Leek always obtains unbiased estimators +author: Mauricio Vargas +date: '2015-07-24' +categories: + - Statistics +tags: + - Markdown + - Lorem Ipsum +thumbnail: https://db.yihui.name/imgur/4rHon0B.png +--- + +**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/hugo-xmag/exampleSite/content/post/2015-07-23-lorem-ipsum3.md b/themes/hugo-xmag/exampleSite/content/post/2015-07-23-lorem-ipsum3.md new file mode 100644 index 0000000000..3672c495f4 --- /dev/null +++ b/themes/hugo-xmag/exampleSite/content/post/2015-07-23-lorem-ipsum3.md @@ -0,0 +1,21 @@ +--- +title: Git commits to Jeff Leek +author: Martin J Frigaard +date: '2015-07-25' +categories: + - Tech +tags: + - Markdown + - Lorem Ipsum +thumbnail: https://db.yihui.name/images/git-diff-gui.png +--- + +**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/hugo-xmag/exampleSite/content/post/2015-07-23-lorem-ipsum4.md b/themes/hugo-xmag/exampleSite/content/post/2015-07-23-lorem-ipsum4.md new file mode 100644 index 0000000000..2a89fa850f --- /dev/null +++ b/themes/hugo-xmag/exampleSite/content/post/2015-07-23-lorem-ipsum4.md @@ -0,0 +1,21 @@ +--- +title: Jeff Leek counted to infinity. Twice. +author: Brian Caffo +date: '2015-07-26' +categories: + - Leekaso +tags: + - Markdown + - Lorem Ipsum +thumbnail: https://db.yihui.name/imgur/2R9iyPv.jpg +--- + +**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/hugo-xmag/exampleSite/content/post/2015-07-23-lorem-ipsum5.md b/themes/hugo-xmag/exampleSite/content/post/2015-07-23-lorem-ipsum5.md new file mode 100644 index 0000000000..11e1645494 --- /dev/null +++ b/themes/hugo-xmag/exampleSite/content/post/2015-07-23-lorem-ipsum5.md @@ -0,0 +1,21 @@ +--- +title: Correlation implies whatever Jeff Leek tells it to imply +author: Kenny Shirley +date: '2015-07-27' +categories: + - Leekaso +tags: + - Markdown + - Lorem Ipsum +thumbnail: https://db.yihui.name/imgur/3mdv0k9.jpg +--- + +**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/hugo-xmag/exampleSite/content/post/2015-07-23-lorem-ipsum6.md b/themes/hugo-xmag/exampleSite/content/post/2015-07-23-lorem-ipsum6.md new file mode 100644 index 0000000000..a7b96ae15f --- /dev/null +++ b/themes/hugo-xmag/exampleSite/content/post/2015-07-23-lorem-ipsum6.md @@ -0,0 +1,21 @@ +--- +title: Jeff Leek can do zero-fold cross-validation +date: '2015-07-28' +author: Thomas Lumley +categories: + - Machine Learning +tags: + - Markdown + - Lorem Ipsum +thumbnail: https://db.yihui.name/imgur/CwBsAqs.png +--- + +**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/hugo-xmag/exampleSite/content/post/2017-02-14-hello-markdown.md b/themes/hugo-xmag/exampleSite/content/post/2017-02-14-hello-markdown.md new file mode 100644 index 0000000000..30b62df5d2 --- /dev/null +++ b/themes/hugo-xmag/exampleSite/content/post/2017-02-14-hello-markdown.md @@ -0,0 +1,89 @@ +--- +title: A Plain Markdown Post +author: + - Yihui Xie + - Frida Gomam +date: '2017-02-14' +categories: + - Example + - Hugo +tags: + - blogdown + - Markdown + - MathJax + - Pandoc + - RStudio +toc: true +--- + +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. To know more about the Hugo XMag theme, please read the [About](/about/) page. + +# 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-xmag)) 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. You may not need the backticks if your math expression does not contain any special Markdown syntax such as underscores or asterisks, but it is always a safer choice to use backticks. When you happen to have a pair of literal dollar signs inside the same element, you can escape one dollar sign, e.g., `\$50 and $100` renders "\$50 and $100".] For R Markdown posts, you do not need the backticks, because Pandoc can identify and process math expressions. + +When creating a new post, I recommend you to use the RStudio addin "New Post": + +![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.name/gif/happy-elmo.gif) + +Looks good? diff --git a/themes/hugo-xmag/exampleSite/data/authors.yaml b/themes/hugo-xmag/exampleSite/data/authors.yaml new file mode 100644 index 0000000000..800a25ad60 --- /dev/null +++ b/themes/hugo-xmag/exampleSite/data/authors.yaml @@ -0,0 +1,2 @@ +"Yihui Xie": "Yihui Xie is currently a softwaren engineer at [RStudio](https://www.rstudio.com). You can find more information about him at https://yihui.name." +"Frida Gomam": "Frida Gomam is a joke." diff --git a/themes/hugo-xmag/hugo-xmag.Rproj b/themes/hugo-xmag/hugo-xmag.Rproj new file mode 100644 index 0000000000..d64e28bb7f --- /dev/null +++ b/themes/hugo-xmag/hugo-xmag.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/hugo-xmag/images/screenshot.png b/themes/hugo-xmag/images/screenshot.png new file mode 100644 index 0000000000..af0bb31c90 Binary files /dev/null and b/themes/hugo-xmag/images/screenshot.png differ diff --git a/themes/hugo-xmag/images/tn.png b/themes/hugo-xmag/images/tn.png new file mode 100644 index 0000000000..68f61b4038 Binary files /dev/null and b/themes/hugo-xmag/images/tn.png differ diff --git a/themes/hugo-xmag/layouts/404.html b/themes/hugo-xmag/layouts/404.html new file mode 100644 index 0000000000..c7d0697925 --- /dev/null +++ b/themes/hugo-xmag/layouts/404.html @@ -0,0 +1,9 @@ +{{ partial "header.html" . }} + +
+
+

404 NOT FOUND

+
+
+ +{{ partial "footer.html" . }} diff --git a/themes/hugo-xmag/layouts/_default/list.html b/themes/hugo-xmag/layouts/_default/list.html new file mode 100644 index 0000000000..cfa9c9bd26 --- /dev/null +++ b/themes/hugo-xmag/layouts/_default/list.html @@ -0,0 +1,46 @@ +{{ partial "header.html" . }} + +
+
+{{ $paginator := .Paginate (where .Data.Pages "Section" "!=" "") }} +{{ range $paginator.Pages }} +
+
+ {{ with .Params.categories }} + {{ range first 1 . }} + {{ . }} + {{ end }} + {{ else }} + {{ default "Uncategorized" .Site.Params.text.uncategorized }} + {{ end }} +
+

{{ .Title }}

+
+ {{ if .Params.author }}{{ partial "author_names.html" . }} / {{ end }} + {{ .Date.Format "2006-01-02" }} +
+ + {{ end }} + {{ end }} + {{ with .Description }} + {{ $.Scratch.Set "summary" (markdownify .) }} + {{ else }} + {{ $.Scratch.Set "summary" ((delimit (findRE "((.|\n)*?

\\s*)+" .Content) "[…] ") | plainify | truncate (default 200 .Site.Params.summary_length) (default " …" .Site.Params.text.truncated ) | replaceRE "&" "&" | safeHTML) }} + {{ end }} + {{ $.Scratch.Get "summary" }} +
+
+ +{{ end }} + + + + +{{ partial "footer.html" . }} diff --git a/themes/hugo-xmag/layouts/_default/single.html b/themes/hugo-xmag/layouts/_default/single.html new file mode 100644 index 0000000000..173ec3bd25 --- /dev/null +++ b/themes/hugo-xmag/layouts/_default/single.html @@ -0,0 +1,41 @@ +{{ partial "header.html" . }} +
+
+ + +{{ if .Params.toc }} +{{ .TableOfContents }} +{{ end }} + +
+{{ .Content }} +
+ +{{ partial "author.html" . }} +{{ partial "info.html" . }} +{{ partial "prev_next.html" . }} +{{ partial "comments.html" . }} +
+
+ +{{ partial "footer.html" . }} diff --git a/themes/hugo-xmag/layouts/_default/terms.html b/themes/hugo-xmag/layouts/_default/terms.html new file mode 100644 index 0000000000..2f432edb58 --- /dev/null +++ b/themes/hugo-xmag/layouts/_default/terms.html @@ -0,0 +1,22 @@ +{{ partial "header.html" . }} + +
+
+
+

{{ $.Scratch.Get "Title" }}

+ +
    + {{ range $key, $value := .Data.Terms }} +
  • + + {{ $key }} + + ({{ len $value }}) +
  • + {{ end }} +
+
+
+
+ +{{ partial "footer.html" . }} diff --git a/themes/hugo-xmag/layouts/partials/author.html b/themes/hugo-xmag/layouts/partials/author.html new file mode 100644 index 0000000000..c4977ab406 --- /dev/null +++ b/themes/hugo-xmag/layouts/partials/author.html @@ -0,0 +1,25 @@ +{{ with .Params.author }} +{{ if eq (substr (jsonify .) 0 1) "["}} +{{ $.Scratch.Set "page_author" .}} +{{ else }} +{{ $.Scratch.Set "page_author" (slice .) }} +{{ end }} + +{{ $.Scratch.Set "author_info" slice }} +{{ if $.Site.Data.authors }} +{{ range $.Scratch.Get "page_author" }} +{{ with (index $.Site.Data.authors .) }} +{{ $.Scratch.Add "author_info" . }} +{{ end }} +{{ end }} +{{ end }} +{{ if $.Scratch.Get "author_info" }} +
+

{{ default "About the Author" $.Site.Params.text.about_author }}

+ {{ range $.Scratch.Get "author_info" }} +

{{ . | markdownify }}

+ {{ end }} +
+{{ end }} + +{{ end }} diff --git a/themes/hugo-xmag/layouts/partials/author_names.html b/themes/hugo-xmag/layouts/partials/author_names.html new file mode 100644 index 0000000000..bbbc9786ba --- /dev/null +++ b/themes/hugo-xmag/layouts/partials/author_names.html @@ -0,0 +1 @@ +{{ replace ((jsonify .Params.author) | replaceRE "[\\[\"\\]]" "") "," (default ", " $.Site.Params.text.author_delimiter) | safeHTML }} diff --git a/themes/hugo-xmag/layouts/partials/banner.html b/themes/hugo-xmag/layouts/partials/banner.html new file mode 100644 index 0000000000..cc4181c434 --- /dev/null +++ b/themes/hugo-xmag/layouts/partials/banner.html @@ -0,0 +1,7 @@ + diff --git a/themes/hugo-xmag/layouts/partials/comments.html b/themes/hugo-xmag/layouts/partials/comments.html new file mode 100644 index 0000000000..e69de29bb2 diff --git a/themes/hugo-xmag/layouts/partials/foot_custom.html b/themes/hugo-xmag/layouts/partials/foot_custom.html new file mode 100644 index 0000000000..e69de29bb2 diff --git a/themes/hugo-xmag/layouts/partials/footer.html b/themes/hugo-xmag/layouts/partials/footer.html new file mode 100644 index 0000000000..78d4c83f07 --- /dev/null +++ b/themes/hugo-xmag/layouts/partials/footer.html @@ -0,0 +1,34 @@ + + + + +{{ if and (not .Params.disable_mathjax) (or (in (string .Content) "\\") (in (string .Content) "$")) }} + + +{{ end }} + +{{ if and (not .Params.disable_highlight) (in (string .Content) "") }} + + + +{{ end }} + +{{ template "_internal/google_analytics.html" . }} + + + diff --git a/themes/hugo-xmag/layouts/partials/head_custom.html b/themes/hugo-xmag/layouts/partials/head_custom.html new file mode 100644 index 0000000000..c37918d954 --- /dev/null +++ b/themes/hugo-xmag/layouts/partials/head_custom.html @@ -0,0 +1 @@ + diff --git a/themes/hugo-xmag/layouts/partials/header.html b/themes/hugo-xmag/layouts/partials/header.html new file mode 100644 index 0000000000..0a79efcb2b --- /dev/null +++ b/themes/hugo-xmag/layouts/partials/header.html @@ -0,0 +1,38 @@ + + + + + + {{ $.Scratch.Set "Title" (default .Title (index .Site.Params.text (print "title_" (lower .Title)))) }} + {{ if eq ($.Scratch.Get "Title") .Site.Title }}{{ .Site.Title }}{{ else }}{{ ($.Scratch.Get "Title") }} | {{ .Site.Title }}{{ end }} + + + {{ partial "head_custom.html" . }} + + + + diff --git a/themes/hugo-xmag/layouts/partials/info.html b/themes/hugo-xmag/layouts/partials/info.html new file mode 100644 index 0000000000..e69de29bb2 diff --git a/themes/hugo-xmag/layouts/partials/meta.html b/themes/hugo-xmag/layouts/partials/meta.html new file mode 100644 index 0000000000..e69de29bb2 diff --git a/themes/hugo-xmag/layouts/partials/prev_next.html b/themes/hugo-xmag/layouts/partials/prev_next.html new file mode 100644 index 0000000000..b2ec68561c --- /dev/null +++ b/themes/hugo-xmag/layouts/partials/prev_next.html @@ -0,0 +1,6 @@ +{{ if .Section }} + +{{ end }} diff --git a/themes/hugo-xmag/static/css/fonts.css b/themes/hugo-xmag/static/css/fonts.css new file mode 100644 index 0000000000..2f9fb347c7 --- /dev/null +++ b/themes/hugo-xmag/static/css/fonts.css @@ -0,0 +1,13 @@ +body { + font-family: Optima, 'Lucida Sans', Calibri, Candara, Arial, 'source-han-serif-sc', 'Source Han Serif SC', 'Source Han Serif CN', 'Source Han Serif TC', 'Source Han Serif TW', 'Source Han Serif', 'Songti SC', 'Microsoft YaHei', sans-serif; +} +blockquote { + font-family: 'Palatino Linotype', 'Book Antiqua', Palatino, 'STKaiti', 'KaiTi', '楷体', 'SimKai', 'DFKai-SB', 'NSimSun', serif; +} +code { + font-family: "Lucida Console", 'Andale Mono', 'STKaiti', 'KaiTi', 'SimKai', monospace; +} +pre code { + font-family: "Lucida Console", Monaco, 'STKaiti', 'KaiTi', 'SimKai', monospace; + font-size: .85em; +} diff --git a/themes/hugo-xmag/static/css/style.css b/themes/hugo-xmag/static/css/style.css new file mode 100644 index 0000000000..40f66221c5 --- /dev/null +++ b/themes/hugo-xmag/static/css/style.css @@ -0,0 +1,175 @@ +body { + margin: 0; + line-height: 1.5em; + background: #fafafa; +} +.header div, .container, .copyright, .menu { + max-width: 1100px; + margin: auto; + padding: 0 15px; +} +.page .header div, .page .container, .page .copyright, .page .menu { max-width: 900px; } +.container { hyphens: auto; } +@media (max-width: 930px) { + .page .container { padding: 0; } +} +main { margin-bottom: 15px; } + +/* header and footer areas */ +.header { + border-top: 5px solid #666; + border-bottom: 4px double #666; + text-align: center; + padding: 15px 0 5px; +} +.head-meta, .menu { + display: flex; + justify-content: space-between; +} +.header, .list section, article { background: #fff; } +.banner { font-size: 4em; } +.banner .text { + display: block; + line-height: 1em; +} +.list { + display: flex; + flex-wrap: wrap; + margin-left: -15px; +} +.list section { + flex: 1 0 350px; + box-sizing: border-box; + box-shadow: 0 0 8px #ccc; + margin: 1em 0 0 15px; + padding: 1em; + overflow-x: hidden; +} +@media (max-width: 380px) { + .list section { flex: auto; } +} +@media (min-width: 715px) { + .list section { max-width: calc(50% - 15px); } + .article-list h1 { + overflow-x: hidden; + white-space: nowrap; + text-overflow: ellipsis; + } + .article-list h1:hover { white-space: inherit; } +} +@media (min-width: 1080px) { + .list section { max-width: calc(33.33333% - 15px); } +} +.article-list a, .banner a { color: #000; } +.categories a { + font-size: .9em; + font-weight: bolder; + text-transform: uppercase; + color: #666; +} +h1 a:hover { text-decoration: underline; } +.article-list h1 { margin: .2em auto .2em 0; } +article { padding: 1em; } +.article-meta { + text-decoration: none; + background: #eee; + padding: 5px; + border-radius: 5px; +} +.menu, .article-meta, footer, .post-nav { text-align: center; } +.article-footer { text-align: left; } +.title { font-size: 1.2em; } +.article-list h1, .title { line-height: 1.2em; } +.article-list a, .header a, footer a, .categories a, .active a, .comments a { text-decoration: none; } +.pagination { text-align: center; } +.pagination li, .terms li { display: inline; } +.pagination a { padding: 0 .2em; } +.footer { + background: #666; + padding: 1em 0; +} +.footer, .footer a { color: #fff; } +.copyright, .copyright a { color: #ccc; } +.menu { + margin-bottom: .5em; + flex-wrap: wrap; +} +.menu li { + display: inline-block; + font-weight: bolder; +} +.menu a { padding: .5em; } +.menu a:hover { + color: #000; + background: #fff; +} + +hr { + border-style: dashed; + color: #ddd; +} + +/* code */ +pre { + border: 1px solid #ddd; + box-shadow: 5px 5px 5px #eee; + overflow-x: auto; +} +code { background: #f9f9f9; } +pre code { + background: none; + padding: .5em; + display: block; +} + +/* misc elements */ +img, iframe, video { max-width: 100%; } +blockquote { + background: #f9f9f9; + border-left: 5px solid #ccc; + padding: 3px 1em 3px; +} + +table { + margin: 1em auto auto; + border-top: 1px solid #666; + border-bottom: 1px solid #666; +} +table thead th { border-bottom: 1px solid #ddd; } +th, td { padding: 5px; } +tr:nth-child(even) { background: #eee } + +.thumbnail { + height: 5.1em; + width: 6.8em; + float: left; + overflow: hidden; + margin: 5px 8px 5px 0; + box-shadow: 0 0 8px #666; +} +.thumbnail img { + width: 100%; + height: 100%; + object-fit: cover; +} +#TableOfContents, #TOC, .comments { + border: 1px solid #eee; + border-radius: 5px; +} +.comments a { + display: inline-block; + width: 100%; + text-align: center; + font-size: 1.2em; +} +.terms { padding-left: 0; } +.post-nav { + margin: .5em 0; + display: flex; + justify-content: space-between; +} +.footnotes { font-size: .9em; } +.footnotes hr { + width: 50%; + margin-left: 0; +} diff --git a/themes/hugo-xmag/theme.toml b/themes/hugo-xmag/theme.toml new file mode 100644 index 0000000000..99a777324f --- /dev/null +++ b/themes/hugo-xmag/theme.toml @@ -0,0 +1,12 @@ +name = "XMag" +license = "MIT" +licenselink = "https://github.com/yihui/hugo-xmag/blob/master/LICENSE.md" +description = "A minimal magazine theme for Hugo" +homepage = "https://xmag.yihui.name" +tags = ["minimal", "magazine", "clean", "simple", "minimalist", "blog", "responsive", "Google Analytics", "Syntax Highlighting"] +features = ["blog", "magazine"] +min_version = "0.18" + +[author] + name = "Yihui Xie" + homepage = "https://yihui.name"