Merge branch 'master' of https://github.com/panr/hugo-theme-terminal
This commit is contained in:
		
						commit
						9b58740c5a
					
				
							
								
								
									
										10
									
								
								.prettierrc
									
									
									
									
									
								
							
							
						
						
									
										10
									
								
								.prettierrc
									
									
									
									
									
								
							| @ -1,5 +1,11 @@ | ||||
| { | ||||
|   "parser": "babylon", | ||||
|   "parser": "babel", | ||||
|   "printWidth": 100, | ||||
|   "trailingComma": "all" | ||||
|   "trailingComma": "all", | ||||
|   "overrides": [{ | ||||
|     "files": ".html", | ||||
|     "options": { | ||||
|       "parser": "html" | ||||
|     } | ||||
|   }] | ||||
| } | ||||
|  | ||||
| @ -11,6 +11,7 @@ | ||||
| - [Code highlighting](#code-highlighting) | ||||
| - [How to start](#how-to-start) | ||||
| - [How to configure](#how-to-configure) | ||||
| - [Post archetype](#post-archetype) | ||||
| - [Add-ons](#add-ons) | ||||
| - [How to run your site](#how-to-run-your-site) | ||||
| - [How to edit the theme](#how-to-edit-the-theme) | ||||
| @ -113,6 +114,10 @@ to `config.toml` file in your Hugo root directory and change params fields. In c | ||||
| 
 | ||||
| **NOTE:** Please keep in mind that currently `main menu` doesn't support nesting. | ||||
| 
 | ||||
| ## Post archetype | ||||
| 
 | ||||
| See the basic `post` file params supported by the theme — https://github.com/panr/hugo-theme-terminal/blob/master/archetypes/post.md | ||||
| 
 | ||||
| ## Add-ons | ||||
| 
 | ||||
| - **Comments** — for adding comments to your blog posts please take a look at `layouts/partials/comments.html` https://github.com/panr/hugo-theme-terminal/blob/master/layouts/partials/comments.html.   | ||||
|  | ||||
							
								
								
									
										9
									
								
								archetypes/post.md
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										9
									
								
								archetypes/post.md
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,9 @@ | ||||
| +++ | ||||
| title = "" | ||||
| date = "" | ||||
| author = "" | ||||
| cover = "" | ||||
| tags = ["", ""] | ||||
| description = "" | ||||
| showFullContent = false | ||||
| +++ | ||||
| @ -1,43 +1,55 @@ | ||||
| {{ define "main" }} | ||||
|   <div class="posts"> | ||||
|     {{ $isntDefault := not (or (eq (trim $.Site.Params.contentTypeName " ") "posts") (eq (trim $.Site.Params.contentTypeName " ") "")) }} | ||||
|     {{ $contentTypeName := cond $isntDefault (string $.Site.Params.contentTypeName) "posts" }} | ||||
|     {{ $paginator := .Paginate (where .Data.Pages "Type" $contentTypeName) }} | ||||
| <div class="posts"> | ||||
|   {{ $isntDefault := not (or (eq (trim $.Site.Params.contentTypeName " ") "posts") (eq (trim $.Site.Params.contentTypeName " ") "")) }} | ||||
|   {{ $contentTypeName := cond $isntDefault (string $.Site.Params.contentTypeName) "posts" }} | ||||
|   {{ $paginator := .Paginate (where .Data.Pages "Type" $contentTypeName) }} | ||||
| 
 | ||||
|     {{ range $paginator.Pages }} | ||||
|     <div class="post on-list"> | ||||
|       <h1 class="post-title"><a href="{{ .Permalink }}">{{ .Title | markdownify }}</a></h1> | ||||
|       <div class="post-meta"> | ||||
|         <span class="post-date"> | ||||
|           {{ .Date.Format "2006-01-02" }} | ||||
|         </span> | ||||
|         {{ with .Params.Author }}<span class="post-author">:: {{ . }}</span>{{ end }} | ||||
|       </div> | ||||
|   {{ range $paginator.Pages }} | ||||
|   <div class="post on-list"> | ||||
|     <h1 class="post-title"> | ||||
|       <a href="{{ .Permalink }}">{{ .Title | markdownify }}</a></h1> | ||||
|     <div class="post-meta"> | ||||
|       <span class="post-date"> | ||||
|         {{ .Date.Format "2006-01-02" }} | ||||
|       </span> | ||||
|       {{ with .Params.Author }}<span class="post-author">:: | ||||
|         {{ . }}</span>{{ end }} | ||||
|     </div> | ||||
| 
 | ||||
|       {{ if .Params.tags }} | ||||
|         <span class="post-tags"> | ||||
|           {{ range .Params.tags }} | ||||
|             #<a href="{{ (urlize (printf "tags/%s/" . )) | absURL }}">{{ . }}</a>  | ||||
|           {{ end }} | ||||
|         </span> | ||||
|     {{ if .Params.tags }} | ||||
|     <span class="post-tags"> | ||||
|       {{ range .Params.tags }} | ||||
|       #<a href="{{ (urlize (printf "tags/%s/" . )) | absURL }}"> | ||||
|         {{- . -}} | ||||
|       </a>  | ||||
|       {{ end }} | ||||
|     </span> | ||||
|     {{ end }} | ||||
| 
 | ||||
|       {{ with .Params.Cover }} | ||||
|         <img src="{{ . | absURL }}" class="post-cover" /> | ||||
|     {{ with .Params.Cover }} | ||||
|     <img src="{{ . | absURL }}" class="post-cover" /> | ||||
|     {{ end }} | ||||
| 
 | ||||
|     <div class="post-content"> | ||||
|       {{ if .Params.showFullContent }} | ||||
|       {{ .Content | markdownify }} | ||||
|       {{ else if .Description }} | ||||
|       {{ .Description | markdownify }} | ||||
|       {{ else }} | ||||
|       {{ if .Truncated }} | ||||
|       {{ .Summary | markdownify }} | ||||
|       {{ end }} | ||||
|       {{ end }} | ||||
|     </div> | ||||
| 
 | ||||
|       <div class="post-content"> | ||||
|         {{ with .Description }} | ||||
|           {{ . | markdownify }} | ||||
|         {{ else }} | ||||
|           {{ if .Truncated }} | ||||
|             {{ .Summary | markdownify }} | ||||
|           {{ end }} | ||||
|         {{ end }} | ||||
|       </div> | ||||
|       <div><a class="read-more button" href="{{.RelPermalink}}">{{ $.Site.Params.ReadMore }} →</a></div> | ||||
|     {{ if not .Params.showFullContent }} | ||||
|     <div> | ||||
|       <a class="read-more button" | ||||
|         href="{{.RelPermalink}}">{{ $.Site.Params.ReadMore }} →</a> | ||||
|     </div> | ||||
|     {{ end }} | ||||
|     {{ partial "pagination.html" . }} | ||||
|   </div> | ||||
|   {{ end }} | ||||
|   {{ partial "pagination.html" . }} | ||||
| </div> | ||||
| {{ end }} | ||||
|  | ||||
| @ -1,55 +1,61 @@ | ||||
| {{ define "main" }} | ||||
|   <div class="post"> | ||||
|     <h1 class="post-title"><a href="{{ .Permalink }}">{{ .Title | markdownify }}</a></h1> | ||||
|     <div class="post-meta"> | ||||
|       <span class="post-date"> | ||||
|         {{ .Date.Format "2006-01-02" }} | ||||
|       </span> | ||||
|       {{ with .Params.Author }}<span class="post-author">:: {{ . }}</span>{{ end }} | ||||
|     </div> | ||||
| 
 | ||||
|     {{ if .Params.tags }} | ||||
|       <span class="post-tags"> | ||||
|         {{ range .Params.tags }} | ||||
|           #<a href="{{ (urlize (printf "tags/%s/" .)) | absURL }}">{{ . }}</a>  | ||||
|         {{ end }} | ||||
|       </span> | ||||
| <div class="post"> | ||||
|   <h1 class="post-title"> | ||||
|     <a href="{{ .Permalink }}">{{ .Title | markdownify }}</a></h1> | ||||
|   <div class="post-meta"> | ||||
|     <span class="post-date"> | ||||
|       {{ .Date.Format "2006-01-02" }} | ||||
|     </span> | ||||
|     {{ with .Params.Author }} | ||||
|     <span class="post-author">:: | ||||
|       {{ . }} | ||||
|     </span> | ||||
|     {{ end }} | ||||
| 
 | ||||
|     {{ with .Params.Cover }} | ||||
|       <img src="{{ . | absURL }}" class="post-cover" /> | ||||
|     {{ end }} | ||||
| 
 | ||||
|     <div class="post-content"> | ||||
|       {{ .Content }} | ||||
|     </div> | ||||
|     {{ if or .NextInSection .PrevInSection }} | ||||
|       <div class="pagination"> | ||||
|         <div class="pagination__title"> | ||||
|           <span class="pagination__title-h">{{ $.Site.Params.ReadOtherPosts }}</span> | ||||
|           <hr /> | ||||
|         </div> | ||||
|         <div class="pagination__buttons"> | ||||
|           {{ if .NextInSection }} | ||||
|             <span class="button previous"> | ||||
|               <a href="{{ .NextInSection.Permalink }}"> | ||||
|                 <span class="button__icon">←</span> | ||||
|                 <span class="button__text">{{ .NextInSection.Title }}</span> | ||||
|               </a> | ||||
|             </span> | ||||
|           {{ end }} | ||||
|           {{ if .PrevInSection }} | ||||
|             <span class="button next"> | ||||
|               <a href="{{ .PrevInSection.Permalink }}"> | ||||
|                 <span class="button__text">{{ .PrevInSection.Title }}</span> | ||||
|                 <span class="button__icon">→</span> | ||||
|               </a> | ||||
|             </span> | ||||
|           {{ end }} | ||||
|         </div> | ||||
|       </div> | ||||
|     {{ end }} | ||||
| 
 | ||||
|     {{ partial "comments.html" . }} | ||||
|   </div> | ||||
| 
 | ||||
|   {{ if .Params.tags }} | ||||
|   <span class="post-tags"> | ||||
|     {{ range .Params.tags }} | ||||
|     #<a href="{{ (urlize (printf "tags/%s/" .)) | absURL }}">{{ . }}</a>  | ||||
|     {{ end }} | ||||
|   </span> | ||||
|   {{ end }} | ||||
| 
 | ||||
|   {{ with .Params.Cover }} | ||||
|   <img src="{{ . | absURL }}" class="post-cover" /> | ||||
|   {{ end }} | ||||
| 
 | ||||
|   <div class="post-content"> | ||||
|     {{ .Content }} | ||||
|   </div> | ||||
|   {{ if or .NextInSection .PrevInSection }} | ||||
|   <div class="pagination"> | ||||
|     <div class="pagination__title"> | ||||
|       <span | ||||
|         class="pagination__title-h">{{ $.Site.Params.ReadOtherPosts }}</span> | ||||
|       <hr /> | ||||
|     </div> | ||||
|     <div class="pagination__buttons"> | ||||
|       {{ if .NextInSection }} | ||||
|       <span class="button previous"> | ||||
|         <a href="{{ .NextInSection.Permalink }}"> | ||||
|           <span class="button__icon">←</span> | ||||
|           <span class="button__text">{{ .NextInSection.Title }}</span> | ||||
|         </a> | ||||
|       </span> | ||||
|       {{ end }} | ||||
|       {{ if .PrevInSection }} | ||||
|       <span class="button next"> | ||||
|         <a href="{{ .PrevInSection.Permalink }}"> | ||||
|           <span class="button__text">{{ .PrevInSection.Title }}</span> | ||||
|           <span class="button__icon">→</span> | ||||
|         </a> | ||||
|       </span> | ||||
|       {{ end }} | ||||
|     </div> | ||||
|   </div> | ||||
|   {{ end }} | ||||
| 
 | ||||
|   {{ partial "comments.html" . }} | ||||
| </div> | ||||
| {{ end }} | ||||
|  | ||||
| @ -16,9 +16,11 @@ | ||||
|   "devDependencies": { | ||||
|     "@babel/cli": "^7.2.3", | ||||
|     "@babel/core": "^7.2.2", | ||||
|     "@babel/parser": "^7.4.2", | ||||
|     "@babel/plugin-transform-runtime": "^7.2.0", | ||||
|     "@babel/preset-env": "^7.3.1", | ||||
|     "@babel/preset-stage-2": "^7.0.0", | ||||
|     "angular-html-parser": "^1.2.0", | ||||
|     "babel-eslint": "^8.2.1", | ||||
|     "babel-loader": "^8.0.5", | ||||
|     "browserslist": "^4.0.1", | ||||
|  | ||||
| @ -51,3 +51,51 @@ code.language-html { | ||||
| .token.namespace { | ||||
|   opacity: .7; | ||||
| } | ||||
| 
 | ||||
| pre[data-line] { | ||||
|   position: relative; | ||||
|   padding: 1em 0 1em 3em; | ||||
| } | ||||
| 
 | ||||
| .line-highlight { | ||||
|   position: absolute; | ||||
|   left: 0; | ||||
|   right: 0; | ||||
|   padding: inherit 0; | ||||
|   margin-top: 1em; | ||||
|   /* Same as .prism’s padding-top */ | ||||
|   background: hsla(24, 20%, 50%, .08); | ||||
|   background: linear-gradient(to right, hsla(24, 20%, 50%, .1) 70%, hsla(24, 20%, 50%, 0)); | ||||
|   pointer-events: none; | ||||
|   line-height: inherit; | ||||
|   white-space: pre; | ||||
| } | ||||
| 
 | ||||
| .line-highlight:before, | ||||
| .line-highlight[data-end]:after { | ||||
|   content: attr(data-start); | ||||
|   position: absolute; | ||||
|   top: .4em; | ||||
|   left: .6em; | ||||
|   min-width: 1em; | ||||
|   padding: 0 .5em; | ||||
|   background-color: hsla(24, 20%, 50%, .4); | ||||
|   color: hsl(24, 20%, 95%); | ||||
|   font: bold 65%/1.5 sans-serif; | ||||
|   text-align: center; | ||||
|   vertical-align: .3em; | ||||
|   border-radius: 999px; | ||||
|   text-shadow: none; | ||||
|   box-shadow: 0 1px white; | ||||
| } | ||||
| 
 | ||||
| .line-highlight[data-end]:after { | ||||
|   content: attr(data-end); | ||||
|   top: auto; | ||||
|   bottom: .4em; | ||||
| } | ||||
| 
 | ||||
| .line-numbers .line-highlight:before, | ||||
| .line-numbers .line-highlight:after { | ||||
|   content: none; | ||||
| } | ||||
|  | ||||
										
											
												File diff suppressed because one or more lines are too long
											
										
									
								
							
										
											
												File diff suppressed because one or more lines are too long
											
										
									
								
							
										
											
												File diff suppressed because one or more lines are too long
											
										
									
								
							| @ -91,10 +91,9 @@ | ||||
|   !*** ./source/js/main.js ***! | ||||
|   \***************************/ | ||||
| /*! no static exports found */ | ||||
| /***/ (function(module, exports, __webpack_require__) { | ||||
| /***/ (function(module, exports) { | ||||
| 
 | ||||
| "use strict"; | ||||
| eval("// Add your script here\n\n\n//# sourceURL=webpack:///./source/js/main.js?"); | ||||
| eval("// Add your script here\n\n//# sourceURL=webpack:///./source/js/main.js?"); | ||||
| 
 | ||||
| /***/ }), | ||||
| 
 | ||||
| @ -103,10 +102,9 @@ eval("// Add your script here\n\n\n//# sourceURL=webpack:///./source/js/main.js? | ||||
|   !*** ./source/js/menu.js ***! | ||||
|   \***************************/ | ||||
| /*! no static exports found */ | ||||
| /***/ (function(module, exports, __webpack_require__) { | ||||
| /***/ (function(module, exports) { | ||||
| 
 | ||||
| "use strict"; | ||||
| eval("\n\nvar container = document.querySelector(\".container\");\nvar menu = document.querySelector(\".menu\");\nvar mobileMenuTrigger = document.querySelector(\".menu-trigger\");\nvar desktopMenu = document.querySelector(\".menu__inner--desktop\");\nvar desktopMenuTrigger = document.querySelector(\".menu__sub-inner-more-trigger\");\nvar menuMore = document.querySelector(\".menu__sub-inner-more\");\nvar mobileQuery = getComputedStyle(document.body).getPropertyValue(\"--phoneWidth\");\n\nvar isMobile = function isMobile() {\n  return window.matchMedia(mobileQuery).matches;\n};\n\nvar handleMenuClasses = function handleMenuClasses() {\n  mobileMenuTrigger && mobileMenuTrigger.classList.toggle(\"hidden\", !isMobile());\n  menu && menu.classList.toggle(\"hidden\", isMobile());\n  menuMore && menuMore.classList.toggle(\"hidden\", !isMobile());\n}; // Common\n\n\nmenu && menu.addEventListener(\"click\", function (e) {\n  return e.stopPropagation();\n});\nmenuMore && menuMore.addEventListener(\"click\", function (e) {\n  return e.stopPropagation();\n});\nhandleMenuClasses();\ndocument.body.addEventListener(\"click\", function () {\n  if (!isMobile() && menuMore && !menuMore.classList.contains(\"hidden\")) {\n    menuMore.classList.add(\"hidden\");\n  } else if (isMobile() && !menu.classList.contains(\"hidden\")) {\n    menu.classList.add(\"hidden\");\n  }\n});\nwindow.addEventListener(\"resize\", handleMenuClasses); // Mobile menu\n\nmobileMenuTrigger && mobileMenuTrigger.addEventListener(\"click\", function (e) {\n  e.stopPropagation();\n  menu && menu.classList.toggle(\"hidden\");\n}); // Desktop menu\n\ndesktopMenuTrigger && desktopMenuTrigger.addEventListener(\"click\", function (e) {\n  e.stopPropagation();\n  menuMore && menuMore.classList.toggle(\"hidden\");\n\n  if (menuMore.getBoundingClientRect().right > container.getBoundingClientRect().right) {\n    menuMore.style.left = \"auto\";\n    menuMore.style.right = 0;\n  }\n});\n\n//# sourceURL=webpack:///./source/js/menu.js?"); | ||||
| eval("var container = document.querySelector(\".container\");\nvar menu = document.querySelector(\".menu\");\nvar mobileMenuTrigger = document.querySelector(\".menu-trigger\");\nvar desktopMenu = document.querySelector(\".menu__inner--desktop\");\nvar desktopMenuTrigger = document.querySelector(\".menu__sub-inner-more-trigger\");\nvar menuMore = document.querySelector(\".menu__sub-inner-more\");\nvar mobileQuery = getComputedStyle(document.body).getPropertyValue(\"--phoneWidth\");\n\nvar isMobile = function isMobile() {\n  return window.matchMedia(mobileQuery).matches;\n};\n\nvar handleMenuClasses = function handleMenuClasses() {\n  mobileMenuTrigger && mobileMenuTrigger.classList.toggle(\"hidden\", !isMobile());\n  menu && menu.classList.toggle(\"hidden\", isMobile());\n  menuMore && menuMore.classList.toggle(\"hidden\", !isMobile());\n}; // Common\n\n\nmenu && menu.addEventListener(\"click\", function (e) {\n  return e.stopPropagation();\n});\nmenuMore && menuMore.addEventListener(\"click\", function (e) {\n  return e.stopPropagation();\n});\nhandleMenuClasses();\ndocument.body.addEventListener(\"click\", function () {\n  if (!isMobile() && menuMore && !menuMore.classList.contains(\"hidden\")) {\n    menuMore.classList.add(\"hidden\");\n  } else if (isMobile() && !menu.classList.contains(\"hidden\")) {\n    menu.classList.add(\"hidden\");\n  }\n});\nwindow.addEventListener(\"resize\", handleMenuClasses); // Mobile menu\n\nmobileMenuTrigger && mobileMenuTrigger.addEventListener(\"click\", function (e) {\n  e.stopPropagation();\n  menu && menu.classList.toggle(\"hidden\");\n}); // Desktop menu\n\ndesktopMenuTrigger && desktopMenuTrigger.addEventListener(\"click\", function (e) {\n  e.stopPropagation();\n  menuMore && menuMore.classList.toggle(\"hidden\");\n\n  if (menuMore.getBoundingClientRect().right > container.getBoundingClientRect().right) {\n    menuMore.style.left = \"auto\";\n    menuMore.style.right = 0;\n  }\n});\n\n//# sourceURL=webpack:///./source/js/menu.js?"); | ||||
| 
 | ||||
| /***/ }), | ||||
| 
 | ||||
|  | ||||
										
											
												File diff suppressed because one or more lines are too long
											
										
									
								
							
										
											
												File diff suppressed because one or more lines are too long
											
										
									
								
							
										
											
												File diff suppressed because one or more lines are too long
											
										
									
								
							
										
											
												File diff suppressed because one or more lines are too long
											
										
									
								
							
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user