mirror of
https://github.com/McShelby/hugo-theme-relearn.git
synced 2024-11-23 07:47:54 +00:00
feat: partials for style and scripts are now empty
This commit is contained in:
parent
9ac9c082b1
commit
f50a77d0c5
14 changed files with 98 additions and 44 deletions
21
README.md
21
README.md
|
@ -1,5 +1,22 @@
|
|||
# Learn Hugo Theme
|
||||
|
||||
This repository contains a theme for Hugo, based on great Grav Learn Theme (http://learn.getgrav.org/).
|
||||
This repository contains a theme for [Hugo](https://gohugo.io/), based on great [Grav Learn Theme](http://learn.getgrav.org/).
|
||||
|
||||
**/!\ Is currently a draft project**
|
||||
Visit the [theme documentation](https://matcornic.github.io/hugo-learn-doc) to see what is going on. It is actually built with this theme.
|
||||
|
||||
# Main functionalities
|
||||
|
||||
- Handle two levels of documentation
|
||||
- Tip/Note/Info and Warning boxes
|
||||
- Resize images
|
||||
- Preview of original image size
|
||||
- Add shadow or border on images
|
||||
- Automatic table of contents
|
||||
- Create buttons (typically used to provide a link to a demo)
|
||||
|
||||
# TODO
|
||||
|
||||
- Handling more than 2 levels in documentation.
|
||||
- Search in site
|
||||
- Handling videos
|
||||
- Add optional button to create doc issue (like github)
|
||||
|
|
14
archetypes/chapter.md
Normal file
14
archetypes/chapter.md
Normal file
|
@ -0,0 +1,14 @@
|
|||
---
|
||||
title: "Some Chapter title"
|
||||
weight: 0
|
||||
prev: /prev/path
|
||||
next: /next/path
|
||||
chapter: true
|
||||
icon: "<b>X. </b>" # HTML code as prefix in the menu
|
||||
---
|
||||
|
||||
### Chapter X
|
||||
|
||||
# Some Chapter title
|
||||
|
||||
Lorem ipsum
|
|
@ -1,11 +1,9 @@
|
|||
---
|
||||
title: "Some Title"
|
||||
aliases:
|
||||
- /some/path
|
||||
weight: 0 # To change for order
|
||||
weight: 5
|
||||
prev: /prev/path
|
||||
next: /next/path
|
||||
toc: true # For leaf pages
|
||||
#chapter: true # For nodes pages
|
||||
#icon: "<b>1. </b>" # Prefix icon for node pages
|
||||
toc: true
|
||||
---
|
||||
|
||||
Lorem Ipsum
|
||||
|
|
|
@ -6,9 +6,27 @@
|
|||
{{ partial "favicon.html" . }}
|
||||
{{ .Scratch.Add "title" "" }}{{ if isset .Site.Data.titles .Title }}{{ .Scratch.Set "title" (index .Site.Data.titles .Title).title }}{{ else }}{{ .Scratch.Set "title" .Title}}{{end}}
|
||||
<title>{{ .Scratch.Get "title" }}</title>
|
||||
{{ partial "head_includes.html" . }}
|
||||
{{ partial "style.html" . }}
|
||||
<link href="/css/nucleus.css" rel="stylesheet">
|
||||
<link href="/css/font-awesome.min.css" rel="stylesheet">
|
||||
<link href="/css/hybrid.css" rel="stylesheet">
|
||||
<link href="/css/featherlight.min.css" rel="stylesheet">
|
||||
<link href="/css/perfect-scrollbar.min.css" rel="stylesheet">
|
||||
<link href="/css/theme.css" rel="stylesheet">
|
||||
<link href="/css/hugo-theme.css" rel="stylesheet">
|
||||
<style type="text/css">
|
||||
:root #header + #content > #left > #rlblock_left {display:none !important;}
|
||||
:root #header + #content > #left > #rlblock_left {
|
||||
display:none !important;
|
||||
}
|
||||
|
||||
p,li,ul {
|
||||
text-align: center
|
||||
}
|
||||
|
||||
ul
|
||||
{
|
||||
list-style-type: none;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
|
@ -19,10 +37,15 @@
|
|||
|
||||
<div class="padding highlightable">
|
||||
<h1>Customize your own home page</h1>
|
||||
<p style="text-align: center">
|
||||
The site is working but you should overwrite this index.html with your own.
|
||||
If you want to redirect You may want to redirect to the first document page.
|
||||
<p>
|
||||
The site is working, change the URL in your browser to get to any custom page. But, don't forget to <a href="https://gohugo.io/themes/customizing/">overwrite this index.html</a> with your own. You typically have 3 choices :
|
||||
</p>
|
||||
<ul>
|
||||
<li><b>1. </b> Create an overview page for your project</li>
|
||||
<li><b>2. </b> Create an empty html page with this code in the head tag to redirect to one of your documentation page : <code><meta http-equiv="refresh" content="0; url=http://example.com/"/></code> </li>
|
||||
<li><b>3. </b> Configure your server to automatically redirect home page to one your documentation page</li>
|
||||
</ul>
|
||||
<p><i class="fa fa-heart fa-4x"></i></p>
|
||||
</div>
|
||||
</section>
|
||||
</body>
|
||||
|
|
|
@ -14,6 +14,18 @@
|
|||
<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 "script_includes.html" . }}
|
||||
<script src="/js/jquery-2.x.min.js"></script>
|
||||
<script src="/js/clipboard.min.js"></script>
|
||||
<script src="/js/perfect-scrollbar.min.js"></script>
|
||||
<script src="/js/perfect-scrollbar.jquery.min.js"></script>
|
||||
<script src="/js/jquery.sticky-kit.min.js"></script>
|
||||
<script src="/js/featherlight.min.js"></script>
|
||||
<script src="/js/html5shiv-printshiv.min.js"></script>
|
||||
<script src="/js/highlight.pack.js"></script>
|
||||
<script>hljs.initHighlightingOnLoad();</script>
|
||||
<script src="/js/modernizr.custom.71422.js"></script>
|
||||
<script src="/js/learn.js"></script>
|
||||
<script src="/js/hugo-learn.js"></script>
|
||||
{{ partial "script.html" . }}
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
@ -1,9 +0,0 @@
|
|||
<link href="/css/nucleus.css" rel="stylesheet">
|
||||
<link href="/css/font-awesome.min.css" rel="stylesheet">
|
||||
<link href="/css/hybrid.css" rel="stylesheet">
|
||||
<link href="/css/featherlight.min.css" rel="stylesheet">
|
||||
<link href="/css/perfect-scrollbar.min.css" rel="stylesheet">
|
||||
<link href="/css/theme.css" rel="stylesheet">
|
||||
<link href="/css/hugo-theme.css" rel="stylesheet">
|
||||
<style type="text/css">:root #header + #content > #left > #rlblock_left
|
||||
{display:none !important;}</style>
|
|
@ -1,11 +1,23 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en" class="js csstransforms3d">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
|
||||
{{ .Hugo.Generator }}
|
||||
{{ partial "meta.html" . }}
|
||||
{{ partial "favicon.html" . }}
|
||||
{{ .Scratch.Add "title" "" }}{{ if isset .Site.Data.titles .Title }}{{ .Scratch.Set "title" (index .Site.Data.titles .Title).title }}{{ else }}{{ .Scratch.Set "title" .Title}}{{end}}
|
||||
<title>{{ .Scratch.Get "title" }}</title>
|
||||
{{ partial "head_includes.html" . }}
|
||||
<link href="/css/nucleus.css" rel="stylesheet">
|
||||
<link href="/css/font-awesome.min.css" rel="stylesheet">
|
||||
<link href="/css/hybrid.css" rel="stylesheet">
|
||||
<link href="/css/featherlight.min.css" rel="stylesheet">
|
||||
<link href="/css/perfect-scrollbar.min.css" rel="stylesheet">
|
||||
<link href="/css/theme.css" rel="stylesheet">
|
||||
<link href="/css/hugo-theme.css" rel="stylesheet">
|
||||
<style type="text/css">:root #header + #content > #left > #rlblock_left
|
||||
{display:none !important;}</style>
|
||||
{{ partial "style.html" . }}
|
||||
</head>
|
||||
<body class="" data-url="/">
|
||||
{{ partial "menu.html" . }}
|
||||
|
@ -34,7 +46,7 @@
|
|||
</a>
|
||||
</span>
|
||||
{{ if and (not .Params.chapter) (.Params.toc) }}
|
||||
<span id="toc-menu"><a href=""><i class="fa fa-ellipsis-v"></i></a></span>
|
||||
<span id="toc-menu"><a href=""><i class="fa fa-list-alt"></i></a></span>
|
||||
{{ end }}
|
||||
{{ $type := .Type }}
|
||||
{{ $relLink := .RelPermalink }}
|
||||
|
|
|
@ -1,5 +1,2 @@
|
|||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
|
||||
<meta name="description" content="{{ with .Description }}{{ . }}{{ else }}{{ with .Site.Params.description }}{{ . }}{{ end }}{{ end }}">
|
||||
{{ with .Site.Params.author }}<meta name="author" content="{{ . }}">{{ end }}
|
||||
{{ .Hugo.Generator }}
|
||||
|
|
1
layouts/partials/script.html
Normal file
1
layouts/partials/script.html
Normal file
|
@ -0,0 +1 @@
|
|||
<!-- Partial intended to be overwritten to add javacript -->
|
|
@ -1,12 +0,0 @@
|
|||
<script src="/js/jquery-2.x.min.js"></script>
|
||||
<script src="/js/clipboard.min.js"></script>
|
||||
<script src="/js/perfect-scrollbar.min.js"></script>
|
||||
<script src="/js/perfect-scrollbar.jquery.min.js"></script>
|
||||
<script src="/js/jquery.sticky-kit.min.js"></script>
|
||||
<script src="/js/featherlight.min.js"></script>
|
||||
<script src="/js/html5shiv-printshiv.min.js"></script>
|
||||
<script src="/js/highlight.pack.js"></script>
|
||||
<script>hljs.initHighlightingOnLoad();</script>
|
||||
<script src="/js/modernizr.custom.71422.js"></script>
|
||||
<script src="/js/learn.js"></script>
|
||||
<script src="/js/hugo-learn.js"></script>
|
1
layouts/partials/style.html
Normal file
1
layouts/partials/style.html
Normal file
|
@ -0,0 +1 @@
|
|||
<!-- Partial intended to be overwritten to add CSS -->
|
|
@ -231,7 +231,7 @@ jQuery(document).ready(function() {
|
|||
$('#top-bar a:not(:has(img)):not(.btn)').addClass('highlight');
|
||||
$('#body-inner a:not(:has(img)):not(.btn)').addClass('highlight');
|
||||
|
||||
$('#toc-menu a').hover(function() {
|
||||
$('#toc-menu').hover(function() {
|
||||
$('.progress').stop(true, false, true).fadeToggle(100);
|
||||
});
|
||||
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
# theme.toml template for a Hugo theme
|
||||
# See https://github.com/spf13/hugoThemes#themetoml for an example
|
||||
|
||||
name = "learn"
|
||||
name = "Learn"
|
||||
license = "MIT"
|
||||
licenselink = "https://github.com/matcornic/hugo-theme-learn/blob/master/LICENSE.md"
|
||||
description = "Documentation theme for Hugo, based on Grav Learn theme"
|
||||
#homepage = "http://siteforthistheme.com/"
|
||||
homepage = "http://matcornic.github.io/hugo-learn-doc"
|
||||
tags = ["documentation", "grav", "learn"]
|
||||
features = ["documentation"]
|
||||
min_version = 0.15
|
||||
|
@ -15,6 +15,6 @@ min_version = 0.15
|
|||
homepage = "http://matcornic.com"
|
||||
|
||||
[original]
|
||||
name = "Grav"
|
||||
name = "Grav Learn"
|
||||
homepage = "http://learn.getgrav.org/"
|
||||
repo = "https://github.com/getgrav/grav-learn"
|
||||
|
|
Loading…
Reference in a new issue