cupper-hugo-theme/exampleSite/content/patterns/setup.md

74 lines
4.2 KiB
Markdown
Raw Normal View History

2017-06-27 21:15:38 +02:00
+++
2017-09-07 10:31:52 +02:00
title = "Setup"
2017-08-02 10:23:48 +02:00
weight = 2
2017-06-27 21:15:38 +02:00
+++
2017-11-02 16:37:06 +01:00
By now, you should have followed the {{% pattern "Installation" %}} instructions. You should have Hugo and Node installed, and a local copy of a forked version of **Cupper**. You should also have run `npm install` in the root of that codebase.
2017-06-27 21:15:38 +02:00
## "Cleaning" the content folder
2017-11-02 16:37:06 +01:00
Before you can start writing documentation, there are a few things still to do in order to get set up. At the moment, your version of **Cupper** is a facsimile of the original, containing all the content you're reading right now. We want to delete that content and replace it with some starter content. There's a simple `clean` command for this.
2017-06-27 21:15:38 +02:00
{{% warning %}}
2017-11-02 16:37:06 +01:00
If you are contributing to an existing **Cupper** library, do not run the following command. It will delete all of the patterns in that library. The `clean` command is just for libraries that you are starting from scratch.
2017-06-27 21:15:38 +02:00
{{% /warning %}}
2017-07-15 10:28:17 +02:00
{{<cmd>}}
npm run clean
{{</cmd>}}
2017-06-27 21:15:38 +02:00
2017-11-02 16:37:06 +01:00
This will leave your `content` folder with just an `_index.md` file and a `patterns` folder containing a single demonstration pattern file. Individual content pages in **Cupper** are referred to as "patterns" — think pattern libraries). Find out more about these in {{% pattern "Project structure" %}}.
2017-06-27 21:15:38 +02:00
## The config file
2017-09-07 10:31:52 +02:00
You'll also want to name your project and configure one or two other things in the `config.toml` file that's found at the root of your project. Here's how that file looks:
2017-06-27 21:15:38 +02:00
{{<codeBlock lang="html" numbered="true">}}
languageCode = "en-us"
2017-11-02 16:37:06 +01:00
title = "Cupper"
baseURL = "https://thepaciellogroup.github.io/cupper/"
theme = "cupper"
2017-06-27 21:15:38 +02:00
[params]
2017-11-02 16:37:06 +01:00
description = "Documentation for the **Cupper** documentation builder. This documentation is constructed using the builder itself."
2017-06-27 21:15:38 +02:00
codePenUser = "Heydon"
{{</codeBlock>}}
2017-11-02 16:37:06 +01:00
* **title** — This is the project's name, like "Megacorp 5000 Pattern Library" or "Assplosion.js Documentation". For **Cupper's** own version of **Cupper**, the `title` is simply _Cupper_ :-)
2017-07-03 21:02:40 +02:00
* **baseURL** — This is the root of the live site. Typically you will publish the site to Github Pages, so this should be the base URL for your Github Pages site.
2017-11-02 16:37:06 +01:00
* **theme** — This is the theme the library is using. Don't change this from "cupper".
* **description** — This is a short description of your documentation project and comes under the logo. You can include markdown syntax here, like _&#x002a;&#x002a;Cupper&#x002a;&#x002a;_ in the above example for making the name of the library bold.
2017-06-27 21:15:38 +02:00
* **codePenUser** — If you want to embed codePens in your pattern files, you need to supply a codePen username here.
2017-08-02 21:57:01 +02:00
## The Web App Manifest
2017-11-02 16:37:06 +01:00
**Cupper** projects work as progressive web applications, meaning users can save them to their home screen and read them offline. The web app manifest, found at the root of the `static` folder, defines names and icons for the app. You'll probably want to open `/static/manifest.json` and personalize the `name` and `short_name` values.
2017-08-02 21:57:01 +02:00
```
{
2017-11-02 16:37:06 +01:00
"name": "Cupper Documentation Builder",
"short_name": "Cupper Docs",
2017-08-02 21:57:01 +02:00
"icons": [
{...
```
2017-11-02 16:37:06 +01:00
{{% figure caption="Cupper's Docs, with `short_name` displayed, available from the homescreen of a Samsung/Android phone." %}}
2017-12-26 12:11:40 +01:00
![Teacup Cupper app icon with Cupper Docs written underneath](/images/samsung_homescreen.jpg)
2017-08-15 10:18:33 +02:00
{{% /figure %}}
2017-08-02 21:57:01 +02:00
{{% note %}}
2017-09-07 10:31:52 +02:00
The `short_name` value refers to the text that appears under the icon on your homescreen. As the name suggests, it should be as short as possible to fit well (12 characters or fewer is ideal).
2017-08-02 21:57:01 +02:00
{{% /note %}}
2017-06-27 21:15:38 +02:00
## Including a logo
2017-11-02 16:37:06 +01:00
In the `images/static` folder, you'll find a `logo.svg` file. Replace this file with your own company or project logo, under the same file name. Currently, only SVG is supported this easily because SVG is the superior format for logos. However, if you must use a different format, you can open up the `themes/cupper/layouts/_default/baseof.html` file and edit the image reference:
2017-08-02 19:00:38 +02:00
```html
<a class="logo" href="/" aria-label="{{ .Site.Title }} pattern library home page">
<img src="{{ "images/logo.svg" | absURL }}" alt="">
</a>
```
2017-06-27 21:15:38 +02:00
2017-09-07 10:31:52 +02:00
Now that your logo is in place, everything should be ready. Where next? You can learn about {{% pattern "Project structure" %}} to help you get writing, or find out how to serve the site locally and on Github Pages in {{% pattern "Serving" %}}.