Skip to content

Commit

Permalink
Merge branch 'release-0.6.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
thingsym committed Jan 14, 2020
2 parents d6d3a93 + fdb43d5 commit 249f938
Show file tree
Hide file tree
Showing 14 changed files with 3,286 additions and 2,974 deletions.
198 changes: 102 additions & 96 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,102 +58,104 @@ For an example of `config.toml`, [config.toml](https://github.com/thingsym/hugo-
### Directory layout

```
archetypes
|- default.md
exampleSite
|- config.toml
|- ...
images
|- screenshot.png
|- tn.png
|- ...
layouts
|- index.html
|- 404.html
|- _default
| |- baseof.html
| |- list.html
| |- single.html
|- blog
| |- li.html
| |- list.html
| |- single.html
| |- summary.html
|- partials
| |- content-footer.html
| |- custom-head.html
| |- edit-meta.html
| |- edit-page.html
| |- footer.html
| |- global-menu.html
| |- head.html
| |- last-updated.html
| |- menu
| | |- open-menu.html
| | |- slide-menu.html
| |- meta
| | |- chroma.html
| | |- google-analytics-async.html
| | |- google-site-verification.html
| | |- metatag-manager.html
| |- notification.html
| |- pagination.html
| |- powered.html
| |- prepend-body.html
| |- sidebar-footer.html
| |- sidebar.html
| |- site-header.html
| |- table-of-contents.html
|- posts
| |- list.html
| |- single.html
|- shortcodes
|- button.html
|- panel.html
node_modules
resources
src
|- js
| |- jquery.backtothetop
| |- functions.js
| |- main.js
|- scss
|- foundation
| |- _element.scss
| |- _normalize.scss
| |- _reset.scss
| |- _stack.scss
|- function
| |- _calc-font-size.scss
| |- _calc-stack.scss
| |- _contrast-color.scss
| |- _strip-unit.scss
|- _component.scss
|- _foundation.scss
|- _function.scss
|- _project.scss
|- _structure.scss
|- _variable.scss
|- chroma.scss
|- theme.scss
static
|- css
| |- chroma.css
| |- chroma.min.css
| |- theme.css
| |- theme.min.css
|- images
|- js
|- bundle.js
.editorconfig
.gitignore
gulpfile.js
LICENSE.md
package-lock.json
package.json
README.md
theme.toml
webpack.config.js
.
├── archetypes
│   └── default.md
├── exampleSite
│   ├── ..
├── gulpfile.js
├── images
│   ├── ..
├── layouts
│   ├── 404.html
│   ├── blog
│   │   ├── li.html
│   │   ├── list.html
│   │   ├── single.html
│   │   └── summary.html
│   ├── _default
│   │   ├── baseof.html
│   │   ├── list.html
│   │   └── single.html
│   ├── index.html
│   ├── partials
│   │   ├── content-footer.html
│   │   ├── custom-css.html
│   │   ├── custom-head.html
│   │   ├── edit-meta.html
│   │   ├── edit-page.html
│   │   ├── footer.html
│   │   ├── global-menu.html
│   │   ├── head.html
│   │   ├── last-updated.html
│   │   ├── menu
│   │   │   ├── open-menu.html
│   │   │   └── slide-menu.html
│   │   ├── meta
│   │   │   ├── chroma.html
│   │   │   ├── google-analytics-async.html
│   │   │   ├── google-site-verification.html
│   │   │   └── tag-manager.html
│   │   ├── notification.html
│   │   ├── pagination.html
│   │   ├── powered.html
│   │   ├── prepend-body.html
│   │   ├── sidebar-footer.html
│   │   ├── sidebar.html
│   │   ├── site-header.html
│   │   └── table-of-contents.html
│   ├── posts
│   │   ├── list.html
│   │   └── single.html
│   └── shortcodes
│       ├── button.html
│       └── panel.html
├── LICENSE.md
├── node_modules
│   └── ..
├── package.json
├── package-lock.json
├── README.md
├── resources
│   └── ..
├── src
│   ├── js
│   │   ├── jquery.backtothetop
│   │   │   ├── jquery.backtothetop.js
│   │   │   └── jquery.backtothetop.min.js
│   │   ├── keydown-nav.js
│   │   ├── main.js
│   │   └── sidebar-menu.js
│   └── scss
│   ├── chroma.scss
│   ├── _component.scss
│   ├── foundation
│   │   ├── _element.scss
│   │   ├── _normalize.scss
│   │   ├── _reset.scss
│   │   └── _stack.scss
│   ├── _foundation.scss
│   ├── function
│   │   ├── _calc-font-size.scss
│   │   ├── _calc-stack.scss
│   │   ├── _contrast-color.scss
│   │   └── _strip-unit.scss
│   ├── _function.scss
│   ├── _project.scss
│   ├── _structure.scss
│   ├── theme.scss
│   └── _variable.scss
├── static
│   ├── css
│   │   ├── chroma.css
│   │   ├── chroma.min.css
│   │   ├── theme.css
│   │   └── theme.min.css
│   ├── images
│   └── js
│   └── bundle.js
├── theme.toml
└── webpack.config.js
```

### Preview site
Expand Down Expand Up @@ -204,6 +206,10 @@ Small patches and bug reports can be submitted a issue tracker in Github. Forkin

## Changelog

* Version 0.6.0 - 2020.01.13
* fix scss
* gulp bump up version to 4.0
* fix hugo deprecated warning
* Version 0.5.0 - 2019.12.08
* update Sample Document
* add table of contents
Expand Down
2 changes: 1 addition & 1 deletion exampleSite/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ enableMissingTranslationPlaceholders = false
# Souce Code repository section
description = "put your description"
github_repository = "https://github.com/thingsym/hugo-theme-techdoc"
version = "0.5.0"
version = "0.6.0"

# Documentation repository section
# documentation repository (set edit link to documentation repository)
Expand Down
4 changes: 2 additions & 2 deletions exampleSite/content/getting-started/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ For an example of `config.toml`, see [config.toml](https://github.com/thingsym/h
# Souce Code repository section
description = "put your description"
github_repository = "https://github.com/thingsym/hugo-theme-techdoc"
version = "0.5.0"
version = "0.6.0"

# Documentation repository section
# documentation repository (set edit link to documentation repository)
Expand Down Expand Up @@ -65,7 +65,7 @@ default: `https://github.com/thingsym/hugo-theme-techdoc`

The version of souce code

default: `0.5.0`
default: `0.6.0`

#### `github_doc_repository`

Expand Down
79 changes: 28 additions & 51 deletions gulpfile.js
Original file line number Diff line number Diff line change
@@ -1,32 +1,25 @@
'use strict';

var gulp = require('gulp');
var $ = require('gulp-load-plugins')();
const gulp = require('gulp');
const $ = require('gulp-load-plugins')();

require('es6-promise').polyfill();

var webpack = require("webpack");
var webpackStream = require("webpack-stream");
var webpackConfig = require("./webpack.config");
const webpack = require("webpack");
const webpackStream = require("webpack-stream");
const webpackConfig = require("./webpack.config");

var runSequence = require('run-sequence');

var browserSync = require('browser-sync').create();
var reload = browserSync.reload;

var src_paths = {
const src_paths = {
sass: ['src/scss/*.scss'],
script: ['src/js/*.js'],
};

var dest_paths = {
const dest_paths = {
style: 'static/css/',
script: 'static/js/',
browserSync: ''
};


gulp.task('lint:sass', function() {
function lint_sass() {
return gulp.src(src_paths.sass)
.pipe($.plumber({
errorHandler: function(err) {
Expand All @@ -36,7 +29,6 @@ gulp.task('lint:sass', function() {
}))
.pipe($.stylelint({
config: {
ignoreFiles: "src/scss/_normalize.scss",
extends: [
"stylelint-config-recommended",
"stylelint-scss",
Expand All @@ -47,16 +39,14 @@ gulp.task('lint:sass', function() {
"no-descending-specificity": null
}
},
reporters: [
{
formatter: 'string',
console: true
}
]
reporters: [{
formatter: 'string',
console: true
}]
}));
});
};

gulp.task('sass:style', function() {
function style_sass() {
return gulp.src(src_paths.sass)
.pipe($.plumber({
errorHandler: function(err) {
Expand All @@ -68,48 +58,35 @@ gulp.task('sass:style', function() {
outputStyle: 'expanded'
}).on( 'error', $.sass.logError ))
.pipe($.autoprefixer({
browsers: ['last 2 versions'],
cascade: false
}))
.pipe(gulp.dest(dest_paths.style))
.pipe($.cssnano())
.pipe($.rename({ suffix: '.min' }))
.pipe(gulp.dest(dest_paths.style));
});
}

gulp.task('lint:javascript', function() {
return gulp.src(dest_paths.script)
.pipe($.jshint())
.pipe($.jshint.reporter('jshint-stylish'));
});

gulp.task('lint:eslint', function() {
function lint_eslint() {
return gulp.src(src_paths.script)
.pipe($.eslint.format())
.pipe($.eslint.failAfterError());
});
};

gulp.task('webpack', function() {
function script() {
return webpackStream(webpackConfig, webpack)
.on('error', function (e) {
this.emit('end');
})
.pipe(gulp.dest("dist"));
});

gulp.task('lint', ['lint:sass', 'lint:eslint', 'lint:javascript']);
gulp.task('sass', ['sass:style']);
gulp.task('script', ['webpack']);
};

gulp.task('default', function(callback) {
runSequence(
'lint',
'sass',
'script',
callback
);
});
function watch_files(done) {
gulp.watch(src_paths.sass).on('change', gulp.series(lint_sass, style_sass));
gulp.watch(src_paths.script).on('change', gulp.series(lint_eslint, script));
}

gulp.task('watch', function() {
gulp.watch([src_paths.sass, src_paths.script], ['default']);
});
exports.lint = gulp.parallel(lint_sass, lint_eslint);
exports.style = style_sass;
exports.script = script;
exports.watch = watch_files;
exports.default = gulp.series(gulp.parallel(lint_sass, lint_eslint), gulp.parallel(style_sass, script));
2 changes: 1 addition & 1 deletion layouts/partials/edit-page.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{{- with .Site.Params.github_doc_repository -}}
<a href="{{ . }}/edit/master/content/{{ $.File.Path }}" class="edit-page"><i class="fas fa-pen-square"></i> Edit on GitHub</a>
{{- with $.File -}}<a href="{{ . }}/edit/master/content/{{ .Path }}" class="edit-page"><i class="fas fa-pen-square"></i> Edit on GitHub</a>{{- end -}}
{{- end -}}
2 changes: 1 addition & 1 deletion layouts/partials/head.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
{{- else if isset .Site.Params "description" }}
<meta name="description" content="{{ .Site.Params.description }}">
{{- end }}
{{ .Hugo.Generator }}
{{ hugo.Generator }}
<link href="{{ .Site.BaseURL }}index.xml" rel="alternate" type="application/rss+xml">
<link rel="canonical" href="{{ .Permalink }}">
<link rel="stylesheet" href="{{"css/theme.min.css" | absURL}}">
Expand Down
Loading

0 comments on commit 249f938

Please sign in to comment.