diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..5d12634 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,13 @@ +# editorconfig.org +root = true + +[*] +indent_style = space +indent_size = 2 +end_of_line = lf +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true + +[*.md] +trim_trailing_whitespace = false diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..4f7e422 --- /dev/null +++ b/.gitignore @@ -0,0 +1,7 @@ +/node_modules +/content +/svgpack +yarn-error.log +config.toml +npm-debug.log +!/exampleSite/config.toml diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..0bd8662 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,26 @@ +language: node_js + +node_js: + - "6" + +sudo: false + +cache: + directories: + - node_modules + +branches: + only: + - master + +before_script: bash ./bin/build.sh + +script: + - ls -al static/css/style.css + +after_success: bash ./bin/deploy.sh + +env: + global: + - GH_REF: github.com/mismith0227/hugo_theme_pickles.git + - secure: "3+eJcE7w2FHiUCywL8jmk4c8M55crxZ8UYZ8sU/HQ+Q07usF/2loFCTv1kmZOs6/sYMIIdbs4E6W402eDkjL++VdQ8JWvs3b5ZHvZPlsw22gJzmoutRAhY+7zKUiAl8NyFcH5X+Co/hJL3OU747tI8pcgpY4cP4kfRetxtwP22n5ozdc5103BajgKjAQbmDDcOxjX2P/lc6Qghxwxtt6hmnT8wjwBPd3kyu9bz59bYPynlf+Igju+R+zHXKwbClNs3wcdTHXxtPl1EuOEYiMWcwGJUCwkLz7g2wVTIGkl9vbTGQqlxkobvOVdrPLoVyUlFLdQrB8t06MCUawan9K+gn0RUlo35tNGUeuuJGN8aaAgWJ2L0/QkW64qzHysHg/MfQ3KWkzUDhuVjoG/ZAW1k2pY6cBrvULPbQNC+pICbkYjHHqSUwjRp6xU7ZuLgEsDPN04lI/UGhfbVKfnpqujl4sDkTHugnwffUj76BaFT+H/g6S50v2HI9PHi6FDFRncTkR9LLpLYxdVTkr5A83m/7QOto+ZcZKKzoJeVxHZXRem2NvR090yg31bgzQv3oMopGSUOmzmbX27OwzV78XyTTYdGKcVRzZBo+oELY/tHL3UhDIyTWmdFt+FHQqHzz/rFZO3xaU/Pl5IC1YXB92pIQ9OPTqV6IaYEiwiqJuum0=" diff --git a/LICENSE.md b/LICENSE.md index 624b3f3..993c947 100644 --- a/LICENSE.md +++ b/LICENSE.md @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2018 YOUR_NAME_HERE +Copyright (c) 2017 Takuma Misumi Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in diff --git a/README.md b/README.md new file mode 100644 index 0000000..efa2bfb --- /dev/null +++ b/README.md @@ -0,0 +1,97 @@ +# Pickles [![Build Status](https://travis-ci.org/mismith0227/hugo_theme_pickles.svg?branch=master)](https://travis-ci.org/mismith0227/hugo_theme_pickles) [![license](https://img.shields.io/github/license/mashape/apistatus.svg)](https://github.com/mismith0227/hugo_theme_pickles/blob/master/license.md) [![Standard - JavaScript Style Guide](https://cdn.rawgit.com/feross/standard/master/badge.svg)](https://github.com/feross/standard) + +Pickles is a modern, simple and beautiful Hugo theme. + +![screenshot](https://github.com/mismith0227/hugo_theme_pickles/blob/master/images/screenshot.png) + +## Overview + +* Modern, Simple and beautiful design +* Medium's Image Zoom([zoom.js](https://github.com/fat/zoom.js/)) +* Social links(Twitter,Facebook,Instagram,Google+,GitHub,GitLab,npm,Codepen,Dribbble,500px,Flickr,Pinterest,Tumblr,Vimeo,YouTube,Linkedin) +* Support for Related Content +* Support for tags +* Analytics with Google Analytics +* Responsive design +* SVG Sprite + +Use short code for Image Zoom. + +``` +{{% zoom-img src="/images/default.jpg" %}} +``` + +## Features + +* gulp +* webpack +* PostCSS +* Babel +* SVG Sprite +* Standard + +## Installation + +In your hugo site directory, run: + +```shell +$ mkdir themes +$ cd themes +$ git clone -b release https://github.com/mismith0227/hugo_theme_pickles +``` + +Or download it from the release branch + +[release](https://github.com/mismith0227/hugo_theme_pickles/tree/release) + +## Usage + +Use hugo's -t hugo_theme_pickles or --theme=hugo_theme_pickles option with hugo commands. Example: + +```shell +$ hugo server -t hugo_theme_pickles -w -D +``` + +## Configuration + +You may specify following options in `config.toml` of your site to make use of +this theme's features. + +For getting started with Pickles, copy the [config.toml](https://github.com/mismith0227/hugo_theme_pickles/blob/master/exampleSite/config.toml) file from the exampleSite directory inside Pickles’s repository to your site repository. + +```shell +$ cp themes/hugo_theme_pickles/exampleSite/config.toml . +``` + +Now, you can start editing this file and add your own information! + +## Contributing + +Pull requests, bug fixes and new features are welcome! + +Please create feature branches from [develop](https://github.com/mismith0227/hugo_theme_pickles/tree/develop) and submit a PR for any change. + +## Development + +1. Install Node modules + + $ yarn + +1. Run gulp. You don't need to install gulp globally. + + // Development + $ yarn run dev + $ // On another tab + $ hugo server + + // Production (compress) + $ yarn run prod + $ // On another tab + $ hugo server + + // Build + $ yarn run build + +## License + +Open sourced under the MIT license. diff --git a/archetypes/default.md b/archetypes/default.md index ac36e06..2a3b476 100644 --- a/archetypes/default.md +++ b/archetypes/default.md @@ -1,2 +1,6 @@ -+++ -+++ +--- +title: "{{ replace .TranslationBaseName "-" " " | title }}" +date: {{ .Date }} +thumbnail: "path/thumbnail.jpg" +draft: true +--- diff --git a/config.js b/config.js new file mode 100644 index 0000000..820a286 --- /dev/null +++ b/config.js @@ -0,0 +1,71 @@ +import minimist from 'minimist' + +const envSettings = { + string: 'env', + default: { + env: process.env.NODE_ENV || 'development' + } +} + +const options = minimist(process.argv.slice(2), envSettings) +const production = options.env === 'production' + +const config = { + dirs: { + src: './src', + dest: './static' + }, + envProduction: production +} + +const tasks = { + css: { + src: `${config.dirs.src}/css/style.css`, + dest: `${config.dirs.dest}/css`, + processors: [ + require('postcss-import'), + require('postcss-custom-properties'), + require('postcss-custom-media'), + require('postcss-apply'), + require('postcss-nesting'), + require('postcss-flexbugs-fixes'), + require('autoprefixer'), + require('postcss-browser-reporter')({ + selector: 'body:before' + }), + require('postcss-reporter')({ + clearMessages: true + }) + ], + minifyLib: require('csswring') + }, + webpack: { + src: `${config.dirs.src}/js/app.js`, + dest: `${config.dirs.dest}/js`, + filename: 'bundle.js' + }, + watch: { + css: [`${config.dirs.src}/css/**/*.css`], + image: [`${config.dirs.src}/img/**/*`], + webpack: [`${config.dirs.src}/js/**/*.js`] + }, + images: { + src: `${config.dirs.src}/images/**/*`, + dest: `${config.dirs.dest}/images` + }, + svg: { + src: `${config.dirs.src}/svg/*.svg`, + dest: './svgpack' + }, + svgRename: { + src: './svgpack/svgpack-sprite.svg', + dest: './layouts/partials', + filename: 'svgpack-sprite.html' + }, + clean: [ + config.dirs.dest + ] +} + +config.tasks = tasks +module.exports = config diff --git a/exampleSite/config.toml b/exampleSite/config.toml new file mode 100644 index 0000000..fef4a83 --- /dev/null +++ b/exampleSite/config.toml @@ -0,0 +1,97 @@ +baseurl = "Your site URL" +languageCode = "en-us" +Title = "Your site title" +# Copyright notice. This is displayer in the footer. +copyright = "© Copyright notice" + +[params] + paginate = 10 + # Social accounts. Link to these accounts are displayed in the header and + # footer + twitter = "Your Twitter username" + facebook = "Your Facebook username" + instagram = "Your Instagram username" + googleplus = "Your Google+ account URL" # https://plus.google.com/u/0/xxxxxx + github = "Your GitHub username" + gitlab = "Your GitLab username" + npm = "Your npm username" + codepen = "Your CodePen username" + dribbble = "Your Dribbble username" + fivehundredpx = "Your 500px username" # 500px + flickr = "Your Flickr username" + pinterest = "Your Pinterest username" + tumblr = "Your Tumblr username" + vimeo = "Your Vimeo username" + youtube = "Your YouTube username" + linkedin = "Your LinkedIn username" + # Disqus shortname + disqus = "" + # Google Analytics API key. + ga_api_key = "Your Google Analytics tracking id" + author = "Your Name" + authorwebsite = "example.com" + avatar = "/path/to/avatar" + contact = "Your contact link (ex. mailto:foo@example.com)" + bio = "Your short bio" + # Short subtitle/tagline. This is displayed in the header. + subtitle = "Short subtitle" + # Logo image. This is displayed ogp image. + logo = "/path/to/logo" + favicon = "/path/to/favicon" + +[[menu.main]] + name = "Blog" + url = "/" + weight = 1 + +[[menu.main]] + name = "About" + url = "/about" + weight = 2 + +[[menu.main]] + identifier = "theme" + name = "/theme" + weight = 3 + +[[menu.main]] + parent = "theme" + name = "creating-a-new-theme" + url = "/posts/creating-a-new-theme" + weight = 1 + +[[menu.main]] + parent = "theme" + name = "migrate-from-jekyll" + url = "/posts/migrate-from-jekyll" + weight = 2 + +[[menu.main]] + name = "Tags" + url = "/tags" + weight = 4 + +[related] + # Only include matches with rank >= threshold. This is a normalized rank between 0 and 100. + threshold = 80 + + # To get stable "See also" sections we, by default, exclude newer related pages. + includeNewer = false + + # Will lower case keywords in both queries and in the indexes. + toLower = false + + [[related.indices]] + name = "keywords" + weight = 150 + [[related.indices]] + name = "author" + toLower = true + weight = 30 + [[related.indices]] + name = "tags" + weight = 100 + [[related.indices]] + name = "date" + weight = 10 + pattern = "2017" diff --git a/exampleSite/content/about.md b/exampleSite/content/about.md new file mode 100644 index 0000000..4156cdc --- /dev/null +++ b/exampleSite/content/about.md @@ -0,0 +1,16 @@ ++++ +title = "About Hugo" +date = "2014-04-09" ++++ + +Hugo is a static site engine written in Go. + + +It makes use of a variety of open source projects including: + +* [Cobra](https://github.com/spf13/cobra) +* [Viper](https://github.com/spf13/viper) +* [J Walter Weatherman](https://github.com/spf13/jWalterWeatherman) +* [Cast](https://github.com/spf13/cast) + +Learn more and contribute on [GitHub](https://github.com/gohugoio). diff --git a/exampleSite/content/posts/goisforlovers.md b/exampleSite/content/posts/goisforlovers.md new file mode 100644 index 0000000..f51b7ae --- /dev/null +++ b/exampleSite/content/posts/goisforlovers.md @@ -0,0 +1,343 @@ ++++ +title = "(Hu)go Template Primer" +description = "" +tags = [ + "go", + "golang", + "templates", + "themes", + "development", +] +date = "2014-04-02" +categories = [ + "Development", + "golang", +] ++++ + +Hugo uses the excellent [go][] [html/template][gohtmltemplate] library for +its template engine. It is an extremely lightweight engine that provides a very +small amount of logic. In our experience that it is just the right amount of +logic to be able to create a good static website. If you have used other +template systems from different languages or frameworks you will find a lot of +similarities in go templates. + +This document is a brief primer on using go templates. The [go docs][gohtmltemplate] +provide more details. + +## Introduction to Go Templates + +Go templates provide an extremely simple template language. It adheres to the +belief that only the most basic of logic belongs in the template or view layer. +One consequence of this simplicity is that go templates parse very quickly. + +A unique characteristic of go templates is they are content aware. Variables and +content will be sanitized depending on the context of where they are used. More +details can be found in the [go docs][gohtmltemplate]. + +## Basic Syntax + +Go lang templates are html files with the addition of variables and +functions. + +**Go variables and functions are accessible within {{ }}** + +Accessing a predefined variable "foo": + + {{ foo }} + +**Parameters are separated using spaces** + +Calling the add function with input of 1, 2: + + {{ add 1 2 }} + +**Methods and fields are accessed via dot notation** + +Accessing the Page Parameter "bar" + + {{ .Params.bar }} + +**Parentheses can be used to group items together** + + {{ if or (isset .Params "alt") (isset .Params "caption") }} Caption {{ end }} + + +## Variables + +Each go template has a struct (object) made available to it. In hugo each +template is passed either a page or a node struct depending on which type of +page you are rendering. More details are available on the +[variables](/layout/variables) page. + +A variable is accessed by referencing the variable name. + +