From 41ce236d33034846f6542ca15314e3cf6b9faa80 Mon Sep 17 00:00:00 2001 From: Serghei Iakovlev Date: Sat, 9 Jul 2022 09:58:21 +0200 Subject: Change theme path --- exampleSite/config.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/exampleSite/config.toml b/exampleSite/config.toml index d5c17c9..b7819ed 100644 --- a/exampleSite/config.toml +++ b/exampleSite/config.toml @@ -12,8 +12,8 @@ defaultContentLanguage = 'en' # title of the page. Eg. "Contacts - Ed." title = 'Ed.' -# You may need to change this line for your real project. -theme = ['github.com/sergeyklay/gohugo-theme-ed'] +# Use full path to theme's repository in case of using Hugo Modules. +theme = 'github.com/sergeyklay/gohugo-theme-ed' # You may need to delete this line for your real project. resourceDir = '../resources' -- cgit v1.2.3 From 233233e97e9e023c90ceba136b11fe0f5fd7ddce Mon Sep 17 00:00:00 2001 From: Serghei Iakovlev Date: Sat, 9 Jul 2022 10:35:11 +0200 Subject: Amend author email --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index f723998..30dbe3f 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "ed", "version": "0.5.0", "private": true, - "description": "Ed theme for minimal editions, based on Alex Gil theme", + "description": "Ed theme for minimal editions, based on Alex Gil theme.", "keywords": [ "hugo", "theme", @@ -17,7 +17,7 @@ "url": "git+https://github.com/sergeyklay/gohugo-theme-ed.git" }, "license": "MIT", - "author": "Serghei Iakovlev", + "author": "Serghei Iakovlev ", "main": "index.js", "scripts": { "server": "HUGO_ENV=development hugo server --verbose --source=exampleSite --buildDrafts --buildFuture --ignoreCache --disableFastRender", -- cgit v1.2.3 From d3d3f34281e231c256478eb383ad2f286b00a077 Mon Sep 17 00:00:00 2001 From: Serghei Iakovlev Date: Sat, 9 Jul 2022 10:56:46 +0200 Subject: Migrate config to yaml --- exampleSite/config.toml | 292 -------------------------- exampleSite/config/_default/config.yaml | 323 +++++++++++++++++++++++++++++ exampleSite/content/documentation/index.md | 12 +- 3 files changed, 329 insertions(+), 298 deletions(-) delete mode 100644 exampleSite/config.toml create mode 100644 exampleSite/config/_default/config.yaml diff --git a/exampleSite/config.toml b/exampleSite/config.toml deleted file mode 100644 index b7819ed..0000000 --- a/exampleSite/config.toml +++ /dev/null @@ -1,292 +0,0 @@ -# You may need to change this line for your real project. -baseURL = 'https://gohugo-theme-ed.netlify.app/' - -languageCode = 'en-us' -defaultContentLanguage = 'en' - -# Keep title short to prevent overflow. -# There’s no official guidance on this, but 40 characters for -# mobile and 60 for desktop is roughly the sweet spot. -# -# NB: Final title of shareable pages will be this plus the -# title of the page. Eg. "Contacts - Ed." -title = 'Ed.' - -# Use full path to theme's repository in case of using Hugo Modules. -theme = 'github.com/sergeyklay/gohugo-theme-ed' - -# You may need to delete this line for your real project. -resourceDir = '../resources' - -enableRobotsTXT = true - -# When using ref or relref to resolve page links and a link cannot -# resolved, it will be logged with this log level. -refLinksErrorLevel = 'WARNING' - -# kick out RSS, we'll use Atom and FEED bellow -disableKinds = ['RSS'] - -# Google Analytics Tracking ID. -# Set `HUGO_ENV` environment variable or `site.Params.env` configuration -# parameter to "production" to use Google Analytics. -googleAnalytics = '' - -[minify] - # Do not minify XML files to avoid CDATA escape issues - disableXML = true - -[outputs] - home = [ 'HTML', 'Atom', 'FEED', 'JSONFEED', 'JSON', 'MANIFEST', 'humanstxt' ] - section = [ 'HTML', 'Atom', 'FEED', 'JSONFEED' ] - page = [ 'HTML' ] - taxonomy = [ 'HTML' ] - term = [ 'HTML' ] - -# Atom feed. -# For more see: https://validator.w3.org/feed/docs/atom.html#whatIsAtom -[outputFormats.Atom] - name = 'Atom' - # The correct header Content-Type header for an Atom feed is - # application/atom+xml. However, Chromium does not handle it - # correctly (see https://code.google.com/p/chromium/issues/detail?id=104358). - # - # The most compatible header is 'text/xml; charset=utf-8', which - # will cause the feed to be parsed correctly by most clients. - # Note that you should be encoding your feed in UTF-8. - mediaType = 'text/xml' - # generated file = . = feeds/feed.atom.xml - baseName = 'feeds/feed.atom' - rel = 'alternate' - isPlainText = false - isHTML = false - noUgly = true - permalinkable = false - -# no collision with buildin RSS -[outputFormats.FEED] - name = 'Feed' - mediaType = 'text/xml' - baseName = 'feeds/feed.rss' - rel = 'alternate' - isPlainText = false - isHTML = false - noUgly = true - permalinkable = false - -# For more see: https://www.jsonfeed.org/ -[outputFormats.JSONFEED] - name = 'JsonFeed' - mediaType = 'application/feed+json' - baseName = 'feeds/feed' - rel = 'alternate' - isPlainText = true - isHTML = false - noUgly = false - -# The .webmanifest extension is specified in the Media type registration -# section of the specification (the response of the manifest file should -# return Content-Type: application/manifest+json). -# -# For more see: https://w3c.github.io/manifest/#media-type-registration= -[outputFormats.MANIFEST] - name = 'Manifest' - mediaType = 'application/manifest+json' - baseName = 'manifest' - rel = 'manifest' - isPlainText = true - isHTML = false - noUgly = false - notAlternative = true - -# For more see: https://gohugo.io/templates/output-formats/ -[outputFormats.humanstxt] - mediaType = 'text/plain' - baseName = 'humans' - rel = 'author' - isPlainText = true - isHTML = false - noUgly = true - permalinkable = false - notAlternative = true - -[mediaTypes] - [mediaTypes.'text/xml'] - suffixes = ['xml'] - [mediaTypes.'application/feed+json'] - suffixes = ['json'] - [mediaTypes.'application/manifest+json'] - suffixes = ['webmanifest'] - -# Sitemap config -[sitemap] - changefreq = 'weekly' - filename = 'sitemap.xml' - priority = 0.5 - -[author] - name = 'John Doe' - email = 'john@example.com' - github = 'john_doe' - twitter = 'john_doe' - location = 'Kyiv, Ukraine' - -[languages] - [languages.en] - weight = 1 - languageDirection = 'ltr' - languageName = 'English' - -[params] - # Site description. Used in meta description - description = 'Ed is a Hugo theme designed for textual editors based on minimal computing principles, and focused on legibility and flexibility.' - - # SEO keywords. Used in 'meta name="keywords"' tag. - # May be overridden by .Keywords or .Tags in front matter. - keywords = ['hugo', 'ed', 'hugo theme', 'minimal', 'responsive', 'clean'] - - # A "copyright"-line to be added to RSS/Atom files. - # "©" and "{year}" will be replaced by © and the current year. - copyright = 'Copyright © 2019-{year} John Doe' - - # Color scheme. Options: red, orange, magenta, cyan, blue, brown - colorScheme = '' - - # Used in site header - tagline = 'a Hugo theme for minimal editions' - - # Custom footer text on left sidebar. Use HTMl if needed. - # "©" and "{year}" will be replaced by © and the current year. - footer = 'Built with Ed. Distributed under an MIT license.' - - # Sections to be displayed in the main page, RSS/Atom feeds as well as search index. - mainSections = ['posts', 'dramas', 'narratives', 'poems'] - - # Posts date format, for example: 2006-01-02 - dateFormat = ':date_long' - dateFormatToc = '2006.01.02' - - # Show "Read more" button in list if true - readmore = true - - # RSS/Atom feed size - feedSize = 25 - recentPostsSize = 5 - - [params.contact] - # Forms Backend URL, used in contacts form - formAction = 'https://submit-form.com/example' - - # Contact form email subject - emailSubject = 'Contact form submission' - - # After successful submit, where should the user be redirected? - thanksUrl = '/thanks' - - [params.assets] - # Site icons, relative to ./static - - # favicon.ico for legacy browsers - favicon = '' - - # A single SVG icon with a light/dark version for modern browsers - svgicon = '' - - # 180×180 PNG image for Apple devices - apple_touch_icon = '' - - # Logo image, relative to ./assets - logo = '/img/open-graph-logo.png' - disable_fingerprinting = false - - [params.seo] - # Will be used in schema.org/Organization. - # The site.Title will be used if empty. - publisher = 'Serghei Iakovlev' - -[social] - # Facebook Page Admin ID for Domain Insights - facebook_admin = '' - - # Facebook Page ID - facebook_id = '' - - # Twitter username for the website used in the card footer - twitter = 'john_doe' - -# For more see https://gohugo.io/content-management/menus/ -[menu] - [[menu.main]] # sections in the website sidebar - identifier = 'home' # section id - name = 'Home' # section display title - url = '/' # path to the section - weight = 1 # order of sections - [[menu.main]] - identifier = 'about' - name = 'About' - url = '/about/' - weight = 2 - [[menu.main]] - identifier = 'credits' - name = 'Credits' - url = '/credits/' - weight = 3 - [[menu.main]] - identifier = 'documentation' - name = 'Documentation' - url = '/documentation/' - weight = 4 - [[menu.main]] - identifier = 'search' - name = 'Search' - url = '/search/' - weight = 5 - [[menu.main]] - identifier = 'contact' - name = 'Contact' - url = '/contact/' - weight = 6 - [[menu.main]] - identifier = 'github' - name = 'GitHub Project' - url = 'https://github.com/sergeyklay/gohugo-theme-ed/' - weight = 20 - [menu.main.params] - external = true - - [[menu.feeds]] - identifier = 'rss' - name = 'RSS 2.0' - url = '/feeds/feed.rss.xml' - weight = 1 - [[menu.feeds]] - identifier = 'atom' - name = 'Atom' - url = '/feeds/feed.atom.xml' - weight = 2 - [[menu.feeds]] - identifier = 'json' - name = 'Json Feed' - url = '/feeds/feed.json' - weight = 3 - -# For more see https://gohugo.io/getting-started/configuration-markup/ -[markup] - defaultMarkdownHandler = 'goldmark' - - [markup.highlight] - # Syntax highlight style. - # For more see https://xyproto.github.io/splash/docs/ - style = 'emacs' - - [markup.goldmark] - [markup.goldmark.parser] - [markup.goldmark.parser.attribute] - # Enable custom attribute support for blocks - block = true - -# If enableGitInfo is true, it will override any lastmod dates in our -# front matter. We should at least allow ourselves to manually override -# this value in the front matter. -[frontmatter] - lastmod = ['lastmod', ':git', 'date', 'publishDate'] diff --git a/exampleSite/config/_default/config.yaml b/exampleSite/config/_default/config.yaml new file mode 100644 index 0000000..44b37bf --- /dev/null +++ b/exampleSite/config/_default/config.yaml @@ -0,0 +1,323 @@ +# You may need to change this line for your real project. +baseURL: 'https://gohugo-theme-ed.netlify.app/' + +languageCode: en-us +defaultContentLanguage: en + +# Keep title short to prevent overflow. +# There’s no official guidance on this, but 40 characters for +# mobile and 60 for desktop is roughly the sweet spot. +# +# NB: Final title of shareable pages will be this plus the +# title of the page. Eg. "Contacts - Ed." +title: Ed. + +# Use full path to theme's repository in case of using Hugo Modules. +theme: github.com/sergeyklay/gohugo-theme-ed + +# You may need to delete this line for your real project. +resourceDir: ../resources + +enableRobotsTXT: true + +# When using ref or relref to resolve page links and a link cannot +# resolved, it will be logged with this log level. +refLinksErrorLevel: WARNING + +# Kick out RSS, we'll use Atom and FEED bellow. +disableKinds: + - RSS + +# Google Analytics Tracking ID. +# Set `HUGO_ENV` environment variable or `site.Params.env` configuration +# parameter to "production" to use Google Analytics. +googleAnalytics: '' + +minify: + # Do not minify XML files to avoid CDATA escape issues + disableXML: true + +outputs: + home: + - HTML + - Atom + - FEED + - JSONFEED + - JSON + - MANIFEST + - humanstxt + section: + - HTML + - Atom + - FEED + - JSONFEED + page: + - HTML + taxonomy: + - HTML + term: + - HTML + +outputFormats: + # For more see: https://validator.w3.org/feed/docs/atom.html#whatIsAtom + Atom: + name: Atom + # The correct header Content-Type header for an Atom feed is + # application/atom+xml. However, Chromium does not handle it + # correctly (see https://code.google.com/p/chromium/issues/detail?id=104358). + # + # The most compatible header is 'text/xml; charset=utf-8', which + # will cause the feed to be parsed correctly by most clients. + # Note that you should be encoding your feed in UTF-8. + mediaType: text/xml + # generated file = . = feeds/feed.atom.xml + baseName: feeds/feed.atom + rel: alternate + isPlainText: false + isHTML: false + noUgly: true + permalinkable: false + + FEED: + name: Feed + mediaType: text/xml + baseName: feeds/feed.rss + rel: alternate + isPlainText: false + isHTML: false + noUgly: true + permalinkable: false + + # For more see: https://www.jsonfeed.org/ + JSONFEED: + name: JsonFeed + mediaType: application/feed+json + baseName: feeds/feed + rel: alternate + isPlainText: true + isHTML: false + noUgly: false + + MANIFEST: + # The .webmanifest extension is specified in the Media type registration + # section of the specification (the response of the manifest file should + # return Content-Type: application/manifest+json). + # + # For more see: https://w3c.github.io/manifest/#media-type-registration= + name: Manifest + mediaType: application/manifest+json + baseName: manifest + rel: manifest + isPlainText: true + isHTML: false + noUgly: false + notAlternative: true + + # For more see: https://gohugo.io/templates/output-formats/ + humanstxt: + mediaType: text/plain + baseName: humans + rel: author + isPlainText: true + isHTML: false + noUgly: true + permalinkable: false + notAlternative: true + +mediaTypes: + text/xml: + suffixes: + - xml + application/feed+json: + suffixes: + - json + application/manifest+json: + suffixes: + - webmanifest + +# Sitemap config +sitemap: + changefreq: weekly + filename: sitemap.xml + priority: 0.5 + +author: + name: John Doe + email: john@example.com + github: john_doe + twitter: john_doe + location: 'Kyiv, Ukraine' + +languages: + en: + weight: 1 + languageDirection: ltr + languageName: English + +params: + # Site description. Used in meta description + description: >- + Ed is a Hugo theme designed for textual editors based on minimal computing + principles, and focused on legibility and flexibility. + + # SEO keywords. Used in 'meta name="keywords"' tag. + # May be overridden by .Keywords or .Tags in front matter. + keywords: + - hugo + - ed + - hugo theme + - minimal + - responsive + - clean + + # A "copyright"-line to be added to RSS/Atom files. + # "©" and "{year}" will be replaced by © and the current year. + copyright: 'Copyright © 2019-{year} John Doe' + + # Color scheme. Options: red, orange, magenta, cyan, blue, brown + colorScheme: '' + + # Used in site header + tagline: a Hugo theme for minimal editions + + # Custom footer text on left sidebar. Use HTMl if needed. + # "©" and "{year}" will be replaced by © and the current year. + footer: >- + Built with Ed. Distributed under an MIT + license. + + # Sections to be displayed in the main page, RSS/Atom feeds as well as search index. + mainSections: + - posts + - dramas + - narratives + - poems + + # Posts date format, for example: 2006-01-02 + dateFormat: ':date_long' + dateFormatToc: 2006.01.02 + + # Show "Read more" button in list if true + readmore: true + + # RSS/Atom feed size + feedSize: 25 + + recentPostsSize: 5 + + contact: + # Forms Backend URL, used in contacts form + formAction: 'https://submit-form.com/example' + + # Contact form email subject + emailSubject: Contact form submission + + # Where should the user be redirected after successful form submit? + thanksUrl: /thanks + + # Site icons, relative to ./static + assets: + # favicon.ico for legacy browsers + favicon: '' + + # A single SVG icon with a light/dark version for modern browsers + svgicon: '' + + # 180×180 PNG image for Apple devices + apple_touch_icon: '' + + # Logo image, relative to ./assets + logo: /img/open-graph-logo.png + disable_fingerprinting: false + seo: + # Will be used in schema.org/Organization. + # The site.Title will be used if empty. + publisher: Serghei Iakovlev + +social: + # Facebook Page Admin ID for Domain Insights + facebook_admin: '' + + # Facebook Page ID + facebook_id: '' + + # Twitter username for the website + twitter: john_doe + +# For more see https://gohugo.io/content-management/menus/ +menu: + main: # sections in the website sidebar + - identifier: home # section id + name: Home # section display title + url: / # path to the section + weight: 1 # order of sections + + - identifier: about + name: About + url: /about/ + weight: 2 + + - identifier: credits + name: Credits + url: /credits/ + weight: 3 + + - identifier: documentation + name: Documentation + url: /documentation/ + weight: 4 + + - identifier: search + name: Search + url: /search/ + weight: 5 + + - identifier: contact + name: Contact + url: /contact/ + weight: 6 + + - identifier: github + name: GitHub Project + url: 'https://github.com/sergeyklay/gohugo-theme-ed/' + weight: 20 + params: + external: true + + feeds: + - identifier: rss + name: RSS 2.0 + url: /feeds/feed.rss.xml + weight: 1 + - identifier: atom + name: Atom + url: /feeds/feed.atom.xml + weight: 2 + - identifier: json + name: Json Feed + url: /feeds/feed.json + weight: 3 + +# For more see https://gohugo.io/getting-started/configuration-markup/ +markup: + defaultMarkdownHandler: goldmark + highlight: + # Syntax highlight style. + # For more see https://xyproto.github.io/splash/docs/ + style: emacs + goldmark: + parser: + attribute: + # Enable custom attribute support for blocks + block: true + +# If enableGitInfo is true, it will override any lastmod dates in our +# front matter. We should at least allow ourselves to manually override +# this value in the front matter. +frontmatter: + lastmod: + - lastmod + - ':git' + - date + - publishDate diff --git a/exampleSite/content/documentation/index.md b/exampleSite/content/documentation/index.md index 4989b86..344dc91 100644 --- a/exampleSite/content/documentation/index.md +++ b/exampleSite/content/documentation/index.md @@ -32,16 +32,16 @@ If you don't get an error, you're good to go. Using the `cd` command on your ter $ hugo mod init github.com// ~~~ -Take a look inside the [`exampleSite`](https://github.com/sergeyklay/gohugo-theme-ed/tree/master/exampleSite) folder of this theme. You'll find a file called [`config.toml`](https://github.com/sergeyklay/gohugo-theme-ed/blob/master/exampleSite/config.toml). To use it, copy the [`config.toml`](https://github.com/sergeyklay/gohugo-theme-ed/blob/master/exampleSite/config.toml) in the root folder of your Hugo site. Feel free to change the strings in this theme. +Take a look inside the [`exampleSite`](https://github.com/sergeyklay/gohugo-theme-ed/tree/master/exampleSite) folder of this theme. You'll find a folder called [`config`](https://github.com/sergeyklay/gohugo-theme-ed/blob/master/exampleSite/config). Copy the [`config`](https://github.com/sergeyklay/gohugo-theme-ed/blob/master/exampleSite/config) folder in the project root of your Hugo site. Check the contents of the `config` folder and configure it. You will need to delete the following line: `resourceDir = '../resources'`, because it's necessary only for theme developers. -After that, import the theme adding the following lines to `config.yaml`: +After that, import the theme adding the following lines to `config/_default/config.yaml`: -~~~ toml -[module] -[[module.imports]] - path = 'github.com/sergeyklay/gohugo-theme-ed' +~~~ yaml +module: + imports: + - path: github.com/sergeyklay/gohugo-theme-ed ~~~ Finally, install Hugo Modules using the following command (remember you can copy and paste): -- cgit v1.2.3 From 3136d6c54c26b92ab5cf1509bc9a210c1a800efa Mon Sep 17 00:00:00 2001 From: Serghei Iakovlev Date: Sat, 9 Jul 2022 11:14:20 +0200 Subject: Split configuration parameters --- .gitattributes | 3 +- exampleSite/config/_default/config.yaml | 157 ++--------------------------- exampleSite/config/_default/languages.yaml | 4 + exampleSite/config/_default/menus.yaml | 53 ++++++++++ exampleSite/config/_default/params.yaml | 89 ++++++++++++++++ 5 files changed, 154 insertions(+), 152 deletions(-) create mode 100644 exampleSite/config/_default/languages.yaml create mode 100644 exampleSite/config/_default/menus.yaml create mode 100644 exampleSite/config/_default/params.yaml diff --git a/.gitattributes b/.gitattributes index 7b018ef..58a5e37 100644 --- a/.gitattributes +++ b/.gitattributes @@ -22,6 +22,7 @@ resources/_gen/** linguist-generated *.asc linguist-language=Public Key *.md linguist-detectable=true linguist-documentation=false *.webmanifest linguist-language=JSON +*.yaml linguist-detectable=true CHANGELOG.md linguist-detectable=false linguist-documentation=true CONTRIBUTING.md linguist-detectable=false linguist-documentation=true @@ -37,8 +38,8 @@ SECURITY.md linguist-detectable=false linguist-documentation=true # plus any specific settings # -CONTRIBUTING.md text eol=lf CHANGELOG.md text eol=lf +CONTRIBUTING.md text eol=lf LICENSE text eol=lf README.md text eol=lf SECURITY.md text eol=lf diff --git a/exampleSite/config/_default/config.yaml b/exampleSite/config/_default/config.yaml index 44b37bf..b9ae39d 100644 --- a/exampleSite/config/_default/config.yaml +++ b/exampleSite/config/_default/config.yaml @@ -13,6 +13,7 @@ defaultContentLanguage: en title: Ed. # Use full path to theme's repository in case of using Hugo Modules. +# This is replaced in go.mod for exampleSite to point to the directory above. theme: github.com/sergeyklay/gohugo-theme-ed # You may need to delete this line for your real project. @@ -148,157 +149,6 @@ author: twitter: john_doe location: 'Kyiv, Ukraine' -languages: - en: - weight: 1 - languageDirection: ltr - languageName: English - -params: - # Site description. Used in meta description - description: >- - Ed is a Hugo theme designed for textual editors based on minimal computing - principles, and focused on legibility and flexibility. - - # SEO keywords. Used in 'meta name="keywords"' tag. - # May be overridden by .Keywords or .Tags in front matter. - keywords: - - hugo - - ed - - hugo theme - - minimal - - responsive - - clean - - # A "copyright"-line to be added to RSS/Atom files. - # "©" and "{year}" will be replaced by © and the current year. - copyright: 'Copyright © 2019-{year} John Doe' - - # Color scheme. Options: red, orange, magenta, cyan, blue, brown - colorScheme: '' - - # Used in site header - tagline: a Hugo theme for minimal editions - - # Custom footer text on left sidebar. Use HTMl if needed. - # "©" and "{year}" will be replaced by © and the current year. - footer: >- - Built with Ed. Distributed under an MIT - license. - - # Sections to be displayed in the main page, RSS/Atom feeds as well as search index. - mainSections: - - posts - - dramas - - narratives - - poems - - # Posts date format, for example: 2006-01-02 - dateFormat: ':date_long' - dateFormatToc: 2006.01.02 - - # Show "Read more" button in list if true - readmore: true - - # RSS/Atom feed size - feedSize: 25 - - recentPostsSize: 5 - - contact: - # Forms Backend URL, used in contacts form - formAction: 'https://submit-form.com/example' - - # Contact form email subject - emailSubject: Contact form submission - - # Where should the user be redirected after successful form submit? - thanksUrl: /thanks - - # Site icons, relative to ./static - assets: - # favicon.ico for legacy browsers - favicon: '' - - # A single SVG icon with a light/dark version for modern browsers - svgicon: '' - - # 180×180 PNG image for Apple devices - apple_touch_icon: '' - - # Logo image, relative to ./assets - logo: /img/open-graph-logo.png - disable_fingerprinting: false - seo: - # Will be used in schema.org/Organization. - # The site.Title will be used if empty. - publisher: Serghei Iakovlev - -social: - # Facebook Page Admin ID for Domain Insights - facebook_admin: '' - - # Facebook Page ID - facebook_id: '' - - # Twitter username for the website - twitter: john_doe - -# For more see https://gohugo.io/content-management/menus/ -menu: - main: # sections in the website sidebar - - identifier: home # section id - name: Home # section display title - url: / # path to the section - weight: 1 # order of sections - - - identifier: about - name: About - url: /about/ - weight: 2 - - - identifier: credits - name: Credits - url: /credits/ - weight: 3 - - - identifier: documentation - name: Documentation - url: /documentation/ - weight: 4 - - - identifier: search - name: Search - url: /search/ - weight: 5 - - - identifier: contact - name: Contact - url: /contact/ - weight: 6 - - - identifier: github - name: GitHub Project - url: 'https://github.com/sergeyklay/gohugo-theme-ed/' - weight: 20 - params: - external: true - - feeds: - - identifier: rss - name: RSS 2.0 - url: /feeds/feed.rss.xml - weight: 1 - - identifier: atom - name: Atom - url: /feeds/feed.atom.xml - weight: 2 - - identifier: json - name: Json Feed - url: /feeds/feed.json - weight: 3 - # For more see https://gohugo.io/getting-started/configuration-markup/ markup: defaultMarkdownHandler: goldmark @@ -321,3 +171,8 @@ frontmatter: - ':git' - date - publishDate + +module: + hugoVersion: + extended: true + min: '0.95.0' diff --git a/exampleSite/config/_default/languages.yaml b/exampleSite/config/_default/languages.yaml new file mode 100644 index 0000000..9f1a04b --- /dev/null +++ b/exampleSite/config/_default/languages.yaml @@ -0,0 +1,4 @@ +en: + weight: 1 + languageDirection: ltr + languageName: English diff --git a/exampleSite/config/_default/menus.yaml b/exampleSite/config/_default/menus.yaml new file mode 100644 index 0000000..8111fbb --- /dev/null +++ b/exampleSite/config/_default/menus.yaml @@ -0,0 +1,53 @@ +# For more see https://gohugo.io/content-management/menus/ + +main: # sections in the website sidebar + - identifier: home # section id + name: Home # section display title + url: / # path to the section + weight: 1 # order of sections + + - identifier: about + name: About + url: /about/ + weight: 2 + + - identifier: credits + name: Credits + url: /credits/ + weight: 3 + + - identifier: documentation + name: Documentation + url: /documentation/ + weight: 4 + + - identifier: search + name: Search + url: /search/ + weight: 5 + + - identifier: contact + name: Contact + url: /contact/ + weight: 6 + + - identifier: github + name: GitHub Project + url: 'https://github.com/sergeyklay/gohugo-theme-ed/' + weight: 20 + params: + external: true + +feeds: + - identifier: rss + name: RSS 2.0 + url: /feeds/feed.rss.xml + weight: 1 + - identifier: atom + name: Atom + url: /feeds/feed.atom.xml + weight: 2 + - identifier: json + name: Json Feed + url: /feeds/feed.json + weight: 3 diff --git a/exampleSite/config/_default/params.yaml b/exampleSite/config/_default/params.yaml new file mode 100644 index 0000000..4b2c913 --- /dev/null +++ b/exampleSite/config/_default/params.yaml @@ -0,0 +1,89 @@ +# Site description. Used in meta description +description: >- + Ed is a Hugo theme designed for textual editors based on minimal computing + principles, and focused on legibility and flexibility. + +# SEO keywords. Used in 'meta name="keywords"' tag. +# May be overridden by .Keywords or .Tags in front matter. +keywords: + - hugo + - ed + - hugo theme + - minimal + - responsive + - clean + +# A "copyright"-line to be added to RSS/Atom files. +# "©" and "{year}" will be replaced by © and the current year. +copyright: 'Copyright © 2019-{year} John Doe' + +# Color scheme. Options: red, orange, magenta, cyan, blue, brown +colorScheme: '' + +# Used in site header +tagline: a Hugo theme for minimal editions + +# Custom footer text on left sidebar. Use HTMl if needed. +# "©" and "{year}" will be replaced by © and the current year. +footer: >- + Built with Ed. Distributed under an MIT + license. + +# Sections to be displayed in the main page, RSS/Atom feeds as well as search index. +mainSections: + - posts + - dramas + - narratives + - poems + +# Posts date format, for example: 2006-01-02 +dateFormat: ':date_long' +dateFormatToc: 2006.01.02 + +# Show "Read more" button in list if true +readmore: true + +# RSS/Atom feed size +feedSize: 25 + +recentPostsSize: 5 + +contact: + # Forms Backend URL, used in contacts form + formAction: 'https://submit-form.com/example' + + # Contact form email subject + emailSubject: Contact form submission + + # Where should the user be redirected after successful form submit? + thanksUrl: /thanks + +# Site icons, relative to ./static +assets: + # favicon.ico for legacy browsers + favicon: '' + + # A single SVG icon with a light/dark version for modern browsers + svgicon: '' + + # 180×180 PNG image for Apple devices + apple_touch_icon: '' + + # Logo image, relative to ./assets + logo: /img/open-graph-logo.png + disable_fingerprinting: false +seo: + # Will be used in schema.org/Organization. + # The site.Title will be used if empty. + publisher: Serghei Iakovlev + +social: +# Facebook Page Admin ID for Domain Insights +facebook_admin: '' + +# Facebook Page ID +facebook_id: '' + +# Twitter username for the website +twitter: john_doe -- cgit v1.2.3 From d13879fd26c04fe6bc5c871d79dc3fee11d4a7a2 Mon Sep 17 00:00:00 2001 From: Serghei Iakovlev Date: Sat, 9 Jul 2022 11:26:26 +0200 Subject: Remove resource dir from example config --- exampleSite/config/_default/config.yaml | 7 ++++--- exampleSite/content/documentation/index.md | 4 +--- package.json | 2 +- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/exampleSite/config/_default/config.yaml b/exampleSite/config/_default/config.yaml index b9ae39d..1b67277 100644 --- a/exampleSite/config/_default/config.yaml +++ b/exampleSite/config/_default/config.yaml @@ -16,9 +16,6 @@ title: Ed. # This is replaced in go.mod for exampleSite to point to the directory above. theme: github.com/sergeyklay/gohugo-theme-ed -# You may need to delete this line for your real project. -resourceDir: ../resources - enableRobotsTXT: true # When using ref or relref to resolve page links and a link cannot @@ -30,6 +27,10 @@ disableKinds: - RSS # Google Analytics Tracking ID. +# +# For more info, read the article +# https://support.google.com/analytics/answer/10089681 +# # Set `HUGO_ENV` environment variable or `site.Params.env` configuration # parameter to "production" to use Google Analytics. googleAnalytics: '' diff --git a/exampleSite/content/documentation/index.md b/exampleSite/content/documentation/index.md index 344dc91..eac5c9c 100644 --- a/exampleSite/content/documentation/index.md +++ b/exampleSite/content/documentation/index.md @@ -26,7 +26,7 @@ Please note, to install Ed, you must have [Go >= 1.12](https://golang.org/dl/) i $ go version ~~~ -If you don't get an error, you're good to go. Using the `cd` command on your terminal, navigate to the folder where you keep your web projects. Once you're in the folder where project live, initialize the Hugo Module system using the following line (replace `` and `` by real names): +If you don't get an error, you're good to go. Using the `cd` command on your terminal, navigate to the folder where you keep your web projects. Once you're in the folder where project live, initialize the [Hugo Modules](https://gohugo.io/hugo-modules) system using the following line (replace `` and `` by real names): ~~~ bash $ hugo mod init github.com// @@ -34,8 +34,6 @@ $ hugo mod init github.com// Take a look inside the [`exampleSite`](https://github.com/sergeyklay/gohugo-theme-ed/tree/master/exampleSite) folder of this theme. You'll find a folder called [`config`](https://github.com/sergeyklay/gohugo-theme-ed/blob/master/exampleSite/config). Copy the [`config`](https://github.com/sergeyklay/gohugo-theme-ed/blob/master/exampleSite/config) folder in the project root of your Hugo site. Check the contents of the `config` folder and configure it. -You will need to delete the following line: `resourceDir = '../resources'`, because it's necessary only for theme developers. - After that, import the theme adding the following lines to `config/_default/config.yaml`: ~~~ yaml diff --git a/package.json b/package.json index 30dbe3f..e42880f 100644 --- a/package.json +++ b/package.json @@ -20,7 +20,7 @@ "author": "Serghei Iakovlev ", "main": "index.js", "scripts": { - "server": "HUGO_ENV=development hugo server --verbose --source=exampleSite --buildDrafts --buildFuture --ignoreCache --disableFastRender", + "server": "HUGO_RESOURCEDIR='../resources' HUGO_ENV=development hugo server --verbose --source=exampleSite --buildDrafts --buildFuture --ignoreCache --disableFastRender", "lint": "npm run lint:js && npm run lint:editorconfig", "lint:editorconfig": "editorconfig-checker", "lint:js": "eslint static/js/*.js assets/js/*.js" -- cgit v1.2.3 From b3c39de2e5265cb81d0268d08c0cd4cb47a93f0d Mon Sep 17 00:00:00 2001 From: Serghei Iakovlev Date: Sat, 9 Jul 2022 12:15:15 +0200 Subject: Update headers for Netlify preview mode --- netlify-update-csp-headers.rb | 42 ++++++++++++++++++++++++++++++++++++++++++ netlify.toml | 4 ++-- 2 files changed, 44 insertions(+), 2 deletions(-) create mode 100755 netlify-update-csp-headers.rb diff --git a/netlify-update-csp-headers.rb b/netlify-update-csp-headers.rb new file mode 100755 index 0000000..5f89c46 --- /dev/null +++ b/netlify-update-csp-headers.rb @@ -0,0 +1,42 @@ +#!/usr/bin/env ruby + +NETLIFY_CONFIG = 'netlify.toml' + +text = File.read(NETLIFY_CONFIG) + +# => default-src 'self'; +# <= default-src 'self' blob:; +text = text.gsub( + /(default-src) ('self')(;)/, + "\\1 \\2 blob:\\3" +) + +# => style-src 'self'; +# <= style-src 'self' 'unsafe-inline'; +text = text.gsub( + /(style-src) ('self')(;)/, + "\\1 \\2 'unsafe-inline'\\3" +) + +# => media-src 'self'; +# <= media-src 'self' blob: https://app.netlify.com; +text = text.gsub( + /(media-src) ('self')(;)/, + "\\1 'self' blob: https://app.netlify.com\\3" +) + +# => frame-src 'none'; +# <= frame-src app.netlify.com; +text = text.gsub( + /(frame-src) ('none')(;)/, + "\\1 app.netlify.com\\3" +) + +# => script-src 'self' *.googletagmanager.com; +# <= script-src 'self' *.googletagmanager.com netlify-cdp-loader.netlify.app; +text = text.gsub( + /(script-src) ('self' \*.googletagmanager.com)(;)/, + "\\1 \\2 netlify-cdp-loader.netlify.app\\3" +) + +File.open(NETLIFY_CONFIG, "w") { |file| file << text } diff --git a/netlify.toml b/netlify.toml index afa9e75..a819a2d 100644 --- a/netlify.toml +++ b/netlify.toml @@ -27,7 +27,7 @@ # Deploy Preview context: all deploys generated from # a pull/merge request will inherit these settings. [context.deploy-preview] - command = 'hugo --source=exampleSite --buildDrafts --buildFuture --baseURL ${DEPLOY_PRIME_URL} --destination ../public' + command = './netlify-update-csp-headers.rb; hugo --source=exampleSite --buildDrafts --buildFuture --baseURL ${DEPLOY_PRIME_URL} --destination ../public' [context.deploy-preview.environment] HUGO_ENV = 'development' @@ -89,7 +89,7 @@ # (including inline scripts and event-handling HTML attributes). Content-Security-Policy = """ default-src 'self'; - script-src 'self' *.netlify.app *.netlify.com *.googletagmanager.com; + script-src 'self' *.googletagmanager.com; style-src 'self'; img-src 'self' data: *.google-analytics.com *.googletagmanager.com *.gstatic.com; font-src 'self'; -- cgit v1.2.3