mirror of
https://github.com/theNewDynamic/gohugo-theme-ananke.git
synced 2025-06-08 17:22:46 +00:00
Allow optional processing of assets through Hugo Pipes
This commit is contained in:
parent
16fc5e6d80
commit
37c8143a2a
2
.gitignore
vendored
2
.gitignore
vendored
@ -18,6 +18,7 @@ nbproject/
|
|||||||
.bin/node_modules/
|
.bin/node_modules/
|
||||||
/node_modules/
|
/node_modules/
|
||||||
src/node_modules/
|
src/node_modules/
|
||||||
|
exampleSite/node_modules/
|
||||||
src/npm-debug.log.*
|
src/npm-debug.log.*
|
||||||
npm-debug.log
|
npm-debug.log
|
||||||
/npm-debug.log*
|
/npm-debug.log*
|
||||||
@ -28,3 +29,4 @@ npm-debug.log
|
|||||||
|
|
||||||
/junit.xml
|
/junit.xml
|
||||||
partials/structure/stylesheet.html
|
partials/structure/stylesheet.html
|
||||||
|
|
||||||
|
24
README.md
24
README.md
@ -153,6 +153,30 @@ For example, if your css files are `static/css/custom.css` and `static/css/custo
|
|||||||
custom_css = ["css/custom.css","css/custom2.css"]
|
custom_css = ["css/custom.css","css/custom2.css"]
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### Processed CSS
|
||||||
|
|
||||||
|
By default, Ananke will read a preprocessed stylesheet from `/assets/ananke/dist/main.[hash].css`. If you want to have Hugo process the stylesheet for you thus allowing better customisation using Hugo's unison file system, you need to:
|
||||||
|
|
||||||
|
1. From the root of your project: `$ hugo mod npm pack`.
|
||||||
|
This will generate a `package.json` for your project, or append the npm packages required by the theme to your existing `package.json`.
|
||||||
|
2. Still from the root of your project: `$ npm install`
|
||||||
|
3. Set the following site Parameter to true:
|
||||||
|
|
||||||
|
```
|
||||||
|
[params]
|
||||||
|
ananke_process_css = true
|
||||||
|
```
|
||||||
|
|
||||||
|
You're all set an can run Hugo.
|
||||||
|
|
||||||
|
#### Overwrite some imported file
|
||||||
|
|
||||||
|
To have your own `_code.css` imported and processed by the theme. Add `/assets/ananke/css/_code.css` to your project.
|
||||||
|
|
||||||
|
#### Add a new import
|
||||||
|
|
||||||
|
Create your own `/assets/ananke/css/` directory at the root of your project, drop your files in there, and create your own `/main.css` with your own import statements. Don't forget to include the existing import statement from the theme's own `main.css`.
|
||||||
|
|
||||||
### Show Reading Time and Word Count
|
### Show Reading Time and Word Count
|
||||||
|
|
||||||
If you add a key of `show_reading_time` true to either the Config Params, a page or section's front matter, articles will show the reading time and word count.
|
If you add a key of `show_reading_time` true to either the Config Params, a page or section's front matter, articles will show the reading time and word count.
|
||||||
|
@ -1,7 +0,0 @@
|
|||||||
module.exports = {
|
|
||||||
plugins: [
|
|
||||||
require("postcss-import")({
|
|
||||||
path: ["/assets/ananke/css"],
|
|
||||||
})
|
|
||||||
],
|
|
||||||
};
|
|
1
assets/ananke/dist/main.css_5c99d70a7725bacd4c701e995b969fea.css
vendored
Normal file
1
assets/ananke/dist/main.css_5c99d70a7725bacd4c701e995b969fea.css
vendored
Normal file
File diff suppressed because one or more lines are too long
@ -3,6 +3,7 @@ baseURL = "https://example.com"
|
|||||||
languageCode = "en-us"
|
languageCode = "en-us"
|
||||||
theme = "gohugo-theme-ananke"
|
theme = "gohugo-theme-ananke"
|
||||||
themesDir = "../.."
|
themesDir = "../.."
|
||||||
|
resourceDir = "../resources"
|
||||||
|
|
||||||
DefaultContentLanguage = "en"
|
DefaultContentLanguage = "en"
|
||||||
SectionPagesMenu = "main"
|
SectionPagesMenu = "main"
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
{{ $script := .Site.Data.webpack_assets.app }}
|
{{ $script := .Site.Data.webpack_assets.app }}
|
||||||
{{ with $script.js }}
|
{{ with resources.Get "/ananke/js/main.js" }}
|
||||||
<script src="{{ relURL (printf "%s%s" "dist/" .) }}"></script>
|
{{ $js := . | js.Build }}
|
||||||
|
<script src="{{ .RelPermalink }}"></script>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
@ -1,10 +1,17 @@
|
|||||||
{{ with resources.Get "/ananke/css/main.css" }}
|
{{ if site.Params.ananke_process_css }}
|
||||||
{{ $settings := dict "config" "/assets/ananke/css/postcss.config.css" }}
|
{{ with resources.Get "/ananke/css/main.css" }}
|
||||||
{{ $style := . | resources.PostCSS }}
|
{{ $options := (dict "targetPath" "/ananke/css/main.css" "enableSourceMap" true "precision" 6 "includePaths" (slice "node_modules")) }}
|
||||||
|
{{ $style := . | resources.ToCSS $options | resources.PostCSS (dict "use" "postcss-cssnext") | minify }}
|
||||||
{{ with $style }}
|
{{ with $style }}
|
||||||
<link rel="stylesheet" href="{{ .RelPermalink }}">
|
<link rel="stylesheet" href="{{ .RelPermalink }}" >
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
{{ end }}
|
||||||
|
{{ else }}
|
||||||
|
{{ with resources.GetMatch "/ananke/dist/main.*.css" }}
|
||||||
|
<link rel="stylesheet" href="{{ .RelPermalink }}" >
|
||||||
|
{{ end }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
||||||
{{ range .Site.Params.custom_css }}
|
{{ range .Site.Params.custom_css }}
|
||||||
<link rel="stylesheet" href="{{ relURL (.) }}">
|
<link rel="stylesheet" href="{{ relURL (.) }}">
|
||||||
{{ end }}
|
{{ end }}
|
132
package-lock.json
generated
132
package-lock.json
generated
@ -1,132 +0,0 @@
|
|||||||
{
|
|
||||||
"name": "gohugo-default-theme",
|
|
||||||
"version": "2.5.6",
|
|
||||||
"lockfileVersion": 1,
|
|
||||||
"requires": true,
|
|
||||||
"dependencies": {
|
|
||||||
"auto-changelog": {
|
|
||||||
"version": "1.16.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/auto-changelog/-/auto-changelog-1.16.1.tgz",
|
|
||||||
"integrity": "sha512-1OMUN5UWWhKtlEMpGUfbLFcZHDf4IXMNU4SsGs44xTlSBhjgTOx9ukbahoC7hTqIm6+sRAnlAbLY4UjbDZY18A==",
|
|
||||||
"dev": true,
|
|
||||||
"requires": {
|
|
||||||
"commander": "^3.0.1",
|
|
||||||
"core-js": "^3.2.1",
|
|
||||||
"handlebars": "^4.1.2",
|
|
||||||
"lodash.uniqby": "^4.7.0",
|
|
||||||
"node-fetch": "^2.6.0",
|
|
||||||
"parse-github-url": "^1.0.2",
|
|
||||||
"regenerator-runtime": "^0.13.3",
|
|
||||||
"semver": "^6.3.0"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"commander": {
|
|
||||||
"version": "3.0.2",
|
|
||||||
"resolved": "https://registry.npmjs.org/commander/-/commander-3.0.2.tgz",
|
|
||||||
"integrity": "sha512-Gar0ASD4BDyKC4hl4DwHqDrmvjoxWKZigVnAbn5H1owvm4CxCPdb0HQDehwNYMJpla5+M2tPmPARzhtYuwpHow==",
|
|
||||||
"dev": true
|
|
||||||
},
|
|
||||||
"core-js": {
|
|
||||||
"version": "3.3.4",
|
|
||||||
"resolved": "https://registry.npmjs.org/core-js/-/core-js-3.3.4.tgz",
|
|
||||||
"integrity": "sha512-BtibooaAmSOptGLRccsuX/dqgPtXwNgqcvYA6kOTTMzonRxZ+pJS4e+6mvVutESfXMeTnK8m3M+aBu3bkJbR+w==",
|
|
||||||
"dev": true
|
|
||||||
},
|
|
||||||
"handlebars": {
|
|
||||||
"version": "4.4.5",
|
|
||||||
"resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.4.5.tgz",
|
|
||||||
"integrity": "sha512-0Ce31oWVB7YidkaTq33ZxEbN+UDxMMgThvCe8ptgQViymL5DPis9uLdTA13MiRPhgvqyxIegugrP97iK3JeBHg==",
|
|
||||||
"dev": true,
|
|
||||||
"requires": {
|
|
||||||
"neo-async": "^2.6.0",
|
|
||||||
"optimist": "^0.6.1",
|
|
||||||
"source-map": "^0.6.1",
|
|
||||||
"uglify-js": "^3.1.4"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"lodash.uniqby": {
|
|
||||||
"version": "4.7.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/lodash.uniqby/-/lodash.uniqby-4.7.0.tgz",
|
|
||||||
"integrity": "sha1-2ZwHpmnp5tJOE2Lf4mbGdhavEwI=",
|
|
||||||
"dev": true
|
|
||||||
},
|
|
||||||
"minimist": {
|
|
||||||
"version": "0.0.10",
|
|
||||||
"resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.10.tgz",
|
|
||||||
"integrity": "sha1-3j+YVD2/lggr5IrRoMfNqDYwHc8=",
|
|
||||||
"dev": true
|
|
||||||
},
|
|
||||||
"neo-async": {
|
|
||||||
"version": "2.6.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.1.tgz",
|
|
||||||
"integrity": "sha512-iyam8fBuCUpWeKPGpaNMetEocMt364qkCsfL9JuhjXX6dRnguRVOfk2GZaDpPjcOKiiXCPINZC1GczQ7iTq3Zw==",
|
|
||||||
"dev": true
|
|
||||||
},
|
|
||||||
"node-fetch": {
|
|
||||||
"version": "2.6.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.0.tgz",
|
|
||||||
"integrity": "sha512-8dG4H5ujfvFiqDmVu9fQ5bOHUC15JMjMY/Zumv26oOvvVJjM67KF8koCWIabKQ1GJIa9r2mMZscBq/TbdOcmNA==",
|
|
||||||
"dev": true
|
|
||||||
},
|
|
||||||
"optimist": {
|
|
||||||
"version": "0.6.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/optimist/-/optimist-0.6.1.tgz",
|
|
||||||
"integrity": "sha1-2j6nRob6IaGaERwybpDrFaAZZoY=",
|
|
||||||
"dev": true,
|
|
||||||
"requires": {
|
|
||||||
"minimist": "~0.0.1",
|
|
||||||
"wordwrap": "~0.0.2"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"parse-github-url": {
|
|
||||||
"version": "1.0.2",
|
|
||||||
"resolved": "https://registry.npmjs.org/parse-github-url/-/parse-github-url-1.0.2.tgz",
|
|
||||||
"integrity": "sha512-kgBf6avCbO3Cn6+RnzRGLkUsv4ZVqv/VfAYkRsyBcgkshNvVBkRn1FEZcW0Jb+npXQWm2vHPnnOqFteZxRRGNw==",
|
|
||||||
"dev": true
|
|
||||||
},
|
|
||||||
"regenerator-runtime": {
|
|
||||||
"version": "0.13.3",
|
|
||||||
"resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.3.tgz",
|
|
||||||
"integrity": "sha512-naKIZz2GQ8JWh///G7L3X6LaQUAMp2lvb1rvwwsURe/VXwD6VMfr+/1NuNw3ag8v2kY1aQ/go5SNn79O9JU7yw==",
|
|
||||||
"dev": true
|
|
||||||
},
|
|
||||||
"semver": {
|
|
||||||
"version": "6.3.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz",
|
|
||||||
"integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==",
|
|
||||||
"dev": true
|
|
||||||
},
|
|
||||||
"source-map": {
|
|
||||||
"version": "0.6.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
|
|
||||||
"integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==",
|
|
||||||
"dev": true
|
|
||||||
},
|
|
||||||
"uglify-js": {
|
|
||||||
"version": "3.6.4",
|
|
||||||
"resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.6.4.tgz",
|
|
||||||
"integrity": "sha512-9Yc2i881pF4BPGhjteCXQNaXx1DCwm3dtOyBaG2hitHjLWOczw/ki8vD1bqyT3u6K0Ms/FpCShkmfg+FtlOfYA==",
|
|
||||||
"dev": true,
|
|
||||||
"optional": true,
|
|
||||||
"requires": {
|
|
||||||
"commander": "~2.20.3",
|
|
||||||
"source-map": "~0.6.1"
|
|
||||||
},
|
|
||||||
"dependencies": {
|
|
||||||
"commander": {
|
|
||||||
"version": "2.20.3",
|
|
||||||
"resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz",
|
|
||||||
"integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==",
|
|
||||||
"dev": true,
|
|
||||||
"optional": true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"wordwrap": {
|
|
||||||
"version": "0.0.3",
|
|
||||||
"resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.3.tgz",
|
|
||||||
"integrity": "sha1-o9XabNXAvAAI03I0u68b7WMFkQc=",
|
|
||||||
"dev": true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,34 +1,41 @@
|
|||||||
{
|
{
|
||||||
"name": "gohugo-theme-ananke",
|
"author": "budparr",
|
||||||
"version": "2.7.0",
|
"bugs": {
|
||||||
"description": "Base Theme to start Hugo Sites",
|
"url": "https://github.com/theNewDynamic/gohugo-theme-ananke/issues"
|
||||||
"main": "index.js",
|
},
|
||||||
"repository": {
|
"comments": {
|
||||||
"type": "git",
|
"dependencies": {},
|
||||||
"url": "git+https://github.com/theNewDynamic/gohugo-theme-ananke.git"
|
|
||||||
},
|
|
||||||
"scripts": {
|
|
||||||
"version": "auto-changelog -p --template keepachangelog --commit-limit 0 && git add CHANGELOG.md"
|
|
||||||
},
|
|
||||||
"keywords": [
|
|
||||||
"hugo",
|
|
||||||
"gohugo"
|
|
||||||
],
|
|
||||||
"author": "budparr",
|
|
||||||
"license": "MIT",
|
|
||||||
"bugs": {
|
|
||||||
"url": "https://github.com/theNewDynamic/gohugo-theme-ananke/issues"
|
|
||||||
},
|
|
||||||
"homepage": "https://github.com/theNewDynamic/gohugo-theme-ananke#readme",
|
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"babel-core": "^6.24.1",
|
"auto-changelog": "project",
|
||||||
"babel-loader": "^7.0.0",
|
"cssnano": "project",
|
||||||
"babel-preset-env": "^1.4.0",
|
"postcss-cli": "project",
|
||||||
"cssnano": "^3.10.0",
|
"postcss-cssnext": "project",
|
||||||
"postcss-cli": "^7.1.0",
|
"tachyons": "project"
|
||||||
"postcss-import": "^12.0.1",
|
|
||||||
"postcss-cssnext": "^2.10.0",
|
|
||||||
"tachyons": "^4.9.1",
|
|
||||||
"auto-changelog": "^1.16.1"
|
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
|
"dependencies": {},
|
||||||
|
"description": "Theme Ananke",
|
||||||
|
"devDependencies": {
|
||||||
|
"auto-changelog": "^1.16.1",
|
||||||
|
"cssnano": "^3.10.0",
|
||||||
|
"postcss-cli": "^7.1.0",
|
||||||
|
"postcss-cssnext": "^2.10.0",
|
||||||
|
"tachyons": "^4.9.1"
|
||||||
|
},
|
||||||
|
"homepage": "https://github.com/theNewDynamic/gohugo-theme-ananke#readme",
|
||||||
|
"keywords": [
|
||||||
|
"hugo",
|
||||||
|
"gohugo"
|
||||||
|
],
|
||||||
|
"license": "MIT",
|
||||||
|
"main": "index.js",
|
||||||
|
"name": "gohugo-theme-ananke",
|
||||||
|
"repository": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "git+https://github.com/theNewDynamic/gohugo-theme-ananke.git"
|
||||||
|
},
|
||||||
|
"scripts": {
|
||||||
|
"version": "auto-changelog -p --template keepachangelog --commit-limit 0 \u0026\u0026 git add CHANGELOG.md"
|
||||||
|
},
|
||||||
|
"version": "2.7.0"
|
||||||
|
}
|
13
package.json
13
package.json
@ -7,27 +7,19 @@
|
|||||||
"dependencies": {},
|
"dependencies": {},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"auto-changelog": "project",
|
"auto-changelog": "project",
|
||||||
"babel-core": "project",
|
|
||||||
"babel-loader": "project",
|
|
||||||
"babel-preset-env": "project",
|
|
||||||
"cssnano": "project",
|
"cssnano": "project",
|
||||||
"postcss-cli": "project",
|
"postcss-cli": "project",
|
||||||
"postcss-cssnext": "project",
|
"postcss-cssnext": "project",
|
||||||
"postcss-import": "project",
|
|
||||||
"tachyons": "project"
|
"tachyons": "project"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"dependencies": {},
|
"dependencies": {},
|
||||||
"description": "Base Theme to start Hugo Sites",
|
"description": "Theme Ananke",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"auto-changelog": "^1.16.1",
|
"auto-changelog": "^1.16.1",
|
||||||
"babel-core": "^6.24.1",
|
|
||||||
"babel-loader": "^7.0.0",
|
|
||||||
"babel-preset-env": "^1.4.0",
|
|
||||||
"cssnano": "^3.10.0",
|
"cssnano": "^3.10.0",
|
||||||
"postcss-cli": "^7.1.0",
|
"postcss-cli": "^7.1.0",
|
||||||
"postcss-cssnext": "^2.10.0",
|
"postcss-cssnext": "^2.10.0",
|
||||||
"postcss-import": "^12.0.1",
|
|
||||||
"tachyons": "^4.9.1"
|
"tachyons": "^4.9.1"
|
||||||
},
|
},
|
||||||
"homepage": "https://github.com/theNewDynamic/gohugo-theme-ananke#readme",
|
"homepage": "https://github.com/theNewDynamic/gohugo-theme-ananke#readme",
|
||||||
@ -43,7 +35,8 @@
|
|||||||
"url": "git+https://github.com/theNewDynamic/gohugo-theme-ananke.git"
|
"url": "git+https://github.com/theNewDynamic/gohugo-theme-ananke.git"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"version": "auto-changelog -p --template keepachangelog --commit-limit 0 \u0026\u0026 git add CHANGELOG.md"
|
"version": "auto-changelog -p --template keepachangelog --commit-limit 0 \u0026\u0026 git add CHANGELOG.md",
|
||||||
|
"deploy": " cd exampleSite; hugo;"
|
||||||
},
|
},
|
||||||
"version": "2.7.0"
|
"version": "2.7.0"
|
||||||
}
|
}
|
File diff suppressed because one or more lines are too long
@ -0,0 +1 @@
|
|||||||
|
{"Target":"ananke/css/main.min.css","MediaType":"text/css","Data":{}}
|
File diff suppressed because one or more lines are too long
5876
static/dist/css/app.4fc0b62e4b82c997bb0041217cd6b979.css
vendored
5876
static/dist/css/app.4fc0b62e4b82c997bb0041217cd6b979.css
vendored
File diff suppressed because it is too large
Load Diff
5872
static/dist/css/app.7e7787cc1402d7de28bc90f7e65adf96.css
vendored
5872
static/dist/css/app.7e7787cc1402d7de28bc90f7e65adf96.css
vendored
File diff suppressed because it is too large
Load Diff
5872
static/dist/css/app.e6e75cdafe2e909dacfabeb26857f994.css
vendored
5872
static/dist/css/app.e6e75cdafe2e909dacfabeb26857f994.css
vendored
File diff suppressed because it is too large
Load Diff
1
static/dist/js/app.3fc0f988d21662902933.js
vendored
1
static/dist/js/app.3fc0f988d21662902933.js
vendored
@ -1 +0,0 @@
|
|||||||
!function(n){function t(e){if(r[e])return r[e].exports;var o=r[e]={i:e,l:!1,exports:{}};return n[e].call(o.exports,o,o.exports,t),o.l=!0,o.exports}var r={};t.m=n,t.c=r,t.i=function(n){return n},t.d=function(n,r,e){t.o(n,r)||Object.defineProperty(n,r,{configurable:!1,enumerable:!0,get:e})},t.n=function(n){var r=n&&n.__esModule?function(){return n.default}:function(){return n};return t.d(r,"a",r),r},t.o=function(n,t){return Object.prototype.hasOwnProperty.call(n,t)},t.p="",t(t.s=1)}([function(n,t){},function(n,t,r){"use strict";var e=r(0);!function(n){n&&n.__esModule}(e)}]);
|
|
@ -8,7 +8,7 @@ description = "A Base theme for building full featured Hugo sites"
|
|||||||
homepage = "https://github.com/theNewDynamic/gohugo-theme-ananke"
|
homepage = "https://github.com/theNewDynamic/gohugo-theme-ananke"
|
||||||
tags = ["website", "starter", "responsive", "Disqus", "blog", "Tachyons", "Multilingual", "Stackbit"]
|
tags = ["website", "starter", "responsive", "Disqus", "blog", "Tachyons", "Multilingual", "Stackbit"]
|
||||||
features = ["posts", "shortcodes", "related content", "comments"]
|
features = ["posts", "shortcodes", "related content", "comments"]
|
||||||
min_version = "0.55.0"
|
min_version = "0.79.0"
|
||||||
|
|
||||||
[author]
|
[author]
|
||||||
name = "theNewDynamic"
|
name = "theNewDynamic"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user