diff --git a/themes/hello-friend-ng/.eslintrc.yml b/themes/hello-friend-ng/.eslintrc.yml
new file mode 100644
index 0000000..d6c937d
--- /dev/null
+++ b/themes/hello-friend-ng/.eslintrc.yml
@@ -0,0 +1,60 @@
+---
+
+env:
+ es6: true
+
+extends:
+ # https://github.com/airbnb/javascript
+ - airbnb
+ - eslint:recommended
+ - prettier
+
+parser: babel-eslint
+
+rules:
+ # best practices
+ arrow-parens:
+ - 2
+ - as-needed
+ semi:
+ - 2
+ - never
+ class-methods-use-this: 0
+ comma-dangle:
+ - 2
+ - always-multiline
+ no-console:
+ - 2
+ no-unused-expressions: 0
+ no-param-reassign:
+ - 2
+ - props: false
+ no-useless-escape: 0
+ func-names: 0
+ quotes:
+ - 2
+ - single
+ - allowTemplateLiterals: true
+ no-underscore-dangle: 0
+ object-curly-newline: 0
+ function-paren-newline: 0
+ operator-linebreak:
+ - 2
+ - after
+ no-unused-vars:
+ - 2
+ - argsIgnorePattern: "^_"
+ # jsx a11y
+ jsx-a11y/no-static-element-interactions: 0
+ jsx-a11y/anchor-is-valid:
+ - 2
+ - specialLink:
+ - to
+
+globals:
+ document: true
+ requestAnimationFrame: true
+ window: true
+ self: true
+ fetch: true
+ Headers: true
diff --git a/themes/hello-friend-ng/.gitignore b/themes/hello-friend-ng/.gitignore
new file mode 100644
index 0000000..b512c09
--- /dev/null
+++ b/themes/hello-friend-ng/.gitignore
@@ -0,0 +1 @@
+node_modules
\ No newline at end of file
diff --git a/themes/hello-friend-ng/.prettierrc b/themes/hello-friend-ng/.prettierrc
new file mode 100644
index 0000000..8c6cd7a
--- /dev/null
+++ b/themes/hello-friend-ng/.prettierrc
@@ -0,0 +1,5 @@
+{
+ "parser": "babylon",
+ "printWidth": 100,
+ "trailingComma": "all"
+}
diff --git a/themes/hello-friend-ng/LICENSE.md b/themes/hello-friend-ng/LICENSE.md
new file mode 100644
index 0000000..9dac281
--- /dev/null
+++ b/themes/hello-friend-ng/LICENSE.md
@@ -0,0 +1,11 @@
+The MIT License (MIT)
+
+Original work Copyright (c) 2018 Track3
+Original work Copyright (c) 2019 panr
+Modified work Copyright (c) 2019 Djordje Atlialp
+
+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 the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/themes/hello-friend-ng/README.md b/themes/hello-friend-ng/README.md
new file mode 100644
index 0000000..f636927
--- /dev/null
+++ b/themes/hello-friend-ng/README.md
@@ -0,0 +1,176 @@
+# Hello Friend NG
+
+![Hello Friend NG](https://dsh.re/d27822)
+
+
+
+## General informations
+
+This theme was highly inspired by the [hello-friend](https://github.com/panr/hugo-theme-hello-friend) and [hermit](https://github.com/Track3/hermit).
+
+
+## Features
+
+- Theming: **dark/light mode**, depending on your preferences (dark is default, but you can change it)
+- Great reading experience thanks to [**Inter UI font**](https://rsms.me/inter/), made by [Rasmus Andersson](https://rsms.me/about/)
+- Nice code highlighting thanks to [**PrismJS**](https://prismjs.com)
+- An easy way to modify the theme with Hugo tooling
+- Fully responsive
+- Support for social
+
+#### Built-in shortcodes
+
+- **`image`** (prop required: **`src`**; props optional: **`alt`**, **`position`** (**left** is default | center | right), **`style`**)
+ - eg: `{{< image src="/img/hello.png" alt="Hello Friend" position="center" style="border-radius: 8px;" >}}`
+- **`figure`** (same as `image`, plus few optional props: **`caption`**, **`captionPosition`** (left | **center** is default | right), **`captionStyle`**
+ - eg: `{{< figure src="/img/hello.png" alt="Hello Friend" position="center" style="border-radius: 8px;" caption="Hello Friend!" captionPosition="right" captionStyle="color: red;" >}}`
+
+#### Code highlighting
+
+By default the theme is using PrismJS to color your code syntax. All you need to do is to wrap you code like this:
+
+
+```html + // your code here +``` ++ +**Supported languages**: https://prismjs.com/#languages-list + +## How to start + +You can download the theme manually by going to [https://github.com/rhazdon/hugo-theme-hello-friend-ng.git](https://github.com/rhazdon/hugo-theme-hello-friend-ng.git) and pasting it to `themes/hello-friend-ng` in your root directory. + +You can also clone it directly to your Hugo folder: + +``` +$ git clone https://github.com/rhazdon/hugo-theme-hello-friend-ng.git themes/hello-friend-ng +``` + +If you don't want to make any radical changes, it's the best option, because you can get new updates when they are available. To do so, include it as a git submodule: + +``` +$ git submodule add https://github.com/rhazdon/hugo-theme-hello-friend-ng.git themes/hello-friend-ng +``` +### Favicon + +Use [RealFaviconGenerator](https://realfavicongenerator.net/) to generate these files, put them into your site's static folder: + +- android-chrome-192x192.png +- android-chrome-512x512.png +- apple-touch-icon.png +- favicon-16x16.png +- favicon-32x32.png +- favicon.ico +- mstile-150x150.png +- safari-pinned-tab.svg +- site.webmanifest + +## How to configure + +The theme doesn't require any advanced configuration. Just copy: + +``` +baseurl = "/" +languageCode = "en-us" +theme = "hello-friend-ng" + +[params] + dateform = "Jan 2, 2006" + dateformShort = "Jan 2" + dateformNum = "2006-01-02" + dateformNumTime = "2006-01-02 15:04 -0700" + + # Metadata mostly used in document's head + description = "Homepage and blog by Djordje Atlialp" + keywords = "homepage, blog, science, informatics, development, programming" + images = [""] + + # Directory name of your blog content (default is `content/posts`) + contentTypeName = "posts" + # Default theme "light" or "dark" + defaultTheme = "dark" + +[languages] + [languages.en] + title = "Hello Friend NG" + subtitle = "A simple theme for Hugo" + keywords = "" + copyright = "" + readOtherPosts = "Read other posts" + + [languages.en.params.logo] + logoText = "hello friend ng" + logoHomeLink = "/" + # or + # + # path = "/img/your-example-logo.svg" + # alt = "Your example logo alt text" + + # You can create a language based menu + [languages.en.menu] + [[languages.en.menu.main]] + identifier = "about" + name = "About" + url = "/about" + [[languages.en.menu.main]] + identifier = "showcase" + name = "Showcase" + url = "/showcase" + +# And you can even create generic menu +[menu] + [[menu.main]] + identifier = "about" + name = "About" + url = "/about" + [[menu.main]] + identifier = "blog" + name = "Blog" + url = "/posts" +``` + + +## How to run your site + +From your Hugo root directory run: + +``` +$ hugo server -t hello-friend-ng +``` + +and go to `localhost:1313` in your browser. From now on all the changes you make will go live, so you don't need to refresh your browser every single time. + + +## How to edit the theme + +If you really want to edit the theme, you need to install Node dependencies. To do this, go to the theme directory (from your Hugo root directory): + +``` +$ cd themes/hello-friend-ng +``` + +and then run: + +``` +$ npm install +``` + + +## How to contribute + +If you spot any bugs, please use [Issue Tracker](https://github.com/rhazdon/hugo-theme-hello-friend-ng/issues) or if you want to add a new feature directly please create a new [Pull Request](https://github.com/rhazdon/hugo-theme-hello-friend-ng/pulls). + + +## Third Party + + - [normalize.css](https://github.com/necolas/normalize.css) + - [Feather Open Source Icons](https://github.com/feathericons/feather) + - [Flag Icon](https://github.com/lipis/flag-icon-css) + + +## Licence + +Copyright © 2019 Djordje Atlialp + +The theme is released under the MIT License. Check the [original theme license](https://github.com/rhazdon/hugo-theme-hello-friend-ng/blob/master/LICENSE.md) for additional licensing information. diff --git a/themes/hello-friend-ng/archetypes/default.md b/themes/hello-friend-ng/archetypes/default.md new file mode 100644 index 0000000..63c1c63 --- /dev/null +++ b/themes/hello-friend-ng/archetypes/default.md @@ -0,0 +1,8 @@ +--- +title: "{{ replace .Name "-" " " | title }}" +date: {{ .Date }} +draft: true +comments: false +images: +--- + diff --git a/themes/hello-friend-ng/archetypes/posts.md b/themes/hello-friend-ng/archetypes/posts.md new file mode 100644 index 0000000..82889f3 --- /dev/null +++ b/themes/hello-friend-ng/archetypes/posts.md @@ -0,0 +1,10 @@ +--- +title: "{{ replace .Name "-" " " | title }}" +date: {{ .Date }} +draft: true +toc: false +images: +tags: + - untagged +--- + diff --git a/themes/hello-friend-ng/assets/js/main.js b/themes/hello-friend-ng/assets/js/main.js new file mode 100644 index 0000000..f4a810a --- /dev/null +++ b/themes/hello-friend-ng/assets/js/main.js @@ -0,0 +1 @@ +// Some code could be here ... diff --git a/themes/hello-friend-ng/assets/js/menu.js b/themes/hello-friend-ng/assets/js/menu.js new file mode 100644 index 0000000..a33e66b --- /dev/null +++ b/themes/hello-friend-ng/assets/js/menu.js @@ -0,0 +1,16 @@ +// Mobile menu + +const menuTrigger = document.querySelector(".menu-trigger"); +const menu = document.querySelector(".menu"); +const mobileQuery = getComputedStyle(document.body).getPropertyValue("--phoneWidth"); +const isMobile = () => window.matchMedia(mobileQuery).matches; +const isMobileMenu = () => { + menuTrigger && menuTrigger.classList.toggle("hidden", !isMobile()); + menu && menu.classList.toggle("hidden", isMobile()); +}; + +isMobileMenu(); + +menuTrigger && menuTrigger.addEventListener("click", () => menu && menu.classList.toggle("hidden")); + +window.addEventListener("resize", isMobileMenu); diff --git a/themes/hello-friend-ng/assets/js/prism.js b/themes/hello-friend-ng/assets/js/prism.js new file mode 100644 index 0000000..04dc2c4 --- /dev/null +++ b/themes/hello-friend-ng/assets/js/prism.js @@ -0,0 +1,163 @@ +/* PrismJS 1.15.0 +https://prismjs.com/download.html#themes=prism-tomorrow&languages=markup+css+clike+javascript+abap+actionscript+ada+apacheconf+apl+applescript+c+arff+asciidoc+asm6502+csharp+autohotkey+autoit+bash+basic+batch+bison+brainfuck+bro+cpp+aspnet+arduino+cil+coffeescript+clojure+ruby+csp+css-extras+d+dart+diff+django+docker+eiffel+elixir+elm+markup-templating+erlang+fsharp+flow+fortran+gcode+gedcom+gherkin+git+glsl+gml+go+graphql+groovy+less+handlebars+haskell+haxe+hcl+http+hpkp+hsts+ichigojam+icon+inform7+ini+io+j+java+javastacktrace+jolie+json+julia+keyman+kotlin+latex+markdown+liquid+lisp+livescript+lolcode+lua+makefile+crystal+erb+matlab+mel+mizar+monkey+n1ql+n4js+nand2tetris-hdl+nasm+nginx+nim+nix+nsis+objectivec+ocaml+opencl+oz+parigp+parser+pascal+perl+php+php-extras+sql+powershell+processing+prolog+properties+protobuf+scss+puppet+pure+python+q+qore+r+jsx+typescript+renpy+reason+rest+rip+roboconf+textile+rust+sas+sass+stylus+scala+scheme+smalltalk+smarty+plsql+soy+pug+swift+yaml+tcl+haml+toml+tt2+twig+tsx+vala+vbnet+velocity+verilog+vhdl+vim+visual-basic+wasm+wiki+xeora+xojo+xquery+tap */ +var _self="undefined"!=typeof window?window:"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope?self:{},Prism=function(){var e=/\blang(?:uage)?-([\w-]+)\b/i,t=0,n=_self.Prism={manual:_self.Prism&&_self.Prism.manual,disableWorkerMessageHandler:_self.Prism&&_self.Prism.disableWorkerMessageHandler,util:{encode:function(e){return e instanceof a?new a(e.type,n.util.encode(e.content),e.alias):"Array"===n.util.type(e)?e.map(n.util.encode):e.replace(/&/g,"&").replace(/e.length)return;if(!(w instanceof s)){if(m&&b!=t.length-1){f.lastIndex=k;var _=f.exec(e);if(!_)break;for(var j=_.index+(d?_[1].length:0),P=_.index+_[0].length,A=b,O=k,x=t.length;x>A&&(P>O||!t[A].type&&!t[A-1].greedy);++A)O+=t[A].length,j>=O&&(++b,k=O);if(t[b]instanceof s)continue;I=A-b,w=e.slice(k,O),_.index-=k}else{f.lastIndex=0;var _=f.exec(w),I=1}if(_){d&&(p=_[1]?_[1].length:0);var j=_.index+p,_=_[0].slice(p),P=j+_.length,N=w.slice(0,j),S=w.slice(P),E=[b,I];N&&(++b,k+=N.length,E.push(N));var C=new s(u,h?n.tokenize(_,h):_,y,_,m);if(E.push(C),S&&E.push(S),Array.prototype.splice.apply(t,E),1!=I&&n.matchGrammar(e,t,a,b,k,!0,u),i)break}else if(i)break}}}}},tokenize:function(e,t){var a=[e],r=t.rest;if(r){for(var l in r)t[l]=r[l];delete t.rest}return n.matchGrammar(e,a,t,0,0,!1),a},hooks:{all:{},add:function(e,t){var a=n.hooks.all;a[e]=a[e]||[],a[e].push(t)},run:function(e,t){var a=n.hooks.all[e];if(a&&a.length)for(var r,l=0;r=a[l++];)r(t)}}},a=n.Token=function(e,t,n,a,r){this.type=e,this.content=t,this.alias=n,this.length=0|(a||"").length,this.greedy=!!r};if(a.stringify=function(e,t,r){if("string"==typeof e)return e;if("Array"===n.util.type(e))return e.map(function(n){return a.stringify(n,t,e)}).join("");var l={type:e.type,content:a.stringify(e.content,t,r),tag:"span",classes:["token",e.type],attributes:{},language:t,parent:r};if(e.alias){var i="Array"===n.util.type(e.alias)?e.alias:[e.alias];Array.prototype.push.apply(l.classes,i)}n.hooks.run("wrap",l);var o=Object.keys(l.attributes).map(function(e){return e+'="'+(l.attributes[e]||"").replace(/"/g,""")+'"'}).join(" ");return"<"+l.tag+' class="'+l.classes.join(" ")+'"'+(o?" "+o:"")+">"+l.content+""+l.tag+">"},!_self.document)return _self.addEventListener?(n.disableWorkerMessageHandler||_self.addEventListener("message",function(e){var t=JSON.parse(e.data),a=t.language,r=t.code,l=t.immediateClose;_self.postMessage(n.highlight(r,n.languages[a],a)),l&&_self.close()},!1),_self.Prism):_self.Prism;var r=document.currentScript||[].slice.call(document.getElementsByTagName("script")).pop();return r&&(n.filename=r.src,n.manual||r.hasAttribute("data-manual")||("loading"!==document.readyState?window.requestAnimationFrame?window.requestAnimationFrame(n.highlightAll):window.setTimeout(n.highlightAll,16):document.addEventListener("DOMContentLoaded",n.highlightAll))),_self.Prism}();"undefined"!=typeof module&&module.exports&&(module.exports=Prism),"undefined"!=typeof global&&(global.Prism=Prism); +Prism.languages.markup={comment://,prolog:/<\?[\s\S]+?\?>/,doctype://i,cdata://i,tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s+[^\s>\/=]+(?:=(?:("|')(?:\\[\s\S]|(?!\1)[^\\])*\1|[^\s'">=]+))?)*\s*\/?>/i,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/i,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"attr-value":{pattern:/=(?:("|')(?:\\[\s\S]|(?!\1)[^\\])*\1|[^\s'">=]+)/i,inside:{punctuation:[/^=/,{pattern:/(^|[^\\])["']/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:/?[\da-z]{1,8};/i},Prism.languages.markup.tag.inside["attr-value"].inside.entity=Prism.languages.markup.entity,Prism.hooks.add("wrap",function(a){"entity"===a.type&&(a.attributes.title=a.content.replace(/&/,"&"))}),Prism.languages.xml=Prism.languages.extend("markup",{}),Prism.languages.html=Prism.languages.markup,Prism.languages.mathml=Prism.languages.markup,Prism.languages.svg=Prism.languages.markup; +Prism.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:/@[\w-]+?[\s\S]*?(?:;|(?=\s*\{))/i,inside:{rule:/@[\w-]+/}},url:/url\((?:(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1|.*?)\)/i,selector:/[^{}\s][^{};]*?(?=\s*\{)/,string:{pattern:/("|')(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},property:/[-_a-z\xA0-\uFFFF][-\w\xA0-\uFFFF]*(?=\s*:)/i,important:/!important\b/i,"function":/[-a-z0-9]+(?=\()/i,punctuation:/[(){};:,]/},Prism.languages.css.atrule.inside.rest=Prism.languages.css,Prism.languages.markup&&(Prism.languages.insertBefore("markup","tag",{style:{pattern:/(