Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Event Calendar and Clean Up Unused javascript/css #31

Merged
merged 4 commits into from
Oct 30, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 4 additions & 11 deletions config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,12 @@ blackfriday:
extensions: [ "noEmptyLineBeforeBlock" ]

params:
editURL: ""
showVisitedLinks: false
ordersectionsby: title
disableHomeIcon: false
disableNavChevron: true
menushortcutsnewtab: false
enableGitInfo: false
sectionPagesMenu: menu
custom_css: [ "css/overrides.css" ]

outputs:
home: [ "HTML", "RSS", "JSON"]

menu.shortcuts:
name: Glossary
url: https://kubernetes.io/docs/reference/glossary/?community=true
menu:
shortcuts:
- name: Glossary
url: https://kubernetes.io/docs/reference/glossary/?community=true
10 changes: 10 additions & 0 deletions gen-site.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ readonly HUGO_BUILD="${HUGO_BUILD:-false}"
readonly KCOMMUNITY_REPO="${KCOMMUNITY_REPO:-"https://github.com/kubernetes/community.git"}"
readonly KCOMMUNITY_SRC_DIR="${KCOMMUNITY_SRC_DIR:-"$DIR/build/community"}"
readonly CONTENT_DIR="$DIR/content"
readonly MANAGED_CONTENT="$DIR/managed_content"
readonly FRONTMATTER_STRING=$(head -n 1 "$DIR/frontmatter.tmplt")
readonly FRONTMATTER_TMPLT=$(sed -e ':a;N;$!ba;s/\n/\\n/g' "$DIR/frontmatter.tmplt")
readonly KCOMMUNITY_EXCLUDE_LIST="$DIR/kcommunity_exclude.list"
Expand Down Expand Up @@ -362,6 +363,12 @@ rename_readme() {
echo "Renamed: $1 to $filename"
}

# Content within the managed content directory is 'out of band' and layered on
# top of the generated content from the various other sources.
sync_managed_content() {
rsync -av "$MANAGED_CONTENT/" "$CONTENT_DIR"
}

main() {
init_content
init_src "$KCOMMUNITY_REPO" "$KCOMMUNITY_SRC_DIR"
Expand All @@ -382,6 +389,9 @@ main() {
[[ $(basename "${file,,}") == 'readme.md' ]] && rename_readme "$file"
done < <(find_md_files "$CONTENT_DIR")

echo "Syncing Managed Content to content dir."
sync_managed_content

echo "Completed Content Update."
if [[ "$HUGO_BUILD" = true ]]; then
echo "Building Site with: hugo --cleanDestinationDir --source \"$DIR\" $*"
Expand Down
5 changes: 0 additions & 5 deletions layouts/_default/li.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,4 @@ <h2 class="post-title"><a href="{{ .RelPermalink }}">{{ .Title }}</a></h2>
<section class="post-excerpt">
<p>{{ .Summary }} <a class="read-more" href="{{.RelPermalink}}">&raquo;</a></p>
</section>
<footer class=" footline" >
{{with .Params.LastModifierDisplayName}}
<i class='fa fa-user'></i> <a href="mailto:{{ $.Params.LastModifierEmail }}">{{ . }}</a> {{with $.Date}} <i class='fa fa-calendar'></i> {{ .Format "02/01/2006" }}{{end}}
{{end}}
</footer>
</article>
22 changes: 9 additions & 13 deletions layouts/_default/list.html
Original file line number Diff line number Diff line change
@@ -1,20 +1,16 @@
{{ define "main" }}
{{if .Content}}
{{ .Content }}
{{else }}
{{ $paginator := .Paginator }}

{{ if .Content }}
{{- .Content }}
{{ else }}
{{- $paginator := .Paginator }}
<div class="extra-pagination inner">
{{ partial "pagination.html" $paginator }}
<nav class="pagination" role="navigation"></nav>
</div>

{{ range $index, $page := $paginator.Pages }}
{{ .Render "li" }}
{{ end }}
{{- range $index, $page := $paginator.Pages }}
{{ .Render "li" }}
{{- end }}

<div style="margin-bottom:2rem"></div>

{{ partial "pagination.html" $paginator }}

<nav class="pagination" role="navigation"></nav>
{{end}}
{{end}}
5 changes: 0 additions & 5 deletions layouts/partials/body-aftercontent.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,7 @@
</div>
</div>

{{ partial "next-prev-page.html" . }}

</section>
<div style="left: -1000px; overflow: scroll; position: absolute; top: -1000px; border: none; box-sizing: content-box; height: 200px; margin: 0px; padding: 0px; width: 200px;">
<div style="border: none; box-sizing: content-box; height: 200px; margin: 0px; padding: 0px; width: 200px;"></div>
</div>

{{ partial "scripts.html" . }}

27 changes: 6 additions & 21 deletions layouts/partials/body-beforecontent.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
<div id="headermain"></div>
<nav id="sidebar" class="{{if $.Site.Params.showVisitedLinks }}showVisitedLinks{{end}}">


<nav id="sidebar">

<div class="highlightable">
<div id="header-wrapper">
Expand All @@ -11,11 +9,9 @@
</div>

<ul class="topics">
{{- if not .Site.Params.disableHomeIcon}}
<li data-nav-id="{{"/" | relLangURL}}" class="dd-item">
<a href="{{"/" | relLangURL}}"><i class="fa fa-fw fa-home"></i></a>
</li>
{{- end}}
<li data-nav-id="{{"/" | relLangURL}}" class="dd-item">
<a href="{{"/" | relLangURL}}"><i class="fa fa-fw fa-home"></i></a>
</li>

{{- with .Site.Menus.main}}
<section id="shortcuts">
Expand All @@ -42,10 +38,6 @@
{{- end}}
</section>

{{- if $.Site.Params.showVisitedLinks}}
<a id="clear-history" class="" href="#" data-clear-history-toggle=""><i class="fa fa-history"></i> {{T "Clear-History"}}</a>
{{- end}}

{{- end}}

<hr />
Expand All @@ -64,17 +56,10 @@
<div class="padding highlightable">
{{if not .IsHome}}
<div id="top-bar">
{{ if and (or .IsPage .IsSection) .Site.Params.editURL }}
{{ $File := .File }}
{{ $Site := .Site }}
{{with $File.Path }}
{{ if isset .Params "original_url" }}
<div id="top-github-link">
<a class="github-link" href="{{ $Site.Params.editURL }}{{ replace $File.Dir "\\" "/" }}{{ $File.LogicalName }}" target="blank">
<i class="fa fa-code-fork"></i>
{{T "Edit-this-page"}}
</a>
<a class="github-link" title="View Original on GitHub" href="{{ .Params.original_url }}" target="blank"><i class="fa fa-github"></i></a>
</div>
{{- end }}
{{- end -}}

<div id="breadcrumbs" itemscope="" itemtype="https://schema.org/breadcrumb">
Expand Down
2 changes: 2 additions & 0 deletions layouts/partials/calendar-head.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<link href="{{"css/fullcalendar.min.css" | relURL}}" rel="stylesheet">
<link href="{{"css/fullcalendar.print.min.css" | relURL}}" rel="stylesheet" media="print" >
33 changes: 33 additions & 0 deletions layouts/partials/calendar-scripts.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<script type="text/javascript" src="{{"js/moment.min.js" | relURL }}"></script>
<script type="text/javascript" src="{{"js/fullcalendar.min.js" | relURL }}"></script>
<script type="text/javascript" src="{{"js/gcal.min.js" | relURL }}"></script>
<script>
$(document).ready(function () {
$('#calendar').fullCalendar({
defaultView: 'agendaWeek',
displayEventTime: true,
eventLimit: true,
nowIndicator: true,
navLinks: true,
timezone: 'local',
header: {
left: 'prev,today,next',
center: 'title' ,
right: 'agendaDay,agendaWeek,month'
},
views: {
month: {
eventLimit: 6
}
},
googleCalendarApiKey: 'AIzaSyDn_UhFPLDgxouI5nc8hOULFY25EjwGR44',
events: {
googleCalendarId: '[email protected]'
},
eventClick: function(event) {
window.open(event.url, 'gcalevent', 'width=600,height=600');
return false;
}
})
});
</script>
9 changes: 9 additions & 0 deletions layouts/partials/google-analytics.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-36037335-10"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());

gtag('config', 'UA-36037335-10');
</script>
30 changes: 9 additions & 21 deletions layouts/partials/head.html
Original file line number Diff line number Diff line change
@@ -1,13 +1,4 @@
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-36037335-10"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());

gtag('config', 'UA-36037335-10');
</script>

{{ partial "google-analytics.html" . }}
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
{{ .Hugo.Generator }}
Expand All @@ -16,16 +7,13 @@
<link rel="shortcut icon" href="{{"images/favicon.png" | relURL}}" type="image/x-icon" />
<link href="{{"css/nucleus.css" | relURL}}" rel="stylesheet">
<link href="{{"css/font-awesome.min.css" | relURL}}" rel="stylesheet">
<link href="{{"css/featherlight.min.css" | relURL}}" rel="stylesheet">
<link href="{{"css/fonts.css" | relURL}}" rel="stylesheet">
<link href="{{"css/style.css" | relURL}}" rel="stylesheet">
{{ range .Site.Params.custom_css -}}
<link rel="stylesheet" href="{{ . | absURL }}">
{{- end }}
<link rel="stylesheet" href="{{"css/bootstrap.min.css" | relURL}}">
<script src="{{"js/jquery-2.x.min.js" | relURL}}"></script>
<style type="text/css">
:root #header + #content > #left > #rlblock_left {
display:none !important;
}
</style>
{{ if eq .Section "events" }}{{ partial "calendar-head.html" . }}{{ end }}
<script type="text/javascript"> var baseurl = "{{.Site.BaseURL}}"; </script>
<script type="text/javascript" src="{{"js/jquery.min.js" | relURL}}"></script>
<script type="text/javascript" src="{{"js/clipboard.min.js" | relURL}}"></script>
<script type="text/javascript" src="{{"js/docdock.js" | relURL}}"></script>
<script type="text/javascript" src="{{"js/script.js" | relURL}}"></script>
{{- if eq .Section "events" }}{{ partial "calendar-scripts.html" . }}{{ end }}
{{ partial "custom-head.html" . }}
42 changes: 8 additions & 34 deletions layouts/partials/menu.html
Original file line number Diff line number Diff line change
@@ -1,19 +1,12 @@
{{- $currentNode := . }}
{{- $showvisitedlinks := .Site.Params.showVisitedLinks -}}

{{- if eq .Site.Params.ordersectionsby "title"}}
{{- range .Site.Home.Sections.ByTitle}}
{{- template "section-tree-nav" dict "sect" . "currentnode" $currentNode "showvisitedlinks" $showvisitedlinks}}
{{- end}}
{{- else}}
{{- range .Site.Home.Sections.ByWeight}}
{{- template "section-tree-nav" dict "sect" . "currentnode" $currentNode "showvisitedlinks" $showvisitedlinks}}
{{- end}}
{{- range .Site.Home.Sections.ByTitle}}
{{- template "section-tree-nav" dict "sect" . "currentnode" $currentNode }}
{{- end}}


<!-- templates -->
{{- define "section-tree-nav" }}
{{- $showvisitedlinks := .showvisitedlinks }}
{{- $currentNode := .currentnode }}
{{- with .sect}}
{{- if and .IsSection (or (not .Params.hidden) $.showhidden)}}
Expand All @@ -23,8 +16,7 @@
{{- if .IsAncestor $currentNode}} parent{{end}}
{{- if eq .URL $currentNode.URL}} active{{end}}
{{- if .Params.alwaysopen}} alwaysopen{{end -}}
{{- if ne $numberOfPages 0 }} haschildren{{end}}
">
{{- if ne $numberOfPages 0 }} haschildren{{end}}">
<div>
<a href="{{ .RelPermalink}}">{{safeHTML .Params.Pre}}{{.Title}}{{safeHTML .Params.Post}}</a>

Expand All @@ -36,44 +28,26 @@
{{- end}}
{{- end}}

{{- if $showvisitedlinks}}<i class="fa fa-circle-thin read-icon"></i>{{end}}
</div>
{{- if ne $numberOfPages 0 }}
<ul>
{{- .Scratch.Set "pages" .Pages }}
{{- if .Sections}}
{{- .Scratch.Set "pages" (.Pages | union .Sections) }}
{{- end}}
{{- if .Sections}}{{ .Scratch.Set "pages" (.Pages | union .Sections) }}{{end}}
{{- $pages := (.Scratch.Get "pages") }}

{{- if eq .Site.Params.ordersectionsby "title"}}
{{- range $pages.ByTitle }}
{{- if and .Params.hidden (not $.showhidden) }}
{{- else}}
{{- template "section-tree-nav" dict "sect" . "currentnode" $currentNode "showvisitedlinks" $showvisitedlinks }}
{{- template "section-tree-nav" dict "sect" . "currentnode" $currentNode }}
{{- end}}
{{- end}}
{{- else}}
{{- range $pages.ByWeight }}
{{- if and .Params.hidden (not $.showhidden) }}
{{- else}}
{{- template "section-tree-nav" dict "sect" . "currentnode" $currentNode "showvisitedlinks" $showvisitedlinks }}
{{- end}}
{{- end}}
{{- end}}
</ul>
{{- end}}
</li>
{{- else}}
{{- if not .Params.Hidden }}
<li data-nav-id="{{.URL}}" class="dd-item
{{- if eq .URL $currentNode.URL}} active{{end -}}
">
<li data-nav-id="{{.URL}}" class="dd-item {{- if eq .URL $currentNode.URL}} active{{end}}">
<div>
<a href="{{ .RelPermalink}}">
{{safeHTML .Params.Pre}}{{.LinkTitle}}{{safeHTML .Params.Post}}
</a>
{{- if $showvisitedlinks}}<i class="fa fa-circle-thin read-icon"></i>{{end}}
<a href="{{ .RelPermalink}}">{{safeHTML .Params.Pre}}{{.LinkTitle}}{{safeHTML .Params.Post}}</a>
</div>
</li>
{{- end}}
Expand Down
44 changes: 0 additions & 44 deletions layouts/partials/next-prev-page.html

This file was deleted.

9 changes: 0 additions & 9 deletions layouts/partials/pagination.html

This file was deleted.

4 changes: 0 additions & 4 deletions layouts/partials/scripts.html

This file was deleted.

Loading