Update algolia search styles

This commit is contained in:
Ryan Watters
2017-02-09 19:29:21 -06:00
parent c20a89b311
commit eb7f8aed67
10 changed files with 225 additions and 32 deletions
+124 -17
View File
@@ -22,22 +22,6 @@ followed by a `./config.json` file.
In this `config` file, you can include precise directions to Hugo regarding how it should render your website, control your website's menus, and arbitrarily define site-wide parameters specific to your project.
## Configure Through Environmental Variables
In addition to the 3 configuration file options already mentioned, website configuration can be accomplished through operating system environment variables.
For example, the following command will effectively set a website's title on Unix-like systems:
{{% input "environment-variable.sh" %}}
```bash
$ env HUGO_TITLE="Some Title" hugo
```
{{% /input %}}
{{% note "Setting Environment Variables" %}}
names must be prefixed with `HUGO_` when setting environment variables through operating system environment variables.
{{% /note %}}
## Configuration in YAML
The following is a typical example of a YAML configuration file. Note the document opens with 3 hyphens and closes with 3 periods. The values nested under `params:` will populate the [`.Site.Params`][] variable for use in [templates][]:
@@ -85,7 +69,7 @@ canonifyURLs = true
## All Configuration Variables, YAML
The following is a list of Hugo-defined variables. The values provided in this example represent the default values used by Hugo if not otherwise specified.
The following is the full list of Hugo-defined variables in a example YAML file. The values provided in this example represent the default values used by Hugo if not otherwise specified.
{{% input "config.yml" %}}
```yaml
@@ -198,7 +182,130 @@ taxonomies:
## All Configuration Variables, TOML
The following is the full list of Hugo-defined variables in a example YAML file. The values provided in this example represent the default values used by Hugo if not otherwise specified.
{{% input "config.toml" %}}
```toml
---
archetypeDir = "archetypes"
# hostname (and path) to the root, e.g. http://spf13.com/
baseURL = ""
# include content marked as draft
buildDrafts = false
# include content with publishdate in the future
buildFuture = false
# include content already expired
buildExpired = false
# enable this to make all relative URLs relative to content root. Note that this does not affect absolute URLs.
relativeURLs = false
canonifyURLs = false
# config file (default is path/config.yaml|json|toml)
config = "config.toml"
contentDir = "content"
dataDir = "data"
defaultExtension = "html"
defaultLayout = "post"
# Missing translations will default to this content language
defaultContentLanguage = "en"
# Renders the default content language in subdir, e.g. /en/. The root directory / will redirect to /en/
defaultContentLanguageInSubdir = false
disableLiveReload = false
# Do not build RSS files
disableRSS = false
# Do not build Sitemap file
disableSitemap = false
# Enable GitInfo feature
enableGitInfo = false
# Build robots.txt file
enableRobotsTXT = false
# Do not render 404 page
disable404 = false
# Do not inject generator meta tag on homepage
disableHugoGeneratorInject = false
# Do not make the url/path to lowercase
disablePathToLower = false
# edit new content with this editor, if provided
editor = ""
# Enable Emoji emoticons support for page content.
# See www.emoji-cheat-sheet.com
enableEmoji = false
# Show a placeholder instead of the default value or an empty string if a translation is missing
enableMissingTranslationPlaceholders = false
footnoteAnchorPrefix = ""
footnoteReturnLinkContents = ""
# google analytics tracking id
googleAnalytics = ""
# if true, auto-detect Chinese/Japanese/Korean Languages in the content. (.Summary and .WordCount can work properly in CJKLanguage)
hasCJKLanguage = false
languageCode = ""
layoutDir = "layouts"
# Enable Logging
log = false
# Log File path (if set, logging enabled automatically)
logFile = ""
# "toml","yaml", or "json"
metaDataFormat = "toml"
newContentEditor = ""
# Don't sync permission mode of files
noChmod = false
# Don't sync modification time of files
noTimes = false
# Pagination
paginate = 10
paginatePath = "page"
# See "content-management/permalinks"
permalinks =
# Pluralize titles in lists using inflect
pluralizeListTitles = true
# Preserve special characters in taxonomy names ("Gérard Depardieu" vs "Gerard Depardieu")
preserveTaxonomyNames = false
# filesystem path to write files to
publishDir = "public"
# enables syntax guessing for code fences without specified language
pygmentsCodeFencesGuessSyntax = false
# color-codes for highlighting derived from this style
pygmentsStyle = "monokai"
# true: use pygments-css or false: color-codes directly
pygmentsUseClasses = false
# default sitemap configuration map
sitemap =
# filesystem path to read files relative from
source = ""
staticDir = "static"
# display memory and timing of different steps of the program
stepAnalysis = false
# theme to use (located by default in /themes/THEMENAME/)
themesDir = "themes"
theme = ""
title = ""
# if true, use /filename.html instead of /filename/
uglyURLs = false
# verbose output
verbose = false
# verbose logging
verboseLog = false
# watch filesystem for changes and recreate as needed
watch = true
[taxonomies]
category = "categories"
tag = "tags"
---
```
{{% /input %}}
## Configure Through Environmental Variables
In addition to the 3 configuration file options already mentioned, website configuration can be accomplished through operating system environment variables.
For example, the following command will effectively set a website's title on Unix-like systems:
```bash
$ env HUGO_TITLE="Some Title" hugo
```
{{% note "Setting Environment Variables" %}}
names must be prefixed with `HUGO_` when setting environment variables through operating system environment variables.
{{% /note %}}
## Ignoring Files When Rendering
@@ -1,3 +1,2 @@
<link rel="stylesheet" href="https://cdn.jsdelivr.net/docsearch.js/2/docsearch.min.css" />
<link rel="stylesheet" href="/css/style.min.css">
<!-- <link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet" integrity="sha384-wvfXpqpZZVQGK6TAh5PVlGOfQNHSoD2xbE+QkPxCAFlNEevoEH3Sl0sibVcOQVnN" crossorigin="anonymous"> -->
@@ -8,5 +8,5 @@
</header>
<form id="site-search" action="">
<i class="icon-search"></i>
<input type="search" id="search-input">
<input type="search" id="search-input" placeholder="Search {{.Site.Title}}...">
</form>
@@ -6,7 +6,7 @@
<script>
(function() {
if (window.location.hostname === "localhost") {
console.log("Analytics not running on local dev.");
console.log("Analytics not running on local dev.");
return;
} else {
(function(i, s, o, g, r, a, m) {
@@ -23,16 +23,19 @@
ga('create', '{{$gaid}}', 'auto');
ga('send', 'pageview');
ga('create', '{{$gaid}}', {'siteSpeedSampleRate': 100});
ga('create', '{{$gaid}}', {
'siteSpeedSampleRate': 100
});
}
})();
</script>
<!-- Algolia embed -->
<script type="text/javascript" src="https://cdn.jsdelivr.net/docsearch.js/2/docsearch.min.js"></script>
<script type="text/javascript"> docsearch({
apiKey: '41fdb7fafd9b009498ef9ab6d3fb1886',
indexName: 'hugodocsconcept',
inputSelector: '#search-input',
debug: true // Set debug to true if you want to inspect the dropdown
<script type="text/javascript">
docsearch({
apiKey: '41fdb7fafd9b009498ef9ab6d3fb1886',
indexName: 'hugodocsconcept',
inputSelector: '#search-input',
debug: true // Set debug to true if you want to inspect the dropdown
});
</script>
@@ -17,7 +17,7 @@ $(document).ready(function () {
// scroll to each target
$(target).velocity('scroll', {
duration: 500,
offset: -50,
offset: -20,
easing: 'ease-in-out'
});
location.hash = hashid;
@@ -8,7 +8,7 @@ $searchbox-config: (
input-focus-border-color: #AAAAAA,
input-background: #FFFFFF,
input-focus-background: #FFFFFF,
font-size: 12px,
font-size: 1em,
placeholder-color: #AAAAAA,
icon-size: 14px,
icon-position: left,
@@ -22,7 +22,7 @@ $searchbox-config: (
$dropdown-config: (
main-color: #458EE1,
layout-type: normal,
layout-width: normal,
layout-width: small,
layout-alignment: align,
background-color: #fff,
border-radius: 4,
@@ -6,7 +6,7 @@ h3,
h4 {
font-weight: $heading-font-weight;
margin: 0px;
padding-bottom: 20px;
padding-bottom: 40px;
line-height: 1.4;
}
@@ -2,7 +2,91 @@
@include on-event($self: true) {
outline: none;
}
width:300px;
outline:none;
border:0px;
border-bottom:1px solid $base-font-color;
}
/* Bottom border of each suggestion */
.algolia-docsearch-suggestion {
border-bottom-color: #3A3DD1;
}
/* Main category headers */
// .algolia-docsearch-suggestion--category-header {
// background-color: #4B54DE;
// }
/* Highlighted search terms */
.algolia-docsearch-suggestion--highlight {
color: #3A33D1;
}
/* Highligted search terms in the main category headers */
.algolia-docsearch-suggestion--category-header .algolia-docsearch-suggestion--highlight {
background-color: #4D47D5;
}
/* Currently selected suggestion */
.aa-cursor .algolia-docsearch-suggestion--content {
color: #272296;
}
.aa-cursor .algolia-docsearch-suggestion {
background: #EBEBFB;
}
.algolia-autocomplete .algolia-docsearch-suggestion--text .algolia-docsearch-suggestion--highlight {
box-shadow: inset 0 -2px 0 0 $hugo-pink;
}
.algolia-autocomplete .algolia-docsearch-suggestion--highlight {
color: $hugo-pink;
background: desaturate(lighten($hugo-pink, 50%), 30%);
padding: 0.1em 0.05em;
}
.algolia-autocomplete .algolia-docsearch-suggestion--subcategory-column {
background-color: $hugo-white;
}
.algolia-autocomplete .ds-dropdown-menu {
font-size:.8em;
min-width: 340px;
max-width: 340px;
@include MQ(M) {
font-size:1em;
min-width: 400px;
max-width: 500px;
}
@include MQ(L) {
min-width: 500px;
max-width: 600px;
}
}
/* For bigger screens, when displaying results in two columns */
@media (min-width: 768px) {
/* Bottom border of each suggestion */
.algolia-docsearch-suggestion {
border-bottom-color: #7671df;
}
/* Left column, with secondary category header */
.algolia-docsearch-suggestion--subcategory-column {
border-right-color: #7671df;
background-color: #F2F2FF;
color: #4E4726;
}
}
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long