You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

README.md 4.9KB

7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  1. # Ananke, A theme for [Hugo](http://gohugo.io/), a framework for building websites.
  2. The intent of this theme is to provide a solid starting place for Hugo sites with basic features and include best practices for performance, accessibility, and rapid development.
  3. ![screenshot](https://raw.githubusercontent.com/budparr/gohugo-theme-ananke/master/images/screenshot.png)
  4. [DEMO](https://gohugo-ananke-theme-demo.netlify.com/)
  5. Features
  6. - Responsive
  7. - Accessible
  8. - Contact form
  9. - Custom Robots.txt (changes values based on environment)
  10. - Internal templates for meta data, google analytics, and DISQUS comments
  11. - RSS Discovery
  12. - Table of Contents (must declare `toc: true` in post parameter)
  13. Also includes examples of Hugo Features or Functions:
  14. - Pagination (internal template)
  15. - Taxonomies
  16. - Archetypes
  17. - Custom shortcode
  18. - Related content
  19. - Hugo built-in menu
  20. - `with`
  21. - `HUGO_ENV`
  22. - `first`
  23. - `after`
  24. - `sort`
  25. - Site LanguageCode
  26. - `where`
  27. - Content Views
  28. - Partials
  29. - Template layouts (type "post" uses a special list template, single template, and a content view)
  30. - Tags
  31. - `len`
  32. - Conditionals
  33. - `ge` (greater than or equal to)
  34. - `.Site.Params.mainSections` to avoid hard-coding "blog," etc. [[release note](https://github.com/spf13/hugo/blob/66ec6305f6cb450ddf9c489854146bac02f7dca1/docs/content/meta/release-notes.md#enhancements)]
  35. This theme uses the "Tachyons" CSS library. This will allow you to manipulate the design of the theme by changing class names in HTML without touching the original CSS files. For more information see the [Tachyons website](http://tachyons.io/).
  36. ## Installation
  37. Inside the folder of your Hugo site run:
  38. $ cd themes
  39. $ git clone https://github.com/budparr/gohugo-theme-ananke.git
  40. For more information read the official [setup guide](//gohugo.io/overview/installing/) of Hugo.
  41. ## Getting started
  42. After installing the theme successfully it requires a just a few more steps to get your site running.
  43. ### The config file
  44. Take a look inside the [`exampleSite`](https://github.com/budparr/gohugo-theme-ananke/tree/master/exampleSite) folder of this theme. You'll find a file called [`config.toml`](https://github.com/budparr/gohugo-theme-ananke/blob/master/exampleSite/config.toml). To use it, copy the [`config.toml`](https://github.com/budparr/gohugo-theme-ananke/blob/master/exampleSite/config.toml) in the root folder of your Hugo site. Feel free to change the strings in this theme.
  45. You may need to delete the line: `themesDir = "../.."`
  46. ### Add comments
  47. To enable DISQUS comments, add `disqusShortname = YOURSHORTNAME` to your config file.
  48. ### Change the hero background
  49. For any page or post you can add a featured image by including the local path in front matter (see content in the ExampleSite folder for examples): `featured_image: '/images/gohugo-default-sample-hero-image.jpg'`
  50. You don't need an image though. The default background color is black, but you can change the color, by changing the default color class in the config.toml file. Choose a background color from any on the [Tachyons](http://tachyons.io/docs/themes/skins/) library site, and preface it with "bg-"
  51. example: `background_color_class = "bg-blue"` or `background_color_class = "bg-gray"`
  52. ### Activate the contact form
  53. This theme includes a shortcode for a contact form that you can add to any page (there is an example on the contact page in the exampleSite folder). One option is to use [formspree.io](//formspree.io/) as proxy to send the actual email. Each month, visitors can send you up to one thousand emails without incurring extra charges. Visit the Formspree site to get the "action" link and add it to your shortcode like this:
  54. ```
  55. {{< form-contact action="http://formspree.io/your@email.com" >}}
  56. ```
  57. ### Update font or body classes
  58. The theme is set, by default, to use a near-white background color and the "Avenir" or serif typeface. You can change these in your config file with the `body_classes` parameter, like this:
  59. ```
  60. [params]
  61. body_classes = "avenir bg-near-white"
  62. ```
  63. which will give you a body class like this:
  64. ```
  65. <body class="avenir bg-near-white">
  66. ```
  67. You can find a list of available typefaces [here](https://github.com/tachyons-css/tachyons/blob/v4.7.0/src/_font-family.css).
  68. And a list of background colors [here](https://github.com/tachyons-css/tachyons/blob/v4.7.0/src/_skins.css#L96).
  69. _n.b. in future versions we will likely separate the typeface and other body classes._
  70. ### Nearly finished
  71. In order to see your site in action, run Hugo's built-in local server.
  72. `$ hugo server`
  73. Now enter [`localhost:1313`](http://localhost:1313/) in the address bar of your browser.
  74. ## Contributing
  75. If you find a bug or have an idea for a feature, feel free to use the [issue tracker](https://github.com/budparr/gohugo-theme-ananke/issues) to let me know.
  76. TODO:
  77. - fix hard-coded link to [section](https://github.com/budparr/gohugo-theme-ananke/blob/master/layouts/index.html#L32)