Welcome to mirror list, hosted at ThFree Co, Russian Federation.

faq.md « docs « content « exampleSite - github.com/Vimux/mainroad.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 6fa84cfa679d34765a6a6b4e1ef5c561e5d1feb8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
---
title: Frequently asked questions (FAQ)
description: Browse this FAQ page to find answers to frequently asked questions that have not been covered elsewhere in
  the documentation.
date: 2022-01-24T14:00:00.000Z
authorbox: false
sidebar: false
pager: false
weight: 3
menu:
  main:
    name: FAQ
---

Browse this FAQ page to find answers to frequently asked questions that have not been covered elsewhere
in the documentation.

<!--more-->

The answers have been categorized into two groups:

1. Answers to general questions without any lines of code.
2. Answers to technical questions with code snippets, step-by-step instructions, etc.

## General questions

### Do I need to have prior experience before proceeding with the Mainroad theme?

**Yes.** You'll need to be familiar with Hugo before proceeding.
[Our docs section]({{< ref "/docs/_index.md" >}} "Mainroad theme documentation") is intended for intermediate to
advanced users and developers. Our documentation may still be helpful to users with minimal experience, but are not
comprehensive.

### Do I need to use the extended version of Hugo?

**No.** Mainroad theme intentionally does not use any features of the extended version. As such, the extended version of
Hugo is not required (but applicable).

### Is there a list of all possible configuration options?

**Configuration:**

* See [All Configuration Settings](https://gohugo.io/getting-started/configuration/#all-configuration-settings)
for the full list of Hugo-defined variables with their default values.
* See [Mainroad config.toml example](https://github.com/Vimux/Mainroad#configtoml-example) for the full list of
Mainroad-specific variables.

**Front Matter:**

* See [Front Matter Variables](https://gohugo.io/content-management/front-matter#front-matter-variables) for the
list of Hugo-defined Front Matter variables.
* See [Mainroad Front Matter example](https://github.com/Vimux/Mainroad#front-matter-example) for the list of
Mainroad-specific Front Matter variables.

### What if I have more questions? Should I create an issue?

**We don't provide personal technical support.** As stated in our
[contributing guidelines](https://github.com/Vimux/Mainroad/blob/master/CONTRIBUTING.md), please do not use the issue
tracker for personal support. This includes reports like: “How do I do this", “Everything is broken; help me”, “I
changed something, and it doesn't work anymore”, “It's not a personal issue, but I just want to ask how X or Y works”,
“I forked your theme, then something broke; fix this immediately”, and so on.

**The issue tracker should only be used for bug reports, feature requests, and discussions that comply with our
contributing rules**. All other issues will be closed and marked as invalid.

## Technical questions

### I want to get the `favicon.ico` and `apple-touch-icon.png` to match my `hightlightColor`. What should I do?

There is no way to do this on the fly with Hugo, but you can use the one-liners below with some preparations:

1. Copy:
    * `./themes/mainroad/static/favicon.ico` to `./static/favicon.ico`
    * `./themes/mainroad/static/apple-touch-icon.png` to `./static/apple-touch-icon.png`
1. At the beginning of each script, replace the color in the variable with your preferred color. You must use
six-digit hex triplet notation (e.g., `#E22D30`) to make it work properly.

Go to the root of your project directory in the terminal and execute these two commands accordingly.

```
a=#E22D30;a=\\x${a:5:2}\\x${a:3:2}\\x${a:1:2};for i in 98 274 578;do printf $a|dd of=static/favicon.ico bs=1 seek=$i conv=notrunc;done
```

```
a=#E22D30;a=$(echo 504C54452A2A2A${a:1:6}|sed -e 's/../\\x&/g');printf $a|gzip|tail -c8|od -tx4 -N4 -An|xargs|sed -e 's/../\\x&/g'|printf $a$(cat -)|dd of=static/apple-touch-icon.png bs=1 seek=37 conv=notrunc
```

### I want to use Google Programmable Search Engine as a site search engine. Is it possible?

**Yes, it is possible to use [Google PSE (CSE)](https://developers.google.com/custom-search/docs/overview) as a site
search engine.**

1. Create a new search engine with [Google PSE](https://programmablesearchengine.google.com/about/). Google account
required.

1. Add a new layout.

    Create file `./layouts/search/index.html` with the following content:

    ```
    {{ define "main" }}
    <script async src="https://cse.google.com/cse.js?cx=YOUR_PSE_ENGINE_ID"></script>
    <div class="gcse-search"></div>
    {{ end }}
    ```

    Don't forget to paste your Google PSE ID.

1. Add search page by creating file `./content/search.md` with the following content:

    ```
    ---
    title: Search
    authorbox: false
    sidebar: false
    pager: false
    ---
    ```

1. Optional. If you use the search widget, don't forget to change the search box parameters:

    ```toml
    [Params.widgets.search]
      url = "/search/"
      input.name = false
      input.pre = ""
    ```

Google PSE (CSE) should work when it's done. Look and feel will be far from perfect, but you have to solve this problem
with [Google PSE Control Panel](https://programmablesearchengine.google.com/controlpanel/all) and additional CSS.

[Edit this page on GitHub](https://github.com/vimux/mainroad/blob/master/exampleSite/content/docs/faq.md)