Skip to content

Commit

Permalink
Shortguide yaml to hiddenguide, new cloud_manager_link yaml, rebuild …
Browse files Browse the repository at this point in the history
…theme
  • Loading branch information
nmelehan committed Aug 23, 2018
1 parent 976e727 commit f56b487
Show file tree
Hide file tree
Showing 17 changed files with 97 additions and 17 deletions.
2 changes: 1 addition & 1 deletion ci/yaml_rules.json
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@
"type": "date",
"description": "Date this guide was originally published. Should use the form YYYY-MM-DD."
},
"shortguide": {
"hiddenguide": {
"elements": false,
"required": false,
"type": "bool",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ modified: 2015-12-18
modified_by:
name: Linode
published: 2015-02-12
cloud_manager_link: 'platform/test-guide/'
title: Getting Started with NodeBalancers
---

Expand Down
1 change: 1 addition & 0 deletions themes/docsmith/layouts/_default/single.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
{{ partial "github" . }}
{{ partial "operating_systems" . }}
{{ partial "deprecated" . }}
{{ partial "cloud_manager_link" . }}
{{ .Content }}
{{ partial "more" . }}
{{ partial "community_link" }}
Expand Down
2 changes: 1 addition & 1 deletion themes/docsmith/layouts/index.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{{- $.Scratch.Add "index" slice -}}
{{- range where .Site.Pages "Type" "not in" (slice "page" "json") -}}
{{- $.Scratch.Add "index" (dict "title" .Title "ref" .RelPermalink "keywords" .Params.keywords "deprecated" .Params.deprecated "shortguide" .Params.shortguide "h1" .Params.h1_title "toc" (.TableOfContents | plainify )) -}}
{{- $.Scratch.Add "index" (dict "title" .Title "ref" .RelPermalink "keywords" .Params.keywords "deprecated" .Params.deprecated "hiddenguide" .Params.hiddenguide "h1" .Params.h1_title "toc" (.TableOfContents | plainify )) -}}
{{- end -}}
{{- $.Scratch.Get "index" | jsonify -}}
4 changes: 2 additions & 2 deletions themes/docsmith/layouts/partials/articles_and_categories.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{{ with .Pages }}
{{ $filtered := where . "Params.shortguide" "!=" true }}
{{ $filtered := where . "Params.hiddenguide" "!=" true }}
{{ $class := cond (eq (len $.Sections) 0) "primary" "neutral" }}
<section class="{{ $class }}">
<div class="container">
Expand Down Expand Up @@ -34,7 +34,7 @@ <h4><a href="{{ .Permalink }}">{{ .Title }}</a></h4>
<h2 class="h3"><a href="{{ .Permalink }}">{{ .Title }}</a></h2>
<ul class="list-group article-list">
{{ $pages := where .Pages ".Params.deprecated" "!=" true }}
{{ $pages := $pages | intersect (where .Pages ".Params.shortguide" "!=" true) }}
{{ $pages := $pages | intersect (where .Pages ".Params.hiddenguide" "!=" true) }}
{{ range $pages }}
<li class="list-group-item library-article-item"><h3 class="h5"><a href="{{ .Permalink }}">{{ .Title }}{{ if .Params.has_video }}&nbsp;<i class="fa fa-youtube-play"></i>{{ end }}</a></h3></li>
{{ end }}
Expand Down
6 changes: 6 additions & 0 deletions themes/docsmith/layouts/partials/cloud_manager_link.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{{ with .Params.cloud_manager_link }}
<blockquote class="cloud_manager_link">
<strong class="callout-title">Cloud Manager</strong>
<div><a href={{ print ($.Site.BaseURL) (.) }}>An updated version of this guide</a> has been written for the <a href="https://cloud.linode.com">new Linode Manager</a>.</div>
</blockquote>
{{ end }}
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@
<script src="{{ relURL "assets/js/main.js" }}" type="text/javascript"></script>
<script src="{{ relURL "assets/js/search.js" }}" type="text/javascript"></script>-->
<script src="{{ relURL "build/js/libs-de389cd58b.min.js" }}" type="text/javascript"></script>
<script src="{{ relURL "build/js/main-f5ec3f3af9.min.js" }}" type="text/javascript"></script>
<script src="{{ relURL "build/js/main-309312ff52.min.js" }}" type="text/javascript"></script>
2 changes: 1 addition & 1 deletion themes/docsmith/layouts/partials/includes_head_prod.html
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<link href="{{ relURL "build/stylesheets/home-cf775b4187.min.css" }}" rel='stylesheet' type='text/css'>
<link href="{{ relURL "build/stylesheets/home-7c46b4fe23.min.css" }}" rel='stylesheet' type='text/css'>

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions themes/docsmith/static/build/js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ function toggleNoteDisclosure(disclosureNote) {
var resultList = $('#ds-search-list');
var MAX_DEPRECATED_GUIDES = 5;
var deprecatedResults = [];
var hiddenGuide = [];
var hiddenGuides = [];
var item, doc;
resultList.empty();
for (var i = 0; i < result.length; i++) {
Expand All @@ -204,7 +204,7 @@ function toggleNoteDisclosure(disclosureNote) {
var url = item.ref
var badge = ''
var deprecated = doc.deprecated
var shortguide = doc.shortguide
var hiddenguide = doc.hiddenguide
if (deprecated) {
badge = '<span class="search-deprecated">DEPRECATED</span>'
}
Expand All @@ -216,8 +216,8 @@ function toggleNoteDisclosure(disclosureNote) {
deprecatedResults.push(searchitem)
}
}
else if (shortguide) {
hiddenGuide.push(searchitem)
else if (hiddenguide) {
hiddenGuides.push(searchitem)
}
else {
resultList.append(searchitem)
Expand All @@ -227,7 +227,7 @@ function toggleNoteDisclosure(disclosureNote) {
deprecatedResults.forEach(function(result) {
resultList.append(result);
resultList = resultList.filter(function(val) {
return hiddenGuide.indexOf(val) == -1;
return hiddenGuides.indexOf(val) == -1;
});
});
resultList.show();
Expand Down
Loading

0 comments on commit f56b487

Please sign in to comment.